Page 1 of 1

Can't create room because room list is empty?

Posted: 08 Mar 2010, 04:09
by Soleil
I have successfully connected and logged in. Now just trying to create a room.

Here's the code I'm using, straight from the docs:

Code: Select all

var roomObj:Object = new Object();
roomObj.name = "The Test Room";
roomObj.isGame = true;
roomObj.maxUsers = 15;

_smartFox.createRoom(roomObj);
And here is the error I get:

Code: Select all

****************************************************************
Warning:
The room list is empty!
The client API cannot function properly until the room list is populated.
Please consult the documentation for more infos.
****************************************************************
How can I populate the list if I can't create a room? Is there anything I need to do first in order to be able to create a room?

Posted: 08 Mar 2010, 07:12
by Soleil
I figured out that I can wait for "onRoomListUpdate", then do _smartFox.autoJoin();

Then, after I'm in the default room I can createRoom(), which automatically puts me in the new room I create.

So do users always have to put in a room first before they can create a room?

Posted: 08 Mar 2010, 10:43
by Lapo
Yes.
You can create a default Room that everyone joins as a temporary location, a limbo Room to be specific.
The "limbo" attribute allows the Room to inhibit all event broadcasting allowing any number of users to join it without generating continuos user updates.

Please read the details here:
http://www.smartfoxserver.com/docs/docP ... ecture.htm