[SOLVED]How to set room auto remove ?

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

lhc1990
Posts: 31
Joined: 26 Oct 2012, 07:49

[SOLVED]How to set room auto remove ?

Postby lhc1990 » 10 Apr 2013, 03:39

I created room from java script client side. How do I set room setting to auto remove when there is no one else ? Here is my code

Code: Select all

var  settings = new SFS2X.Requests.Game.SFSGameSettings(name);
   settings.name = param.invitation.params.roomName;
   settings.maxUsers = 2;
   settings.maxSpectators = 2;
   settings.isPublic = true;
   settings.minPlayersToStartGame = 2;
   settings.isGame = true;
   settings.groupId = 'games';
   settings.leaveLastJoinedRoom = true;
   settings.extension = new SFS2X.Requests.RoomExtension('GameRoom', 'room.game.RoomExtension');

Thanks
Last edited by lhc1990 on 10 Apr 2013, 09:00, edited 1 time in total.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to set room auto remove ?

Postby Lapo » 10 Apr 2013, 08:46

On the client side you cannot set the REMOVE behavior. It will always use the default behavior which is explained here:
http://docs2x.smartfoxserver.com/Develo ... chitecture

From the docs:
DEFAULT: this is applied by default if the setting is not provided. In this mode regular Rooms are removed when the Room is empty and it's creator is no longer logged in the Zone. Game Rooms are removed as soon as they are empty.


cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 20 guests