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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions dfhack-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/AdventureControl.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/Basic.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/BasicApi.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/CoreProtocol.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/DwarfControl.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/ItemdefInstrument.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/RemoteFortressReader.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/isoworldremote.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/rename.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/stockpiles.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)]
Expand Down
5 changes: 2 additions & 3 deletions dfhack-proto/src/generated/messages/ui_sidebar_mode.rs
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)]
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ 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,
}

// 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,
Expand All @@ -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<TMessage: protobuf::MessageFull> {
pub id: i16,
pub message: TMessage,
Expand Down