diff --git a/RLBotCS/Conversion/GameStateToFlat.cs b/RLBotCS/Conversion/GameStateToFlat.cs index 9ca3f0e..5347cb0 100644 --- a/RLBotCS/Conversion/GameStateToFlat.cs +++ b/RLBotCS/Conversion/GameStateToFlat.cs @@ -83,7 +83,15 @@ public static GamePacketT ToFlatBuffers(this GameState gameState) ), }; - balls.Add(new() { Physics = ballPhysics, Shape = collisionShape }); + balls.Add( + new() + { + Physics = ballPhysics, + Shape = collisionShape, + ChargeLevel = ball.chargeLevel, + TargetSpeed = ball.targetSpeed, + } + ); } RLBot.Flat.MatchPhase matchPhase = gameState.MatchPhase switch @@ -128,6 +136,12 @@ public static GamePacketT ToFlatBuffers(this GameState gameState) }) .ToList(); + List tileStates = gameState + .Tiles.Values.OrderBy(tile => tile.SpawnPosition.Y) + .ThenBy(tile => tile.SpawnPosition.X) + .Select(tile => (RLBot.Flat.TileDamageLevel)tile.DamageLevel) + .ToList(); + List players = new(gameState.GameCars.Count); foreach (var car in gameState.GameCars.Values) { @@ -205,6 +219,11 @@ public static GamePacketT ToFlatBuffers(this GameState gameState) HasDodged = car.HasDodged, DodgeElapsed = car.DodgeElapsed, DodgeDir = car.DodgeDir.ToVector2T(), + RumbleItem = car.RumbleInfo.Item is not null + ? (RLBot.Flat.RumbleItem)car.RumbleInfo.Item + : null, + TimeUntilNextItem = car.RumbleInfo.TimeUntilNextItem, + MaxTimeUntilNextItem = car.RumbleInfo.MaxTimeUntilNextItem, } ); } @@ -216,6 +235,7 @@ public static GamePacketT ToFlatBuffers(this GameState gameState) Teams = teams, BoostPads = boostStates, Players = players, + Tiles = tileStates, }; } } diff --git a/RLBotCS/Main.cs b/RLBotCS/Main.cs index 0e7dc66..4af0196 100644 --- a/RLBotCS/Main.cs +++ b/RLBotCS/Main.cs @@ -10,7 +10,7 @@ if (args.Length > 0 && args[0] == "--version") { Console.WriteLine( - "RLBotServer v5.0.0-rc.11\n" + "RLBotServer v5.0.0-rc.12\n" + $"Bridge {BridgeVersion.Version}\n" + "@ https://www.rlbot.org & https://github.com/RLBot/core" ); diff --git a/RLBotCS/Server/ServerMessage/DistributeFieldInfo.cs b/RLBotCS/Server/ServerMessage/DistributeFieldInfo.cs index b3506bd..9d1f098 100644 --- a/RLBotCS/Server/ServerMessage/DistributeFieldInfo.cs +++ b/RLBotCS/Server/ServerMessage/DistributeFieldInfo.cs @@ -12,6 +12,7 @@ public ServerAction Execute(ServerContext context) { BoostPads = new List(GameState.BoostPads.Count), Goals = new List(GameState.Goals.Count), + Tiles = new List(GameState.Tiles.Count), }; foreach (GoalInfo goal in GameState.Goals.Values) @@ -63,6 +64,31 @@ public ServerAction Execute(ServerContext context) } ); + foreach (var tile in GameState.Tiles.Values) + { + context.FieldInfo.Tiles.Add( + new TileT + { + Location = new Vector3T + { + X = tile.SpawnPosition.X, + Y = tile.SpawnPosition.Y, + Z = tile.SpawnPosition.Z, + }, + Team = tile.Team, + } + ); + } + + context.FieldInfo.Tiles.Sort( + (a, b) => + { + if (a.Location.Y != b.Location.Y) + return a.Location.Y.CompareTo(b.Location.Y); + return a.Location.X.CompareTo(b.Location.X); + } + ); + // Distribute the field info to all waiting sessions foreach (var writer in context.WaitingFieldInfoRequests) { diff --git a/RLBotCS/lib/Bridge.dll b/RLBotCS/lib/Bridge.dll index c75aeb8..65df1f7 100644 Binary files a/RLBotCS/lib/Bridge.dll and b/RLBotCS/lib/Bridge.dll differ diff --git a/flatbuffers-schema b/flatbuffers-schema index aa6a526..a83ce10 160000 --- a/flatbuffers-schema +++ b/flatbuffers-schema @@ -1 +1 @@ -Subproject commit aa6a52636f63cc84d527ba5432f9eca0420bac47 +Subproject commit a83ce106ed599303d8e5b5e6084687a0665f7edf