Skip to content

Commit

Permalink
Fix command packets (#155)
Browse files Browse the repository at this point in the history
* Fix copy&paste mistake from chat command signed packet to chat command packet

* Bugfix

---------

Co-authored-by: EnderKill98 <[email protected]>
  • Loading branch information
EnderKill98 and EnderKill98 authored Jun 16, 2024
1 parent f9e20fd commit 350e32d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
14 changes: 1 addition & 13 deletions azalea-client/src/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,7 @@ fn handle_send_chat_kind_event(
.get(),
ChatPacketKind::Command => {
// TODO: chat signing
ServerboundChatCommandPacket {
command: content,
timestamp: SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("Time shouldn't be before epoch")
.as_millis()
.try_into()
.expect("Instant should fit into a u64"),
salt: azalea_crypto::make_salt(),
argument_signatures: vec![],
last_seen_messages: LastSeenMessagesUpdate::default(),
}
.get()
ServerboundChatCommandPacket { command: content }.get()
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
use super::serverbound_chat_packet::LastSeenMessagesUpdate;
use azalea_buf::McBuf;
use azalea_crypto::MessageSignature;
use azalea_protocol_macros::ServerboundGamePacket;

#[derive(Clone, Debug, McBuf, ServerboundGamePacket)]
pub struct ServerboundChatCommandPacket {
pub command: String,
pub timestamp: u64,
pub salt: u64,
pub argument_signatures: Vec<ArgumentSignature>,
pub last_seen_messages: LastSeenMessagesUpdate,
}

#[derive(Clone, Debug, McBuf)]
pub struct ArgumentSignature {
pub name: String,
pub signature: MessageSignature,
}

0 comments on commit 350e32d

Please sign in to comment.