Merge pull request #76 from MrOkiDoki/develop

bug fixes
This commit is contained in:
MrOkiDoki 2023-08-28 08:21:55 -07:00 committed by GitHub
commit 4af88e78df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 5 deletions

View File

@ -43,5 +43,7 @@
NotifyNewRoundID = 73,
Log = 74,
OnSquadLeaderChanged = 75,
UpdateNewGameData = 76,
UpdateConnectedPlayers = 77,
}
}

View File

@ -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;

View File

@ -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)))

View File

@ -18,7 +18,7 @@
<PackageProjectUrl>https://github.com/MrOkiDoki/BattleBit-Community-Server-API</PackageProjectUrl>
<RepositoryUrl>https://github.com/MrOkiDoki/BattleBit-Community-Server-API</RepositoryUrl>
<PackageTags>BattleBit</PackageTags>
<Version>1.0.4</Version>
<Version>1.0.4.1</Version>
</PropertyGroup>
<ItemGroup>