Add s_player_action packet
Note: this packet is currently only parsed, not handled.
This commit is contained in:
parent
cce0161e3d
commit
b38e6af2f3
@ -8,6 +8,7 @@ mod s_player_position;
|
|||||||
mod s_player_position_rotation;
|
mod s_player_position_rotation;
|
||||||
mod s_player_rotation;
|
mod s_player_rotation;
|
||||||
mod s_swing_arm;
|
mod s_swing_arm;
|
||||||
|
mod s_player_action;
|
||||||
|
|
||||||
pub use c_client_information::*;
|
pub use c_client_information::*;
|
||||||
pub use c_interact::*;
|
pub use c_interact::*;
|
||||||
@ -19,3 +20,4 @@ pub use s_player_position::*;
|
|||||||
pub use s_player_position_rotation::*;
|
pub use s_player_position_rotation::*;
|
||||||
pub use s_player_rotation::*;
|
pub use s_player_rotation::*;
|
||||||
pub use s_swing_arm::*;
|
pub use s_swing_arm::*;
|
||||||
|
pub use s_player_action::*;
|
||||||
|
|||||||
12
pumpkin-protocol/src/server/play/s_player_action.rs
Normal file
12
pumpkin-protocol/src/server/play/s_player_action.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
use pumpkin_macros::packet;
|
||||||
|
|
||||||
|
use crate::{position::WorldPosition, VarInt};
|
||||||
|
|
||||||
|
#[derive(serde::Deserialize)]
|
||||||
|
#[packet(0x24)]
|
||||||
|
pub struct SPlayerAction {
|
||||||
|
status: VarInt,
|
||||||
|
location: WorldPosition,
|
||||||
|
face: u8,
|
||||||
|
sequence: VarInt,
|
||||||
|
}
|
||||||
@ -28,7 +28,8 @@ use pumpkin_protocol::{
|
|||||||
login::{SEncryptionResponse, SLoginAcknowledged, SLoginPluginResponse, SLoginStart},
|
login::{SEncryptionResponse, SLoginAcknowledged, SLoginPluginResponse, SLoginStart},
|
||||||
play::{
|
play::{
|
||||||
SChatCommand, SChatMessage, SClientInformationPlay, SConfirmTeleport, SInteract,
|
SChatCommand, SChatMessage, SClientInformationPlay, SConfirmTeleport, SInteract,
|
||||||
SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation, SSwingArm,
|
SPlayerAction, SPlayerCommand, SPlayerPosition, SPlayerPositionRotation,
|
||||||
|
SPlayerRotation, SSwingArm,
|
||||||
},
|
},
|
||||||
status::{SPingRequest, SStatusRequest},
|
status::{SPingRequest, SStatusRequest},
|
||||||
},
|
},
|
||||||
@ -286,8 +287,9 @@ impl Client {
|
|||||||
server,
|
server,
|
||||||
SClientInformationPlay::read(bytebuf).unwrap(),
|
SClientInformationPlay::read(bytebuf).unwrap(),
|
||||||
),
|
),
|
||||||
SInteract::PACKET_ID => {
|
SInteract::PACKET_ID => self.handle_interact(server, SInteract::read(bytebuf).unwrap()),
|
||||||
self.handle_interact(server, SInteract::read(bytebuf).unwrap());
|
SPlayerAction::PACKET_ID => {
|
||||||
|
self.handle_player_action(server, SPlayerAction::read(bytebuf).unwrap())
|
||||||
}
|
}
|
||||||
_ => log::error!("Failed to handle player packet id {}", packet.id.0),
|
_ => log::error!("Failed to handle player packet id {}", packet.id.0),
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,8 @@ use pumpkin_protocol::{
|
|||||||
},
|
},
|
||||||
server::play::{
|
server::play::{
|
||||||
SChatCommand, SChatMessage, SClientInformationPlay, SConfirmTeleport, SInteract,
|
SChatCommand, SChatMessage, SClientInformationPlay, SConfirmTeleport, SInteract,
|
||||||
SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation, SSwingArm,
|
SPlayerAction, SPlayerCommand, SPlayerPosition, SPlayerPositionRotation, SPlayerRotation,
|
||||||
|
SSwingArm,
|
||||||
},
|
},
|
||||||
VarInt,
|
VarInt,
|
||||||
};
|
};
|
||||||
@ -277,4 +278,5 @@ impl Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn handle_player_action(&mut self, _server: &mut Server, player_action: SPlayerAction) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user