From 799a9e68804633c24b47b759c75269f7106918cc 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 | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 062af3c..040d3e0 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -255,15 +255,19 @@ 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)] -pub struct PlayerInitiatedPB { - pb_amount: u8, - unknown1: u32, +#[pso_message(0x39)] +pub struct PlayerPBReady { + player: u16, } #[pso_message(0x3A)] @@ -345,11 +349,9 @@ pub struct PlayerTechDone { } #[pso_message(0x49)] -pub struct PlayerPBUsed { - pb: u8, - unknown1: u32, - amount: u8, - unknown2: u32, +pub struct PlayerInitiatedPB { + pb: u32, + energy: u32, } #[pso_message(0x4A)] @@ -992,7 +994,7 @@ pub enum GameMessage { PlayerResurrected(PlayerResurrected), PlayerResurrectedMedicalCenter(PlayerResurrectedMedicalCenter), PlayerUsedMoonAtomizer(PlayerUsedMoonAtomizer), - PlayerPBDonation(PlayerPBDonation), + // PlayerPBDonation(PlayerPBDonation), PlayerInitiatedPB(PlayerInitiatedPB), PlayerLeftArea(PlayerLeftArea), PlayerSpawnedIntoArea(PlayerSpawnedIntoArea), @@ -1007,6 +1009,7 @@ pub enum GameMessage { PlayerTechCast(PlayerTechCast), PlayerTechDone(PlayerTechDone), PlayerPBUsed(PlayerPBUsed), + PlayerDonatedPB(PlayerDonatedPB), PlayerBlockedDamage(PlayerBlockedDamage), PlayerReceivedDamage(PlayerReceivedDamage), PlayerReceivedDamage2(PlayerReceivedDamage2), @@ -1157,7 +1160,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)?)), @@ -1172,6 +1175,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)?)), @@ -1324,7 +1328,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(), @@ -1339,6 +1343,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(),