Hello,
How can I fillter the roomList that I get from getRoomListFromGroup.
I want to filter the games that not started.
var roomList:Array = sfs.roomManager.getRoomListFromGroup(games_grup);
Best Regards,
filter roomlist from getRoomListFromGroup
Re: filter roomlist from getRoomListFromGroup
I'd recommend doing it via RoomVariables.
If you use rooms of type SFSGame there's already a variable signaling if the game is started.
http://docs2x.smartfoxserver.com/Advanc ... s/game-api
Otherwise you can set up your own Room Variables and then use them as filters. In other words you can cycle through the room list and select those that match your criteria.
An even better way is to use the FindRoomRequest passing a specific MatchExpression, which is a query-like expression to filter rooms based on multiple parameters.
MatchExpressions are also explained in the above link.
hope it helps
If you use rooms of type SFSGame there's already a variable signaling if the game is started.
http://docs2x.smartfoxserver.com/Advanc ... s/game-api
Otherwise you can set up your own Room Variables and then use them as filters. In other words you can cycle through the room list and select those that match your criteria.
An even better way is to use the FindRoomRequest passing a specific MatchExpression, which is a query-like expression to filter rooms based on multiple parameters.
MatchExpressions are also explained in the above link.
hope it helps
Re: filter roomlist from getRoomListFromGroup
Hi Lapo,
Thank you very much your quick and detailed answer.
My main problem is changing the rooms.
Beginners have 1000 active users and 500 games,
Masters have 20 users and 10 games
Promasters have 10 users and 5 games.
When i change the room from masters to promaster, it becomes very fastly, but when i try to login Beginners room, it is coming slowly (because of counts)
I planned to show only the game rooms that game not started, so that i asked this question.
After trying the FindRoomsRequest, i understand that i asked wrongly Because same problem goes on.
Also i wanto to inform that i'm creating games with CreateSFSGameRequest.
Do you have any advice for me my main problem? (i hope I explained the problem)
Best Regards
Thank you very much your quick and detailed answer.
My main problem is changing the rooms.
Beginners have 1000 active users and 500 games,
Masters have 20 users and 10 games
Promasters have 10 users and 5 games.
When i change the room from masters to promaster, it becomes very fastly, but when i try to login Beginners room, it is coming slowly (because of counts)
I planned to show only the game rooms that game not started, so that i asked this question.
After trying the FindRoomsRequest, i understand that i asked wrongly Because same problem goes on.
Also i wanto to inform that i'm creating games with CreateSFSGameRequest.
Do you have any advice for me my main problem? (i hope I explained the problem)
Best Regards
Return to “SFS2X ActionScript 3 API”
Who is online
Users browsing this forum: No registered users and 30 guests