Lapo wrote:How do you manage leaving a previous Room exactly?
You said each player is joined in a Room and a Table at once. So typically you'd expect a player to be in 2 Rooms at once? Right?
What happens next?
Is the player allowed to leave the main Room?
I suppose he's also allowed to leave the current Table and join another one.
How are these operations handled? How do you leave one Room and join the next? Can you show me actual code?
Thanks
Thanks Lapo,
There are two ways players are removed from rooms.
(1) While in game they can hit a button that sends a client request to return to the lobby. This triggers an onleave event that removes them from the game and table rooms.
(2) While in a game, when the round ends the server moves people automatically based on if they win or lose. The code is posted on the other issue we've been having here:
viewtopic.php?f=19&t=19318#p84210You are correct, during ongoing gameplay the players are in two rooms. The entire purpose of two rooms is 1 room they can chat in, 1 room they can play in. The chat room has all the players in the game (up to 300), the game room (table) is only 4 players. During a game players are moved from table to table in-between rounds of play, using the code linked above.
There is no way for a player to leave a table and join another one on their own within an ongoing game and they do not get to select what tables they join, the server manages that.
Once a game starts, players are supposed to be able to chat via the chat room to everyone in the game. The client properly sends the messages to the chat room. Some players can see messages all players send to the chat room. Other players can only see the messages sent to players at their table. We have determined that the messages that cannot be seen ARE being relayed by the server and the client IS receiving them, however the SENDER is coming through from the client API code as "null".
Here is an excerpt from the client console:
110 [MainApp] Received chat message:
{message:Having trouble Mandy?, sender:null, room:[Room: Room_1, Id: 3, GroupId: RoomGroup], data:null}
111 [MainApp]
---------|----------------------------------------------------------------------------------------------------
ERROR | Chat message received without sender. Aborting.
---------|----------------------------------------------------------------------------------------------------
When the client received this message, it would have been in the following two rooms:
Room_1 (the "chat" room containing all of the game players.)
Room_1_Table_1 (the game play "table" room)
Thus as you can see from the console entry, Matt's client sent the message to the right room properly. The server relayed it properly. The client received it properly. But the API somehow stripped or failed to look up the sender.
This should not be possible and we really need a fix for it...
It feels to me like the API only does the lookup in the "last joined room" rather than "all joined rooms". It should be quick and easy for the author to check and confirm if that is the case or not. We are happy to work directly via email or whatever preferred method to assist, but fixing the AS3 API is beyond our resources and expertise.