public override void OnConnectionShutdown(NetworkShutdownType type, string reason) { base.OnConnectionShutdown(type, reason); ELogger.Log($"Server stopped for reason '{reason}' with type {type}", ELogger.LogType.Server); if (NetworkManager.Instance != null) { NetworkManager.Instance.m_IsPlaying = false; foreach (NetworkPlayer player in NetworkManager.Instance.GetPlayers()) { RemovePlayer(player, "Server Stopping", NetworkDisconnectType.ServerStopped, true); } } Destroy(); }
public void Shutdown(NetworkShutdownType type, string reason) { OnConnectionShutdown(type, reason); Destroy(); }
/// <summary> /// Called when the connection is being shutdown, right before anything happens /// </summary> public virtual void OnConnectionShutdown(NetworkShutdownType type, string reason) { }