JoinRoomRequest only joins to one room.

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

freeandoni
Posts: 14
Joined: 28 Feb 2012, 19:02

JoinRoomRequest only joins to one room.

Postby freeandoni » 26 Sep 2012, 12:31

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.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: JoinRoomRequest only joins to one room.

Postby rjgtav » 26 Sep 2012, 17:03

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.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
freeandoni
Posts: 14
Joined: 28 Feb 2012, 19:02

Re: JoinRoomRequest only joins to one room.

Postby freeandoni » 28 Sep 2012, 08:50

Thank you, that works for me.

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 1 guest