Class: RoomInfo

Photon.LoadBalancing.RoomInfo(name)

Used for Room listings of the lobby (not yet joining). Offers the basic info about a room: name, player counts, properties, etc.

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:
Custom properties.
Type
object

getCustomProperty(name) → {object}

Returns custom property by name.

Parameters:
Name Type Description
name string Name of the property.
Returns:
Property or undefined if property not found.
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:
Property or default value if property not found.
Type
object

getPropsListedInLobby() → {object}

Returns properties listed in lobby.

Returns:
Properties listed in lobby.
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.