diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-11-18 22:11:30 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-18 22:11:30 -0600 |
| commit | befa22c1f3ff0c1f0cb745b3f4e736910c053a8b (patch) | |
| tree | 17037d0d62d1259366d9385c47236774886b4002 /azalea-protocol/src/packets | |
| parent | 6c6eb5572b869e3199adc560b101fa663c01b5d2 (diff) | |
| download | azalea-drasl-befa22c1f3ff0c1f0cb745b3f4e736910c053a8b.tar.xz | |
Player List (#41)
* keep track of player list
* send player update events
Diffstat (limited to 'azalea-protocol/src/packets')
| -rwxr-xr-x | azalea-protocol/src/packets/game/clientbound_player_info_packet.rs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs index 84218842..dea3b784 100755 --- a/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs @@ -1,8 +1,11 @@ use crate::packets::login::serverbound_hello_packet::ProfilePublicKeyData; +use azalea_auth::game_profile::ProfilePropertyValue; use azalea_buf::{BufReadError, McBuf}; use azalea_buf::{McBufReadable, McBufWritable}; use azalea_chat::Component; +use azalea_core::GameType; use azalea_protocol_macros::ClientboundGamePacket; +use std::collections::HashMap; use std::io::{Cursor, Write}; use uuid::Uuid; @@ -21,21 +24,13 @@ pub enum Action { } #[derive(Clone, Debug, McBuf)] -pub struct PlayerProperty { - pub name: String, - pub value: String, - pub signature: Option<String>, -} - -#[derive(Clone, Debug, McBuf)] pub struct AddPlayer { pub uuid: Uuid, pub name: String, - pub properties: Vec<PlayerProperty>, - #[var] - pub gamemode: u32, + pub properties: HashMap<String, ProfilePropertyValue>, + pub gamemode: GameType, #[var] - pub ping: i32, + pub latency: i32, pub display_name: Option<Component>, pub profile_public_key: Option<ProfilePublicKeyData>, } @@ -43,15 +38,14 @@ pub struct AddPlayer { #[derive(Clone, Debug, McBuf)] pub struct UpdateGameMode { pub uuid: Uuid, - #[var] - pub gamemode: u32, + pub gamemode: GameType, } #[derive(Clone, Debug, McBuf)] pub struct UpdateLatency { pub uuid: Uuid, #[var] - pub ping: i32, + pub latency: i32, } #[derive(Clone, Debug, McBuf)] |
