From befa22c1f3ff0c1f0cb745b3f4e736910c053a8b Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 18 Nov 2022 22:11:30 -0600 Subject: Player List (#41) * keep track of player list * send player update events --- .../packets/game/clientbound_player_info_packet.rs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'azalea-protocol/src/packets') 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; @@ -20,22 +23,14 @@ pub enum Action { RemovePlayer(Vec), } -#[derive(Clone, Debug, McBuf)] -pub struct PlayerProperty { - pub name: String, - pub value: String, - pub signature: Option, -} - #[derive(Clone, Debug, McBuf)] pub struct AddPlayer { pub uuid: Uuid, pub name: String, - pub properties: Vec, - #[var] - pub gamemode: u32, + pub properties: HashMap, + pub gamemode: GameType, #[var] - pub ping: i32, + pub latency: i32, pub display_name: Option, pub profile_public_key: Option, } @@ -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)] -- cgit v1.2.3