Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UpdateLevels

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.

Hierarchy

  • UpdateLevels

Index

Constructors

constructor

Properties

allRoomAttributes

allRoomAttributes: boolean = false

Identical to the sharedRoomAttributes variable, but also includes non-shared attributes. Requires administrator privileges; defaults to false.

observerCount

observerCount: boolean = false

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: -RoomEvent.OBSERVER_COUNT (via the target room)

observerList

observerList: boolean = false

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:

  • RoomEvent.ADD_OBSERVER (via the target room)
  • RoomEvent.REMOVE_OBSERVER (via the target room)

observerLoginLogoff

observerLoginLogoff: boolean = false

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:

  • AccountEvent.LOGIN (via the AccountManager and the UserAccount object for the client that logged in)
  • AccountEvent.LOGOFF (via the AccountManager and the UserAccount object for the client that logged off)

occupantCount

occupantCount: boolean = false

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: -RoomEvent.OCCUPANT_COUNT (via the target room)

occupantList

occupantList: boolean = false

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:

  • RoomEvent.ADD_OCCUPANT (via the target room)
  • RoomEvent.REMOVE_OCCUPANT (via the target room)

occupantLoginLogoff

occupantLoginLogoff: boolean = false

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:

  • AccountEvent.LOGIN (via the AccountManager and the UserAccount object for the client that logged in)
  • AccountEvent.LOGOFF (via the AccountManager and the UserAccount object for the client that logged off)

roomMessages

roomMessages: boolean = false

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.addMessageListener method.

sharedObserverAttributesGlobal

sharedObserverAttributesGlobal: boolean = false

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:

  • RoomEvent.UPDATE_CLIENT_ATTRIBUTE (via the target room)
  • RoomEvent.DELETE_CLIENT_ATTRIBUTE (via the target room)
  • AttributeEvent.DELETE (via the client that deleted the attribute)
  • AttributeEvent.UPDATE (via the client that set the attribute)

sharedObserverAttributesRoom

sharedObserverAttributesRoom: boolean = false

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:

  • RoomEvent.UPDATE_CLIENT_ATTRIBUTE (via the target room)
  • RoomEvent.DELETE_CLIENT_ATTRIBUTE (via the target room)
  • AttributeEvent.DELETE (via the client that deleted the attribute)
  • AttributeEvent.UPDATE (via the client that set the attribute)

sharedOccupantAttributesGlobal

sharedOccupantAttributesGlobal: boolean = false

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:

  • RoomEvent.UPDATE_CLIENT_ATTRIBUTE (via the target room)
  • RoomEvent.DELETE_CLIENT_ATTRIBUTE (via the target room)
  • AttributeEvent.DELETE (via the client that deleted the attribute)
  • AttributeEvent.UPDATE (via the client that set the attribute)

sharedOccupantAttributesRoom

sharedOccupantAttributesRoom: boolean = false

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:

  • RoomEvent.UPDATE_CLIENT_ATTRIBUTE (via the target room)
  • RoomEvent.DELETE_CLIENT_ATTRIBUTE (via the target room)
  • AttributeEvent.DELETE (via the client that deleted the attribute)
  • AttributeEvent.UPDATE (via the client that set the attribute)

sharedRoomAttributes

sharedRoomAttributes: boolean = false

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:

  • AttributeEvent.DELETE (via the target room)
  • AttributeEvent.UPDATE (via the target room)

Static Readonly FLAG_ALL_ROOM_ATTRIBUTES

FLAG_ALL_ROOM_ATTRIBUTES: number = 1 << 12

Static Readonly FLAG_OBSERVER_COUNT

FLAG_OBSERVER_COUNT: number = 1 << 3

Static Readonly FLAG_OBSERVER_LIST

FLAG_OBSERVER_LIST: number = 1 << 5

Static Readonly FLAG_OBSERVER_LOGIN_LOGOFF

FLAG_OBSERVER_LOGIN_LOGOFF: number = 1 << 11

Static Readonly FLAG_OCCUPANT_COUNT

FLAG_OCCUPANT_COUNT: number = 1 << 2

Static Readonly FLAG_OCCUPANT_LIST

FLAG_OCCUPANT_LIST: number = 1 << 4

Static Readonly FLAG_OCCUPANT_LOGIN_LOGOFF

FLAG_OCCUPANT_LOGIN_LOGOFF: number = 1 << 10

Static Readonly FLAG_ROOM_MESSAGES

FLAG_ROOM_MESSAGES: 1 = 1

Static Readonly FLAG_SHARED_OBSERVER_ATTRIBUTES_GLOBAL

FLAG_SHARED_OBSERVER_ATTRIBUTES_GLOBAL: number = 1 << 9

Static Readonly FLAG_SHARED_OBSERVER_ATTRIBUTES_ROOM

FLAG_SHARED_OBSERVER_ATTRIBUTES_ROOM: number = 1 << 7

Static Readonly FLAG_SHARED_OCCUPANT_ATTRIBUTES_GLOBAL

FLAG_SHARED_OCCUPANT_ATTRIBUTES_GLOBAL: number = 1 << 8

Static Readonly FLAG_SHARED_OCCUPANT_ATTRIBUTES_ROOM

FLAG_SHARED_OCCUPANT_ATTRIBUTES_ROOM: number = 1 << 6

Static Readonly FLAG_SHARED_ROOM_ATTRIBUTES

FLAG_SHARED_ROOM_ATTRIBUTES: number = 1 << 1

Methods

clearAll

  • clearAll(): void
  • Sets all update levels to false.

    Returns void

fromInt

  • fromInt(levels: number): void
  • 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 Orbiter when receiving room update levels from Union Server.

    Parameters

    • levels: number

    Returns void

restoreDefaults

  • restoreDefaults(): void
  • Sets all update levels to their default values, as specified in the documentation for each update level constant.

    Returns void

toInt

  • toInt(): number
  • Converts this UpdateLevels object to an integer whose bits represent the specified update levels. The toInt() method is used internally by Orbiter when sending room update levels to Union Server.

    Returns number