Photon is broken (rooms)

Options
Danthekilla
edited January 2015 in DotNet
I am setting the custom properties on a room, and it does not sync across to other machines. What do?
        private void DoOnReciptOfString(string in_String)
        {
            //Get the custom Properties and rename the room
            g_CraftWorldSettings.GET.RoomName_String = in_String;
            var Pro = NetworkingManagerBase.GET.MySession.networkPeer.CurrentRoom.CustomProperties;
            Pro[MonoGamerPeer.RoomNamePropertyKey] = g_CraftWorldSettings.GET.RoomName_String;//


            NetworkingManagerBase.GET.MySession.networkPeer.CurrentRoom.SetCustomProperties(Pro);
            NetworkingManagerBase.GET.MySession.networkPeer.OpSetCustomPropertiesOfRoom(Pro);
            //Also change the current session name.
        }

Comments

  • vadim
    Options
    Any errors or other messages in logs when trying to update properties?
    Are clients joined to the room?
    How do you access those properties on other clients?

    SetCustomProperties calls OpSetCustomPropertiesOfRoom internally. So call of latter method is excess.
  • Tobias
    Options
    Don't call networkPeer.OpSetCustomPropertiesOfRoom(Pro). If you call CurrentRoom.SetCustomProperties(Pro), it should do the trick (provided you are in a room).
    As tip: If you only put new and changed key-values into the Hashtable, only those will get sent and you save lots of bandwidth. PRO does not have to be initialized to all props of the room.
  • I am no longer calling networkPeer.OpSetCustomPropertiesOfRoom(Pro)

    I will keep as few values in the lobby listed properties as possible, as you said.

    I found that I must set PropsListedInLobby, for props to list in lobby. I am an XNA user, and expected the design of not sending data to reduce bandwidth, instead of the manually specifying what is not to be ignored, as it currently works. Can you please add detailed summaries to every method, parameter, class and variable to the Windows store binaries? As it is, it's a bit like flying blind without descriptions on Photon as I'm coding.

    *Edited for clarity
  • Tobias
    Options
    All SDKs should have a pdf included which is the reference documentation of all Photon code.
    If you prefer online docs, we have those here: http://doc-api.exitgames.com/en/realtim ... dotnet/doc
    And in best case, your IDE should load the .xml file with the docs and show them as tooltips. Which IDE do you use? It seems that's not working for our DLLs?

    > I am an XNA user, and expected the design of not sending data to reduce bandwidth, instead of the manually specifying what is not to be ignored, as it currently works
    XNA would also need to know which values are of interest. If you only specify which ones to NOT send to the lobby, any new value will be sent and you might never use it.

    In any case: I'm happy you seem to be making progress. Sorry for the hassle and thanks for checking out our tips.