diff --git a/CHANGELOG.md b/CHANGELOG.md index bbb5fcd..01dd46a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) ### Changed - All the request now return a reply that contain both the data and the corresponding text fragments +- General dependency update ### Removed diff --git a/Cargo.toml b/Cargo.toml index db200cc..c8a7b51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,21 +18,21 @@ categories = ["api-bindings", "game-development", "games"] exclude = ["images/"] [dependencies] -protobuf = "=3.4.0" +protobuf = "=3.7.2" byteorder = "1.5.0" -num_enum = "0.7.1" -log = "0.4.20" -derive_more = "0.99.17" +num_enum = "0.7.3" +log = "0.4.26" +derive_more = { version = "2.0", features = ["display"] } dfhack-proto = { version = "0.9.0", path = "dfhack-proto" } -thiserror = "1.0.50" +thiserror = "2" [dev-dependencies] bmp = "0.5.0" -ctor = "0.2.5" -lazy_static = "1.4.0" -rand = "0.8.5" -env_logger = "0.11.2" +ctor = "0.4.1" +lazy_static = "1.5.0" +rand = "0.9.0" +env_logger = "0.11.7" [features] diff --git a/dfhack-proto/Cargo.toml b/dfhack-proto/Cargo.toml index 40a3386..c0c0a7f 100644 --- a/dfhack-proto/Cargo.toml +++ b/dfhack-proto/Cargo.toml @@ -13,11 +13,11 @@ categories = ["api-bindings", "game-development", "games"] reflection = [] [dependencies] -protobuf = "=3.4.0" +protobuf = "=3.7.2" [build-dependencies] -protobuf-codegen = "=3.4.0" -protobuf = "=3.4.0" +protobuf-codegen = "=3.7.2" +protobuf = "=3.7.2" dfhack-proto-srcs = { version = "0.9.0", path = "../dfhack-proto-srcs" } regex = "1" heck = "0.5.0" diff --git a/dfhack-proto/src/generated/messages/AdventureControl.rs b/dfhack-proto/src/generated/messages/AdventureControl.rs index 030b126..ece07ba 100644 --- a/dfhack-proto/src/generated/messages/AdventureControl.rs +++ b/dfhack-proto/src/generated/messages/AdventureControl.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:AdventureControl.MoveCommandParams) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/Basic.rs b/dfhack-proto/src/generated/messages/Basic.rs index bc8caa2..9929539 100644 --- a/dfhack-proto/src/generated/messages/Basic.rs +++ b/dfhack-proto/src/generated/messages/Basic.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:dfproto.EnumItemName) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/BasicApi.rs b/dfhack-proto/src/generated/messages/BasicApi.rs index f54d46d..90c6fd9 100644 --- a/dfhack-proto/src/generated/messages/BasicApi.rs +++ b/dfhack-proto/src/generated/messages/BasicApi.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:dfproto.GetWorldInfoOut) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/CoreProtocol.rs b/dfhack-proto/src/generated/messages/CoreProtocol.rs index 2d8eeac..78f9428 100644 --- a/dfhack-proto/src/generated/messages/CoreProtocol.rs +++ b/dfhack-proto/src/generated/messages/CoreProtocol.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:dfproto.CoreTextFragment) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/DwarfControl.rs b/dfhack-proto/src/generated/messages/DwarfControl.rs index 1f8ae4a..d4761f7 100644 --- a/dfhack-proto/src/generated/messages/DwarfControl.rs +++ b/dfhack-proto/src/generated/messages/DwarfControl.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:DwarfControl.SidebarState) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/ItemdefInstrument.rs b/dfhack-proto/src/generated/messages/ItemdefInstrument.rs index b42a82b..d471117 100644 --- a/dfhack-proto/src/generated/messages/ItemdefInstrument.rs +++ b/dfhack-proto/src/generated/messages/ItemdefInstrument.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:ItemdefInstrument.InstrumentFlags) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/RemoteFortressReader.rs b/dfhack-proto/src/generated/messages/RemoteFortressReader.rs index 8407575..441fca0 100644 --- a/dfhack-proto/src/generated/messages/RemoteFortressReader.rs +++ b/dfhack-proto/src/generated/messages/RemoteFortressReader.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; #[derive(Hash, Eq)] // @@protoc_insertion_point(message:RemoteFortressReader.Coord) diff --git a/dfhack-proto/src/generated/messages/isoworldremote.rs b/dfhack-proto/src/generated/messages/isoworldremote.rs index 9b1145c..6d594b8 100644 --- a/dfhack-proto/src/generated/messages/isoworldremote.rs +++ b/dfhack-proto/src/generated/messages/isoworldremote.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:isoworldremote.ColorDefinition) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/rename.rs b/dfhack-proto/src/generated/messages/rename.rs index bfab5e9..692af2b 100644 --- a/dfhack-proto/src/generated/messages/rename.rs +++ b/dfhack-proto/src/generated/messages/rename.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:dfproto.RenameSquadIn) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/stockpiles.rs b/dfhack-proto/src/generated/messages/stockpiles.rs index 81e744e..36108bf 100644 --- a/dfhack-proto/src/generated/messages/stockpiles.rs +++ b/dfhack-proto/src/generated/messages/stockpiles.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; // @@protoc_insertion_point(message:dfstockpiles.StockpileSettings) #[derive(PartialEq,Clone,Default,Debug)] diff --git a/dfhack-proto/src/generated/messages/ui_sidebar_mode.rs b/dfhack-proto/src/generated/messages/ui_sidebar_mode.rs index 4031fcb..ee628e5 100644 --- a/dfhack-proto/src/generated/messages/ui_sidebar_mode.rs +++ b/dfhack-proto/src/generated/messages/ui_sidebar_mode.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.4.0. Do not edit +// This file is generated by rust-protobuf 3.7.2. Do not edit // .proto file is parsed by pure // @generated @@ -9,7 +9,6 @@ #![allow(unused_attributes)] #![cfg_attr(rustfmt, rustfmt::skip)] -#![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] @@ -23,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2; #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)] // @@protoc_insertion_point(enum:proto.enums.ui_sidebar_mode.ui_sidebar_mode) diff --git a/src/message.rs b/src/message.rs index 52e8a61..69a5638 100644 --- a/src/message.rs +++ b/src/message.rs @@ -45,7 +45,7 @@ pub enum CommandResult { // https://docs.dfhack.org/en/stable/docs/Remote.html#handshake-request // https://docs.dfhack.org/en/stable/docs/Remote.html#handshake-reply #[derive(Display)] -#[display(fmt = "Handshake {} version {}", magic, version)] +#[display("Handshake {} version {}", magic, version)] pub struct Handshake { pub magic: String, pub version: i32, @@ -53,7 +53,7 @@ pub struct Handshake { // https://docs.dfhack.org/en/stable/docs/Remote.html#header #[derive(Display)] -#[display(fmt = "Header id {}, size {}", id, size)] +#[display("Header id {}, size {}", id, size)] pub struct Header { pub id: i16, padding: i16, @@ -62,7 +62,7 @@ pub struct Header { // https://docs.dfhack.org/en/stable/docs/Remote.html#request #[derive(Display)] -#[display(fmt = "protobuf message id {}", id)] +#[display("protobuf message id {}", id)] pub struct Request { pub id: i16, pub message: TMessage,