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 (LoadBalancingClient client) | |
Creates a SystemConnectionSummary for an incident of a local LoadBalancingClient. This gets used automatically by the LoadBalancingClient! More... | |
SystemConnectionSummary (int summary) | |
Creates a SystemConnectionSummary instance from an int (reversing ToInt()). This can then be turned into a string again. More... | |
int | ToInt () |
Turns the SystemConnectionSummary into an integer, which can be 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 bool | GetBit (ref int value, int bitpos) |
static byte | GetBits (ref int value, int bitpos, byte mask) |
static void | SetBit (ref int value, bool bitval, int bitpos) |
Applies bitval to bitpos (no matter value's initial bit value). More... | |
static void | SetBits (ref int value, byte bitvals, int bitpos) |
Applies bitvals via OR operation (expects bits in value to be 0 initially). More... | |
The SystemConnectionSummary (SBS) is useful to analyze low level connection issues in Unity. This requires a ConnectionHandler in the scene.
A LoadBalancingClient 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.
SystemConnectionSummary | ( | LoadBalancingClient | client | ) |
Creates a SystemConnectionSummary for an incident of a local LoadBalancingClient. This gets used automatically by the LoadBalancingClient!
If the LoadBalancingClient.SystemConnectionSummary is non-null after a connection-loss, you can call .ToInt() and send this to analytics or log it.
client |
SystemConnectionSummary | ( | int | summary | ) |
Creates a SystemConnectionSummary instance from an int (reversing ToInt()). This can then be turned into a string again.
summary | An int, as provided by ToInt(). No error checks yet. |
|
static |
Applies bitval to bitpos (no matter value's initial bit value).
|
static |
Applies bitvals via OR operation (expects bits in value to be 0 initially).
int ToInt | ( | ) |
Turns the SystemConnectionSummary into an integer, which can be be used for analytics purposes. It contains a lot of info and can be used to instantiate a new SystemConnectionSummary.
override string ToString | ( | ) |
A readable debug log string of the context for network problems.