Browse Source

add gcmd 0x20 0xAE

pull/3/head
jake 5 years ago
parent
commit
519e01fe65
  1. 23
      src/packet/messages.rs

23
src/packet/messages.rs

@ -47,6 +47,14 @@ pub struct PlayerChangedMap2 {
unknown1: u32, unknown1: u32,
} }
#[pso_message(0x20)]
pub struct TellOtherPlayerMyLocation {
unknown1: u32,
unknown2: u32,
x: f32,
y: f32,
z: f32,
}
#[pso_message(0x3F)] #[pso_message(0x3F)]
pub struct PlayerLoadedIn { pub struct PlayerLoadedIn {
@ -63,6 +71,15 @@ pub struct PlayerDoneChangingMap {
} }
#[pso_message(0xAE)]
pub struct UnknownAE {
unknown1: u32,
unknown2: u32,
unknown3: u32,
}
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub enum GameMessage { pub enum GameMessage {
PlayerWalking(PlayerWalking), PlayerWalking(PlayerWalking),
@ -72,6 +89,8 @@ pub enum GameMessage {
PlayerChangedMap(PlayerChangedMap), PlayerChangedMap(PlayerChangedMap),
PlayerChangedMap2(PlayerChangedMap2), PlayerChangedMap2(PlayerChangedMap2),
PlayerDoneChangingMap(PlayerDoneChangingMap), PlayerDoneChangingMap(PlayerDoneChangingMap),
TellOtherPlayerMyLocation(TellOtherPlayerMyLocation),
UnknownAE(UnknownAE),
} }
impl PSOPacketData for GameMessage { impl PSOPacketData for GameMessage {
@ -89,6 +108,8 @@ impl PSOPacketData for GameMessage {
PlayerChangedMap::CMD if len[0] == 6 => Ok(GameMessage::PlayerChangedMap(PlayerChangedMap::from_bytes(&mut cur)?)), PlayerChangedMap::CMD if len[0] == 6 => Ok(GameMessage::PlayerChangedMap(PlayerChangedMap::from_bytes(&mut cur)?)),
PlayerChangedMap2::CMD if len[0] == 2 => Ok(GameMessage::PlayerChangedMap2(PlayerChangedMap2::from_bytes(&mut cur)?)), PlayerChangedMap2::CMD if len[0] == 2 => Ok(GameMessage::PlayerChangedMap2(PlayerChangedMap2::from_bytes(&mut cur)?)),
PlayerDoneChangingMap::CMD => Ok(GameMessage::PlayerDoneChangingMap(PlayerDoneChangingMap::from_bytes(&mut cur)?)), PlayerDoneChangingMap::CMD => Ok(GameMessage::PlayerDoneChangingMap(PlayerDoneChangingMap::from_bytes(&mut cur)?)),
TellOtherPlayerMyLocation::CMD => Ok(GameMessage::TellOtherPlayerMyLocation(TellOtherPlayerMyLocation::from_bytes(&mut cur)?)),
UnknownAE::CMD => Ok(GameMessage::UnknownAE(UnknownAE::from_bytes(&mut cur)?)),
_ => Err(PacketParseError::WrongPacketCommand), _ => Err(PacketParseError::WrongPacketCommand),
} }
} }
@ -101,6 +122,8 @@ impl PSOPacketData for GameMessage {
GameMessage::PlayerChangedMap(data) => data.as_bytes(), GameMessage::PlayerChangedMap(data) => data.as_bytes(),
GameMessage::PlayerChangedMap2(data) => data.as_bytes(), GameMessage::PlayerChangedMap2(data) => data.as_bytes(),
GameMessage::PlayerDoneChangingMap(data) => data.as_bytes(), GameMessage::PlayerDoneChangingMap(data) => data.as_bytes(),
GameMessage::TellOtherPlayerMyLocation(data) => data.as_bytes(),
GameMessage::UnknownAE(data) => data.as_bytes(),
} }
} }
} }

Loading…
Cancel
Save