Package | net.user1.reactor.snapshot |
Class | public class RoomListSnapshot |
Inheritance | RoomListSnapshot ![]() ![]() |
Since : | Reactor 1.0.0 |
// Create a snapshot of roomIDs including every room on the server var snapshot:RoomListSnapshot = new RoomListSnapshot(null, true); // Register a callback function snapshot.onLoad = function ():void { trace("Here is the room list: " + snapshot.getRoomList()); } // Or register a listener function snapshot.addEventListener(SnapshotEvent.LOAD, loadListener); function loadListener (e:SnapshotEvent):void { var snapshot:RoomListSnapshot = RoomListSnapshot(e.target); trace("Here are the rooms on the server: " + snapshot.getRoomList()); } // Load the room list by passing the snapshot object to // Reactor's updateSnapshot() method: reactor.updateSnapshot(snapshot);
The list of room IDs retrieved by RoomListSnapshot is a one-time snapshot of the state of the server, and is not kept up to date after it is loaded. To update a RoomListSnapshot object to match latest the state of the server, pass that object to Reactor's updateSnapshot() method.
See also
Method | Defined By | ||
---|---|---|---|
RoomListSnapshot(qualifier:String = null, recursive:Boolean = false)
Constructor
| RoomListSnapshot | ||
getQualifier():String
Returns the qualifier of the rooms that are included in this snapshot. | RoomListSnapshot | ||
getRecursive():Boolean
Indicates whether the room list for this snapshot includes rooms directly
qualified by the specified qualifier only, or also all rooms qualified by
all child qualifiers of the specified qualifier. | RoomListSnapshot | ||
getRoomList():Array
Returns an array of the fully qualified roomIDs of the rooms with the
qualifier specified by this snapshot. | RoomListSnapshot | ||
![]() | getStatus():String
Returns the status of the most recent snapshot load-operation. | Snapshot | |
![]() | updateInProgress():Boolean
Indicates whether the snapshot is currently loading data. | Snapshot |
RoomListSnapshot | () | Constructor |
public function RoomListSnapshot(qualifier:String = null, recursive:Boolean = false)
Constructor
Parametersqualifier:String (default = null ) — The room id qualifier of the rooms that should be
included in the list. For a server-wide room list, supply
null for qualifier and true for recursive. For a list of
rooms with no qualifier, supply null for qualifier and
false for recursive. For a list of rooms with the
qualifier "chat.sports", supply "chat.sports" for
qualifier and false for recursive. In Reactor 1.0.0,
recursion is supported when qualifier is null only.
| |
recursive:Boolean (default = false ) — Indicates whether the room list for this snapshot should
include rooms directly qualified by the specified qualifier
only, or also all rooms qualified by all child qualifiers
of the specified qualifier. For Reactor 1.0.0, this
parameter applies to the unnamed qualifier only (i.e.,
when the qualifier parameter is null).
|
getQualifier | () | method |
public function getQualifier():String
Since : | Reactor 1.0.0 |
Returns the qualifier of the rooms that are included in this snapshot.
ReturnsString |
getRecursive | () | method |
public function getRecursive():Boolean
Since : | Reactor 1.0.0 |
Indicates whether the room list for this snapshot includes rooms directly qualified by the specified qualifier only, or also all rooms qualified by all child qualifiers of the specified qualifier.
ReturnsBoolean |
getRoomList | () | method |
public function getRoomList():Array
Since : | Reactor 1.0.0 |
Returns an array of the fully qualified roomIDs of the rooms with the qualifier specified by this snapshot.
ReturnsArray |