Page 1 of 1

Bug in joining a newly created room, when in temp room

Posted: 14 Feb 2006, 16:34
by Pippoflash
hey :)
this is what happens:

I create e temp room with this syntax and join it. fine.

Code: Select all

s.createRoom({name:r,maxUsers:50,isGame:true,exitCurrentRoom:true,uCount:false,extension:{name:"RoomMotion",script:"_RoomMotion.as"}});
Then I create another with exactly the same syntax, It calls the callback function, (onJoinRoom) but the "room" argument is empty!
Other users can then connect the room and it works correctly (for them)
But the first user (the one who created the room), gets the callback functions (onUserJoin, etc.) but ALWAYS WITHOUT ARGUMENTS.

It looks like a bug, or am I doing something wrong?

thx!
P

Posted: 15 Feb 2006, 07:05
by Lapo
A couple of questions:

1) We are talking about the createRoom() of the client API? Not server side?
2) Is the 2nd room created a game room?

thnx

Posted: 15 Feb 2006, 09:10
by Pippoflash
yes it's the client API in AS1.
they are both game rooms.

Posted: 15 Feb 2006, 17:07
by Lapo
There could be a bug here, but I have some more questions.

The way you're creating the rooms now, will make the user leave the current room.
So you're doing something like this:

- Enter the autojoin room
- create room A, join it and leave prev. room
- create room B, join it and leave prev. room

so is it necessary to create room A?

Posted: 16 Feb 2006, 16:15
by Pippoflash
Sorry maybe i didnt explain myself :)

So this is the list of events that produced the bug

1 - Join a static room
2 - Crate a dynamic game room with autojoin
3 - Create another dynamic game room with autojoin
this is where the bug came out.
The room is created correctly, and the user joins it and leaves the previous room (which gets destroyed).
The user on the admin panel appears in the users list of the newly created room.
Other users can join, and things work perfectly for them, but the original user (the one who created the room), has callbacks from SFS (I tried a few, amongst them: onJoinRoom, onUserJoin...) without arguments.
The function is called, but no arguments are sent with it.

The workaround I found is, after joining the game room, before creating and joining the second one, to join again the static room...
If I leave the dynamic room and destroy it, joining the static room, I can then create another dynamic room and join it without any malfunction...

I hope I wrote clearly enough :)
wisdom
P

Posted: 16 Feb 2006, 16:46
by Lapo
Hi PippoFlash,
thanks, now it is perfectly clear! :)

I've gone through the server code and I have found out that this is not a bug. It was an intentional choice: game rooms by default do not receive onRoomAdded and onRoomDeleted events.

This is the reason why the onJoinRoom event gives you and undefined object, it's because you didn't receive the update, and your local version of the roomList does not contain the new room object.

Why this?
In almost 90% of the cases, you don't need to keep an updated list of rooms while playing. You will receive it again when you leave the game room and go back to the Lobby or similar "Main Room"

Disabling those events will also help in optimizing the number of messages being broadcasted by the server.

Maybe we've found one of those cases that falls in the other 10% :)
However it's not clear to me why you create the first game room and then leave it immediately when the 2nd game room is created and joined...
What is it for?

I think we may add a configuration parameter in the Zone to activate/deactivate those events for game rooms...

Let me know what you think

p.s. = another workaround could be to not leave the main room... in that case you will continue to receive all the updates... but also many other broadcasted messages :?

Posted: 16 Feb 2006, 17:05
by Pippoflash
ah ok...
the rooms are created on the fly because they reflect the system I wrote many posts about :)
where there could be up to 25000 rooms, so all the rooms are created on the fly.
That situation happens only when the last user to leave a room is the first user to enter another room... so the first one gets destroyed, and the second one is created...
Glad to know it's not a bug :)
anyway I found that workaround and now it works perfectly...
btw, smart fox server rocks ;)

Posted: 16 Feb 2006, 17:24
by Lapo
Question... if you're going to handle all those rooms... I guess it would be better to create them from the server side.

This way is not the client handling the application logic, but the server. So you can add validation etc...
btw, smart fox server rocks
Our very first client contacted me via ICQ a few minutes ago. He's been running the server for over 7 months without any restarts... over 2 million games played.

Code: Select all

uptime: 211 days, 0 hours, 58 minutes
Data in: 198.1 GB
Data Out: 430.9 GB
Now he's going to stop it in order to update it to the latest version... it's still a 1.1.0 :D