-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With now the state added the the const name of the packet some of them needed to be repare by adding the name and/or the side
- Loading branch information
Showing
21 changed files
with
89 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,6 +311,7 @@ pub enum PacketState { | |
Status, | ||
Login, | ||
Play, | ||
Configuration, | ||
} | ||
|
||
#[allow(dead_code)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/valence_protocol/src/packets/play/bundle_splitter_s2c.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
use crate::{packet_id, Decode, Encode, Packet}; | ||
use crate::{PacketSide, Decode, Encode, Packet}; | ||
|
||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
#[packet(id = packet_id::BUNDLE_SPLITTER)] | ||
#[packet(name = "BUNDLE_SPLITTER", side = PacketSide::Clientbound)] | ||
pub struct BundleSplitterS2c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/valence_protocol/src/packets/play/look_and_on_ground_c2s.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/valence_protocol/src/packets/play/move_relative_s2c.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/valence_protocol/src/packets/play/on_ground_only_c2s.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
use crate::{packet_id, Decode, Encode, Packet}; | ||
use crate::{PacketSide, Decode, Encode, Packet}; | ||
|
||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
#[packet(id = packet_id::ON_GROUND_ONLY)] | ||
#[packet(name = "ON_GROUND_ONLY", side = PacketSide::Serverbound)] | ||
pub struct OnGroundOnlyC2s { | ||
pub on_ground: bool, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
use crate::{Decode, Encode, Packet}; | ||
|
||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
#[packet(name = "COMMON_PING_S2C")] | ||
pub struct PlayPingS2c { | ||
pub id: i32, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
use crate::{Decode, Encode, Packet}; | ||
|
||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
#[packet(name = "COMMON_PONG_C2S")] | ||
pub struct PlayPongC2s { | ||
pub id: i32, | ||
} |
52 changes: 27 additions & 25 deletions
52
crates/valence_protocol/src/packets/play/player_spawn_s2c.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
use uuid::Uuid; | ||
use valence_math::DVec3; | ||
// use uuid::Uuid; | ||
// use valence_math::DVec3; | ||
|
||
use crate::{ByteAngle, Decode, Encode, Packet, VarInt}; | ||
// use crate::{ByteAngle, Decode, Encode, Packet, VarInt}; | ||
|
||
/// This packet is sent by the server when a player comes into visible range, | ||
/// not when a player joins. | ||
/// | ||
/// This packet must be sent after the Player Info Update packet that adds the | ||
/// player data for the client to use when spawning a player. If the Player Info | ||
/// for the player spawned by this packet is not present when this packet | ||
/// arrives, Notchian clients will not spawn the player entity. The Player Info | ||
/// packet includes skin/cape data. | ||
/// | ||
/// Servers can, however, safely spawn player entities for players not in | ||
/// visible range. The client appears to handle it correctly. | ||
/// | ||
/// wiki : [Spawn Player](https://wiki.vg/Protocol#Spawn_Player) | ||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
pub struct PlayerSpawnS2c { | ||
/// A unique integer ID mostly used in the protocol to identify the player. | ||
pub entity_id: VarInt, | ||
pub player_uuid: Uuid, | ||
pub position: DVec3, | ||
pub yaw: ByteAngle, | ||
pub pitch: ByteAngle, | ||
} | ||
// /// This packet is sent by the server when a player comes into visible range, | ||
// /// not when a player joins. | ||
// /// | ||
// /// This packet must be sent after the Player Info Update packet that adds the | ||
// /// player data for the client to use when spawning a player. If the Player Info | ||
// /// for the player spawned by this packet is not present when this packet | ||
// /// arrives, Notchian clients will not spawn the player entity. The Player Info | ||
// /// packet includes skin/cape data. | ||
// /// | ||
// /// Servers can, however, safely spawn player entities for players not in | ||
// /// visible range. The client appears to handle it correctly. | ||
// /// | ||
// /// wiki : [Spawn Player](https://wiki.vg/Protocol#Spawn_Player) | ||
// #[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
// pub struct PlayerSpawnS2c { | ||
// /// A unique integer ID mostly used in the protocol to identify the player. | ||
// pub entity_id: VarInt, | ||
// pub player_uuid: Uuid, | ||
// pub position: DVec3, | ||
// pub yaw: ByteAngle, | ||
// pub pitch: ByteAngle, | ||
// } | ||
// | ||
/// Seems to be deprecated, need to be verify and remove if true |
4 changes: 2 additions & 2 deletions
4
crates/valence_protocol/src/packets/play/position_and_on_ground_c2s.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
crates/valence_protocol/src/packets/play/rotate_and_move_relative_s2c.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
crates/valence_protocol/src/packets/play/scoreboard_player_update_s2c.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
crates/valence_protocol/src/packets/status/query_pong_s2c.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
use crate::{Decode, Encode, Packet, PacketState}; | ||
// use crate::{Decode, Encode, Packet, PacketState}; | ||
|
||
#[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
#[packet(state = PacketState::Status)] | ||
pub struct QueryPongS2c { | ||
pub payload: u64, | ||
} | ||
// #[derive(Copy, Clone, Debug, Encode, Decode, Packet)] | ||
// #[packet(state = PacketState::Status)] | ||
// pub struct QueryPongS2c { | ||
// pub payload: u64, | ||
// } | ||
// | ||
/// Deprecated I would guess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters