From 29e5ab809338f14993afa593fa9f7e4ff3f5c219 Mon Sep 17 00:00:00 2001 From: Li Date: Thu, 17 Nov 2022 13:32:47 +1300 Subject: [PATCH] Update HISP --- .../HISPd/Properties/AssemblyInfo.cs | 4 ++-- .../HISPd/Resources/DEBIAN/control | 2 +- .../LibHISP/Properties/AssemblyInfo.cs | 4 ++-- HorseIsleServer/LibHISP/Server/Entry.cs | 5 ----- .../LibHISP/Server/Network/Hybrid.cs | 12 +++++++++-- .../LibHISP/Server/Network/Transport.cs | 21 ++++++++++++------- .../LibHISP/Server/Network/WebSocket.cs | 2 +- .../MPN00BS/Properties/AssemblyInfo.cs | 4 ++-- 8 files changed, 31 insertions(+), 23 deletions(-) diff --git a/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs b/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs index 18fa52a..d6af841 100755 --- a/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs +++ b/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.8.41.0")] -[assembly: AssemblyFileVersion("1.8.41.0")] +[assembly: AssemblyVersion("1.8.42.0")] +[assembly: AssemblyFileVersion("1.8.42.0")] diff --git a/HorseIsleServer/HISPd/Resources/DEBIAN/control b/HorseIsleServer/HISPd/Resources/DEBIAN/control index 05977ea..942fd17 100755 --- a/HorseIsleServer/HISPd/Resources/DEBIAN/control +++ b/HorseIsleServer/HISPd/Resources/DEBIAN/control @@ -1,5 +1,5 @@ Package: hisp -Version: 1.8.41 +Version: 1.8.42 Depends: coreutils,systemd,mariadb-server,libsqlite3-dev,zlib1g-dev,libicu-dev,libkrb5-dev Maintainer: Li Homepage: https://islehorse.com diff --git a/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs b/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs index 9e40559..d853c5a 100755 --- a/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs +++ b/HorseIsleServer/LibHISP/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.8.41.0")] -[assembly: AssemblyFileVersion("1.8.41.0")] +[assembly: AssemblyVersion("1.8.42.0")] +[assembly: AssemblyFileVersion("1.8.42.0")] diff --git a/HorseIsleServer/LibHISP/Server/Entry.cs b/HorseIsleServer/LibHISP/Server/Entry.cs index 0ee448a..394d4c1 100755 --- a/HorseIsleServer/LibHISP/Server/Entry.cs +++ b/HorseIsleServer/LibHISP/Server/Entry.cs @@ -85,11 +85,6 @@ namespace HISP.Server Logger.CrashPrint(crashMsg); - try - { - GameServer.ShutdownServer(); - } - catch (Exception) { }; } diff --git a/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs b/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs index 4676940..08f9425 100644 --- a/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs +++ b/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs @@ -86,8 +86,16 @@ namespace HISP.Server.Network internal override void receivePackets(object sender, SocketAsyncEventArgs e) { - if (!base.checkForError(e)) - ProcessReceivedPackets(e.BytesTransferred, e.Buffer); + try + { + if (!base.checkForError(e)) + ProcessReceivedPackets(e.BytesTransferred, e.Buffer); + } + catch (Exception ex) + { + Logger.ErrorPrint(ex.StackTrace); + try { this.Disconnect(); } catch (Exception) { }; + }; } public override void Send(byte[] data) diff --git a/HorseIsleServer/LibHISP/Server/Network/Transport.cs b/HorseIsleServer/LibHISP/Server/Network/Transport.cs index 4f51d03..ae8b0f7 100644 --- a/HorseIsleServer/LibHISP/Server/Network/Transport.cs +++ b/HorseIsleServer/LibHISP/Server/Network/Transport.cs @@ -36,15 +36,20 @@ namespace HISP.Server.Network } internal virtual void receivePackets(object sender, SocketAsyncEventArgs e) { - do + try { - if (!checkForError(e)) + do + { + if (checkForError(e)) break; ProcessReceivedPackets(e.BytesTransferred, e.Buffer); - else - break; + if (checkForError(e)) break; - - } while (!socket.ReceiveAsync(e)); + } while (!socket.ReceiveAsync(e)); + } + catch (Exception ex) { + Logger.ErrorPrint(ex.StackTrace); + try { this.Disconnect(); } catch (Exception) { }; + }; } @@ -102,8 +107,8 @@ namespace HISP.Server.Network socket = null; } - catch (SocketException e) { } - catch (ObjectDisposedException e) { }; + catch (SocketException) { } + catch (ObjectDisposedException) { }; } onDisconnectCallback(); diff --git a/HorseIsleServer/LibHISP/Server/Network/WebSocket.cs b/HorseIsleServer/LibHISP/Server/Network/WebSocket.cs index 3f33312..1d79515 100644 --- a/HorseIsleServer/LibHISP/Server/Network/WebSocket.cs +++ b/HorseIsleServer/LibHISP/Server/Network/WebSocket.cs @@ -350,7 +350,7 @@ namespace HISP.Server.Network additionalLengthData = BitConverter.GetBytes(Convert.ToUInt16(toSend)).Reverse().ToArray(); } - else if(toSend < Int64.MaxValue) + else if(Convert.ToInt64(toSend) < Int64.MaxValue) { maskAndLength |= WEBSOCKET_LENGTH_INT64; additionalLengthData = BitConverter.GetBytes(Convert.ToInt64(toSend)).Reverse().ToArray(); diff --git a/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs b/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs index 4a88539..68b59bc 100755 --- a/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs +++ b/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ using System.Runtime.InteropServices; // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.8.41.0")] -[assembly: AssemblyFileVersion("1.8.41.0")] +[assembly: AssemblyVersion("1.8.42.0")] +[assembly: AssemblyFileVersion("1.8.42.0")]