Quick question n.2: _server.createRoom

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

Moderators: Lapo, Bax

User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Quick question n.2: _server.createRoom

Postby mistermind » 06 Oct 2009, 20:52

I noticed this is not clear in the documentation so here it goes:
Page: http://www.smartfoxserver.com/docs/docP ... eRoom.html

By creating a room server from an extension that is a game (roomObj.isGame = true) does it automatically join the room creator like the client side coding? If so, does exitCurrentRoom=false works?

Code: Select all

var roomObj:Object = new Object();
roomObj.name = params.r;
roomObj.isGame = true;
roomObj.maxU =2;
roomObj.exitCurrentRoom = false;
var newGameRoom = _server.createRoom(roomObj, user, false, false);
SELECT * FROM users WHERE clue > 0
0 rows returned.
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 13 Oct 2009, 17:34

Let me refine my question:
the create room method from the client API tells us that when a room is a game room (isGame = true) it automatically joins the creator of that room in. In order for that user not to leave the previous room, there is a tag called exitCurrentRoom where you set it to false during the creation.

Problem is that the _server.createRoom also has the isGame, but not the exitCurrentRoom (or at least not specified in the docs).

So my questions are:
Does the isGame tag also automatically joins the user in from _server.createRoom?
If so, does that forces the user to leave the previous room? Is there a way to stop it?
SELECT * FROM users WHERE clue > 0

0 rows returned.
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 14 Oct 2009, 08:39

No, from server side you don't get this automatic behavior.
You can choose to join a User immediately after creation or not, but by default nothing the User will remain were he is.

On the server side you can create a Room at any time and assign it to a User or the Server so we don't automate the joining operation
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
mistermind
Posts: 131
Joined: 15 Sep 2007, 01:33
Contact:

Postby mistermind » 15 Oct 2009, 17:35

Thanks lapo thats what I needed to know :)
SELECT * FROM users WHERE clue > 0

0 rows returned.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 23 guests