Module loadbalancing.RoomInfo
Used for Room listings of the lobby (not yet joining).
Offers the basic info about a room: name, player counts, properties, etc.
Functions
instance:onPropertiesChange (changedCustomProps, byClient) | Called on every room properties update: room creation, properties set by client, poperties update from server. |
instance:getCustomProperty (name) | Returns custom property by name. |
instance:getCustomPropertyOrElse (name, defaultValue) | Returns custom property by name or default value. |
Fields
instance.name | (string) Room name. |
instance.address | (string) Joined room Game server address. |
instance.maxPlayers | (int) Max players before room is considered full. |
instance.isVisible | (boolean) Shows the room in the lobby's room list. |
instance.isOpen | (boolean) Defines if this room can be joined. |
instance.playerCount | (int) Count of player currently in room. |
instance.emptyRoomLiveTime | (int) Time in ms indicating how long the room instance will be kept alive in the server room cache after all clients have left the room. |
instance.suspendedPlayerLiveTime | (int) Time in ms indicating how long suspended player will be kept in the room . |
instance.removed | (boolean) Room removed (in room list updates). |
Functions
- instance: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:
- changedCustomProps table Key-value map of changed properties.
- byClient boolean true if called on room creation or properties set by client.
- instance:getCustomProperty (name)
-
Returns custom property by name.
Parameters:
- name string Name of the property.
Returns:
-
Property or nil if property not found.
- instance:getCustomPropertyOrElse (name, defaultValue)
-
Returns custom property by name or default value.
Parameters:
- name string Name of the property.
- defaultValue Default property value.
Returns:
-
Property or default value if property not found.
Fields
- instance.name
- (string) Room name.
- instance.address
- (string) Joined room Game server address.
- instance.maxPlayers
- (int) Max players before room is considered full.
- instance.isVisible
- (boolean) Shows the room in the lobby's room list. Makes sense only for local room.
- instance.isOpen
- (boolean) Defines if this room can be joined.
- instance.playerCount
- (int) Count of player currently in room.
- instance.emptyRoomLiveTime
- (int) Time in ms indicating how long the room instance will be kept alive in the server room cache after all clients have left the room.
- instance.suspendedPlayerLiveTime
- (int) Time in ms indicating how long suspended player will be kept in the room .
- instance.removed
- (boolean) Room removed (in room list updates).