fix disconnect event being cancelled

This commit is contained in:
RaidMax 2020-02-06 21:05:50 -06:00
parent fe380ca331
commit 1dd88cdacb

View File

@ -94,18 +94,18 @@ namespace IW4MAdmin
if (client.ClientNumber >= 0) if (client.ClientNumber >= 0)
{ {
#endif #endif
Logger.WriteInfo($"Client {client} [{client.State.ToString().ToLower()}] disconnecting..."); Logger.WriteInfo($"Client {client} [{client.State.ToString().ToLower()}] disconnecting...");
Clients[client.ClientNumber] = null; Clients[client.ClientNumber] = null;
await client.OnDisconnect(); await client.OnDisconnect();
var e = new GameEvent() var e = new GameEvent()
{ {
Origin = client, Origin = client,
Owner = this, Owner = this,
Type = GameEvent.EventType.Disconnect Type = GameEvent.EventType.Disconnect
}; };
Manager.GetEventHandler().AddEvent(e); Manager.GetEventHandler().AddEvent(e);
#if DEBUG == true #if DEBUG == true
} }
#endif #endif
@ -728,11 +728,6 @@ namespace IW4MAdmin
foreach (var disconnectingClient in polledClients[1]) foreach (var disconnectingClient in polledClients[1])
{ {
if (disconnectingClient.State == ClientState.Disconnecting)
{
continue;
}
var e = new GameEvent() var e = new GameEvent()
{ {
Type = GameEvent.EventType.PreDisconnect, Type = GameEvent.EventType.PreDisconnect,