diff --git a/Cargo.lock b/Cargo.lock index c96e2ce..8e626a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -314,7 +314,7 @@ dependencies = [ [[package]] name = "rlbot-flatbuffers-py" -version = "0.1.2" +version = "0.1.3" dependencies = [ "flatbuffers", "get-size", diff --git a/Cargo.toml b/Cargo.toml index 81321b4..4d66ba8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rlbot-flatbuffers-py" -version = "0.1.2" +version = "0.1.3" edition = "2021" description = "A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers" repository = "https://github.com/VirxEC/rlbot-flatbuffers-py" diff --git a/build.rs b/build.rs index bdbf71d..a4e748a 100644 --- a/build.rs +++ b/build.rs @@ -25,7 +25,7 @@ struct PythonBindGenerator { } impl PythonBindGenerator { - const BASE_TYPES: [&'static str; 5] = ["bool", "i32", "f32", "String", "u8"]; + const BASE_TYPES: [&'static str; 6] = ["bool", "i32", "u32", "f32", "String", "u8"]; fn new(path: &Path) -> Option { // get the filename without the extension @@ -1044,6 +1044,7 @@ fn pyi_generator(type_data: &[(String, String, Vec>)]) -> io::Result let primitive_map = [ ("bool", "bool"), ("i32", "int"), + ("u32", "int"), ("f32", "float"), ("String", "str"), ("u8", "int"), @@ -1127,7 +1128,7 @@ fn pyi_generator(type_data: &[(String, String, Vec>)]) -> io::Result if type_name == "bool" { file_contents.push(Cow::Owned(format!(" {variable_name}: Optional[bool]"))); - } else if type_name == "i32" { + } else if type_name == "i32" || type_name == "u32" { file_contents.push(Cow::Owned(format!(" {variable_name}: Optional[int]"))); } else if type_name == "f32" { file_contents.push(Cow::Owned(format!(" {variable_name}: Optional[float]"))); @@ -1170,7 +1171,7 @@ fn pyi_generator(type_data: &[(String, String, Vec>)]) -> io::Result let default_value = match variable_type.as_str() { "bool" => Cow::Borrowed("False"), - "i32" | "f32" | "u8" => Cow::Borrowed("0"), + "i32" | "u32" | "f32" | "u8" => Cow::Borrowed("0"), "String" => Cow::Borrowed("\"\""), t => { if t.starts_with("Vec<") { diff --git a/flatbuffers-schema b/flatbuffers-schema index 40d0d07..1468624 160000 --- a/flatbuffers-schema +++ b/flatbuffers-schema @@ -1 +1 @@ -Subproject commit 40d0d073727d8f93f8c511b670e160445128de8f +Subproject commit 14686241bea255cd7fd332cc26519e89ca531bdf diff --git a/src/lib.rs b/src/lib.rs index 7d2f439..4a31c2d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,6 +48,7 @@ pynamedmodule! { GameStateType, GameSpeedOption, ScoreInfo, + BotSpawnIndex, MessagePacket, DemolishOption, Vector3Partial,