iOS Client 3.2.2.0 load balancing room properties problem

admiralronton
edited November 2013 in Native
Hi there,

We have been using the iOS 3.2.0.0 load balancing client with PhotonServer v3.2.10.4248 without any issues with custom room properties.

On updating to the 3.2.2.0 client, it appears that the master is receiving the custom room properties, but the game server is not. We've confirmed this both by debugging the server and creating some additional server logging (see below). Is this a known bug and / or something you can fix as a patch?

As an aside, we noted that the Secret parameter has not been implemented in the iOS client, as it had in the .NET client. Any chance of getting equivalent function in the iOS client?

Here's a copy of the code we're using to instantiate the client in Objective-C and then call OpCreateRoom. Note that "NetworkClient" is a subclass of EGLoadBalancingClient.

[code2=objc]NetworkClient* client = [[self alloc] initWithAppId:appId andAppVersion:appVersion andUserName:userName];[/code2]

[code2=objc]-(void)createRoom:(NSString*)roomName withUserName:(NSString*)userName andMaxPlayers:(int)maxPlayers andMapName:(NSString*)mapName
{

// set default room properties
bool isvisible = YES;
bool isopen = YES;

// fix map nme for the server
if (![mapName endsWith:@-ipadhd])
{
mapName = [mapName stringByAppendingString:@-ipadhd];
}

// Room properties
NSString* GAMESTATE_KEY = kLobbyProperties_GameState;
nByte GAMESTATE_VALUE = (nByte)kGameState_Lobby;
NSString* MAPID_KEY = kLobbyProperties_Map;
NSString* MAPID_VALUE = mapName;
NSString* TURNNUMBER_KEY = kLobbyProperties_TurnNumber;
nByte TURNNUMBER_VALUE = 0;
NSDictionary* dictGameRoomProps = [NSDictionary dictionaryWithObjectsAndKeys:
MAPID_VALUE, MAPID_KEY,
[NSValue valueWithBytes:&TURNNUMBER_VALUE objCType:@encode(;nByte)], TURNNUMBER_KEY,
[NSValue valueWithBytes:&GAMESTATE_VALUE objCType:@encode(;nByte)], GAMESTATE_KEY,
nil];

// Player properties
NSString* NAME_KEY = @Name;
NSString* NAME_VALUE = userName;
NSDictionary* dictPlayerProps = [NSDictionary dictionaryWithObjectsAndKeys:
NAME_VALUE, NAME_KEY,
nil];

// Lobby properties
EGArray* arrayLobbyProps = [EGArray arrayWithObjects:
kLobbyProperties_GameState,
kLobbyProperties_PlayerList,
kLobbyProperties_PlayerCount,
kLobbyProperties_Map,
kLobbyProperties_TurnNumber,
kLobbyProperties_TurnTimeout,
kLobbyProperties_TurnStartTime,
nil];

// convert maxplayer to nbyte
nByte MAXPLAYERS = maxPlayers;

// send opRequest to the server
[self opCreateRoom:roomName :isvisible :isopen :MAXPLAYERS :dictGameRoomProps :dictPlayerProps :arrayLobbyProps];
}[/code2]

And here are some samples from the master and game servers:

Master Server:
2013-10-29 10:57:19,248 [22] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - OnOperationRequest: pid=2, op=227
2013-10-29 10:57:19,257 [22] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameList [(null)] - AddGameState:id=536162A4-0AE6-4296-AFDD-EF84BA0F3741, peers=0, max=2, open=True, visible=True, peersJoining=0, disconnected=False, ggpState=Lobby, turn=0
2013-10-29 10:57:19,264 [22] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState [(null)] - Added peer: gameId=536162A4-0AE6-4296-AFDD-EF84BA0F3741, userId=tbgtest03, joiningPeers=1
2013-10-29 10:57:19,348 [11] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - Disconnect: pid=2: reason=ClientDisconnect, detail=
2013-10-29 10:57:20,263 [11] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - HandleUpdateGameState
2013-10-29 10:57:20,266 [11] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState [(null)] - User joined on game server: gameId=536162A4-0AE6-4296-AFDD-EF84BA0F3741, userId=tbgtest03
2013-10-29 10:57:20,268 [11] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameList [(null)] - UpdateGameState: id=536162A4-0AE6-4296-AFDD-EF84BA0F3741, peers=1, max=2, open=True, visible=True, peersJoining=0, disconnected=False, ggpState=NotDefined, turn=


Game server:
2013-10-29 10:57:19,669 [14] DEBUG Photon.LoadBalancing.GameServer.GameApplication [(null)] - CreatePeer for Lite
2013-10-29 10:57:19,674 [14] DEBUG Photon.LoadBalancing.GameServer.GameApplication [(null)] - incoming game peer at 192.168.1.124:5056 from 70.36.227.149:55526
2013-10-29 10:57:19,953 [10] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer [(null)] - OnOperationRequest: conId=3, opCode=230
2013-10-29 10:57:19,959 [10] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer [(null)] - Authenticate: UserID: tbgtest03, Secret:
2013-10-29 10:57:20,054 [13] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer [(null)] - OnOperationRequest: conId=3, opCode=227
2013-10-29 10:57:20,212 [11] DEBUG Lite.Room [(null)] - Executing operation 227
2013-10-29 10:57:20,225 [11] DEBUG Lite.Room [(null)] - Join operation from IP: 70.36.227.149 to port: 5056
2013-10-29 10:57:20,229 [11] DEBUG Lite.Room [(null)] - Actor added: 1 to game: 536162A4-0AE6-4296-AFDD-EF84BA0F3741
2013-10-29 10:57:20,351 [20] DEBUG Photon.LoadBalancing.GameServer.GameClientPeer [(null)] - OnOperationRequest: conId=3, opCode=199
2013-10-29 10:57:20,355 [20] DEBUG Lite.Room [(null)] - Executing operation 199
2013-10-29 10:57:20,377 [20] DEBUG Lite.Room [(null)] - Serializing room to cache: 250:System.String[];

Comments

  • Hi admiralronton.

    As stated in the release history inside the client SDK, starting with 3.2.2.0, the parameter customLocalPlayerProperties has been removed from the parameter list of EGLoadBalancingClient::opCreateRoom().

    However it's still there in the parameter list of the base class implementation EGLoadBalancingPeer::opCreateRoom().

    This leads into the unfortunate situation that your client has been calling EGLoadBalancingClient::opCreateRoom() in 3.2.0.0, but is now in 3.2.2.0 calling EGLoadBalancingPeer::opCreateRoom().In opposition to the client the more low level peer will not automatically send these properties to the game server.

    Please just remove the parameter dictPlayerProps from your call to opCreateRoom() and it should work again.
    If you need to set custom player properties, then please do this through EGLoadBalancingClient.LocalPlayer. However there already is a built-in property for the username, so you should not need to additionally set a custom one for it - just use the built one by passing the username to EGLoadBalancingClient::initClient().
  • Thank you, removing the localPlayerProperties parameter solved the issue with the room properties!

    Regarding the side issue, are there any plans to release a version of the iOS client that implements the Secret parameter for authentication?

    Thanks again!
  • Are you talking about CustomAuthentication? I am not aware of anything else, where a parameter named Secret may be in use in the .NET implementation.
    The next release of the iOS client SDK will also support custom authentication.
  • Yes, CustomAuthentication. Thanks for the info, any idea when the next iOS SDK will be released?
  • Its feature complete, but we are still testing it and have fixed a bunch of bugs this week. I guess, it will get released next week.