Photon .NET Client API 4.1.4.8

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

Container type for callbacks defined by IConnectionCallbacks. See LoadBalancingCallbackTargets. More...

Inheritance diagram for Photon.Realtime.ConnectionCallbacksContainer:
Photon.Realtime.IConnectionCallbacks

Public Member Functions

 ConnectionCallbacksContainer (LoadBalancingClient client)
 
void OnConnected ()
 Called to signal that the "low level connection" got established but before the client can call operation on the server. More...
 
void OnConnectedToMaster ()
 Called when the client is connected to the Master Server and ready for matchmaking and other tasks. More...
 
void OnRegionListReceived (RegionHandler regionHandler)
 Called when the Name Server provided a list of regions for your title. More...
 
void OnDisconnected (DisconnectCause cause)
 Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call More...
 
void OnCustomAuthenticationResponse (Dictionary< string, object > data)
 Called when your Custom Authentication service responds with additional data. More...
 
void OnCustomAuthenticationFailed (string debugMessage)
 Called when the custom authentication failed. Followed by disconnect! More...
 

Detailed Description

Container type for callbacks defined by IConnectionCallbacks. See LoadBalancingCallbackTargets.

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

◆ ConnectionCallbacksContainer()

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

Member Function Documentation

◆ OnConnected()

void Photon.Realtime.ConnectionCallbacksContainer.OnConnected ( )
inline

Called to signal that the "low level connection" got established but before the client can call operation on the server.

After the (low level transport) connection is established, the client will automatically send the Authentication operation, which needs to get a response before the client can call other operations.

Your logic should wait for either: OnRegionListReceived or OnConnectedToMaster.

This callback is useful to detect if the server can be reached at all (technically). Most often, it's enough to implement OnDisconnected(DisconnectCause cause) and check for the cause.

This is not called for transitions from the masterserver to game servers.

Implements Photon.Realtime.IConnectionCallbacks.

◆ OnConnectedToMaster()

void Photon.Realtime.ConnectionCallbacksContainer.OnConnectedToMaster ( )
inline

Called when the client is connected to the Master Server and ready for matchmaking and other tasks.

The list of available rooms won't become available unless you join a lobby via LoadBalancingClient.OpJoinLobby. You can join rooms and create them even without being in a lobby. The default lobby is used in that case.

Implements Photon.Realtime.IConnectionCallbacks.

◆ OnCustomAuthenticationFailed()

void Photon.Realtime.ConnectionCallbacksContainer.OnCustomAuthenticationFailed ( string  debugMessage)
inline

Called when the custom authentication failed. Followed by disconnect!

Custom Authentication can fail due to user-input, bad tokens/secrets. If authentication is successful, this method is not called. Implement OnJoinedLobby() or OnConnectedToMaster() (as usual).

During development of a game, it might also fail due to wrong configuration on the server side. In those cases, logging the debugMessage is very important.

Unless you setup a custom authentication service for your app (in the Dashboard), this won't be called!

Parameters
debugMessageContains a debug message why authentication failed. This has to be fixed during development.

Implements Photon.Realtime.IConnectionCallbacks.

◆ OnCustomAuthenticationResponse()

void Photon.Realtime.ConnectionCallbacksContainer.OnCustomAuthenticationResponse ( Dictionary< string, object >  data)
inline

Called when your Custom Authentication service responds with additional data.

Custom Authentication services can include some custom data in their response. When present, that data is made available in this callback as Dictionary. While the keys of your data have to be strings, the values can be either string or a number (in Json). You need to make extra sure, that the value type is the one you expect. Numbers become (currently) int64.

Example: void OnCustomAuthenticationResponse(Dictionary<string, object> data) { ... }

https://doc.photonengine.com/en-us/realtime/current/reference/custom-authentication

Implements Photon.Realtime.IConnectionCallbacks.

◆ OnDisconnected()

void Photon.Realtime.ConnectionCallbacksContainer.OnDisconnected ( DisconnectCause  cause)
inline

Called after disconnecting from the Photon server. It could be a failure or an explicit disconnect call

The reason for this disconnect is provided as DisconnectCause.

Implements Photon.Realtime.IConnectionCallbacks.

◆ OnRegionListReceived()

void Photon.Realtime.ConnectionCallbacksContainer.OnRegionListReceived ( RegionHandler  regionHandler)
inline

Called when the Name Server provided a list of regions for your title.

Check the RegionHandler class description, to make use of the provided values.

Parameters
regionHandlerThe currently used RegionHandler.

Implements Photon.Realtime.IConnectionCallbacks.


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