From e02e3dff29b10151410339e3585cc6db56245213 Mon Sep 17 00:00:00 2001 From: andy Date: Sat, 15 May 2021 23:29:06 +0000 Subject: [PATCH 1/8] update tech packet struct, and some random comments --- src/packet/messages.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 062af3c..529a825 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -329,18 +329,18 @@ pub struct ComboStepDone { } #[pso_message(0x47)] -pub struct PlayerTechCast { +pub struct PlayerTechCast { // this packet and packet 0x8D (PlayerTechStart) are both sent at the same time as soon as the player presses a tech button, regardless if the tech is ACTUALLY casted (it not cancelled due to player blocking) or not. technique: u8, unknown1: u8, - unknown2: u8, + tech_level: u8, num_of_targets: u8, } #[pso_message(0x48)] -pub struct PlayerTechDone { +pub struct PlayerTechDone { // this packet gets sent once the tech is actually casted (ie: barta actually shoots out from your feet) technique: u8, unknown1: u8, - level: u8, + tech_level: u8, // tech level in packets is 0-based unknown2: u8, } @@ -561,6 +561,11 @@ pub struct KillMonster { //} +//#[pso_message(0x80)] +//pub struct PlayerTrapActivate { + +//} + #[pso_message(0x83)] pub struct PlayerTrapSet { trap_type: u16, @@ -572,11 +577,6 @@ pub struct PlayerTrapSet { //} -//#[pso_message(0x80)] -//pub struct PlayerTrapActivate { - -//} - //#[pso_message(0x87)] //pub struct PlayerShrink { @@ -597,10 +597,10 @@ pub struct PlayerKilledByMonster { //} -//#[pso_message(0x8D)] -//pub struct PlayerTechStart { - -//} +#[pso_message(0x8D)] +pub struct PlayerTechStart { // this packet and packet 0x47 (PlayerTechCast) are both sent at the same time (PlayerTechStart then PlayerTechCast) as soon as the player presses a tech button, regardless if the tech is ACTUALLY casted (it not cancelled due to player blocking) or not. + data: [u8; 4], // always 0'd? +} #[pso_message(0x94)] pub struct PlayerWarped2 { @@ -1047,7 +1047,7 @@ pub enum GameMessage { //PlayerUnshrink(PlayerUnshrink), PlayerKilledByMonster(PlayerKilledByMonster), //CmodeStatistics(CmodeStatistics), - //PlayerTechStart(PlayerTechStart), + PlayerTechStart(PlayerTechStart), PlayerWarped2(PlayerWarped2), //CmodeTryAgain(CmodeTryAgain), ModifyPlayerStats(ModifyPlayerStats), @@ -1212,7 +1212,7 @@ impl PSOPacketData for GameMessage { //PlayerUnshrink::CMD => Ok(GameMessage::PlayerUnshrink(PlayerUnshrink::from_bytes(&mut cur)?)), PlayerKilledByMonster::CMD => Ok(GameMessage::PlayerKilledByMonster(PlayerKilledByMonster::from_bytes(&mut cur)?)), //CmodeStatistics::CMD => Ok(GameMessage::CmodeStatistics(CmodeStatistics::from_bytes(&mut cur)?)), - //PlayerTechStart::CMD => Ok(GameMessage::PlayerTechStart(PlayerTechStart::from_bytes(&mut cur)?)), + PlayerTechStart::CMD => Ok(GameMessage::PlayerTechStart(PlayerTechStart::from_bytes(&mut cur)?)), PlayerWarped2::CMD => Ok(GameMessage::PlayerWarped2(PlayerWarped2::from_bytes(&mut cur)?)), //CmodeTryAgain::CMD => Ok(GameMessage::CmodeTryAgain(CmodeTryAgain::from_bytes(&mut cur)?)), ModifyPlayerStats::CMD => Ok(GameMessage::ModifyPlayerStats(ModifyPlayerStats::from_bytes(&mut cur)?)), @@ -1379,7 +1379,7 @@ impl PSOPacketData for GameMessage { //GameMessage::PlayerUnshrink(data) => data.as_bytes(), GameMessage::PlayerKilledByMonster(data) => data.as_bytes(), //GameMessage::CmodeStatistics(data) => data.as_bytes(), - //GameMessage::PlayerTechStart(data) => data.as_bytes(), + GameMessage::PlayerTechStart(data) => data.as_bytes(), GameMessage::PlayerWarped2(data) => data.as_bytes(), //GameMessage::CmodeTryAgain(data) => data.as_bytes(), GameMessage::ModifyPlayerStats(data) => data.as_bytes(), -- 2.36.0 From a58191833ff13138a11b54afeda592b1e1265f80 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 20 May 2021 01:38:26 +0000 Subject: [PATCH 2/8] random struct updates --- src/packet/messages.rs | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 529a825..ef538a5 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -135,7 +135,8 @@ pub struct TellOtherPlayerMyLocation { x: f32, y: f32, z: f32, - unknown2: u32, + rotation: u16, + unknown2: u16, } #[pso_message(0x21)] @@ -263,7 +264,7 @@ pub struct PlayerPBDonation { #[pso_message(0x37)] pub struct PlayerInitiatedPB { pb_amount: u8, - unknown1: u32, + unknown1: [u8; 4], } #[pso_message(0x3A)] @@ -278,7 +279,8 @@ pub struct PlayerSpawnedIntoArea { #[pso_message(0x3E)] pub struct PlayerStopped { - unknown1: u32, + unknown1: [u8; 2], + rotation: u16, area: u16, room: u16, x: f32, @@ -288,8 +290,10 @@ pub struct PlayerStopped { #[pso_message(0x3F)] pub struct PlayerLoadedIn { - unknown1: u32, - unknown2: u32, + unknown1: [u8; 2], + rotation: u16, + area: u16, + room: u16, x: f32, y: f32, z: f32, @@ -299,7 +303,7 @@ pub struct PlayerLoadedIn { pub struct PlayerWalking { x: f32, z: f32, - unknown: f32, + stance: u32, } #[pso_message(0x42)] @@ -310,22 +314,26 @@ pub struct PlayerRunning { #[pso_message(0x43)] pub struct ComboStep1 { - data: [u8; 4], + rotation: u16, + attack: u16, } #[pso_message(0x44)] pub struct ComboStep2 { - data: [u8; 4], + rotation: u16, + attack: u16, + } #[pso_message(0x45)] pub struct ComboStep3 { - data: [u8; 4], + rotation: u16, + attack: u16, } #[pso_message(0x46)] -pub struct ComboStepDone { - data: [u8; 4], +pub struct TargetsHit { + targets: u32, // thats a lot of targets! } #[pso_message(0x47)] @@ -1003,7 +1011,7 @@ pub enum GameMessage { ComboStep1(ComboStep1), ComboStep2(ComboStep2), ComboStep3(ComboStep3), - ComboStepDone(ComboStepDone), + TargetsHit(TargetsHit), PlayerTechCast(PlayerTechCast), PlayerTechDone(PlayerTechDone), PlayerPBUsed(PlayerPBUsed), @@ -1168,7 +1176,7 @@ impl PSOPacketData for GameMessage { ComboStep1::CMD => Ok(GameMessage::ComboStep1(ComboStep1::from_bytes(&mut cur)?)), ComboStep2::CMD => Ok(GameMessage::ComboStep2(ComboStep2::from_bytes(&mut cur)?)), ComboStep3::CMD => Ok(GameMessage::ComboStep3(ComboStep3::from_bytes(&mut cur)?)), - ComboStepDone::CMD => Ok(GameMessage::ComboStepDone(ComboStepDone::from_bytes(&mut cur)?)), + TargetsHit::CMD => Ok(GameMessage::TargetsHit(TargetsHit::from_bytes(&mut cur)?)), 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)?)), @@ -1335,7 +1343,7 @@ impl PSOPacketData for GameMessage { GameMessage::ComboStep1(data) => data.as_bytes(), GameMessage::ComboStep2(data) => data.as_bytes(), GameMessage::ComboStep3(data) => data.as_bytes(), - GameMessage::ComboStepDone(data) => data.as_bytes(), + GameMessage::TargetsHit(data) => data.as_bytes(), GameMessage::PlayerTechCast(data) => data.as_bytes(), GameMessage::PlayerTechDone(data) => data.as_bytes(), GameMessage::PlayerPBUsed(data) => data.as_bytes(), -- 2.36.0 From 68080eff4bce72f4813ed6c1b9e2ee550114680d Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 23 May 2021 19:10:31 +0000 Subject: [PATCH 3/8] add telepipe struct --- src/packet/messages.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index ef538a5..f60d2a2 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -512,7 +512,15 @@ pub struct SpawningMonsters { #[pso_message(0x68)] pub struct PlayerTelepipe { - + unknown1: u16, + area: u16, + room: u16, + unknown2: u16, + x: f32, + y: f32, + z: f32, + rotation: u16, + unknown3: [u8; 2], } #[pso_message(0x69)] -- 2.36.0 From 2c00b5999aa4879f2df5bf6c0c7a2dc5a414b956 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 23 May 2021 19:16:43 +0000 Subject: [PATCH 4/8] telepipe owner --- src/packet/messages.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index f60d2a2..07273b5 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -512,15 +512,15 @@ pub struct SpawningMonsters { #[pso_message(0x68)] pub struct PlayerTelepipe { - unknown1: u16, + caster: u16, // room client # area: u16, room: u16, - unknown2: u16, + unknown1: u16, x: f32, y: f32, z: f32, rotation: u16, - unknown3: [u8; 2], + unknown2: [u8; 2], } #[pso_message(0x69)] -- 2.36.0 From cb219d807d46d4ccb5c882501c9863ef7b615107 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 23 May 2021 20:54:35 +0000 Subject: [PATCH 5/8] fix tech packet lengths. now everyone can get s/d yay --- src/packet/messages.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 07273b5..1a27e7f 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -333,7 +333,10 @@ pub struct ComboStep3 { #[pso_message(0x46)] pub struct TargetsHit { - targets: u32, // thats a lot of targets! + num_of_targets: [u8; 4], // thats a lot of targets? + client2: u8, + target2: u8, + unknown2: [u8; 2], } #[pso_message(0x47)] @@ -341,14 +344,17 @@ pub struct PlayerTechCast { // this packet and packet 0x8D (PlayerTechStart) are technique: u8, unknown1: u8, tech_level: u8, + #[length_of(targets)] num_of_targets: u8, + #[length_is(num_of_targets)] + targets: Vec, } #[pso_message(0x48)] pub struct PlayerTechDone { // this packet gets sent once the tech is actually casted (ie: barta actually shoots out from your feet) technique: u8, unknown1: u8, - tech_level: u8, // tech level in packets is 0-based + tech_level: u8, // level - 1 unknown2: u8, } -- 2.36.0 From 77f657dbc06462aa3588e9d29230b08a1dc74e7f Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 23 May 2021 20:55:22 +0000 Subject: [PATCH 6/8] dont forget to check this later --- src/packet/messages.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 1a27e7f..062f141 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -334,8 +334,8 @@ pub struct ComboStep3 { #[pso_message(0x46)] pub struct TargetsHit { num_of_targets: [u8; 4], // thats a lot of targets? - client2: u8, - target2: u8, + client2: u8, // TODO: what even is this? + target2: u8, // TODO: what even is this? unknown2: [u8; 2], } -- 2.36.0 From ef69b2064d184a0bd6fb9430a8acc2e0b6060719 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 23 May 2021 21:22:48 +0000 Subject: [PATCH 7/8] make the compiler happy --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1ff7c69..853d636 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -551,7 +551,7 @@ mod test { #[pso_message(0x23)] struct Test { b: [u32; 100], - }; + } let test = Test { client: 1, -- 2.36.0 From 65532db884afe622ee73e2b92e4cd46af62e1e4c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 17 Jun 2021 21:07:49 +0000 Subject: [PATCH 8/8] sloppy spacing --- src/packet/messages.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 062f141..f1d698d 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -322,7 +322,6 @@ pub struct ComboStep1 { pub struct ComboStep2 { rotation: u16, attack: u16, - } #[pso_message(0x45)] -- 2.36.0