How to Update the room property after the room created?
Options
coco
✭
I want to Clinet send a request to server,then the Server decide who get which card. and then server Update the room property.
var setPropertiesOperation = new SetPropertiesRequest(peer.Protocol, operationRequest); setPropertiesOperation.Properties.Add("cards",p.Cards); setPropertiesOperation.OnStart(); this.HandleSetPropertiesOperation(peer, setPropertiesOperation, sendParameters); setPropertiesOperation.OnComplete();I used "SetProperties" ,it doesn't work. Client can't get Properties. Where is my mistake
0
Comments
-
hi @JohnTube ,two day ago you told me about how to send message to specifies player.
I also don't know how to use plugins yet,but I found publishEvent can do it.
Am I right ? Or Even have better method?if (CheckGameReady()) { PaohuziCards pao = new PaohuziCards(); pao.Xipai(); int i = 0; foreach (var actor in Actors) { byte[] HandCards = new byte[20]; switch (i) { case 0: HandCards = pao.Actor1; break; case 1: HandCards = pao.Actor2; break; case 2: HandCards = pao.Actor3; break; } i++; var cardEvent = new CustomEvent(actor.ActorNr, (byte)OperationCode.SendCard, HandCards); PublishEvent(cardEvent, actor, new SendParameters()); } Log.Debug("开始游戏"); }
0