How to Update the room property after the room created?

cocococo
edited June 12 in Photon Server
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

Comments

  • Hi @coco,

    Thank you for choosing Photon!

    I moved your discussion to Photon Server category.

    I assume you are working on a custom LoadBalancing server app using server SDK.
    Did you consider Plugins? much more easier.

    Otherwise, @chvetsov may help you here.
  • @JohnTube OK. thank you!
  • cocococo
    edited June 14
    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("开始游戏");
                                        }
Sign In or Register to comment.