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
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
0
Comments
-
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.0 -
it is nice that you found solution
we constantly improove documetation, but yeah still a lot of work
best,
ilya0 -
Hi Ilya,
I'm using a .Net disassembler to look inside the Photon DLLs, which helps solve a lot of problems.
Best regards,
Shaun0 -
@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 aGameProperties
property toICreateGameCallInfo
(if possible):createGameCallInfo.GameProperties[PhotonRoomProperties.CreationTime] = Environment.TickCount;
0 -
@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 cents0 -
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.0