diff --git a/BattleBitAPI/Server/GameServer.cs b/BattleBitAPI/Server/GameServer.cs index 904d689..11c5cb3 100644 --- a/BattleBitAPI/Server/GameServer.cs +++ b/BattleBitAPI/Server/GameServer.cs @@ -1,5 +1,4 @@ -using System.Diagnostics; -using System.Net; +using System.Net; using System.Net.Sockets; using System.Numerics; using System.Text; diff --git a/BattleBitAPI/Server/ServerListener.cs b/BattleBitAPI/Server/ServerListener.cs index 2c1773b..d283b88 100644 --- a/BattleBitAPI/Server/ServerListener.cs +++ b/BattleBitAPI/Server/ServerListener.cs @@ -1,7 +1,6 @@ using System.Net; using System.Net.Sockets; using System.Numerics; -using System.Runtime.CompilerServices; using BattleBitAPI.Common; using BattleBitAPI.Common.Extentions; using BattleBitAPI.Networking; @@ -190,12 +189,12 @@ namespace BattleBitAPI.Server throw new Exception("Incoming package wasn't hail."); } - //Read the server name + //Read the server token string token; { readStream.Reset(); if (!await networkStream.TryRead(readStream, 2, source.Token)) - throw new Exception("Unable to read the Token Size"); + throw new Exception("Unable to read the token Size"); int stringSize = readStream.ReadUInt16(); if (stringSize > Const.MaxTokenSize) @@ -339,7 +338,7 @@ namespace BattleBitAPI.Server throw new Exception("Unable to read the Loading Screen Text Size"); int stringSize = readStream.ReadUInt16(); - if (stringSize < Const.MinLoadingScreenTextLength || stringSize > Const.MaxLoadingScreenTextLength) + if (stringSize > Const.MaxLoadingScreenTextLength) throw new Exception("Invalid server Loading Screen Text Size"); if (stringSize > 0) @@ -364,7 +363,7 @@ namespace BattleBitAPI.Server throw new Exception("Unable to read the Server Rules Text Size"); int stringSize = readStream.ReadUInt16(); - if (stringSize < Const.MinServerRulesTextLength || stringSize > Const.MaxServerRulesTextLength) + if (stringSize > Const.MaxServerRulesTextLength) throw new Exception("Invalid server Server Rules Text Size"); if (stringSize > 0) @@ -546,7 +545,7 @@ namespace BattleBitAPI.Server { readStream.Reset(); if (!await networkStream.TryRead(readStream, 4, source.Token)) - throw new Exception("Unable to read the LoadoutSize"); + throw new Exception("Unable to read the Loadout + Wearings size"); int loadoutSize = (int)readStream.ReadUInt32(); readStream.Reset();