Page 1 of 1

smartfox.joinRoom(roomName)

Posted: 01 Apr 2007, 21:46
by treylok
Hi,

I create a zone with 2 rooms; "Lobby" and "gameRoomLobby"

<Room name="Lobby" maxUsers="10000" isPrivate="false" isTemp="false" limbo="true" autoJoin="true" />
<Room name="gameRoomLobby" maxUsers="1000" isPrivate="false" isTemp="false">


I have a custom login, in which I use smartfox.autoJoin() to join the lobby.

Once I enter the Game Room Lobby, I call smartfox.joinRoom("gameRoomLobby") in the timeline.

I get an error message saying "SmartFoxError: requested room to join does not exist!"

If I change this to smartfox.joinRoom(2).....everything works fine.


However, if I change the code of my custom login to say smartfox.getRoomList()

smartfox.joinRoom("gameRoomLobby") works fine.

I think this is a bug, unless the clients is supposed to receive an entire room list before they can join a room by String name.

I would like to save as much bandwidth as possible, so I would rather use autojoin, rather then receive the entire room list upon login.


-Treylok

Posted: 03 Apr 2007, 08:06
by Lapo
I think this is a bug, unless the clients is supposed to receive an entire room list before they can join a room by String name.
e x a c t l y ! :D
Always call the getRoomList() before doing anything else.

Two possible cases:

1- default login: getRoomList gets called automagically for you, behind the scenes

2- custom login: do it manually by either calling the getRoomList from the client side or using sendRoomList fromt the server side