creating game room = automatic join?

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

brandon
Posts: 7
Joined: 28 Mar 2005, 22:47
Location: Portland, OR, USA
Contact:

creating game room = automatic join?

Postby brandon » 05 May 2005, 23:45

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
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 06 May 2005, 12:57

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! :D

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,
Lapo
--
gotoAndPlay()
...addicted to flash games
brandon
Posts: 7
Joined: 28 Mar 2005, 22:47
Location: Portland, OR, USA
Contact:

Postby brandon » 06 May 2005, 15:25

Ok, thanks for clarifying that - I suspected that was the case and it does make sense. And yes, perhaps I can accomplish what I want through other means. If you wouldn't mind, I'll send you an email with a rough screen mockup of the type of lobby I'm thinking about.

thanks again,
brandon
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 06 May 2005, 15:40

sure! no problem :)
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

CORRECTION

Postby Lapo » 07 May 2005, 09:56

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:

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.
Lapo

--

gotoAndPlay()

...addicted to flash games
brandon
Posts: 7
Joined: 28 Mar 2005, 22:47
Location: Portland, OR, USA
Contact:

Postby brandon » 09 May 2005, 00:41

Swell! that's good to know. thank you

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 36 guests