OnLeaveInGameServer
public MatchInGameLeaveSessionEventHandler OnLeaveInGameServer;
Argument
Value | Type | Description |
---|---|---|
args | MatchInGameSessionEventArgs | Information on connection termination error |
MatchInGameSessionEventArgs
Value | Type | Description |
---|---|---|
ErrInfo | ErrorCode | Error information |
Reason | string | Error information |
GameRecord | MatchUserGameRecord | Session's information(Session ID, nickname, battle history, etc.) |
Description
This event is called when the connection to the in-game server is terminated.
This event may be called in the following cases:
- When the client explicitly terminates connection to the server
- When the game ends in the game room and the result is compiled
- When the server terminates connection to the client
- Not all users connect to the game room within one minute after being matched
- Server disconnects due to an abnormal reason
- When the user fails to reconnect
In order for an event to be called, the message sending/receiving method must be called.
Example
//example
Backend.Match.OnLeaveInGameServer = (MatchInGameSessionEventArgs args) => {
// TODO
};
Argument cases
When the game ends properly and the server disconnects
ErrInfo : ErrorCode.Success
When the game room is terminated and the server disconnects
ErrInfo : ErrorCode.Success
When the game is nullified because the result is not compiled, and the server disconnects
ErrInfo : ErrorCode.Success
Server disconnects due to an abnormal error
ErrInfo : ErrorCode.Exception
Reason : "reason for error"
When the user fails to reconnect
ErrInfo : ErrorCode.Exception
Reason : Fail To Reconnect
When the user tries to reconnect in an abnormal way
ErrInfo : ErrorCode.AuthenticationFailed
Reason : Invalid rars operation(0).
When the SSL stream is not established while reading data due to a Unity TLS error
ErrInfo : ErrorCode.Exception
Reason : System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception.
In this case, the SDK tries to reconnect to the server automatically.