aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-07 11:22:03 -0500
committermat <github@matdoes.dev>2022-05-07 11:22:03 -0500
commit79bf5771303c70115cba09ac55c7b7a2d3e32091 (patch)
treedb0b42f593cc45ca0a4f82f73a8bf8a116d3c693 /azalea-protocol
parent34058b25283947137216964462a1370d08010066 (diff)
downloadazalea-drasl-79bf5771303c70115cba09ac55c7b7a2d3e32091.tar.xz
clientbound add player packet
Diffstat (limited to 'azalea-protocol')
-rwxr-xr-xazalea-protocol/src/connect.rs1
-rw-r--r--azalea-protocol/src/packets/game/clientbound_add_player_packet.rs14
-rwxr-xr-xazalea-protocol/src/packets/game/mod.rs2
3 files changed, 17 insertions, 0 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs
index e9d898d6..67771d8e 100755
--- a/azalea-protocol/src/connect.rs
+++ b/azalea-protocol/src/connect.rs
@@ -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,
diff --git a/azalea-protocol/src/packets/game/clientbound_add_player_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_player_packet.rs
new file mode 100644
index 00000000..9fe086cb
--- /dev/null
+++ b/azalea-protocol/src/packets/game/clientbound_add_player_packet.rs
@@ -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,
+}
diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs
index bdba6d2b..81980723 100755
--- a/azalea-protocol/src/packets/game/mod.rs
+++ b/azalea-protocol/src/packets/game/mod.rs
@@ -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,