smartfox.joinRoom(roomName)

You think you've found a bug? Please report it here.

Moderators: Lapo, Bax

Post Reply
treylok
Posts: 21
Joined: 18 Aug 2006, 00:53
Contact:

smartfox.joinRoom(roomName)

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

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