new FindRoomsRequest(expr[, groupId][, limit])

Creates a new FindRoomsRequest instance. The instance must be passed to the SmartFox.send() method for the request to be executed.

By providing a matching expression and a search scope (a Group or the entire Zone), with this request it is possible to find those Rooms matching the passed criteria on the server side and retrieve them by means of the roomFindResult event.

Example

This example looks for all the server Rooms whose "country" Room Variable is set to "Sweden".

function someMethod()
{
	sfs.addEventListener(SFS2X.SFSEvent.ROOM_FIND_RESULT, onRoomFindResult, this);

	// Create a matching expression to find Rooms with a "country" variable equal to "Sweden"
	var exp = new SFS2X.MatchExpression("country", SFS2X.StringMatch.EQUALS, "Sweden");

	// Find the Rooms
	sfs.send(new SFS2X.FindRoomsRequest(exp));
}

function onRoomFindResult(evtParams)
{
	console.log("Rooms found: " + evtParams.rooms);
}

Parameters

Name Type Optional Description

expr

 

 

A matching expression that the system will use to retrieve the Rooms.

groupId

 

Yes

The name of the Group where to search for matching Rooms; if null, the search is executed in the whole Zone.

Defaults to null.

limit

 

Yes

The maximum size of the list of Rooms that will be returned by the roomFindResult event. If 0, all the found Rooms are returned.

Defaults to 0.

See also
SmartFox#send
SFSEvent.ROOM_FIND_RESULT
MatchExpression