diff options
| author | mat <github@matdoes.dev> | 2022-07-10 23:43:09 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-07-10 23:43:09 -0500 |
| commit | ec0b6ec06c1607d7bfc9df2fca220f59c700e07b (patch) | |
| tree | 2499278bf20badd6b411404a80bbdedc788453dc /azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs | |
| parent | 5e3a6066f87b1a03e0303b41cee82103a709b02a (diff) | |
| download | azalea-drasl-ec0b6ec06c1607d7bfc9df2fca220f59c700e07b.tar.xz | |
1.19.1-pre4
Diffstat (limited to 'azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs')
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs index 4aac93f4..f5df8869 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs @@ -1,22 +1,50 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use azalea_crypto::SaltSignaturePair; +use azalea_crypto::{MessageSignature, SignedMessageHeader}; use packet_macros::GamePacket; +use uuid::Uuid; #[derive(Clone, Debug, McBuf, GamePacket)] pub struct ClientboundPlayerChatPacket { - pub signed_content: Component, + pub message: PlayerChatMessage, + pub chat_type: ChatTypeBound, +} + +#[derive(Copy, Clone, Debug, McBuf)] +pub enum ChatType { + Chat = 0, + SayCommand = 1, + MsgCommandIncoming = 2, + MsgCommandOutgoing = 3, + TeamMsgCommandIncoming = 4, + EmoteCommand = 5, +} + +#[derive(Clone, Debug, McBuf)] +pub struct ChatTypeBound { + pub chat_type: ChatType, + pub name: Component, + pub target_name: Component, +} + +#[derive(Clone, Debug, McBuf)] +pub struct PlayerChatMessage { + pub signed_header: SignedMessageHeader, + pub header_signature: MessageSignature, + pub signed_body: SignedMessageBody, pub unsigned_content: Option<Component>, - #[var] - pub type_id: i32, - pub sender: ChatSender, +} + +#[derive(Clone, Debug, McBuf)] +pub struct SignedMessageBody { + pub content: Component, pub timestamp: u64, - pub salt_signature: SaltSignaturePair, + pub salt: u64, + pub last_seen: Vec<LastSeen>, } #[derive(Clone, Debug, McBuf)] -pub struct ChatSender { - pub uuid: uuid::Uuid, - pub name: Component, - pub team_name: Option<Component>, +pub struct LastSeen { + pub profile_id: Uuid, + pub last_signature: MessageSignature, } |
