Class: Room

Photon.LoadBalancing. Room

Represents a room client joins or is joined to. Extend to implement custom logic. Custom properties can be set via setCustomProperty() while being in the room.

new Room(name)

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

Mixes In

Methods

setCustomProperty(name, value, webForward)

Sets custom property

Parameters:
Name Type Argument Default Description
name string Name of the property.
value object Property value.
webForward boolean <optional>
false Forward to web hook.
Source:
  • Photon-Javascript_SDK.js, line 2109

setCustomProperty(properties, webForward)

Sets custom property

Parameters:
Name Type Argument Default Description
properties object Table of properties to set.
webForward boolean <optional>
false Forward to web hook.
Source:
  • Photon-Javascript_SDK.js, line 2127

setEmptyRoomLiveTime(emptyRoomLiveTime)

Sets room live time in the server room cache after all clients have left the room.

Parameters:
Name Type Description
emptyRoomLiveTime number New live time value in ms.
Source:
  • Photon-Javascript_SDK.js, line 2190

setIsOpen(isVisible)

Sets rooms visibility in the lobby's room list.

Parameters:
Name Type Description
isVisible boolean New visibility value.
Source:
  • Photon-Javascript_SDK.js, line 2154

setIsOpen(isOpen)

Sets if this room can be joined.

Parameters:
Name Type Description
isOpen boolean New property value.
Source:
  • Photon-Javascript_SDK.js, line 2166

setMaxPlayers(maxPlayers)

Sets max players before room is considered full.

Parameters:
Name Type Description
maxPlayers number New max players value.
Source:
  • Photon-Javascript_SDK.js, line 2178

setPropsListedInLobby(props)

Sets list of the room properties to pass to the RoomInfo list in a lobby.

Parameters:
Name Type Description
props string[] Array of properties names.
Source:
  • Photon-Javascript_SDK.js, line 2217

setSuspendedPlayerLiveTime(suspendedPlayerLiveTime)

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

Parameters:
Name Type Description
suspendedPlayerLiveTime number New live time value in ms.
Source:
  • Photon-Javascript_SDK.js, line 2199

setUniqueUserId(unique)

activates user id checks on joining if set to true.

Parameters:
Name Type Description
unique boolean New property value.
Source:
  • Photon-Javascript_SDK.js, line 2208