From e33c442a1883611bfcbe0a9e2d0124df1bc321ea Mon Sep 17 00:00:00 2001 From: edmand46 Date: Sat, 14 Oct 2023 21:35:51 +0300 Subject: [PATCH] :bug: WebSocket buffer size --- Ragon.Protocol/Ragon.Protocol.csproj | 1 - Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs | 3 ++- Ragon.Server/Ragon.Server.csproj | 2 +- Ragon.Server/Sources/RagonServerConfiguration.cs | 8 ++++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Ragon.Protocol/Ragon.Protocol.csproj b/Ragon.Protocol/Ragon.Protocol.csproj index c2a2e8f..6a0a76c 100644 --- a/Ragon.Protocol/Ragon.Protocol.csproj +++ b/Ragon.Protocol/Ragon.Protocol.csproj @@ -6,7 +6,6 @@ 8 Ragon.Common true - 1.2.4-rc Ragon.Protocol Eduard Kargin https://ragon-server.com diff --git a/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs b/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs index 8361e63..e2195f9 100644 --- a/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs +++ b/Ragon.Server.WebSocketServer/Sources/WebSocketServer.cs @@ -75,6 +75,7 @@ public class WebSocketServer : INetworkServer var webSocket = connection.Socket; var bytes = new byte[2048]; var buffer = new Memory(bytes); + while ( webSocket.State == WebSocketState.Open || !cancellationToken.IsCancellationRequested) @@ -84,7 +85,7 @@ public class WebSocketServer : INetworkServer var result = await webSocket.ReceiveAsync(buffer, cancellationToken); if (result.Count > 0) { - var payload = buffer.Slice(0, buffer.Length); + var payload = buffer.Slice(0, result.Count); _networkListener.OnData(connection, NetworkChannel.RELIABLE, payload.ToArray()); } } diff --git a/Ragon.Server/Ragon.Server.csproj b/Ragon.Server/Ragon.Server.csproj index 2575c98..3dde34d 100644 --- a/Ragon.Server/Ragon.Server.csproj +++ b/Ragon.Server/Ragon.Server.csproj @@ -5,7 +5,7 @@ enable Ragon.Core true - 1.2.4-rc + 1.3.1 Ragon.Server Eduard Kargin https://ragon-server.com diff --git a/Ragon.Server/Sources/RagonServerConfiguration.cs b/Ragon.Server/Sources/RagonServerConfiguration.cs index c37b572..53b230c 100644 --- a/Ragon.Server/Sources/RagonServerConfiguration.cs +++ b/Ragon.Server/Sources/RagonServerConfiguration.cs @@ -47,7 +47,7 @@ public struct RagonServerConfiguration public Dictionary WebHooks; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - private static readonly string ServerVersion = "1.2.9-rc"; + private static readonly string ServerVersion = "1.3.2"; private static Dictionary _serverTypes = new Dictionary() { {"enet", Server.ServerType.ENET}, @@ -65,7 +65,11 @@ public struct RagonServerConfiguration private static void CopyrightInfo() { - Logger.Info($"Server Version: {ServerVersion}"); + var assembly = System.Reflection.Assembly.GetExecutingAssembly(); + var fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location); + var version = fvi.ProductVersion; + + Logger.Info($"Server Version: {version}"); Logger.Info($"Machine Name: {Environment.MachineName}"); Logger.Info($"OS: {Environment.OSVersion}"); Logger.Info($"Processors: {Environment.ProcessorCount}");