diff --git a/src/protocol/codec.rs b/src/protocol/codec.rs index 0054372..062896f 100644 --- a/src/protocol/codec.rs +++ b/src/protocol/codec.rs @@ -200,7 +200,10 @@ impl Decoder { .context("decoding packet after decompressing")?; ensure!( decompressed.is_empty(), - "packet contents were not read completely" + format!( + "packet contents were not read completely, {} remaining bytes", + decompressed.len() + ) ); packet } else { diff --git a/src/protocol/packets/c2s.rs b/src/protocol/packets/c2s.rs index 735183f..5237e10 100644 --- a/src/protocol/packets/c2s.rs +++ b/src/protocol/packets/c2s.rs @@ -122,9 +122,16 @@ pub mod play { } } + def_struct! { + MessageAcknowledgmentList { + entries: Vec, + } + } + def_struct! { MessageAcknowledgment { - entry: Option, + last_seen: MessageAcknowledgmentList, + last_received: Option, } } @@ -135,11 +142,21 @@ pub mod play { } } + def_struct! { + ArgumentSignatureEntry { + name: BoundedString<0, 16>, + signature: Vec, + } + } + def_struct! { CommandExecution { - command: String, // TODO: bounded? - // TODO: timestamp, arg signatures + command: BoundedString<0, 256>, + timestamp: u64, + salt: u64, + arg_sig: Vec, signed_preview: bool, + acknowledgement: MessageAcknowledgment, } } @@ -150,6 +167,7 @@ pub mod play { salt: u64, signature: Vec, signed_preview: bool, + acknowledgement: MessageAcknowledgment, } }