Constructor
new RoomInfo(name)
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Room name. |
Members
(readonly) address :string
Joined room Game server address.
Type:
- string
(readonly) isOpen :boolean
Defines if this room can be joined.
Type:
- boolean
(readonly) isVisible :boolean
Shows the room in the lobby's room list. Makes sense only for local room.
Type:
- boolean
(readonly) masterClientId :number
Master client set by game server. Note: Not all servers support this currently. If the value of the property is 0, use lowest actorid instead.
Type:
- number
(readonly) maxPlayers :number
Max players before room is considered full.
Type:
- number
(readonly) name :string
Room name.
Type:
- string
(readonly) playerCount :number
Count of player currently in room.
Type:
- number
(readonly) playerTTL :number
Time in ms indicating how long suspended player will be kept in the room.
Type:
- number
(readonly) removed :boolean
Room removed (in room list updates).
Type:
- boolean
(readonly) roomTTL :number
Time in ms indicating how long the room instance will be keeped alive in the server room cache after all clients have left the room.
Type:
- number
Methods
getCustomProperties() → {object}
Returns custom properties.
Returns:
- Type
- object
getCustomProperty(name) → {object}
Returns custom property by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the property. |
Returns:
- Type
- object
getCustomPropertyOrElse(name, defaultValue) → {object}
Returns custom property by name or default value.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the property. |
defaultValue |
object | Default property value. |
Returns:
- Type
- object
getPropsListedInLobby() → {object}
Returns properties listed in lobby.
Returns:
- Type
- object
onPropertiesChange(changedCustomProps, byClientopt)
Called on every room properties update: room creation, properties set by client, poperties update from server. Override to update custom room state.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
changedCustomProps |
object | Key-value map of changed properties. | |
byClient |
boolean |
<optional> |
true if called on room creation or properties set by client. |