How to Update the room property after the room created?

Options
coco
coco
edited June 2017 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

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    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.
  • coco
    Options
    @JohnTube OK. thank you!
  • coco
    coco
    edited June 2017
    Options
    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("开始游戏");
                                        }