| Package | com.smartfoxserver.v2.requests |
| Class | public class FindRoomsRequest |
| Inheritance | FindRoomsRequest com.smartfoxserver.v2.requests.BaseRequest |
By providing a matching expression and a search scope (a Group or the entire Zone), SmartFoxServer can find those Rooms matching the passed criteria and return them by means of the roomFindResult event.
See also
| Method | Defined By | ||
|---|---|---|---|
FindRoomsRequest(expr:MatchExpression, groupId:String = null, limit:int = 0)
Creates a new FindRoomsRequest instance. | FindRoomsRequest | ||
| FindRoomsRequest | () | Constructor |
public function FindRoomsRequest(expr:MatchExpression, groupId:String = null, limit:int = 0)Creates a new FindRoomsRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.
Parametersexpr:MatchExpression — A matching expression that the system will use to retrieve the Rooms.
| |
groupId:String (default = null) — The name of the Group where to search for matching Rooms; if null, the search is performed in the whole Zone.
| |
limit:int (default = 0) — The maximum size of the list of Rooms that will be returned by the roomFindResult event. If 0, all the found Rooms are returned.
|
See also
Sweden:
private function someMethod():void
{
sfs.addEventListener(SFSEvent.ROOM_FIND_RESULT, onRoomFindResult);
// Create a matching expression to find Rooms with a "country" variable equal to "Sweden"
var exp:MatchExpression = new MatchExpression("country", StringMatch.EQUALS, "Sweden");
// Find the Rooms
sfs.send(new FindRoomsRequest(exp));
}
private function onRoomFindResult(evt:SFSEvent):void
{
trace("Rooms found: " + evt.params.rooms);
}