Getting the server time on the client for a room

Options
Hi,

I'm using Photon Enterprise to create a room and passing a GameProperty called CreationTime, which simply holds an int of Environment.TickCount from the server, marking the time the room was created. The client sends it as 0 when CreateRoom is raised, then I modify this property on the server when PluginBase.OnCreateGame is fired, BEFORE calling Continue().

When I get the OpResponse from the server (ServerConnection.GameServer) saying the room is created, the GameProperties sent back from the server are not modified, and CreationTime is still 0.

Any ideas on how to make this work, or a better approach?

Best regards,
Shaun

Comments

  • shaun_cmune
    Options
    OK, looks like you need to modify the CreateGameCallInfo.Request, as that's what is getting returned to the client.
    
    createGameCallInfo.Request.GameProperties[PhotonRoomProperties.CreationTime] = Environment.TickCount;
    createGameCallInfo.Continue();
    
    The documentation on how all this works is pretty sparse and really needs improvement.
  • chvetsov
    Options
    it is nice that you found solution

    we constantly improove documetation, but yeah still a lot of work

    best,
    ilya
  • shaun_cmune
    Options
    Hi Ilya,

    I'm using a .Net disassembler to look inside the Photon DLLs, which helps solve a lot of problems.

    Best regards,
    Shaun
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    @chvetsov I think we should also make the ICallInfo properties' setters reflect changes on the request itself, so I think instead of:

    createGameCallInfo.Request.GameProperties[PhotonRoomProperties.CreationTime] = Environment.TickCount;

    we should add a GameProperties property to ICreateGameCallInfo (if possible):

    createGameCallInfo.GameProperties[PhotonRoomProperties.CreationTime] = Environment.TickCount;
  • chvetsov
    Options
    @JohnTube yeah, it may make sense

    best,
    ilya
  • shaun_cmune
    Options
    @JohnTube +1 makes sense.

    Also, nomenclature for Room, Game & Custom Properties is mixed in places which lead to some head scratching.

    For example, properties exposed to the Lobby are not consistently named, and Game/Room Properties are sometimes mixed but are actually the same thing. This is both on the server, and between the client and server.

    Just my two cents :)
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    thanks @shaun_cmune for the feedback!

    We will try to rectify the naming and reach max. consistency which is not easy as we need to have backward compatibility.