Skip to content

Commit

Permalink
Update to newest flatbuffers spec
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Jan 10, 2025
1 parent e1b4a51 commit f40fcd4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 36 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rlbot_flatbuffers"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
description = "A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers"
repository = "https://github.com/VirxEC/rlbot_flatbuffers_py"
Expand Down
9 changes: 6 additions & 3 deletions codegen/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::literal_string_with_formatting_args)]

mod class_inject;
mod enums;
mod generator;
Expand Down Expand Up @@ -37,7 +39,7 @@ impl PythonBindType {
"SphereShape",
"CylinderShape",
"BoostPadState",
"GameInfo",
"MatchInfo",
"TeamInfo",
"Physics",
"Vector2",
Expand Down Expand Up @@ -184,8 +186,9 @@ fn mod_rs_generator(type_data: &[PythonBindType]) -> io::Result<()> {

fn run_flatc() -> io::Result<()> {
println!("cargo:rerun-if-changed=flatbuffers-schema/comms.fbs");
println!("cargo:rerun-if-changed=flatbuffers-schema/gamestate.fbs");
println!("cargo:rerun-if-changed=flatbuffers-schema/matchstart.fbs");
println!("cargo:rerun-if-changed=flatbuffers-schema/gamedata.fbs");
println!("cargo:rerun-if-changed=flatbuffers-schema/gamestatemanip.fbs");
println!("cargo:rerun-if-changed=flatbuffers-schema/matchconfig.fbs");
println!("cargo:rerun-if-changed=flatbuffers-schema/rendering.fbs");
println!("cargo:rerun-if-changed=flatbuffers-schema/rlbot.fbs");

Expand Down
2 changes: 1 addition & 1 deletion flatbuffers-schema
8 changes: 4 additions & 4 deletions pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ def random_script_config():
except InvalidFlatbuffer as e:
print(e)

match_settings = MatchSettings(
game_path=random_string(),
match_settings = MatchConfiguration(
launcher_arg=random_string(),
game_map_upk=random_string(),
player_configurations=[random_player_config() for _ in range(128)],
script_configurations=[random_script_config() for _ in range(8)],
mutator_settings=MutatorSettings(),
mutators=MutatorSettings(),
)

data = match_settings.pack()
Expand All @@ -151,7 +151,7 @@ def random_script_config():

print()

ballPred = BallPrediction([PredictionSlice(1) for _ in range(5 * 120)])
ballPred = BallPrediction([PredictionSlice(1) for _ in range(6 * 120)])
data = ballPred.pack()
print(f"BallPrediction size: {len(data)} bytes")

Expand Down
48 changes: 24 additions & 24 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)]
pub mod generated;

#[allow(clippy::enum_variant_names, unused_imports)]
#[allow(clippy::enum_variant_names, clippy::useless_conversion, unused_imports)]
mod python;

use pyo3::{create_exception, exceptions::PyValueError, prelude::*, PyClass};
Expand Down Expand Up @@ -165,20 +165,20 @@ pynamedmodule! {
name: rlbot_flatbuffers,
classes: [
AirState,
AudioOption,
AudioMutator,
BallAnchor,
BallBouncinessOption,
BallBouncinessMutator,
BallInfo,
BallMaxSpeedOption,
BallMaxSpeedMutator,
BallPrediction,
BallSizeOption,
BallTypeOption,
BallWeightOption,
BallSizeMutator,
BallTypeMutator,
BallWeightMutator,
Bool,
BoostOption,
BoostMutator,
BoostPad,
BoostPadState,
BoostStrengthOption,
BoostStrengthMutator,
BoxShape,
CarAnchor,
CollisionShape,
Expand All @@ -190,7 +190,7 @@ pynamedmodule! {
ControllerState,
CustomBot,
CylinderShape,
DemolishOption,
DemolishMutator,
DesiredBallState,
DesiredBoostState,
DesiredCarState,
Expand All @@ -200,26 +200,26 @@ pynamedmodule! {
ExistingMatchBehavior,
FieldInfo,
Float,
GameEventOption,
GameInfo,
GameEventMutator,
GameMode,
GamePacket,
GameSpeedOption,
GameStatus,
GameSpeedMutator,
GoalInfo,
GravityOption,
GravityMutator,
Human,
Launcher,
Line3D,
LoadoutPaint,
MatchComm,
MatchLength,
MatchSettings,
MaxScore,
MaxTimeOption,
MultiBall,
MatchConfiguration,
MatchInfo,
MatchLengthMutator,
MatchPhase,
MaxScoreMutator,
MaxTimeMutator,
MultiBallMutator,
MutatorSettings,
OvertimeOption,
OvertimeMutator,
PartyMember,
Physics,
PlayerClass,
Expand All @@ -239,13 +239,13 @@ pynamedmodule! {
RenderGroup,
RenderMessage,
RenderType,
RespawnTimeOption,
RespawnTimeMutator,
Rotator,
RotatorPartial,
RumbleOption,
RumbleMutator,
ScoreInfo,
ScriptConfiguration,
SeriesLengthOption,
SeriesLengthMutator,
SetLoadout,
SphereShape,
StartCommand,
Expand Down

0 comments on commit f40fcd4

Please sign in to comment.