1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

clientbound add player packet

This commit is contained in:
mat 2022-05-07 11:22:03 -05:00
parent 34058b2528
commit 79bf577130
5 changed files with 21 additions and 1 deletions

View file

@ -255,6 +255,9 @@ impl Client {
GamePacket::ClientboundSetEntityLinkPacket(p) => {
println!("Got set entity link packet {:?}", p);
}
GamePacket::ClientboundAddPlayerPacket(p) => {
println!("Got add player packet {:?}", p);
}
_ => panic!("Unexpected packet {:?}", packet),
}
println!();

View file

@ -10,6 +10,7 @@ use crate::ServerIpAddress;
use azalea_crypto::{Aes128CfbDec, Aes128CfbEnc};
use tokio::net::TcpStream;
#[derive(Debug, Clone, Copy)]
pub enum PacketFlow {
ClientToServer,
ServerToClient,

View file

@ -0,0 +1,14 @@
use packet_macros::GamePacket;
use uuid::Uuid;
#[derive(Clone, Debug, GamePacket)]
pub struct ClientboundAddPlayerPacket {
#[varint]
pub id: i32,
pub uuid: Uuid,
pub x: f64,
pub y: f64,
pub z: f64,
pub x_rot: i8,
pub y_rot: i8,
}

View file

@ -1,5 +1,6 @@
pub mod clientbound_add_entity_packet;
pub mod clientbound_add_mob_packet;
pub mod clientbound_add_player_packet;
pub mod clientbound_change_difficulty_packet;
pub mod clientbound_custom_payload_packet;
pub mod clientbound_declare_commands_packet;
@ -33,6 +34,7 @@ declare_state_packets!(
Clientbound => {
0x00: clientbound_add_entity_packet::ClientboundAddEntityPacket,
0x02: clientbound_add_mob_packet::ClientboundAddMobPacket,
0x04: clientbound_add_player_packet::ClientboundAddPlayerPacket,
0x0e: clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket,
0x12: clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket,
0x1a: clientbound_disconnect_packet::ClientboundDisconnectPacket,

View file

@ -5,7 +5,7 @@ async fn main() {
println!("Hello, world!");
// let address = "95.111.249.143:10000";
let address = "172.23.192.1:58024";
let address = "172.23.192.1:53911";
// let response = azalea_client::ping::ping_server(&address.try_into().unwrap())
// .await
// .unwrap();