Class: RoomInfo

Photon.LoadBalancing. RoomInfo

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

new RoomInfo(name)

Parameters:
Name Type Description
name string Room name.
Source:
  • Photon-Javascript_SDK.js, line 1139

Members

<readonly> address :string

Joined room Game server address.

Source:
  • Photon-Javascript_SDK.js, line 1154

<readonly> emptyRoomLiveTime :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.

Source:
  • Photon-Javascript_SDK.js, line 1189

<readonly> isOpen :boolean

Defines if this room can be joined.

Source:
  • Photon-Javascript_SDK.js, line 1175

<readonly> isVisible :boolean

Shows the room in the lobby's room list. Makes sense only for local room.

Source:
  • Photon-Javascript_SDK.js, line 1168

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

Source:
  • Photon-Javascript_SDK.js, line 1212

<readonly> maxPlayers :number

Max players before room is considered full.

Source:
  • Photon-Javascript_SDK.js, line 1161

<readonly> name :string

Room name.

Source:
  • Photon-Javascript_SDK.js, line 1147

<readonly> playerCount :number

Count of player currently in room.

Source:
  • Photon-Javascript_SDK.js, line 1182

<readonly> removed :boolean

Room removed (in room list updates).

Source:
  • Photon-Javascript_SDK.js, line 1203

<readonly> suspendedPlayerLiveTime :number

Time in ms indicating how long suspended player will be kept in the room.

Source:
  • Photon-Javascript_SDK.js, line 1196

Methods

getCustomProperties() → {object}

Returns custom properties.

Source:
  • Photon-Javascript_SDK.js, line 1224
Returns:
Custom properties.
Type
object

getCustomProperty(name) → {object}

Returns custom property by name.

Parameters:
Name Type Description
name string Name of the property.
Source:
  • Photon-Javascript_SDK.js, line 1256
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.
Source:
  • Photon-Javascript_SDK.js, line 1263
Returns:
Property or default value if property not found.
Type
object

getPropsListedInLobby() → {object}

Returns properties listed in lobby.

Source:
  • Photon-Javascript_SDK.js, line 1236
Returns:
Properties listed in lobby.
Type
object

onPropertiesChange(changedCustomProps, byClient)

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 Argument Description
changedCustomProps object Key-value map of changed properties.
byClient boolean <optional>
true if called on room creation or properties set by client.
Source:
  • Photon-Javascript_SDK.js, line 1248