Photon Unity Networking v1.101

Public Member Functions | Protected Attributes | Properties | List of all members
RoomInfo Class Reference

A simplified room with just the info required to list and join, used for the room listing in the lobby. The properties are not settable (open, MaxPlayers, etc). More...

Inherited by Room.

Public Member Functions

override bool Equals (object other)
 Makes RoomInfo comparable (by name). More...
 
override int GetHashCode ()
 Accompanies Equals, using the name's HashCode as return. More...
 
override string ToString ()
 Simple printingin method. More...
 
string ToStringFull ()
 Simple printingin method. More...
 

Protected Attributes

byte maxPlayersField = 0
 Backing field for property. More...
 
int emptyRoomTtlField = 0
 Backing field for property. More...
 
int playerTtlField = 0
 Backing field for property. More...
 
string[] expectedUsersField
 Backing field for property. More...
 
bool openField = true
 Backing field for property. More...
 
bool visibleField = true
 Backing field for property. More...
 
bool autoCleanUpField = PhotonNetwork.autoCleanUpPlayerObjects
 Backing field for property. False unless the GameProperty is set to true (else it's not sent). More...
 
string nameField
 Backing field for property. More...
 

Properties

bool removedFromList [get, set]
 Used internally in lobby, to mark rooms that are no longer listed. More...
 
Hashtable CustomProperties [get]
 Read-only "cache" of custom properties of a room. Set via Room.SetCustomProperties (not available for RoomInfo class!). More...
 
string Name [get]
 The name of a room. Unique identifier (per Loadbalancing group) for a room/match. More...
 
int PlayerCount [get]
 Only used internally in lobby, to display number of players in room (while you're not in). More...
 
bool IsLocalClientInside [get, set]
 State if the local client is already in the game or still going to join it on gameserver (in lobby always false). More...
 
byte MaxPlayers [get]
 Sets a limit of players to this room. This property is shown in lobby, too. If the room is full (players count == maxplayers), joining this room will fail. More...
 
bool IsOpen [get]
 Defines if the room can be joined. This does not affect listing in a lobby but joining the room will fail if not open. If not open, the room is excluded from random matchmaking. Due to racing conditions, found matches might become closed before they are joined. Simply re-connect to master and find another. Use property "IsVisible" to not list the room. More...
 
bool IsVisible [get]
 Defines if the room is listed in its lobby. Rooms can be created invisible, or changed to invisible. To change if a room can be joined, use property: open. More...
 
Hashtable customProperties [get]
 
string name [get]
 
int playerCount [get, set]
 
bool isLocalClientInside [get, set]
 
byte maxPlayers [get]
 
bool open [get]
 
bool visible [get]
 

Detailed Description

A simplified room with just the info required to list and join, used for the room listing in the lobby. The properties are not settable (open, MaxPlayers, etc).

This class resembles info about available rooms, as sent by the Master server's lobby. Consider all values as readonly. None are synced (only updated by events by server).

Member Function Documentation

◆ Equals()

override bool RoomInfo.Equals ( object  other)

Makes RoomInfo comparable (by name).

◆ GetHashCode()

override int RoomInfo.GetHashCode ( )

Accompanies Equals, using the name's HashCode as return.

Returns

◆ ToString()

override string RoomInfo.ToString ( )

Simple printingin method.

Returns
Summary of this RoomInfo instance.

◆ ToStringFull()

string RoomInfo.ToStringFull ( )

Simple printingin method.

Returns
Summary of this RoomInfo instance.

Member Data Documentation

◆ autoCleanUpField

bool RoomInfo.autoCleanUpField = PhotonNetwork.autoCleanUpPlayerObjects
protected

Backing field for property. False unless the GameProperty is set to true (else it's not sent).

◆ emptyRoomTtlField

int RoomInfo.emptyRoomTtlField = 0
protected

Backing field for property.

◆ expectedUsersField

string [] RoomInfo.expectedUsersField
protected

Backing field for property.

◆ maxPlayersField

byte RoomInfo.maxPlayersField = 0
protected

Backing field for property.

◆ nameField

string RoomInfo.nameField
protected

Backing field for property.

◆ openField

bool RoomInfo.openField = true
protected

Backing field for property.

◆ playerTtlField

int RoomInfo.playerTtlField = 0
protected

Backing field for property.

◆ visibleField

bool RoomInfo.visibleField = true
protected

Backing field for property.

Property Documentation

◆ CustomProperties

Hashtable RoomInfo.CustomProperties
get

Read-only "cache" of custom properties of a room. Set via Room.SetCustomProperties (not available for RoomInfo class!).

All keys are string-typed and the values depend on the game/application.

Room.SetCustomProperties

◆ customProperties

Hashtable RoomInfo.customProperties
get

◆ IsLocalClientInside

bool RoomInfo.IsLocalClientInside
getset

State if the local client is already in the game or still going to join it on gameserver (in lobby always false).

◆ isLocalClientInside

bool RoomInfo.isLocalClientInside
getset

◆ IsOpen

bool RoomInfo.IsOpen
get

Defines if the room can be joined. This does not affect listing in a lobby but joining the room will fail if not open. If not open, the room is excluded from random matchmaking. Due to racing conditions, found matches might become closed before they are joined. Simply re-connect to master and find another. Use property "IsVisible" to not list the room.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ IsVisible

bool RoomInfo.IsVisible
get

Defines if the room is listed in its lobby. Rooms can be created invisible, or changed to invisible. To change if a room can be joined, use property: open.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ MaxPlayers

byte RoomInfo.MaxPlayers
get

Sets a limit of players to this room. This property is shown in lobby, too. If the room is full (players count == maxplayers), joining this room will fail.

As part of RoomInfo this can't be set. As part of a Room (which the player joined), the setter will update the server and all clients.

◆ maxPlayers

byte RoomInfo.maxPlayers
get

◆ Name

string RoomInfo.Name
get

The name of a room. Unique identifier (per Loadbalancing group) for a room/match.

◆ name

string RoomInfo.name
get

◆ open

bool RoomInfo.open
get

◆ PlayerCount

int RoomInfo.PlayerCount
get

Only used internally in lobby, to display number of players in room (while you're not in).

◆ playerCount

int RoomInfo.playerCount
getset

◆ removedFromList

bool RoomInfo.removedFromList
getset

Used internally in lobby, to mark rooms that are no longer listed.

◆ visible

bool RoomInfo.visible
get