From e723a52c9790be171a205d99d6e1fa1ace78a18c Mon Sep 17 00:00:00 2001 From: vis2k Date: Mon, 10 May 2021 20:57:38 +0800 Subject: [PATCH] add comments --- Assets/Mirror/Runtime/NetworkManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Mirror/Runtime/NetworkManager.cs b/Assets/Mirror/Runtime/NetworkManager.cs index 8c3a99937..68d46f8a8 100644 --- a/Assets/Mirror/Runtime/NetworkManager.cs +++ b/Assets/Mirror/Runtime/NetworkManager.cs @@ -1196,6 +1196,9 @@ public virtual void OnServerConnect(NetworkConnection conn) {} // Called by NetworkServer.OnTransportDisconnect! public virtual void OnServerDisconnect(NetworkConnection conn) { + // by default, this function destroys the connection's player. + // can be overwritten for cases like delayed logouts in MMOs to + // avoid players escaping from PvP situations by logging out. NetworkServer.DestroyPlayerForConnection(conn); Debug.Log("OnServerDisconnect: Client disconnected."); }