Quantum 3 3.1.0

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

Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions. More...

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

Public Member Functions

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

Detailed Description

Collection of "organizational" callbacks for the Realtime Api to cover: Connection and Regions.

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

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

Member Function Documentation

◆ OnConnected()

void Photon.Realtime.IConnectionCallbacks.OnConnected ( )

Obsolete. Replaced by better logging. Was: Called to signal that the "low level connection" got established.

Implemented in Photon.Realtime.ConnectionCallbacksContainer.

◆ OnConnectedToMaster()

void Photon.Realtime.IConnectionCallbacks.OnConnectedToMaster ( )

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 RealtimeClient.OpJoinLobby. You can join rooms and create them even without being in a lobby. The default lobby is used in that case.

Implemented in Photon.Realtime.ConnectionCallbacksContainer.

◆ OnDisconnected()

void Photon.Realtime.IConnectionCallbacks.OnDisconnected ( DisconnectCause  cause)

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.

Implemented in Photon.Realtime.ConnectionCallbacksContainer.

◆ OnRegionListReceived()

void Photon.Realtime.IConnectionCallbacks.OnRegionListReceived ( RegionHandler  regionHandler)

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

This callback is called as soon as the list is available. No pings were sent for Best Region selection yet. If the client is set to connect to the Best Region (lowest ping), one or more regions get pinged. Not all regions are pinged. As soon as the results are final, the client will connect to the best region, so you can check the ping results when connected to the Master Server.

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

Parameters
regionHandlerThe currently used RegionHandler.

Implemented in Photon.Realtime.ConnectionCallbacksContainer.

◆ OnCustomAuthenticationResponse()

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

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

Custom Authentication

Implemented in Photon.Realtime.ConnectionCallbacksContainer.

◆ OnCustomAuthenticationFailed()

void Photon.Realtime.IConnectionCallbacks.OnCustomAuthenticationFailed ( string  debugMessage)

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.

Implemented in Photon.Realtime.ConnectionCallbacksContainer.