A probelm with sorting rooms list after zone.getRooms()
Posted: 11 Nov 2010, 08:04
Hello.
I've been trying to work this out, but can't seem to find the right way to do what I need...
Lets say I want to send me newly logged client a list of the last 10 rooms to be created.
When I ask the zone for the rooms list, using, of course, zone.getRooms(), the list returned in not in order of the rooms by the time of their creation.
Since sortOn is not supported on the server, meaning I can't sort the rooms (all dynamic rooms) by their id, and I can't sort to the correct order using simple sort after, for example, converting the data into strings, since room_id_10 will come before room_id_2, or even, should I try 10_room, it will still come before 2_room, what can you suggest to make this kind of sort work, or is there some kind of command I'm missing or some parameters I could pass the getRooms function to give me back the rooms by order??
Thanks.
Yuval Lahav.
I've been trying to work this out, but can't seem to find the right way to do what I need...
Lets say I want to send me newly logged client a list of the last 10 rooms to be created.
When I ask the zone for the rooms list, using, of course, zone.getRooms(), the list returned in not in order of the rooms by the time of their creation.
Since sortOn is not supported on the server, meaning I can't sort the rooms (all dynamic rooms) by their id, and I can't sort to the correct order using simple sort after, for example, converting the data into strings, since room_id_10 will come before room_id_2, or even, should I try 10_room, it will still come before 2_room, what can you suggest to make this kind of sort work, or is there some kind of command I'm missing or some parameters I could pass the getRooms function to give me back the rooms by order??
Thanks.
Yuval Lahav.