Can't create room because room list is empty?

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

Moderators: Lapo, Bax

Post Reply
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

Can't create room because room list is empty?

Post 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?
Soleil
Posts: 19
Joined: 06 Mar 2010, 06:24

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

Post 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
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply