onRoomAddedHandler is not fired on client side

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

arun8483
Posts: 33
Joined: 15 Dec 2010, 02:35
Contact:

onRoomAddedHandler is not fired on client side

Postby arun8483 » 22 Feb 2012, 10:07

newRoom = helper.createRoom(currZone, map, null, true, true);

UserA - in lobby (non-game room)
UserB- in game room
UserC-About to join game room. But before that when his request arrives at the server side, I am creating a new gameroom in handleInternal event. After room creation, only User C and User A got the onRoomAdded event fired at the client side...Is it how helper.createRoom(....) works?????.
How to make all users in a zone synchronized after room creation???????? helper.sendRoomList(....)????? But this will send the entire room list and also this call invokes onRoomListUpdate in the client I dont want this to happen. Is there any other better approach.....???
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: onRoomAddedHandler is not fired on client side

Postby rjgtav » 22 Feb 2012, 10:59

Hi.
Yes, that's the expected behaviour. You can read more about room's behaviour on these white papers.

On the Tris example, when a client leaves the game, the client requests the roomList again from the server. If you think that it is using too much bandwidth, you can always do it yourself, by sending manually from a server-side extension a custom roomList with, for example, only the games that still have empty slots, etc, which will save some bandwidth. In the last case, you can always use regular rooms instead of game-rooms, as they receive the onRoomAdded and onRoomRemoved events.
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.
arun8483
Posts: 33
Joined: 15 Dec 2010, 02:35
Contact:

Re: onRoomAddedHandler is not fired on client side

Postby arun8483 » 28 Feb 2012, 12:39

Hi,
We have solved that problem by making the user stay both in lobby as well as in game room. I have set the lobby limit to around 500000.
So he will be getting the roomAdded event all the time....Do you think this is a better approach????
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: onRoomAddedHandler is not fired on client side

Postby rjgtav » 28 Feb 2012, 23:10

Well, it depends on your application. If games just take around 1-2 minutes, then yeah, it is better if you also handle the onRoomAdded event. But even in that case, i don't think the room will be capable of handling such a number of users - remember that if the room has 500.000 players, each time you create or remove a room, it has to send a message 500.000 times.

So my suggestion is to follow the flow as SFSTris suggests, and to maybe send a custom list of rooms, showing only the available games.
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.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 26 guests