set and update Roomvariables...

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

Moderators: Lapo, Bax

Rashomon
Posts: 72
Joined: 11 Aug 2010, 19:48

Postby Rashomon » 27 Sep 2011, 14:00

(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?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 27 Sep 2011, 23:02

Well, according to this documentation it would look like:

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

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'
Smartfox's forum is my daily newspaper.
Rashomon
Posts: 72
Joined: 11 Aug 2010, 19:48

Postby Rashomon » 28 Sep 2011, 11:51

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();

newGameRoom.name = "game" + smartFox.myUserId;

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


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

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 69 guests