|
@ -1,6 +1,9 @@ |
|
|
use psopacket::pso_packet;
|
|
|
|
|
|
|
|
|
use psopacket::{pso_packet, PSOPacketData};
|
|
|
use crate::{PSOPacket, PacketParseError, PSOPacketData};
|
|
|
use crate::{PSOPacket, PacketParseError, PSOPacketData};
|
|
|
use crate::utf8_to_utf16_array;
|
|
|
use crate::utf8_to_utf16_array;
|
|
|
|
|
|
use crate::packet::messages::GameMessage;
|
|
|
|
|
|
//use character::character::FullCharacter;
|
|
|
|
|
|
use crate::character::character as character;
|
|
|
|
|
|
|
|
|
use std::io::Read;
|
|
|
use std::io::Read;
|
|
|
|
|
|
|
|
@ -73,5 +76,92 @@ impl ShipBlockList { |
|
|
}).collect()
|
|
|
}).collect()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: menu should be an enum
|
|
|
|
|
|
// TODO: or perhaps MenuSelect should be broken up into different structs based on menu
|
|
|
|
|
|
// TODO: i.e. ShipMenuSelect, BlockMenuSelect, etc
|
|
|
|
|
|
#[pso_packet(0x10)]
|
|
|
|
|
|
pub struct MenuSelect {
|
|
|
|
|
|
pub menu: u32,
|
|
|
|
|
|
pub item: u32,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[pso_packet(0xE7)]
|
|
|
|
|
|
pub struct FullCharacter {
|
|
|
|
|
|
#[no_debug]
|
|
|
|
|
|
character: character::FullCharacter,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[pso_packet(0x95)]
|
|
|
|
|
|
pub struct CharDataRequest {
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: what does this even do?
|
|
|
|
|
|
#[pso_packet(0x61)]
|
|
|
|
|
|
pub struct CharData {
|
|
|
|
|
|
_unknown: [u8; 0x828]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[pso_packet(0x60)]
|
|
|
|
|
|
pub struct Message {
|
|
|
|
|
|
msg: GameMessage,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl Message {
|
|
|
|
|
|
pub fn new(msg: GameMessage) -> Message {
|
|
|
|
|
|
Message {
|
|
|
|
|
|
msg: msg,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[pso_packet(0x62, manual_flag)]
|
|
|
|
|
|
pub struct DirectedMessage {
|
|
|
|
|
|
flag: u32,
|
|
|
|
|
|
msg: GameMessage
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl DirectedMessage {
|
|
|
|
|
|
fn new(target: u32, msg: GameMessage) -> DirectedMessage {
|
|
|
|
|
|
DirectedMessage {
|
|
|
|
|
|
flag: target,
|
|
|
|
|
|
msg: msg,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(PSOPacketData, Clone)]
|
|
|
|
|
|
pub struct PlayerHeader {
|
|
|
|
|
|
pub tag: u32,
|
|
|
|
|
|
pub guildcard: u32,
|
|
|
|
|
|
pub _unknown1: [u32; 5],
|
|
|
|
|
|
pub client_id: u32,
|
|
|
|
|
|
pub name: [u16; 16],
|
|
|
|
|
|
pub _unknown2: u32,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(PSOPacketData, Clone)]
|
|
|
|
|
|
pub struct PlayerInfo {
|
|
|
|
|
|
pub header: PlayerHeader,
|
|
|
|
|
|
pub inventory: character::Inventory,
|
|
|
|
|
|
pub character: character::Character,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[pso_packet(0x67)]
|
|
|
|
|
|
pub struct JoinLobby {
|
|
|
|
|
|
pub client: u8,
|
|
|
|
|
|
pub leader: u8,
|
|
|
|
|
|
pub one: u8,
|
|
|
|
|
|
pub lobby: u8,
|
|
|
|
|
|
pub block: u16,
|
|
|
|
|
|
pub event: u16,
|
|
|
|
|
|
pub padding: u32,
|
|
|
|
|
|
pub playerinfo: Vec<PlayerInfo>,
|
|
|
}
|
|
|
}
|