Skip to content

Commit

Permalink
prevent typing in chat from kicking players
Browse files Browse the repository at this point in the history
fixes #24
  • Loading branch information
dyc3 committed Sep 7, 2022
1 parent 6215373 commit 946491f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/protocol/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ 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 {
Expand Down
21 changes: 21 additions & 0 deletions src/protocol/packets/c2s.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@ pub mod play {
salt: u64,
signature: Vec<u8>,
signed_preview: bool,
acknowledgement: LastSeenMessageListAcknowledgement,
}
}

def_struct! {
LastSeenMessageList {
entries: Vec<LastSeenMessageListEntry>,
}
}

def_struct! {
LastSeenMessageListEntry {
profile_id: Uuid,
last_signature: Vec<u8>,
}
}

def_struct! {
LastSeenMessageListAcknowledgement {
last_seen: LastSeenMessageList,
last_received: Option<LastSeenMessageListEntry>
}
}

Expand Down

0 comments on commit 946491f

Please sign in to comment.