From e959fc3094e1f75206ed45f6d1f57f7284dd7631 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 24 May 2021 20:48:25 +0000 Subject: [PATCH] pb structs --- src/packet/messages.rs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 65fcfc1..00635ac 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -256,9 +256,14 @@ pub struct PlayerUsedMoonAtomizer { } -#[pso_message(0x36)] -pub struct PlayerPBDonation { +#[pso_message(0x37)] +pub struct PlayerPBUsed { + energy: u32, +} +#[pso_message(0x38)] +pub struct PlayerDonatedPB { + recipient: u32, } #[pso_message(0x37)] @@ -266,6 +271,10 @@ pub struct PlayerInitiatedPB { pb_amount: u8, unknown1: [u8; 4], } +#[pso_message(0x39)] +pub struct PlayerPBReady { + player: u16, +} #[pso_message(0x3A)] pub struct PlayerLeftArea { @@ -358,11 +367,9 @@ pub struct PlayerTechDone { // this packet gets sent once the tech is actually c } #[pso_message(0x49)] -pub struct PlayerPBUsed { - pb: u8, - unknown1: u32, - amount: u8, - unknown2: u32, +pub struct PlayerInitiatedPB { + pb: u32, + energy: u32, } #[pso_message(0x4A)] @@ -1015,7 +1022,7 @@ pub enum GameMessage { PlayerResurrected(PlayerResurrected), PlayerResurrectedMedicalCenter(PlayerResurrectedMedicalCenter), PlayerUsedMoonAtomizer(PlayerUsedMoonAtomizer), - PlayerPBDonation(PlayerPBDonation), + // PlayerPBDonation(PlayerPBDonation), PlayerInitiatedPB(PlayerInitiatedPB), PlayerLeftArea(PlayerLeftArea), PlayerSpawnedIntoArea(PlayerSpawnedIntoArea), @@ -1030,6 +1037,7 @@ pub enum GameMessage { PlayerTechCast(PlayerTechCast), PlayerTechDone(PlayerTechDone), PlayerPBUsed(PlayerPBUsed), + PlayerDonatedPB(PlayerDonatedPB), PlayerBlockedDamage(PlayerBlockedDamage), PlayerReceivedDamage(PlayerReceivedDamage), PlayerReceivedDamage2(PlayerReceivedDamage2), @@ -1180,7 +1188,7 @@ impl PSOPacketData for GameMessage { PlayerResurrected::CMD => Ok(GameMessage::PlayerResurrected(PlayerResurrected::from_bytes(&mut cur)?)), PlayerResurrectedMedicalCenter::CMD => Ok(GameMessage::PlayerResurrectedMedicalCenter(PlayerResurrectedMedicalCenter::from_bytes(&mut cur)?)), PlayerUsedMoonAtomizer::CMD => Ok(GameMessage::PlayerUsedMoonAtomizer(PlayerUsedMoonAtomizer::from_bytes(&mut cur)?)), - PlayerPBDonation::CMD => Ok(GameMessage::PlayerPBDonation(PlayerPBDonation::from_bytes(&mut cur)?)), + // PlayerPBDonation::CMD => Ok(GameMessage::PlayerPBDonation(PlayerPBDonation::from_bytes(&mut cur)?)), PlayerInitiatedPB::CMD => Ok(GameMessage::PlayerInitiatedPB(PlayerInitiatedPB::from_bytes(&mut cur)?)), PlayerLeftArea::CMD => Ok(GameMessage::PlayerLeftArea(PlayerLeftArea::from_bytes(&mut cur)?)), PlayerSpawnedIntoArea::CMD => Ok(GameMessage::PlayerSpawnedIntoArea(PlayerSpawnedIntoArea::from_bytes(&mut cur)?)), @@ -1195,6 +1203,7 @@ impl PSOPacketData for GameMessage { PlayerTechCast::CMD => Ok(GameMessage::PlayerTechCast(PlayerTechCast::from_bytes(&mut cur)?)), PlayerTechDone::CMD => Ok(GameMessage::PlayerTechDone(PlayerTechDone::from_bytes(&mut cur)?)), PlayerPBUsed::CMD => Ok(GameMessage::PlayerPBUsed(PlayerPBUsed::from_bytes(&mut cur)?)), + PlayerDonatedPB::CMD => Ok(GameMessage::PlayerDonatedPB(PlayerDonatedPB::from_bytes(&mut cur)?)), PlayerBlockedDamage::CMD => Ok(GameMessage::PlayerBlockedDamage(PlayerBlockedDamage::from_bytes(&mut cur)?)), PlayerReceivedDamage::CMD => Ok(GameMessage::PlayerReceivedDamage(PlayerReceivedDamage::from_bytes(&mut cur)?)), PlayerReceivedDamage2::CMD => Ok(GameMessage::PlayerReceivedDamage2(PlayerReceivedDamage2::from_bytes(&mut cur)?)), @@ -1347,7 +1356,7 @@ impl PSOPacketData for GameMessage { GameMessage::PlayerResurrected(data) => data.as_bytes(), GameMessage::PlayerResurrectedMedicalCenter(data) => data.as_bytes(), GameMessage::PlayerUsedMoonAtomizer(data) => data.as_bytes(), - GameMessage::PlayerPBDonation(data) => data.as_bytes(), + // GameMessage::PlayerPBDonation(data) => data.as_bytes(), GameMessage::PlayerInitiatedPB(data) => data.as_bytes(), GameMessage::PlayerLeftArea(data) => data.as_bytes(), GameMessage::PlayerSpawnedIntoArea(data) => data.as_bytes(), @@ -1362,6 +1371,7 @@ impl PSOPacketData for GameMessage { GameMessage::PlayerTechCast(data) => data.as_bytes(), GameMessage::PlayerTechDone(data) => data.as_bytes(), GameMessage::PlayerPBUsed(data) => data.as_bytes(), + GameMessage::PlayerDonatedPB(data) => data.as_bytes(), GameMessage::PlayerBlockedDamage(data) => data.as_bytes(), GameMessage::PlayerReceivedDamage(data) => data.as_bytes(), GameMessage::PlayerReceivedDamage2(data) => data.as_bytes(),