mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-23 14:31:30 +11:00
Update definition for ChatMessage and CommandExecution (#30)
* Update ChatMessage definition, prevent typing in chat from kicking players fixes #24 * Update definition for CommandExecution
This commit is contained in:
parent
ce02b50623
commit
2b3794da7e
|
@ -200,7 +200,10 @@ impl<R: AsyncRead + Unpin> Decoder<R> {
|
|||
.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 {
|
||||
|
|
|
@ -122,9 +122,16 @@ pub mod play {
|
|||
}
|
||||
}
|
||||
|
||||
def_struct! {
|
||||
MessageAcknowledgmentList {
|
||||
entries: Vec<MessageAcknowledgmentEntry>,
|
||||
}
|
||||
}
|
||||
|
||||
def_struct! {
|
||||
MessageAcknowledgment {
|
||||
entry: Option<MessageAcknowledgmentEntry>,
|
||||
last_seen: MessageAcknowledgmentList,
|
||||
last_received: Option<MessageAcknowledgmentEntry>,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,11 +142,21 @@ pub mod play {
|
|||
}
|
||||
}
|
||||
|
||||
def_struct! {
|
||||
ArgumentSignatureEntry {
|
||||
name: BoundedString<0, 16>,
|
||||
signature: Vec<u8>,
|
||||
}
|
||||
}
|
||||
|
||||
def_struct! {
|
||||
CommandExecution {
|
||||
command: String, // TODO: bounded?
|
||||
// TODO: timestamp, arg signatures
|
||||
command: BoundedString<0, 256>,
|
||||
timestamp: u64,
|
||||
salt: u64,
|
||||
arg_sig: Vec<ArgumentSignatureEntry>,
|
||||
signed_preview: bool,
|
||||
acknowledgement: MessageAcknowledgment,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,6 +167,7 @@ pub mod play {
|
|||
salt: u64,
|
||||
signature: Vec<u8>,
|
||||
signed_preview: bool,
|
||||
acknowledgement: MessageAcknowledgment,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue