createRoom Problem

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

Moderators: Lapo, Bax

rsnail
Posts: 33
Joined: 04 Nov 2005, 20:19

createRoom Problem

Postby rsnail » 23 Nov 2005, 20:15

Hello,

I ran into a problem with createRoom. Basically the user is not automatically joining if the isGame = false.

Example:

The following code works. The room is created and the user automatically joins the room.

Code: Select all

room = new Object();
room.name = "RoomName";
room.isGame = true;
room.maxUsers = 10;
smartFox.createRoom(room);


The Following code does not work. The room is created but the user remains in their current room.

Code: Select all

room = new Object();
room.name = "RoomName";
room.isGame = false;
room.maxUsers = 10;
smartFox.createRoom(room);

OR

room = new Object();
room.name = "RoomName";
room.maxUsers = 10;
smartFox.createRoom(room);


I have also tried setting the exitCurrentRoom to both true or false

Thanks

rsnail
User avatar
Lapo
Site Admin
Posts: 21790
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 23 Nov 2005, 20:43

hello,
the behaviour you're getting is okay. Maybe it's not explained too clearly in the client API docs... but it is shown clearly in the example tutorials.

When a "normal" room is created (where the isGame flag is false) the room is not automatically joined. You can do it by "trapping" the onRoomAdded() and join such room as soon as it is availble.

On the other hand when a game room is created, its creator is immediately joined inside of it as we presume he wants to be inside in order to play.

These client side behaviours are currently being expanded on the server side. We're adding new extensions methods to create rooms and join users from the server side allowing all types of advanced behaviours such as custom challenge systems, hidden rooms, advanced join systems, reserved rooms etc...

All these new feature will be available in version 1.4.0

:)
Lapo
--
gotoAndPlay()
...addicted to flash games
x.Mara.x
Posts: 23
Joined: 18 Dec 2008, 20:03

IDK!

Postby x.Mara.x » 18 Dec 2008, 20:05

For me it works and the room is created.. BUUTTT as i read in some descriptions, it gets destroyed once the owner leaves the server i dont want that! how do i do it?

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 32 guests