Page 2 of 2

Posted: 27 Sep 2011, 14:00
by Rashomon
(Lapo) ...set the variables in your config.xml. This way they will be initially owned by the Server. When you call the setRoomVariables() method, specify the setOwnership flag to false (check the docs!)

The config file has a name parameter for the room. Will this work with dynamic rooms? Rooms where you don't know their names ahead of time? If so, how should the config file look?

Posted: 27 Sep 2011, 23:02
by BigFIsh
Well, according to this documentation it would look like:

<Room name="Pre-defined room name" .... ... />

As for your second question. Sure, it will work with dynamic rooms - assuming you mean by 'creating a new room at run-time via your extension while running SFS'

Posted: 28 Sep 2011, 11:51
by Rashomon
I don't understand how you can have both a pre-defined room name and a dynamic user-specified room name at the same time.

For example:

Code: Select all

var newGameRoom:Object = new Object(); = "game" + smartFox.myUserId;

newGameRoom.maxUsers = 3
newGameRoom.maxSpectators = 0
newGameRoom.isGame = true
newGameRoom.isTemp = true
var xt:Object = {} = "race"
xt.script = ""
newGameRoom.extension = xt
smartFox.createRoom( newGameRoom )

Wouldn't "game" + smartFox.myUserId conflict with <Room name="Pre-defined room name" .... ... /> ?