Hi,
Is it possible to change the owner of room, after creating the room with server as the owner...??????.
I have tried setting setCreator()..But even after all players left the room, room didn't destroy.....
ie,
1) I've created a room with server as the owner( passed null for owner)
2) I am changing the owner using setCreator to a randoom User when game starts in that particular room.
3) FInally, when game ends, I am expecting the room to be destroyed automatically according to the docs...
But the room is not getting destroyed.....
Room destroy
Re: Room destroy
Hello.
Yes, if you specify null as the owner, the room will only get removed after a server restart. In this scenario, I suggest you to create those rooms with a null owner and then have an extension controlling the rooms. When the game ends, you can simply destroy the room from the extension (using the destroyRoom() method if you'r using an AS Extension - or ExtensionHelper.destroyRoom() in case of a Java extension).
Yes, if you specify null as the owner, the room will only get removed after a server restart. In this scenario, I suggest you to create those rooms with a null owner and then have an extension controlling the rooms. When the game ends, you can simply destroy the room from the extension (using the destroyRoom() method if you'r using an AS Extension - or ExtensionHelper.destroyRoom() in case of a Java extension).
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.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Room destroy
Hi,
I have to consider one more scenario...
1) How to find out If room is empty???
a) I have two scenarios, when a player press leave table button, I am calling leaveRoom in the server side, this call inturn calls handleInternalEvent. Now I am checking the total players length in this room, I am getting the total as 0 in this case.
b) When I close flash player(browser), userLost is getting called in handleInternalEvent, now the total length of the room is "1".
So where to decide the room destruction???????????
How to find out the room is empty????????
I have to consider one more scenario...
1) How to find out If room is empty???
a) I have two scenarios, when a player press leave table button, I am calling leaveRoom in the server side, this call inturn calls handleInternalEvent. Now I am checking the total players length in this room, I am getting the total as 0 in this case.
b) When I close flash player(browser), userLost is getting called in handleInternalEvent, now the total length of the room is "1".
So where to decide the room destruction???????????
How to find out the room is empty????????
Re: Room destroy
Well, are you using the getUserCount() method of the room object? If you instead use getUserList() (which returns an array) and then get that array's length, doesn't it either work? And are you using a Zone-Level or a Room-Level extension to handle those events?
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.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Re: Room destroy
Yea...both are not working....when last player leaves the room....I am getting the count as "1" not 0. is that how it works?????
Room Level extension....
Room Level extension....
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 48 guests