From 7fcaf412df0f4d1bf47c599f3e89a3631f1cd540 Mon Sep 17 00:00:00 2001 From: Li Date: Fri, 18 Nov 2022 19:51:25 +1300 Subject: [PATCH] Fix build --- .../HISPd/Properties/AssemblyInfo.cs | 4 +-- .../HISPd/Resources/DEBIAN/control | 2 +- .../LibHISP/Properties/AssemblyInfo.cs | 4 +-- .../LibHISP/Server/Network/Hybrid.cs | 34 ++++++++----------- .../MPN00BS/Properties/AssemblyInfo.cs | 4 +-- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs b/HorseIsleServer/HISPd/Properties/AssemblyInfo.cs index ee51e8d..99b2706 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.45.0")] -[assembly: AssemblyFileVersion("1.8.45.0")] +[assembly: AssemblyVersion("1.8.46.0")] +[assembly: AssemblyFileVersion("1.8.46.0")] diff --git a/HorseIsleServer/HISPd/Resources/DEBIAN/control b/HorseIsleServer/HISPd/Resources/DEBIAN/control index 38dbdd0..6928f86 100755 --- a/HorseIsleServer/HISPd/Resources/DEBIAN/control +++ b/HorseIsleServer/HISPd/Resources/DEBIAN/control @@ -1,5 +1,5 @@ Package: hisp -Version: 1.8.45 +Version: 1.8.46 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 9a8dfaa..5c116c3 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.45.0")] -[assembly: AssemblyFileVersion("1.8.45.0")] +[assembly: AssemblyVersion("1.8.46.0")] +[assembly: AssemblyFileVersion("1.8.46.0")] diff --git a/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs b/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs index 323f4ac..6ce3e1b 100644 --- a/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs +++ b/HorseIsleServer/LibHISP/Server/Network/Hybrid.cs @@ -5,7 +5,6 @@ namespace HISP.Server.Network { public class Hybrid : Transport { - Transport actualTransport = null; @@ -58,29 +57,24 @@ namespace HISP.Server.Network public override void ProcessReceivedPackets(int available, byte[] buffer) { - for (int i = 0; i < available; i++) - base.currentPacket.Add(buffer[i]); - if (currentPacket.Count >= 3) + if (ConfigReader.EnableWebSocket && WebSocket.IsStartOfHandshake(buffer)) { - if (ConfigReader.EnableWebSocket && WebSocket.IsStartOfHandshake(currentPacket.ToArray())) - { - Logger.InfoPrint(this.Ip + " Switching to WebSocket"); - actualTransport = new WebSocket(); + Logger.InfoPrint(this.Ip + " Switching to WebSocket"); + actualTransport = new WebSocket(); - actualTransport.passObjects(this.socket, this.onReceiveCallback, this.onDisconnectCallback); - actualTransport.ProcessReceivedPackets(available, buffer); - actualTransport.Accept(base.socket, base.onReceiveCallback, base.onDisconnectCallback); - } - else - { - Logger.InfoPrint(this.Ip + " Switching to XmlSocket"); - actualTransport = new XmlSocket(); + actualTransport.passObjects(this.socket, this.onReceiveCallback, this.onDisconnectCallback); + actualTransport.ProcessReceivedPackets(available, buffer); + actualTransport.Accept(base.socket, base.onReceiveCallback, base.onDisconnectCallback); + } + else + { + Logger.InfoPrint(this.Ip + " Switching to XmlSocket"); + actualTransport = new XmlSocket(); - actualTransport.passObjects(this.socket, this.onReceiveCallback, this.onDisconnectCallback); - actualTransport.ProcessReceivedPackets(available, buffer); - actualTransport.Accept(base.socket, base.onReceiveCallback, base.onDisconnectCallback); - } + actualTransport.passObjects(this.socket, this.onReceiveCallback, this.onDisconnectCallback); + actualTransport.ProcessReceivedPackets(available, buffer); + actualTransport.Accept(base.socket, base.onReceiveCallback, base.onDisconnectCallback); } } diff --git a/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs b/HorseIsleServer/MPN00BS/Properties/AssemblyInfo.cs index 4afd1b4..3aca806 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.45.0")] -[assembly: AssemblyFileVersion("1.8.45.0")] +[assembly: AssemblyVersion("1.8.46.0")] +[assembly: AssemblyFileVersion("1.8.46.0")]