Browse Source

Merge pull request 'guildcard send/recv' (#19) from send_guildcard into master

Reviewed-by: jake <jake@sharnoth.com>
pull/3/head
jake 5 years ago
parent
commit
2407b4ca23
  1. 4
      src/character/guildcard.rs
  2. 23
      src/packet/messages.rs

4
src/character/guildcard.rs

@ -69,7 +69,7 @@ pub struct GuildCard {
pub language: u8, pub language: u8,
pub section_id: u8, pub section_id: u8,
pub class: u8, pub class: u8,
pub paddding: u32,
pub padding: u32,
pub comment: [u16; 0x58], pub comment: [u16; 0x58],
} }
@ -85,7 +85,7 @@ impl Default for GuildCard {
language: 0, language: 0,
section_id: 0, section_id: 0,
class: 0, class: 0,
paddding: 0,
padding: 0,
comment: [0; 0x58], comment: [0; 0x58],
} }
} }

23
src/packet/messages.rs

@ -199,6 +199,23 @@ pub struct PlayerTrapActivate {
} }
#[pso_message(0x06)]
pub struct GuildcardSend {
}
#[pso_message(0x06)]
pub struct GuildcardRecv {
guildcard: u32,
name: [u16; 0x18],
team: [u16; 0x10],
desc: [u16; 0x58],
one: u8,
language: u8,
section_id: u8,
class: u8,
}
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub enum GameMessage { pub enum GameMessage {
@ -232,6 +249,8 @@ pub enum GameMessage {
PlayerBlockedDamage(PlayerBlockedDamage), PlayerBlockedDamage(PlayerBlockedDamage),
PlayerTrapSet(PlayerTrapSet), PlayerTrapSet(PlayerTrapSet),
PlayerTrapActivate(PlayerTrapActivate), PlayerTrapActivate(PlayerTrapActivate),
GuildcardSend(GuildcardSend),
GuildcardRecv(GuildcardRecv),
} }
impl PSOPacketData for GameMessage { impl PSOPacketData for GameMessage {
@ -272,6 +291,8 @@ impl PSOPacketData for GameMessage {
PlayerBlockedDamage::CMD => Ok(GameMessage::PlayerBlockedDamage(PlayerBlockedDamage::from_bytes(&mut cur)?)), PlayerBlockedDamage::CMD => Ok(GameMessage::PlayerBlockedDamage(PlayerBlockedDamage::from_bytes(&mut cur)?)),
PlayerTrapSet::CMD => Ok(GameMessage::PlayerTrapSet(PlayerTrapSet::from_bytes(&mut cur)?)), PlayerTrapSet::CMD => Ok(GameMessage::PlayerTrapSet(PlayerTrapSet::from_bytes(&mut cur)?)),
PlayerTrapActivate::CMD => Ok(GameMessage::PlayerTrapActivate(PlayerTrapActivate::from_bytes(&mut cur)?)), PlayerTrapActivate::CMD => Ok(GameMessage::PlayerTrapActivate(PlayerTrapActivate::from_bytes(&mut cur)?)),
GuildcardSend::CMD => Ok(GameMessage::GuildcardSend(GuildcardSend::from_bytes(&mut cur)?)),
GuildcardRecv::CMD => Ok(GameMessage::GuildcardRecv(GuildcardRecv::from_bytes(&mut cur)?)),
_ => Err(PacketParseError::UnknownMessage(byte[0], _ => Err(PacketParseError::UnknownMessage(byte[0],
{ {
let mut b = vec![0; len[0] as usize * 4]; let mut b = vec![0; len[0] as usize * 4];
@ -313,6 +334,8 @@ impl PSOPacketData for GameMessage {
GameMessage::PlayerTrapSet(data) => data.as_bytes(), GameMessage::PlayerTrapSet(data) => data.as_bytes(),
GameMessage::PlayerTrapActivate(data) => data.as_bytes(), GameMessage::PlayerTrapActivate(data) => data.as_bytes(),
GameMessage::PlayerChangedFloor(data) => data.as_bytes(), GameMessage::PlayerChangedFloor(data) => data.as_bytes(),
GameMessage::GuildcardSend(data) => data.as_bytes(),
GameMessage::GuildcardRecv(data) => data.as_bytes(),
} }
} }
} }

Loading…
Cancel
Save