Quantum 3 3.1.0

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Photon.Realtime.SystemConnectionSummary Class Reference

The SystemConnectionSummary (SBS) is useful to analyze low level connection issues in Unity. This requires a ConnectionHandler in the scene. More...

Public Member Functions

 SystemConnectionSummary (int summary)
 Creates a SystemConnectionSummary instance from an int (reversing ToInt()). This can then be turned into a string again. More...
 
 SystemConnectionSummary (RealtimeClient client)
 Creates a SystemConnectionSummary for an incident of a local RealtimeClient. This gets used automatically by the RealtimeClient! More...
 
int ToInt ()
 Turns the SystemConnectionSummary into an integer, which can be used for analytics purposes. It contains a lot of info and can be used to instantiate a new SystemConnectionSummary. More...
 
override string ToString ()
 A readable debug log string of the context for network problems. More...
 

Static Public Member Functions

static int GetErrorCode (int summary)
 Extracts the recorded error code from a SystemConnectionSummary binary representation. More...
 

Public Attributes

bool AppOutOfFocus
 True if the Unity app is out of focus / minimized. More...
 
bool AppOutOfFocusRecent
 True if the Unity app was out of focus / minimized recently (past 5 sec). More...
 
bool AppPause
 True if the Unity app is paused. More...
 
bool AppPauseRecent
 True if the Unity app was paused recently (past 5 sec). More...
 
bool AppQuits
 True if the Unity app is closing / shut down. More...
 
bool ErrorCodeFits
 True if the Socket-level error code fits into the usual byte "budget". More...
 
bool ErrorCodeWinSock
 True if the Socket-level error code is WinSock based. More...
 
bool NetworkReachable
 True if the Unity engine tells us the network is reachable. More...
 
int SocketErrorCode
 Socket-level error code (if any is available). More...
 
byte UsedProtocol
 Which protocol is used. Refer to ConnectionProtocol. More...
 
readonly byte Version = 0
 Version of the SystemConnectionSummary type. More...
 

Detailed Description

The SystemConnectionSummary (SBS) is useful to analyze low level connection issues in Unity. This requires a ConnectionHandler in the scene.

A RealtimeClient automatically creates a SystemConnectionSummary on these disconnect causes: DisconnectCause.ExceptionOnConnect, DisconnectCause.Exception, DisconnectCause.ServerTimeout and DisconnectCause.ClientTimeout.

The SBS can then be turned into an integer (ToInt()) or string to debug the situation or use in analytics. Both, ToString and ToInt summarize the network-relevant conditions of the client at and before the connection fail, including the PhotonPeer.SocketErrorCode.

Important: To correctly create the SBS instance, a ConnectionHandler component must be present and enabled in the Unity scene hierarchy. In best case, keep the ConnectionHandler on a GameObject which is flagged as DontDestroyOnLoad.

Constructor & Destructor Documentation

◆ SystemConnectionSummary() [1/2]

Photon.Realtime.SystemConnectionSummary.SystemConnectionSummary ( RealtimeClient  client)
inline

Creates a SystemConnectionSummary for an incident of a local RealtimeClient. This gets used automatically by the RealtimeClient!

If the RealtimeClient.SystemConnectionSummary is non-null after a connection-loss, you can call .ToInt() and send this to analytics or log it.

Parameters
client

◆ SystemConnectionSummary() [2/2]

Photon.Realtime.SystemConnectionSummary.SystemConnectionSummary ( int  summary)
inline

Creates a SystemConnectionSummary instance from an int (reversing ToInt()). This can then be turned into a string again.

Parameters
summaryAn int, as provided by ToInt(). No error checks yet.

Member Function Documentation

◆ ToInt()

int Photon.Realtime.SystemConnectionSummary.ToInt ( )
inline

Turns the SystemConnectionSummary into an integer, which can be used for analytics purposes. It contains a lot of info and can be used to instantiate a new SystemConnectionSummary.

Returns
Compact representation of the context for a disconnect issue.

◆ ToString()

override string Photon.Realtime.SystemConnectionSummary.ToString ( )
inline

A readable debug log string of the context for network problems.

Returns
SystemConnectionSummary as readable string.

◆ GetErrorCode()

static int Photon.Realtime.SystemConnectionSummary.GetErrorCode ( int  summary)
inlinestatic

Extracts the recorded error code from a SystemConnectionSummary binary representation.

Parameters
summaryPass the value of SystemConnectionSummary.ToInt().
Returns
Error code from a SCS summary (int) or -1 if the version can't be read.

Member Data Documentation

◆ Version

readonly byte Photon.Realtime.SystemConnectionSummary.Version = 0

Version of the SystemConnectionSummary type.

◆ UsedProtocol

byte Photon.Realtime.SystemConnectionSummary.UsedProtocol

Which protocol is used. Refer to ConnectionProtocol.

◆ AppQuits

bool Photon.Realtime.SystemConnectionSummary.AppQuits

True if the Unity app is closing / shut down.

◆ AppPause

bool Photon.Realtime.SystemConnectionSummary.AppPause

True if the Unity app is paused.

◆ AppPauseRecent

bool Photon.Realtime.SystemConnectionSummary.AppPauseRecent

True if the Unity app was paused recently (past 5 sec).

◆ AppOutOfFocus

bool Photon.Realtime.SystemConnectionSummary.AppOutOfFocus

True if the Unity app is out of focus / minimized.

◆ AppOutOfFocusRecent

bool Photon.Realtime.SystemConnectionSummary.AppOutOfFocusRecent

True if the Unity app was out of focus / minimized recently (past 5 sec).

◆ NetworkReachable

bool Photon.Realtime.SystemConnectionSummary.NetworkReachable

True if the Unity engine tells us the network is reachable.

◆ ErrorCodeFits

bool Photon.Realtime.SystemConnectionSummary.ErrorCodeFits

True if the Socket-level error code fits into the usual byte "budget".

◆ ErrorCodeWinSock

bool Photon.Realtime.SystemConnectionSummary.ErrorCodeWinSock

True if the Socket-level error code is WinSock based.

◆ SocketErrorCode

int Photon.Realtime.SystemConnectionSummary.SocketErrorCode

Socket-level error code (if any is available).