can i sort rooms in a zone?

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

Moderators: Lapo, Bax

praveen213
Posts: 31
Joined: 27 Dec 2010, 04:56

can i sort rooms in a zone?

Postby praveen213 » 07 Feb 2011, 11:46

Is it possible to sort rooms in a zone based on different properties?? lets say i want to sort rooms in the descending order based on the number of players in that room. i am using SFS PRO 1.6.9.
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 07 Feb 2011, 21:23

Sorry, but there's no in-build functionality for that.

Why do you need to sort rooms? I have a number of workarounds in mind, depending on why you need to sort it for.
Smartfox's forum is my daily newspaper.
User avatar
Bax
Site Admin
Posts: 4522
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: can i sort rooms in a zone?

Postby Bax » 08 Feb 2011, 07:16

praveen213 wrote:Is it possible to sort rooms in a zone based on different properties?? lets say i want to sort rooms in the descending order based on the number of players in that room. i am using SFS PRO 1.6.9.

This is a client-side requirements. As long as you have the informations available (for example you can't access room variables from outside the room), you can do whatever you need on the client. For example ActionScript's ArrayCollection has great sorting and filtering capabilities, if you use it as dataprovider of a list.
Paolo Bax
The SmartFoxServer Team
shanti
Posts: 45
Joined: 19 Jul 2011, 10:19

Merging one or more rooms

Postby shanti » 16 Sep 2011, 04:53

Hi,
Is it possible to merge multiple rooms to single room. i am using SFS PRO 1.6.9.

when user logout from the game, to show more people in each room. want to merge rooms and put them to single room.



Thanks,
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 17 Sep 2011, 01:43

when user logout from the game, to show more people in each room. want to merge rooms and put them to single room.


Can you explain more about what you want to achieve. Do you want to populate a list of all players in the entire game? Do you want to only view their stats? Only their names? Or do you want to communicate with other players? Please clarify.
Smartfox's forum is my daily newspaper.
shanti
Posts: 45
Joined: 19 Jul 2011, 10:19

Postby shanti » 20 Sep 2011, 10:42

BigFIsh wrote:
when user logout from the game, to show more people in each room. want to merge rooms and put them to single room.


Can you explain more about what you want to achieve. Do you want to populate a list of all players in the entire game? Do you want to only view their stats? Only their names? Or do you want to communicate with other players? Please clarify.


Like i have 4 rooms created and all 4 are filled with 5 peoples each.
now when people leave room (logout from game),
say Room1 , Room2 got now only 2 each, in such case want to bring both users into single room either Room1 or Room2 and destroy the other one.

Thanks,
Shanti
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 20 Sep 2011, 22:03

This is something that will be needed to be done on serverside in your extension. Get your extension to check if condition is met (such as 'less than 2 players') in 'userLost' (disconnection) and 'userExit' (leaving a room) and logOut (when logging out). If the condition is met, you can then carry out the required actions such as creating a new room and placing all the users in that room.
Smartfox's forum is my daily newspaper.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 38 guests