[SOLVED]How to set room auto remove ?

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

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

[SOLVED]How to set room auto remove ?

Post by lhc1990 »

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: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to set room auto remove ?

Post by Lapo »

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
Post Reply