From 68330a7165d55f85b7f4364a098563bdb8180a8a Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 5 May 2020 22:04:17 -0600 Subject: [PATCH] item pickup packets --- src/packet/messages.rs | 50 ++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/src/packet/messages.rs b/src/packet/messages.rs index 8d36512..4ed7199 100644 --- a/src/packet/messages.rs +++ b/src/packet/messages.rs @@ -202,11 +202,9 @@ pub struct PlayerDropItem2 { #[pso_message(0x2B)] pub struct AddItemToInventory { - item_data: u32, - item_data2: u32, - item_data3: u32, + item_data: [u8; 12], slot: u32, - item_data4: u32, + item_data2: [u8; 4], unknown1: u32, } @@ -414,15 +412,20 @@ pub struct LobbyEmote { emote: u32, } -//#[pso_message(0x59)] -//pub struct PickupItem { -// client_id: u16, -// item_id: u32, -//} +#[pso_message(0x59)] +pub struct RemoveItemFromFloor { + client_id: u8, + unknown: u8, + area: u8, + unknown2: u8, + item_id: u32, +} #[pso_message(0x5A)] -pub struct PickupItem2 { - data: [u8; 6], +pub struct PickupItem { + item_id: u32, + area: u8, + unknown: [u8; 3], } //#[pso_message(0x5D)] @@ -736,6 +739,16 @@ pub struct PhotonChairMove { // unknown2: u8, //} + + +#[pso_message(0xBE)] +pub struct CreateItem { + item_data: [u8; 12], + item_id: u32, + item_data2: [u8; 4], + unknown: u32, +} + //#[pso_message(0xC0)] //pub struct PlayerSoldItem { // client_id: u16, @@ -966,8 +979,8 @@ pub enum GameMessage { //Unknown53(Unknown53), PlayerWarped(PlayerWarped), LobbyEmote(LobbyEmote), - //PickupItem(PickupItem), - PickupItem2(PickupItem2), + RemoveItemFromFloor(RemoveItemFromFloor), + PickupItem(PickupItem), //SplittingStack(SplittingStack), //BuyFromShop(BuyFromShop), ItemDrop(ItemDrop), @@ -1024,6 +1037,7 @@ pub enum GameMessage { //PlayerSoldItem(PlayerSoldItem), //TeamInvite(TeamInvite), //AcceptTeamInvite(AcceptTeamInvite), + CreateItem(CreateItem), DropCoordinates(DropCoordinates), SortItems(SortItems), PlayerUsedMedicalCenter(PlayerUsedMedicalCenter), @@ -1127,8 +1141,8 @@ impl PSOPacketData for GameMessage { //Unknown53::CMD => Ok(GameMessage::Unknown53(Unknown53::from_bytes(&mut cur)?)), PlayerWarped::CMD => Ok(GameMessage::PlayerWarped(PlayerWarped::from_bytes(&mut cur)?)), LobbyEmote::CMD => Ok(GameMessage::LobbyEmote(LobbyEmote::from_bytes(&mut cur)?)), - //PickupItem::CMD => Ok(GameMessage::PickupItem(PickupItem::from_bytes(&mut cur)?)), - PickupItem2::CMD => Ok(GameMessage::PickupItem2(PickupItem2::from_bytes(&mut cur)?)), + RemoveItemFromFloor::CMD => Ok(GameMessage::RemoveItemFromFloor(RemoveItemFromFloor::from_bytes(&mut cur)?)), + PickupItem::CMD => Ok(GameMessage::PickupItem(PickupItem::from_bytes(&mut cur)?)), //SplittingStack::CMD => Ok(GameMessage::SplittingStack(SplittingStack::from_bytes(&mut cur)?)), //BuyFromShop::CMD => Ok(GameMessage::BuyFromShop(BuyFromShop::from_bytes(&mut cur)?)), ItemDrop::CMD => Ok(GameMessage::ItemDrop(ItemDrop::from_bytes(&mut cur)?)), @@ -1185,6 +1199,7 @@ impl PSOPacketData for GameMessage { //PlayerSoldItem::CMD => Ok(GameMessage::PlayerSoldItem(PlayerSoldItem::from_bytes(&mut cur)?)), //TeamInvite::CMD => Ok(GameMessage::TeamInvite(TeamInvite::from_bytes(&mut cur)?)), //AcceptTeamInvite::CMD => Ok(GameMessage::AcceptTeamInvite(AcceptTeamInvite::from_bytes(&mut cur)?)), + CreateItem::CMD => Ok(GameMessage::CreateItem(CreateItem::from_bytes(&mut cur)?)), DropCoordinates::CMD => Ok(GameMessage::DropCoordinates(DropCoordinates::from_bytes(&mut cur)?)), SortItems::CMD => Ok(GameMessage::SortItems(SortItems::from_bytes(&mut cur)?)), PlayerUsedMedicalCenter::CMD => Ok(GameMessage::PlayerUsedMedicalCenter(PlayerUsedMedicalCenter::from_bytes(&mut cur)?)), @@ -1290,8 +1305,8 @@ impl PSOPacketData for GameMessage { //GameMessage::Unknown53(data) => data.as_bytes(), GameMessage::PlayerWarped(data) => data.as_bytes(), GameMessage::LobbyEmote(data) => data.as_bytes(), - //GameMessage::PickupItem(data) => data.as_bytes(), - GameMessage::PickupItem2(data) => data.as_bytes(), + GameMessage::RemoveItemFromFloor(data) => data.as_bytes(), + GameMessage::PickupItem(data) => data.as_bytes(), //GameMessage::SplittingStack(data) => data.as_bytes(), //GameMessage::BuyFromShop(data) => data.as_bytes(), GameMessage::ItemDrop(data) => data.as_bytes(), @@ -1348,6 +1363,7 @@ impl PSOPacketData for GameMessage { //GameMessage::PlayerSoldItem(data) => data.as_bytes(), //GameMessage::TeamInvite(data) => data.as_bytes(), //GameMessage::AcceptTeamInvite(data) => data.as_bytes(), + GameMessage::CreateItem(data) => data.as_bytes(), GameMessage::DropCoordinates(data) => data.as_bytes(), GameMessage::SortItems(data) => data.as_bytes(), GameMessage::PlayerUsedMedicalCenter(data) => data.as_bytes(),