Photon Unity Networking 2: ILobbyCallbacks Interface Reference

Photon Unity Networking 2

ILobbyCallbacks Interface Reference

Collection of "organizational" callbacks for the Realtime Api to cover the Lobby. More...

Inherited by MonoBehaviourPunCallbacks, OnJoinedInstantiate, LobbyCallbacksContainer, and SupportLogger.

Public Member Functions

void OnJoinedLobby ()
 Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate. More...
 
void OnLeftLobby ()
 Called after leaving a lobby. More...
 
void OnRoomListUpdate (List< RoomInfo > roomList)
 Called for any update of the room-listing while in a lobby (InLobby) on the Master Server. More...
 
void OnLobbyStatisticsUpdate (List< TypedLobbyInfo > lobbyStatistics)
 Called when the Master Server sent an update for the Lobby Statistics, updating PhotonNetwork.LobbyStatistics. More...
 

Detailed Description

Collection of "organizational" callbacks for the Realtime Api to cover the Lobby.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, PhotonNetwork.AddCallbackTarget(<Your Component implementing this interface>); To stop getting callbacks, PhotonNetwork.RemoveCallbackTarget(<Your Component implementing this interface>);

You can also simply override MonoBehaviourPunCallbacks which will provide you with Magic Callbacks ( like Unity would call Start(), Update() on a MonoBehaviour)

Member Function Documentation

void OnJoinedLobby ( )

Called on entering a lobby on the Master Server. The actual room-list updates will call OnRoomListUpdate.

While in the lobby, the roomlist is automatically updated in fixed intervals (which you can't modify in the public cloud). The room list gets available via OnRoomListUpdate.

Implemented in MonoBehaviourPunCallbacks, SupportLogger, OnJoinedInstantiate, and ConnectAndJoinRandom.

void OnLeftLobby ( )

Called after leaving a lobby.

When you leave a lobby, OpCreateRoom and OpJoinRandomRoom automatically refer to the default lobby.

Implemented in MonoBehaviourPunCallbacks, SupportLogger, and OnJoinedInstantiate.

void OnLobbyStatisticsUpdate ( List< TypedLobbyInfo lobbyStatistics)

Called when the Master Server sent an update for the Lobby Statistics, updating PhotonNetwork.LobbyStatistics.

This callback has two preconditions: EnableLobbyStatistics must be set to true, before this client connects. And the client has to be connected to the Master Server, which is providing the info about lobbies.

Implemented in MonoBehaviourPunCallbacks, SupportLogger, and OnJoinedInstantiate.

void OnRoomListUpdate ( List< RoomInfo roomList)

Called for any update of the room-listing while in a lobby (InLobby) on the Master Server.

Each item is a RoomInfo which might include custom properties (provided you defined those as lobby-listed when creating a room). Not all types of lobbies provide a listing of rooms to the client. Some are silent and specialized for server-side matchmaking.

Implemented in MonoBehaviourPunCallbacks, SupportLogger, and OnJoinedInstantiate.

Online Documentation  -  Dashboard  -  Support Forum Exit Games GmbH