Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion RLBotCS/Conversion/GameStateToFlat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -128,6 +136,12 @@ public static GamePacketT ToFlatBuffers(this GameState gameState)
})
.ToList();

List<RLBot.Flat.TileDamageLevel> tileStates = gameState
.Tiles.Values.OrderBy(tile => tile.SpawnPosition.Y)
.ThenBy(tile => tile.SpawnPosition.X)
.Select(tile => (RLBot.Flat.TileDamageLevel)tile.DamageLevel)
.ToList();

List<PlayerInfoT> players = new(gameState.GameCars.Count);
foreach (var car in gameState.GameCars.Values)
{
Expand Down Expand Up @@ -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,
}
);
}
Expand All @@ -216,6 +235,7 @@ public static GamePacketT ToFlatBuffers(this GameState gameState)
Teams = teams,
BoostPads = boostStates,
Players = players,
Tiles = tileStates,
};
}
}
2 changes: 1 addition & 1 deletion RLBotCS/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
Expand Down
26 changes: 26 additions & 0 deletions RLBotCS/Server/ServerMessage/DistributeFieldInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public ServerAction Execute(ServerContext context)
{
BoostPads = new List<BoostPadT>(GameState.BoostPads.Count),
Goals = new List<GoalInfoT>(GameState.Goals.Count),
Tiles = new List<TileT>(GameState.Tiles.Count),
};

foreach (GoalInfo goal in GameState.Goals.Values)
Expand Down Expand Up @@ -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)
{
Expand Down
Binary file modified RLBotCS/lib/Bridge.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion flatbuffers-schema
Loading