Browse Source

Merge pull request 'room join packets' (#27) from room_join into master

pull/3/head
jake 5 years ago
parent
commit
94c0fb5d48
  1. 38
      src/packet/messages.rs
  2. 64
      src/packet/ship.rs

38
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(),
}
}
}
}

64
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],
}
Loading…
Cancel
Save