From 1dd88cdacb12c21d269d16cffefa990737bd002c Mon Sep 17 00:00:00 2001 From: RaidMax Date: Thu, 6 Feb 2020 21:05:50 -0600 Subject: [PATCH] fix disconnect event being cancelled --- Application/IW4MServer.cs | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index 877fcc2f9..46c86acec 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -94,18 +94,18 @@ namespace IW4MAdmin if (client.ClientNumber >= 0) { #endif - Logger.WriteInfo($"Client {client} [{client.State.ToString().ToLower()}] disconnecting..."); - Clients[client.ClientNumber] = null; - await client.OnDisconnect(); + Logger.WriteInfo($"Client {client} [{client.State.ToString().ToLower()}] disconnecting..."); + Clients[client.ClientNumber] = null; + await client.OnDisconnect(); - var e = new GameEvent() - { - Origin = client, - Owner = this, - Type = GameEvent.EventType.Disconnect - }; + var e = new GameEvent() + { + Origin = client, + Owner = this, + Type = GameEvent.EventType.Disconnect + }; - Manager.GetEventHandler().AddEvent(e); + Manager.GetEventHandler().AddEvent(e); #if DEBUG == true } #endif @@ -728,11 +728,6 @@ namespace IW4MAdmin foreach (var disconnectingClient in polledClients[1]) { - if (disconnectingClient.State == ClientState.Disconnecting) - { - continue; - } - var e = new GameEvent() { Type = GameEvent.EventType.PreDisconnect,