From b75121b54fa6db1c5dcdf91d6a14706dd4a34861 Mon Sep 17 00:00:00 2001 From: Bluzume <39113159+KuromeSan@users.noreply.github.com> Date: Fri, 5 Nov 2021 05:41:29 -0400 Subject: [PATCH] Fix hi1 --- .../HorseIsleServer/Server/GameClient.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/HorseIsleServer/HorseIsleServer/Server/GameClient.cs b/HorseIsleServer/HorseIsleServer/Server/GameClient.cs index ea252e3..10a27e5 100644 --- a/HorseIsleServer/HorseIsleServer/Server/GameClient.cs +++ b/HorseIsleServer/HorseIsleServer/Server/GameClient.cs @@ -124,7 +124,16 @@ namespace HISP.Server do { // HI1 Packets are terminates by 0x00 so we have to read until we receive that terminator - ClientSocket.Poll(0, SelectMode.SelectRead); + + if (isDisconnecting || ClientSocket == null) + return; + + if(ClientSocket.Poll(0, SelectMode.SelectRead)) + { + Disconnect(); + return; + } + if (!ClientSocket.Connected) { Disconnect(); @@ -153,7 +162,7 @@ namespace HISP.Server } } - if (isDisconnecting) + if (isDisconnecting || ClientSocket == null) return;