Photon Unity Networking 2 2.45

Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
TypedLobby Class Reference

Refers to a specific lobby on the server. More...

Inherited by TypedLobbyInfo.

Public Member Functions

 TypedLobby (string name, LobbyType type)
 Sets Name and Type of the new instance. Make sure name is not empty or null, as that always points to the "default lobby" (TypedLobby.Default). More...
 
override string ToString ()
 

Public Attributes

string Name
 Name of the lobby. Default: null, pointing to the "default lobby". More...
 
LobbyType Type
 Type (and behaviour) of the lobby. More...
 

Static Public Attributes

static readonly TypedLobby Default = new TypedLobby()
 A reference to the default lobby which is the unique lobby that uses null as name and is of type LobbyType.Default. More...
 

Properties

bool IsDefault [get]
 Returns whether or not this instance points to the "default lobby" (TypedLobby.Default). More...
 

Detailed Description

Refers to a specific lobby on the server.

Name and Type combined are the unique identifier for a lobby.
The server will create lobbies "on demand", so no registration or setup is required.
An empty or null Name always points to the "default lobby" as special case.

Constructor & Destructor Documentation

◆ TypedLobby()

TypedLobby ( string  name,
LobbyType  type 
)

Sets Name and Type of the new instance. Make sure name is not empty or null, as that always points to the "default lobby" (TypedLobby.Default).

Parameters
nameSome string to identify a lobby.
typeThe type of a lobby defines it's capabilities and behaviour.

Member Data Documentation

◆ Default

readonly TypedLobby Default = new TypedLobby()
static

A reference to the default lobby which is the unique lobby that uses null as name and is of type LobbyType.Default.

There is only a single lobby with an empty name on the server. It is always of type LobbyType.Default.
On the other hand, this is a shortcut and reusable reference to the default lobby.
Do not change Name or Type.

◆ Name

string Name

Name of the lobby. Default: null, pointing to the "default lobby".

If Name is null or empty, a TypedLobby will point to the "default lobby". This ignores the Type value and always acts as LobbyType.Default.

◆ Type

LobbyType Type

Type (and behaviour) of the lobby.

An empty or null Name always points to the "default lobby" as special case.

Property Documentation

◆ IsDefault

bool IsDefault
get

Returns whether or not this instance points to the "default lobby" (TypedLobby.Default).

This comes up to checking if the Name is null or empty. LobbyType.Default is not the same thing as the "default lobby" (TypedLobby.Default).