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_v4-0-0-7_Cloud_SDK.js, line 1892

Members

<readonly> address :string

Joined room Game server address.

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1907

<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_v4-0-0-7_Cloud_SDK.js, line 1942

<readonly> isOpen :boolean

Defines if this room can be joined.

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1928

<readonly> isVisible :boolean

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

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1921

<readonly> masterClientId :number

Master client set by game server. Note: Not all servers support this currently. If the value of the propery is 0, use lowest actorid instead.

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1966

<readonly> masterClientId :number

Actor number of the player who's the master of this Room. Note: This changes when the current master leaves the room.

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 2441

<readonly> maxPlayers :number

Max players before room is considered full.

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1914

<readonly> name :string

Room name.

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1900

<readonly> playerCount :number

Count of player currently in room.

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1935

<readonly> removed :boolean

Room removed (in room list updates).

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1957

<readonly> suspendedPlayerLiveTime :number

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

Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1949

Methods

getCustomProperty(name) → {object}

Returns custom property by name.

Parameters:
Name Type Description
name string Name of the property.
Source:
  • Photon-Javascript_v4-0-0-7_Cloud_SDK.js, line 1986
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_v4-0-0-7_Cloud_SDK.js, line 1993
Returns:
Property or default value if property not found.
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_v4-0-0-7_Cloud_SDK.js, line 1978