I am attempting to have a lobby where players can start a game but without leaving the lobby - they will just update a user variable to reflect a 'busy' status that the others see. But I don't even get far enough to use the 'dontLeave' flag on an joinRoom() call, because it seems like creating a game room autojoins the user who created it. How should I accomplish this?
thanks,
Brandon
creating game room = automatic join?
At the moment when a game room is created, its creator is auto-joined so that he can wait for the other (or others) player(s)
This is done because usually the guy who starts a game room is the one who also wants to play. If we don't autojoin him in the game room he will not be 100% sure to play.
Let's say a user creates a game room for 2 players, but he doesn't join it.
Maybe two other players with faster reflexes and connections may enter the room and start playing, leaving the creator out. (He would have to create a new room again)
A possible solution to this is to allow the room creator to stay in both rooms (the current one and the new game room). This way he could still interact in the old room while keeping his player slot occupied, so no one else can get it.
This option is already supported by the server but I am quite sure it's not yet implemented in the API. We didn't implement it because we thought this would be a pretty rare case... but maybe you proved us wrong!
Activating this new feature wouldn't take too much time and if you're interested we can implement it in the next days and send you a new version of the API, meanwhile we'll do some more tests and we'll publish the new stable API as soon as they're enough tested.
Also I'd like to know better how your application is supposed to work, maybe I could suggest some other ways to get to the same result.
Cheers,
This is done because usually the guy who starts a game room is the one who also wants to play. If we don't autojoin him in the game room he will not be 100% sure to play.
Let's say a user creates a game room for 2 players, but he doesn't join it.
Maybe two other players with faster reflexes and connections may enter the room and start playing, leaving the creator out. (He would have to create a new room again)
A possible solution to this is to allow the room creator to stay in both rooms (the current one and the new game room). This way he could still interact in the old room while keeping his player slot occupied, so no one else can get it.
This option is already supported by the server but I am quite sure it's not yet implemented in the API. We didn't implement it because we thought this would be a pretty rare case... but maybe you proved us wrong!
Activating this new feature wouldn't take too much time and if you're interested we can implement it in the next days and send you a new version of the API, meanwhile we'll do some more tests and we'll publish the new stable API as soon as they're enough tested.
Also I'd like to know better how your application is supposed to work, maybe I could suggest some other ways to get to the same result.
Cheers,
CORRECTION
I was wrong: the feature is already present in the current SmartFoxServer API!
We just forgot to mention it in the createRoom() method documentation. Now it's been updated!
By default when you create a game room you're automatically joined in the new room leaving the one you were in before.
If you don't want to leave the old room you can set the "exitCurrentRoom" property to false.
Here's a code example:
The above code creates a new game room and allows the user to stay in the current room and the new one at the same time.
We just forgot to mention it in the createRoom() method documentation. Now it's been updated!
By default when you create a game room you're automatically joined in the new room leaving the one you were in before.
If you don't want to leave the old room you can set the "exitCurrentRoom" property to false.
Here's a code example:
Code: Select all
var rObj:Object = new Object()
rObj.name = "myGameRoom"
rObj.isGame = true
rObj.maxUsers = 4
rObj.exitCurrentRoom = false
smartFox.createRoom(rObj)
The above code creates a new game room and allows the user to stay in the current room and the new one at the same time.
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 88 guests