Room variables not sent to other users

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

dutzi
Posts: 12
Joined: 28 Jan 2008, 09:33

Room variables not sent to other users

Postby dutzi » 13 Feb 2008, 12:34

Hi,

I'm writing a Lobby for a multiplayer game, in which user can choose which room they'd like to join, or create a new room.

When a new room is created a server side extension is attached to it:

Code: Select all

var gameRoom:Object      = new Object()
gameRoom.name          = sfServer.myUserName+"'s Room";
gameRoom.maxUsers       = 2
gameRoom.maxSpectators    = 0
gameRoom.isGame       = true
gameRoom.isTemp       = true
gameRoom.extension      = {name:"fourinarow",script:"fourinarow.as"}

sfServer.createRoom(gameRoom)

Then, in the extension, the initializetion function creates a room variable and sets its value:

Code: Select all

rVars=[{name:RV_ROOM_STATUS, val:ROOM_STATUS_WAITING}];
_server.setRoomVariables(_server.getCurrentRoom(), null, rVars);

When i run two instances of the Lobby and i use one of them to create a new room, the new room appears on the second Lobby instance and its variable are OK. But, if i run just ONE instance of the Lobby, create a new room through it, and ONLY THEN run a second instance of the Lobby, the room list that appears on the second Lobby contains the new room but not its vars.

When i saw the SmartFox's trace it appears like when a new user logs on to the server and receives the rooms list, the room variables don't come with it.

How can i load dynamically created room variables? Aren't they supposed to be sent automatically to each user logging in?

Thank you! :D

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 29 guests