aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs
diff options
context:
space:
mode:
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.rs48
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,
}