LeaveRoom problem Lite Lobby

peteo
edited August 2011 in Native
I met one problem in the Lite Lobby.

In IOS client, I use
- (void) EnterLobby
{
NSDictionary * pDic = [NSDictionary dictionaryWithObjectsAndKeys:
@chat_lobby ,[KeyObject withByteValue:P_GAMEID],
nil];
[m_pLitePeer opCustom:OPC_RT_JOIN : pDic :true];
}
to enter a Lobby

and then use
NSDictionary * pDic = [NSDictionary dictionaryWithObjectsAndKeys:
gameId ,[KeyObject withByteValue:P_GAMEID],
@chat_lobby ,[KeyObject withByteValue:((nByte)5)],
nil];
return [m_pLitePeer opCustom:OPC_RT_JOIN : pDic :true];
to enter a room

All is OK.But when I Leave room:
[m_pLitePeer opLeave:gameId];or [m_pLitePeer opLeave];

it will not receive events in the Lobby from others any more.

Where is the problem?

Comments

  • The lobby and a "game room" are both rooms but have different "tasks".
    Lobby: a potentially huge number of players gets into the lobby, to get the names of currently running games. Here, no gaming is done, clients don't know who is in the lobby as well.
    Room: is used to gather the players and exchange events between them. Players send their turns or positions and names, etc. Here, you don't need / want room listings anymore.

    If you leave the lobby, you won't get updates anymore. From the lobby, you would want to get players into specific rooms (by name).
    When a player is in the lobby, he should select a room by name and join this. That will leave the lobby but join the room.

    Our objC programmer is on vaction this week, so I can hardly help with code.
  • Thank you!
    My problem is leaving a "game room".When I left a "game room",I want to return the lobby . But I have to call EnterLobby() again.

    Is there anyway to leave a "game room" and return to Lobby automatically ?
  • There are many ways to do so, but none out of the box.
    You could change the server logic to join a lobby, whenever a "room" is left. For this, you would modify the Leave operation in Lite Lobby. Take a look at the Join operation, to see how a player (peer) is getting into a room, as you should not assign it directly (the rooms are processed in separated threads).