Photon Lua (Corona) Client API

Module loadbalancing.Room

Represents a room client joins or is joined to.

To implement custom logic customize default Room instance with initRoom function passed to LoadBalancingClient.new. Custom properties can be set via setCustomProperty() while being in the room. Extended from loadbalancing.RoomInfo.

Functions

instance:setCustomProperty (name, value, webForward) Sets custom property
instance:setCustomProperties (properties, webForward) Sets custom properties
instance:setIsVisible (isVisible) Sets rooms visibility in the lobby's room list.
instance:setIsOpen (isOpen) Sets if this room can be joined.
instance:setMaxPlayers (maxPlayers) Sets max players before room is considered full.
instance:setEmptyRoomLiveTime (emptyRoomLiveTime) Sets room live time in the server room cache after all clients have left the room.
instance:setSuspendedPlayerLiveTime (suspendedPlayerLiveTime) Sets time in ms indicating how long suspended player will be kept in the room.
instance:setPropsListedInLobby (props) Sets list of the room properties to pass to the RoomInfo list in a lobby.


Functions

instance:setCustomProperty (name, value, webForward)
Sets custom property

Parameters:

  • name string Name of the property.
  • value Property value. Pass nil to remove property.
  • webForward boolean Forward to web hook.
instance:setCustomProperties (properties, webForward)
Sets custom properties

Parameters:

  • properties table Table of properties to set.
  • webForward boolean Forward to web hook.
instance:setIsVisible (isVisible)
Sets rooms visibility in the lobby's room list.

Parameters:

  • isVisible boolean New visibility value.
instance:setIsOpen (isOpen)
Sets if this room can be joined.

Parameters:

  • isOpen boolean New property value.
instance:setMaxPlayers (maxPlayers)
Sets max players before room is considered full.

Parameters:

  • maxPlayers int New max players value.
instance:setEmptyRoomLiveTime (emptyRoomLiveTime)
Sets room live time in the server room cache after all clients have left the room.

Parameters:

  • emptyRoomLiveTime int New live time value in ms.
instance:setSuspendedPlayerLiveTime (suspendedPlayerLiveTime)
Sets time in ms indicating how long suspended player will be kept in the room.

Parameters:

  • suspendedPlayerLiveTime int New live time value in ms.
instance:setPropsListedInLobby (props)
Sets list of the room properties to pass to the RoomInfo list in a lobby.

Parameters:

  • props array Array of properties names.
generated by LDoc 1.3