iOS Client load balancing room properties problem

edited November 2013 in Native
Hi there,

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

On updating to the 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;
NSDictionary* dictGameRoomProps = [NSDictionary dictionaryWithObjectsAndKeys:
[NSValue valueWithBytes:&TURNNUMBER_VALUE objCType:@encode(;nByte)], TURNNUMBER_KEY,
[NSValue valueWithBytes:&GAMESTATE_VALUE objCType:@encode(;nByte)], GAMESTATE_KEY,

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

// Lobby properties
EGArray* arrayLobbyProps = [EGArray arrayWithObjects:

// convert maxplayer to nbyte
nByte MAXPLAYERS = maxPlayers;

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

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 from
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: 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[];


  • Hi admiralronton.

    As stated in the release history inside the client SDK, starting with, 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, but is now in 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.
Sign In or Register to comment.