mirror of
https://github.com/italicsjenga/valence.git
synced 2025-01-11 15:21:31 +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")?;
|
.context("decoding packet after decompressing")?;
|
||||||
ensure!(
|
ensure!(
|
||||||
decompressed.is_empty(),
|
decompressed.is_empty(),
|
||||||
"packet contents were not read completely"
|
format!(
|
||||||
|
"packet contents were not read completely, {} remaining bytes",
|
||||||
|
decompressed.len()
|
||||||
|
)
|
||||||
);
|
);
|
||||||
packet
|
packet
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -122,9 +122,16 @@ pub mod play {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def_struct! {
|
||||||
|
MessageAcknowledgmentList {
|
||||||
|
entries: Vec<MessageAcknowledgmentEntry>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def_struct! {
|
def_struct! {
|
||||||
MessageAcknowledgment {
|
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! {
|
def_struct! {
|
||||||
CommandExecution {
|
CommandExecution {
|
||||||
command: String, // TODO: bounded?
|
command: BoundedString<0, 256>,
|
||||||
// TODO: timestamp, arg signatures
|
timestamp: u64,
|
||||||
|
salt: u64,
|
||||||
|
arg_sig: Vec<ArgumentSignatureEntry>,
|
||||||
signed_preview: bool,
|
signed_preview: bool,
|
||||||
|
acknowledgement: MessageAcknowledgment,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +167,7 @@ pub mod play {
|
||||||
salt: u64,
|
salt: u64,
|
||||||
signature: Vec<u8>,
|
signature: Vec<u8>,
|
||||||
signed_preview: bool,
|
signed_preview: bool,
|
||||||
|
acknowledgement: MessageAcknowledgment,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue