diff options
| author | mat <git@matdoes.dev> | 2024-11-28 20:33:39 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-11-28 20:33:39 +0000 |
| commit | f364ad6b210f93f53b6ee8f73c259622e9f37421 (patch) | |
| tree | 4ed81d4d3929b543253d72f411d1a7cab6967c74 /azalea-protocol/src | |
| parent | ae5c0ea8e5e1ac9571b78281c26b7d63d110f5e5 (diff) | |
| download | azalea-drasl-f364ad6b210f93f53b6ee8f73c259622e9f37421.tar.xz | |
switch some packet structs to unit structs
Diffstat (limited to 'azalea-protocol/src')
11 files changed, 17 insertions, 20 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index f64d9eb8..f33ce2a5 100755 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -61,6 +61,7 @@ pub struct WriteConnection<W: ProtocolPacket> { /// resolver, /// connect::Connection, /// packets::{ +/// self, /// ClientIntention, PROTOCOL_VERSION, /// login::{ /// ClientboundLoginPacket, @@ -115,7 +116,13 @@ pub struct WriteConnection<W: ProtocolPacket> { /// return Err("login disconnect".into()); /// } /// ClientboundLoginPacket::CustomQuery(p) => {} -/// ClientboundLoginPacket::CookieRequest(_) => {} +/// ClientboundLoginPacket::CookieRequest(p) => { +/// conn.write(packets::login::ServerboundCookieResponse { +/// key: p.key, +/// payload: None, +/// }) +/// .await?; +/// } /// } /// }; /// diff --git a/azalea-protocol/src/packets/config/c_finish_configuration.rs b/azalea-protocol/src/packets/config/c_finish_configuration.rs index e3f3e5a5..ea6e6d27 100644 --- a/azalea-protocol/src/packets/config/c_finish_configuration.rs +++ b/azalea-protocol/src/packets/config/c_finish_configuration.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; #[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] -pub struct ClientboundFinishConfiguration {} +pub struct ClientboundFinishConfiguration; diff --git a/azalea-protocol/src/packets/config/s_finish_configuration.rs b/azalea-protocol/src/packets/config/s_finish_configuration.rs index a4d94fb1..dc7d4316 100644 --- a/azalea-protocol/src/packets/config/s_finish_configuration.rs +++ b/azalea-protocol/src/packets/config/s_finish_configuration.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; #[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] -pub struct ServerboundFinishConfiguration {} +pub struct ServerboundFinishConfiguration; diff --git a/azalea-protocol/src/packets/game/c_chunk_batch_start.rs b/azalea-protocol/src/packets/game/c_chunk_batch_start.rs index 8b0555dc..b5cd1ba2 100644 --- a/azalea-protocol/src/packets/game/c_chunk_batch_start.rs +++ b/azalea-protocol/src/packets/game/c_chunk_batch_start.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] -pub struct ClientboundChunkBatchStart {} +pub struct ClientboundChunkBatchStart; diff --git a/azalea-protocol/src/packets/game/c_player_chat.rs b/azalea-protocol/src/packets/game/c_player_chat.rs index 0e9960f2..3628fa95 100644 --- a/azalea-protocol/src/packets/game/c_player_chat.rs +++ b/azalea-protocol/src/packets/game/c_player_chat.rs @@ -88,16 +88,6 @@ pub struct MessageSignatureCache { pub entries: Vec<Option<MessageSignature>>, } -// impl MessageSignatureCache { -// pub fn unpacker(&self) -> impl Fn(u32) -> Option<SignedMessageBody> { - -// } -// } - -// impl PackedSignedMessageBody { -// pub fn unpack(&self, unpacker: impl Fn(u32) -> Option<SignedMessageBody>) -// {} } - impl ClientboundPlayerChat { /// Returns the content of the message. If you want to get the FormattedText /// for the whole message including the sender part, use diff --git a/azalea-protocol/src/packets/game/c_player_combat_enter.rs b/azalea-protocol/src/packets/game/c_player_combat_enter.rs index 8c344b49..ee58e277 100755 --- a/azalea-protocol/src/packets/game/c_player_combat_enter.rs +++ b/azalea-protocol/src/packets/game/c_player_combat_enter.rs @@ -3,4 +3,4 @@ use azalea_protocol_macros::ClientboundGamePacket; /// Unused in vanilla. #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] -pub struct ClientboundPlayerCombatEnter {} +pub struct ClientboundPlayerCombatEnter; diff --git a/azalea-protocol/src/packets/game/c_start_configuration.rs b/azalea-protocol/src/packets/game/c_start_configuration.rs index 6955b70d..d1c60d5e 100644 --- a/azalea-protocol/src/packets/game/c_start_configuration.rs +++ b/azalea-protocol/src/packets/game/c_start_configuration.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] -pub struct ClientboundStartConfiguration {} +pub struct ClientboundStartConfiguration; diff --git a/azalea-protocol/src/packets/game/s_client_tick_end.rs b/azalea-protocol/src/packets/game/s_client_tick_end.rs index d8d93049..221525ec 100644 --- a/azalea-protocol/src/packets/game/s_client_tick_end.rs +++ b/azalea-protocol/src/packets/game/s_client_tick_end.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] -pub struct ServerboundClientTickEnd {} +pub struct ServerboundClientTickEnd; diff --git a/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs b/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs index 58e27abb..3e137494 100644 --- a/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs +++ b/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] -pub struct ServerboundConfigurationAcknowledged {} +pub struct ServerboundConfigurationAcknowledged; diff --git a/azalea-protocol/src/packets/login/s_login_acknowledged.rs b/azalea-protocol/src/packets/login/s_login_acknowledged.rs index e36648b6..263d58c6 100644 --- a/azalea-protocol/src/packets/login/s_login_acknowledged.rs +++ b/azalea-protocol/src/packets/login/s_login_acknowledged.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundLoginPacket; #[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] -pub struct ServerboundLoginAcknowledged {} +pub struct ServerboundLoginAcknowledged; diff --git a/azalea-protocol/src/packets/status/s_status_request.rs b/azalea-protocol/src/packets/status/s_status_request.rs index 662d74bf..53fdbcaa 100755 --- a/azalea-protocol/src/packets/status/s_status_request.rs +++ b/azalea-protocol/src/packets/status/s_status_request.rs @@ -2,4 +2,4 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundStatusPacket; #[derive(Clone, Debug, AzBuf, ServerboundStatusPacket)] -pub struct ServerboundStatusRequest {} +pub struct ServerboundStatusRequest; |
