Photon .NET Client API 4.1.4.8

Public Member Functions | List of all members
Photon.Realtime.IMatchmakingCallbacks Interface Reference

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

Inheritance diagram for Photon.Realtime.IMatchmakingCallbacks:
Photon.Realtime.MatchMakingCallbacksContainer Photon.Realtime.SupportLogger

Public Member Functions

void OnFriendListUpdate (List< FriendInfo > friendList)
 Called when the server sent the response to a FindFriends request. More...
 
void OnCreatedRoom ()
 Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
 
void OnCreateRoomFailed (short returnCode, string message)
 Called when the server couldn't create a room (OpCreateRoom failed). More...
 
void OnJoinedRoom ()
 Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
 
void OnJoinRoomFailed (short returnCode, string message)
 Called when a previous OpJoinRoom call failed on the server. More...
 
void OnJoinRandomFailed (short returnCode, string message)
 Called when a previous OpJoinRandom call failed on the server. More...
 
void OnLeftRoom ()
 Called when the local user/client left a room, so the game's logic can clean up it's internal state. More...
 

Detailed Description

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

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

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnCreatedRoom()

void Photon.Realtime.IMatchmakingCallbacks.OnCreatedRoom ( )

Called when this client created a room and entered it. OnJoinedRoom() will be called as well.

This callback is only called on the client which created a room (see OpCreateRoom).

As any client might close (or drop connection) anytime, there is a chance that the creator of a room does not execute OnCreatedRoom.

If you need specific room properties or a "start signal", implement OnMasterClientSwitched() and make each new MasterClient check the room's state.

Implemented in Photon.Realtime.MatchMakingCallbacksContainer, and Photon.Realtime.SupportLogger.

◆ OnCreateRoomFailed()

void Photon.Realtime.IMatchmakingCallbacks.OnCreateRoomFailed ( short  returnCode,
string  message 
)

Called when the server couldn't create a room (OpCreateRoom failed).

Creating a room may fail for various reasons. Most often, the room already exists (roomname in use) or the RoomOptions clash and it's impossible to create the room.

When creating a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCodeOperation ReturnCode from the server.
messageDebug message for the error.

Implemented in Photon.Realtime.MatchMakingCallbacksContainer, and Photon.Realtime.SupportLogger.

◆ OnFriendListUpdate()

void Photon.Realtime.IMatchmakingCallbacks.OnFriendListUpdate ( List< FriendInfo friendList)

Called when the server sent the response to a FindFriends request.

After calling OpFindFriends, the Master Server will cache the friend list and send updates to the friend list. The friends includes the name, userId, online state and the room (if any) for each requested user/friend.

Use the friendList to update your UI and store it, if the UI should highlight changes.

Implemented in Photon.Realtime.MatchMakingCallbacksContainer, and Photon.Realtime.SupportLogger.

◆ OnJoinedRoom()

void Photon.Realtime.IMatchmakingCallbacks.OnJoinedRoom ( )

Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined.

When this is called, you can access the existing players in Room.Players, their custom properties and Room.CustomProperties.

In this callback, you could create player objects. For example in Unity, instantiate a prefab for the player.

If you want a match to be started "actively", enable the user to signal "ready" (using OpRaiseEvent or a Custom Property).

Implemented in Photon.Realtime.MatchMakingCallbacksContainer, and Photon.Realtime.SupportLogger.

◆ OnJoinRandomFailed()

void Photon.Realtime.IMatchmakingCallbacks.OnJoinRandomFailed ( short  returnCode,
string  message 
)

Called when a previous OpJoinRandom call failed on the server.

The most common causes are that a room is full or does not exist (due to someone else being faster or closing the room).

This operation is only ever sent to the Master Server. Once a room is found by the Master Server, the client will head off to the designated Game Server and use the operation Join on the Game Server.

When using multiple lobbies (via OpJoinLobby or a TypedLobby parameter), another lobby might have more/fitting rooms.

Parameters
returnCodeOperation ReturnCode from the server.
messageDebug message for the error.

Implemented in Photon.Realtime.MatchMakingCallbacksContainer, and Photon.Realtime.SupportLogger.

◆ OnJoinRoomFailed()

void Photon.Realtime.IMatchmakingCallbacks.OnJoinRoomFailed ( short  returnCode,
string  message 
)

Called when a previous OpJoinRoom call failed on the server.

Joining a room may fail for various reasons. Most often, the room is full or does not exist anymore (due to someone else being faster or closing the room).

When joining a room fails on a Game Server: The client will cache the failure internally and returns to the Master Server before it calls the fail-callback. This way, the client is ready to find/create a room at the moment of the callback. In this case, the client skips calling OnConnectedToMaster but returning to the Master Server will still call OnConnected. Treat callbacks of OnConnected as pure information that the client could connect.

Parameters
returnCodeOperation ReturnCode from the server.
messageDebug message for the error.

Implemented in Photon.Realtime.MatchMakingCallbacksContainer, and Photon.Realtime.SupportLogger.

◆ OnLeftRoom()

void Photon.Realtime.IMatchmakingCallbacks.OnLeftRoom ( )

Called when the local user/client left a room, so the game's logic can clean up it's internal state.

When leaving a room, the LoadBalancingClient will disconnect the Game Server and connect to the Master Server. This wraps up multiple internal actions.

Wait for the callback OnConnectedToMaster, before you use lobbies and join or create rooms.

Implemented in Photon.Realtime.MatchMakingCallbacksContainer, and Photon.Realtime.SupportLogger.


The documentation for this interface was generated from the following file: