diff --git a/BattleBitAPI/Networking/NetworkCommuncation.cs b/BattleBitAPI/Networking/NetworkCommuncation.cs index b687440..e504326 100644 --- a/BattleBitAPI/Networking/NetworkCommuncation.cs +++ b/BattleBitAPI/Networking/NetworkCommuncation.cs @@ -43,5 +43,7 @@ NotifyNewRoundID = 73, Log = 74, OnSquadLeaderChanged = 75, + UpdateNewGameData = 76, + UpdateConnectedPlayers = 77, } } diff --git a/BattleBitAPI/Server/GameServer.cs b/BattleBitAPI/Server/GameServer.cs index 3624e9a..0963f71 100644 --- a/BattleBitAPI/Server/GameServer.cs +++ b/BattleBitAPI/Server/GameServer.cs @@ -1357,6 +1357,8 @@ namespace BattleBitAPI.Server this.RoundIndex = roundIndex; this.SessionID = sessionID; + this.Players.Clear(); + this.ServerSettings.Reset(); this._RoomSettings.Reset(); this.IsDirtyRoomSettings = false; diff --git a/BattleBitAPI/Server/ServerListener.cs b/BattleBitAPI/Server/ServerListener.cs index b2eb487..8a68220 100644 --- a/BattleBitAPI/Server/ServerListener.cs +++ b/BattleBitAPI/Server/ServerListener.cs @@ -486,10 +486,6 @@ namespace BattleBitAPI.Server sessionID = readStream.ReadInt64(); } - - - - server = this.mInstanceDatabase.GetServerInstance(hash, out resources, this.OnCreatingGameServerInstance, ip, (ushort)gamePort); resources.Set( this.mExecutePackage, @@ -859,6 +855,34 @@ namespace BattleBitAPI.Server var communcation = (NetworkCommuncation)stream.ReadInt8(); switch (communcation) { + case NetworkCommuncation.UpdateNewGameData: + { + if (stream.CanRead(10)) + { + resources.CurrentPlayerCount = stream.ReadInt8(); + resources.InQueuePlayerCount = stream.ReadInt8(); + resources.MaxPlayerCount = stream.ReadInt8(); + resources.MaxPlayerCount = stream.ReadInt8(); + stream.TryReadString(out resources.Gamemode); + resources.MapSize = (MapSize)stream.ReadInt8(); + stream.TryReadString(out resources.Map); + byte gameType = stream.ReadInt8(); + resources.DayNight = (MapDayNight)stream.ReadInt8(); + } + break; + } + case NetworkCommuncation.UpdateConnectedPlayers: + { + if (stream.CanRead(4)) + { + resources.CurrentPlayerCount = stream.ReadInt8(); + resources.InQueuePlayerCount = stream.ReadInt8(); + resources.MaxPlayerCount = stream.ReadInt8(); + resources.MaxPlayerCount = stream.ReadInt8(); + } + break; + } + case NetworkCommuncation.PlayerConnected: { if (stream.CanRead(8 + 2 + 4 + (1 + 1 + 1))) diff --git a/CommunityServerAPI.csproj b/CommunityServerAPI.csproj index fcd53a0..6470c51 100644 --- a/CommunityServerAPI.csproj +++ b/CommunityServerAPI.csproj @@ -18,7 +18,7 @@ https://github.com/MrOkiDoki/BattleBit-Community-Server-API https://github.com/MrOkiDoki/BattleBit-Community-Server-API BattleBit - 1.0.4 + 1.0.4.1