Server room max vars weird

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

freeandoni
Posts: 14
Joined: 28 Feb 2012, 19:02

Server room max vars weird

Postby freeandoni » 14 Aug 2012, 14:38

I'm trying to use more than five vars in room. I have applied the settings parameter to eight - more than five - but something weird happens on the web monitor. And it is not working either.

Code: Select all

         
                        var variables:Array = new Array();
         
         variables.push(new SFSRoomVariable("currentTurn", -1, VariableType.INT));
         variables.push(new SFSRoomVariable("startWithOne", data.pointer.checkbox_0.value));
         variables.push(new SFSRoomVariable("colorWalls", data.wall.checkbox_0.value));
         variables.push(new SFSRoomVariable("time", data.time.radio_0.value));
         variables.push(new SFSRoomVariable("dices", data.dices.radio_0.value));
         variables.push(new SFSRoomVariable("teleporters", data.ray.checkbox_0.value));
         variables.push(new SFSRoomVariable("isVs", data.vs.checkbox_0.value));
         variables.push(new SFSRoomVariable("vs", data.vs.radio_1.value));
         
         //Create a new Chat Room
         var settings:SFSGameSettings = new SFSGameSettings("room_" + String(Math.round(Math.random() * 10000)));
         settings.maxVariables = 8;
         settings.maxUsers = Number(data.players.radio_0.value);
         settings.isPublic = Boolean(!data.lock.checkbox_0.value);
         settings.minPlayersToStartGame = settings.maxUsers;
         settings.notifyGameStarted = true;
         settings.isGame = true;
         
         //Set a Room Variable containing the description of the game
         settings.variables = variables;
         
         Connector.send(new CreateSFSGameRequest(settings));


I'm attaching an image file with web monitor output.

What could I do to have more than 5 room vars?

Also, what is the $GS Boolean var that shows the web monitor?

Thank you.
Attachments
smartfoxscreen.png
(20.32 KiB) Not downloaded yet
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Server room max vars weird

Postby rjgtav » 14 Aug 2012, 22:05

Hi.

By default, when you create a Zone, it sets the maximum number of RoomVariables per Room (SFSGames included) to 5. You need to change this parameter, which is located on the General tab of the Zone Configurator, i order to be able to add more than 5 variables.

The $GS RoomVariable is a RoomVariable which is reserved for telling what is the state of the current "Game" whether it has already started or not. This is a feature of SFSGame rooms, if you use a common SFSRoom, it won't have any reserved RoomVariable.

You can find a list of the reserved RoomVariables on the ReservedRoomVariables class, which is available on both the server and the client sides.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
freeandoni
Posts: 14
Joined: 28 Feb 2012, 19:02

Re: Server room max vars weird

Postby freeandoni » 16 Aug 2012, 08:41

All is working now. Change the room var number from on zone configuration solved my problem.

I realize that for this change the server must be rebooted either.

Thank for the info.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Server room max vars weird

Postby rjgtav » 16 Aug 2012, 11:34

Yes, when you change anything on the Zone Configurator, those changes get saved to the corresponding xml configuration files, which are only loaded during the server boot, that's why you need to restart the server after applying those changes.

On the other hand, there are some settings that you can change on runtime, on the Zone Monitor module, but these changes won't take effect if you restart the server, as it will again load the configuration stored in the xml files.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 83 guests