From 7553fd1e1005898fa4943d73e2a0772000c659a0 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 21 Apr 2020 07:23:22 -0600 Subject: [PATCH] room join packets --- src/packet/messages.rs | 38 ++++++++++++++----------- src/packet/ship.rs | 64 ++++++++++++++++++++++++++++++------------ 2 files changed, 68 insertions(+), 34 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index fd155b6..627a2a3 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -129,10 +129,10 @@ pub struct PlayerChangedMap2 { #[pso_message(0x20)] pub struct TellOtherPlayerMyLocation { unknown1: u32, - unknown2: u32, x: f32, y: f32, z: f32, + unknown2: u32, } #[pso_message(0x21)] @@ -506,15 +506,18 @@ pub struct NpcSpawn { data: [u8; 8], } -//#[pso_message(0x6F)] -//pub struct PlayerJoiningGame { - -//} +#[pso_message(0x6F)] +pub struct PlayerJoiningGame { + data: [u32; 0x81], +} -//#[pso_message(0x71)] -//pub struct PlayerJoiningGame2 { - -//} +#[pso_message(0x71)] +pub struct PlayerJoiningGame2 { +} + +#[pso_message(0x72)] +pub struct BurstDone { +} #[pso_message(0x74)] pub struct WordSelect { @@ -974,8 +977,9 @@ pub enum GameMessage { SpawningMonsters(SpawningMonsters), PlayerTelepipe(PlayerTelepipe), NpcSpawn(NpcSpawn), - //PlayerJoiningGame(PlayerJoiningGame), - //PlayerJoiningGame2(PlayerJoiningGame2), + PlayerJoiningGame(PlayerJoiningGame), + PlayerJoiningGame2(PlayerJoiningGame2), + BurstDone(BurstDone), WordSelect(WordSelect), PlayerChangedFloor(PlayerChangedFloor), KillMonster(KillMonster), @@ -1134,8 +1138,9 @@ impl PSOPacketData for GameMessage { SpawningMonsters::CMD => Ok(GameMessage::SpawningMonsters(SpawningMonsters::from_bytes(&mut cur)?)), PlayerTelepipe::CMD => Ok(GameMessage::PlayerTelepipe(PlayerTelepipe::from_bytes(&mut cur)?)), NpcSpawn::CMD => Ok(GameMessage::NpcSpawn(NpcSpawn::from_bytes(&mut cur)?)), - //PlayerJoiningGame::CMD => Ok(GameMessage::PlayerJoiningGame(PlayerJoiningGame::from_bytes(&mut cur)?)), - //PlayerJoiningGame2::CMD => Ok(GameMessage::PlayerJoiningGame2(PlayerJoiningGame2::from_bytes(&mut cur)?)), + PlayerJoiningGame::CMD => Ok(GameMessage::PlayerJoiningGame(PlayerJoiningGame::from_bytes(&mut cur)?)), + PlayerJoiningGame2::CMD => Ok(GameMessage::PlayerJoiningGame2(PlayerJoiningGame2::from_bytes(&mut cur)?)), + BurstDone::CMD => Ok(GameMessage::BurstDone(BurstDone::from_bytes(&mut cur)?)), WordSelect::CMD => Ok(GameMessage::WordSelect(WordSelect::from_bytes(&mut cur)?)), PlayerChangedFloor::CMD => Ok(GameMessage::PlayerChangedFloor(PlayerChangedFloor::from_bytes(&mut cur)?)), KillMonster::CMD => Ok(GameMessage::KillMonster(KillMonster::from_bytes(&mut cur)?)), @@ -1296,8 +1301,9 @@ impl PSOPacketData for GameMessage { GameMessage::SpawningMonsters(data) => data.as_bytes(), GameMessage::PlayerTelepipe(data) => data.as_bytes(), GameMessage::NpcSpawn(data) => data.as_bytes(), - //GameMessage::PlayerJoiningGame(data) => data.as_bytes(), - //GameMessage::PlayerJoiningGame2(data) => data.as_bytes(), + GameMessage::PlayerJoiningGame(data) => data.as_bytes(), + GameMessage::PlayerJoiningGame2(data) => data.as_bytes(), + GameMessage::BurstDone(data) => data.as_bytes(), GameMessage::WordSelect(data) => data.as_bytes(), GameMessage::PlayerChangedFloor(data) => data.as_bytes(), GameMessage::KillMonster(data) => data.as_bytes(), @@ -1371,4 +1377,4 @@ impl PSOPacketData for GameMessage { //GameMessage::Coren(data) => data.as_bytes(), } } -} \ No newline at end of file +} diff --git a/src/packet/ship.rs b/src/packet/ship.rs index b0a1c1c..975b7e0 100644 --- a/src/packet/ship.rs +++ b/src/packet/ship.rs @@ -8,7 +8,7 @@ use crate::ConsumingBlob; use std::io::Read; -const BLOCK_MENU_ID: u32 = 1; +pub const BLOCK_MENU_ID: u32 = 1; pub const ROOM_MENU_ID: u32 = 2; pub const LOBBY_MENU_ID: u32 = 3; @@ -115,6 +115,25 @@ pub struct CharData { } +#[pso_packet(0x60)] +pub struct BurstDone72 { + msg: u8, + len: u8, + client: u8, + target: u8, +} + +impl BurstDone72 { + pub fn new() -> BurstDone72 { + BurstDone72 { + msg: 0x72, + len: 3, + client: 0x18, + target: 0x08, + } + } +} + #[pso_packet(0x60)] pub struct Message { @@ -226,22 +245,22 @@ impl SmallDialog { #[pso_packet(0x64, manual_flag)] pub struct JoinRoom { - flag: u32, // # of elements in players - maps: [u32; 0x20], - players: [PlayerHeader; 4], - client_id: u8, - leader_id: u8, - one: u8, - difficulty: u8, // TODO: enum - battle: u8, - event: u8, - section: u8, - challenge: u8, - random_seed: u32, - episode: u8, - one2: u8, - single_player: u8, - unknown: u8, + pub flag: u32, // # of elements in players + pub maps: [u32; 0x20], + pub players: [PlayerHeader; 4], + pub client: u8, + pub leader: u8, + pub one: u8, + pub difficulty: u8, // TODO: enum + pub battle: u8, + pub event: u8, + pub section: u8, + pub challenge: u8, + pub random_seed: u32, + pub episode: u8, + pub one2: u8, + pub single_player: u8, + pub unknown: u8, } impl JoinRoom { @@ -254,7 +273,7 @@ impl JoinRoom { #[pso_packet(0x65, manual_flag)] pub struct AddToRoom { - flag: u32, + pub flag: u32, pub client: u8, pub leader: u8, pub one: u8, @@ -410,3 +429,12 @@ impl LobbyList { } } } + +#[pso_packet(0x6F)] +pub struct DoneBursting { +} + +#[pso_packet(0x98)] +pub struct ClientCharacterData { + pub data: [u8; 2112], +}