Photon .NET Client API 4.1.4.8

Public Member Functions | List of all members
Photon.Realtime.MatchMakingCallbacksContainer Class Reference

Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets. More...

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

Public Member Functions

 MatchMakingCallbacksContainer (LoadBalancingClient client)
 
void OnCreatedRoom ()
 Called when this client created a room and entered it. OnJoinedRoom() will be called as well. More...
 
void OnJoinedRoom ()
 Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined. More...
 
void OnCreateRoomFailed (short returnCode, string message)
 Called when the server couldn't create a room (OpCreateRoom failed). More...
 
void OnJoinRandomFailed (short returnCode, string message)
 Called when a previous OpJoinRandom call failed on the server. More...
 
void OnJoinRoomFailed (short returnCode, string message)
 Called when a previous OpJoinRoom 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...
 
void OnFriendListUpdate (List< FriendInfo > friendList)
 Called when the server sent the response to a FindFriends request. More...
 

Detailed Description

Container type for callbacks defined by IMatchmakingCallbacks. See MatchMakingCallbackTargets.

While the interfaces of callbacks wrap up the methods that will be called, the container classes implement a simple way to call a method on all registered objects.

Constructor & Destructor Documentation

◆ MatchMakingCallbacksContainer()

Photon.Realtime.MatchMakingCallbacksContainer.MatchMakingCallbacksContainer ( LoadBalancingClient  client)
inline

Member Function Documentation

◆ OnCreatedRoom()

void Photon.Realtime.MatchMakingCallbacksContainer.OnCreatedRoom ( )
inline

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.

Implements Photon.Realtime.IMatchmakingCallbacks.

◆ OnCreateRoomFailed()

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

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.

Implements Photon.Realtime.IMatchmakingCallbacks.

◆ OnFriendListUpdate()

void Photon.Realtime.MatchMakingCallbacksContainer.OnFriendListUpdate ( List< FriendInfo friendList)
inline

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.

Implements Photon.Realtime.IMatchmakingCallbacks.

◆ OnJoinedRoom()

void Photon.Realtime.MatchMakingCallbacksContainer.OnJoinedRoom ( )
inline

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).

Implements Photon.Realtime.IMatchmakingCallbacks.

◆ OnJoinRandomFailed()

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

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.

Implements Photon.Realtime.IMatchmakingCallbacks.

◆ OnJoinRoomFailed()

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

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.

Implements Photon.Realtime.IMatchmakingCallbacks.

◆ OnLeftRoom()

void Photon.Realtime.MatchMakingCallbacksContainer.OnLeftRoom ( )
inline

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.

Implements Photon.Realtime.IMatchmakingCallbacks.


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