Package | net.user1.reactor |
Class | public final class UpdateLevels |
Inheritance | UpdateLevels ![]() |
Since : | Reactor 1.0.0 |
The UpdateLevels class specifies the amount of information a client wishes to receive from the server about a room it has either joined or is observing. Room update levels are intended for use with massively multiuser applications, where clients must conserve bandwidth by minimizing the amount of traffic sent by the server.
For example, imagine a nation-wide live quiz with 10000 participants in a single room. To conserve bandwidth and CPU, each participant must disable all updates about all other room occupants, while receiving aggregated application updates in the form of room messages sent by a server-side room module. To receive messages sent to the room by room modules only, and ignore all other updates for the room, each quiz client explicitly sets reduced update levels when joining the room, as shown in the following code. Notice the use of the UpdateLevels class's clearAll() method, which provides a convenient way to set all update levels to false.
var updateLevels:UpdateLevels = new UpdateLevels(); // First, disable all updates by invoking clearAll() updateLevels.clearAll() // Next, enable room-message updates only updateLevels.roomMessages = true; quizRoom.join(null, updateLevels);
See also
Variable | Defined By | ||
---|---|---|---|
allRoomAttributes : Boolean
Identical to the sharedRoomAttributes variable, but also includes non-shared
attributes. | UpdateLevels | ||
observerCount : Boolean
When true, the current client is sent an update any time the number of
clients observing the target room changes; defaults to false. | UpdateLevels | ||
observerList : Boolean
When true, the current client is sent an update any time a client
observes or stops observing the target room; defaults to false. | UpdateLevels | ||
observerLoginLogoff : Boolean
When true, the current client is sent an update any time an observer
of the target room logs in or logs off; defaults to true. | UpdateLevels | ||
occupantCount : Boolean
When true, the current client is sent an update any time the number of
clients in the target room changes; defaults to false. | UpdateLevels | ||
occupantList : Boolean
When true, the current client is sent an update any time a client
joins or leaves the target room; defaults to true. | UpdateLevels | ||
occupantLoginLogoff : Boolean
When true, the current client is sent an update any time an occupant
of the target room logs in or logs off; defaults to true. | UpdateLevels | ||
roomMessages : Boolean
When true, the current client is sent an update any time a message is
sent to the target room; defaults to true. | UpdateLevels | ||
sharedObserverAttributesGlobal : Boolean
When true, the current client is sent an update any time an observer
of the target room sets or deletes a global shared attribute;
defaults to false. | UpdateLevels | ||
sharedObserverAttributesRoom : Boolean
When true, the current client is sent an update any time an observer
of the target room sets or deletes a room-scoped shared-attribute;
defaults to false. | UpdateLevels | ||
sharedOccupantAttributesGlobal : Boolean
When true, the current client is sent an update any time an occupant
of the target room sets or deletes a global shared attribute; defaults
to true. | UpdateLevels | ||
sharedOccupantAttributesRoom : Boolean
When true, the current client is sent an update any time an occupant
of the target room sets or deletes a room-scoped shared-attribute;
defaults to true. | UpdateLevels | ||
sharedRoomAttributes : Boolean
When true, the current client is sent an update any time one
of the target room's shared attributes changes or is deleted;
defaults to true. | UpdateLevels |
Method | Defined By | ||
---|---|---|---|
UpdateLevels | |||
clearAll():void
Sets all update levels to false. | UpdateLevels | ||
fromInt(levels:int):void
Assigns the levels of this UpdateLevels object based on the supplied
integer, whose bits represent the desired new update levels. | UpdateLevels | ||
restoreDefaults():void
Sets all update levels to their default values, as specified in the
documentation for each update level constant. | UpdateLevels | ||
toInt():int
Converts this UpdateLevels object to an integer whose bits represent
the specified update levels. | UpdateLevels |
allRoomAttributes | variable |
public var allRoomAttributes:Boolean
Since : | Reactor 1.0.0 |
Identical to the sharedRoomAttributes variable, but also includes non-shared attributes. Requires administrator privileges; defaults to false.
observerCount | variable |
public var observerCount:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time the number of clients observing the target room changes; defaults to false. Updates trigger the following events:
observerList | variable |
public var observerList:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time a client observes or stops observing the target room; defaults to false. Updates trigger the following events:
observerLoginLogoff | variable |
public var observerLoginLogoff:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time an observer of the target room logs in or logs off; defaults to true. Updates trigger the following events:
See also
occupantCount | variable |
public var occupantCount:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time the number of clients in the target room changes; defaults to false. Updates trigger the following events:
occupantList | variable |
public var occupantList:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time a client joins or leaves the target room; defaults to true. Updates trigger the following events:
occupantLoginLogoff | variable |
public var occupantLoginLogoff:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time an occupant of the target room logs in or logs off; defaults to true. Updates trigger the following events:
See also
roomMessages | variable |
public var roomMessages:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time a message is sent to the target room; defaults to true. Updates trigger message listeners registered via the Room class's addMessageListener() method.
See also
sharedObserverAttributesGlobal | variable |
public var sharedObserverAttributesGlobal:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time an observer of the target room sets or deletes a global shared attribute; defaults to false. Updates trigger the following events:
sharedObserverAttributesRoom | variable |
public var sharedObserverAttributesRoom:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time an observer of the target room sets or deletes a room-scoped shared-attribute; defaults to false. Updates trigger the following events:
sharedOccupantAttributesGlobal | variable |
public var sharedOccupantAttributesGlobal:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time an occupant of the target room sets or deletes a global shared attribute; defaults to true. Updates trigger the following events:
sharedOccupantAttributesRoom | variable |
public var sharedOccupantAttributesRoom:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time an occupant of the target room sets or deletes a room-scoped shared-attribute; defaults to true. Updates trigger the following events:
sharedRoomAttributes | variable |
public var sharedRoomAttributes:Boolean
Since : | Reactor 1.0.0 |
When true, the current client is sent an update any time one of the target room's shared attributes changes or is deleted; defaults to true. Updates trigger the following events:
UpdateLevels | () | Constructor |
public function UpdateLevels()
clearAll | () | method |
public function clearAll():void
Since : | Reactor 1.0.0 |
Sets all update levels to false.
fromInt | () | method |
public function fromInt(levels:int):void
Since : | Reactor 1.0.0 |
Assigns the levels of this UpdateLevels object based on the supplied integer, whose bits represent the desired new update levels. The fromInt() method is used internally by Reactor when receiving room update levels from Union Server.
Parameters
levels:int |
restoreDefaults | () | method |
public function restoreDefaults():void
Since : | Reactor 1.0.0 |
Sets all update levels to their default values, as specified in the documentation for each update level constant.
toInt | () | method |
public function toInt():int
Since : | Reactor 1.0.0 |
Converts this UpdateLevels object to an integer whose bits represent the specified update levels. The toInt() method is used internally by Reactor when sending room update levels to Union Server.
Returnsint |