mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Fixed: ServerDisconnected due to error: Timeout. Also improved log messages to make more sense.
This commit is contained in:
parent
d4eb84182d
commit
e505cbd5f4
@ -1017,9 +1017,16 @@ public virtual void OnServerConnect(NetworkConnection conn)
|
||||
public virtual void OnServerDisconnect(NetworkConnection conn)
|
||||
{
|
||||
NetworkServer.DestroyPlayersForConnection(conn);
|
||||
if (conn.lastError != NetworkError.Ok)
|
||||
|
||||
// note: timeouts happen all the time, no need to throw an error there.
|
||||
if (conn.lastError == NetworkError.Ok || conn.lastError == NetworkError.Timeout)
|
||||
{
|
||||
if (LogFilter.logError) { Debug.LogError("ServerDisconnected due to error: " + conn.lastError); }
|
||||
if (LogFilter.logDebug) { Debug.Log("OnServerDisconnect: client disconnected:" + conn); }
|
||||
}
|
||||
else
|
||||
{
|
||||
// a client disconnected, let's show a message
|
||||
if (LogFilter.logError) { Debug.LogError("OnServerDisconnect: Client disconnected with error: " + conn.lastError); }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user