Page 1 of 1

JoinRoomRequest only joins to one room.

Posted: 26 Sep 2012, 12:31
by freeandoni
Hello,

I'm trying to connect to two room simultaneously. I don't know if it is possible but I pretty sure of SmartFox joinedRooms method existence.

On my custom zone I have chat and game as public and default groups:
· I have a permanent room on that zone called global and it is of chat group. It has password but is neither game room or hidden room.
· Users can create it's own game rooms of game group. This rooms are game rooms.

Users should be connected to one chat group room and one game room group (or none).

So....

I only see last connected when I use:

Code: Select all

Connector.send(new JoinRoomRequest(globalChatRoom);
Connector.send(new JoinRoomRequest(gameRoom);

for each (var r:Room in Connector.smartFox.joinedRooms)
{
   trace("onRoom: " + r.name +"\n");
}


Tracing I see SmartFoxServer kick me out when I send request for second room.

Is it possible do this?

Do I have to check some server var for multple room connection?

Thank you.

Re: JoinRoomRequest only joins to one room.

Posted: 26 Sep 2012, 17:03
by rjgtav
Hi.
You should not send multiple requests at once. Please send the 1st request, wait for the ROOM_JOIN event and, only after that, send the 2nd request.
You also have to specify a negative number as the 3rd parameter of the request, so the server doesn't remove you from the previously joined room.

Re: JoinRoomRequest only joins to one room.

Posted: 28 Sep 2012, 08:50
by freeandoni
Thank you, that works for me.