Browse Source

bank packets

pull/3/head
jake 4 years ago
parent
commit
cdc4ee0bb2
  1. 6
      src/character/character.rs
  2. 35
      src/packet/messages.rs
  3. 16
      src/packet/ship.rs

6
src/character/character.rs

@ -348,6 +348,12 @@ pub struct Bank {
pub items: [BankItem; 200], pub items: [BankItem; 200],
} }
impl std::default::Default for Bank {
fn default() -> Bank {
Bank::from_bytes(&mut std::io::Cursor::new([0; 0x12C8].to_vec())).unwrap()
}
}
#[derive(PSOPacketData, Copy, Clone)] #[derive(PSOPacketData, Copy, Clone)]
pub struct KeyTeamConfig { pub struct KeyTeamConfig {
pub _unknown: [u8; 0x114], pub _unknown: [u8; 0x114],

35
src/packet/messages.rs

@ -742,19 +742,20 @@ pub struct TekPreview {
//} //}
//#[pso_message(0xBB)]
//pub struct BankRequest {
#[pso_message(0xBB)]
pub struct BankRequest {
unknown: u32,
}
//}
//#[pso_message(0xBD)]
//pub struct BankInteraction {
// item_id: u16,
// amount: u8,
// action: u8,
// item_amount: u8,
// unknown2: u8,
//}
#[pso_message(0xBD)]
pub struct BankInteraction {
item_id: u32,
meseta_amount: u32,
action: u8,
item_amount: u8,
unknown: u16,
}
@ -1055,8 +1056,8 @@ pub enum GameMessage {
TekRequest(TekRequest), TekRequest(TekRequest),
TekPreview(TekPreview), TekPreview(TekPreview),
//TekAccept(TekAccept), //TekAccept(TekAccept),
//BankRequest(BankRequest),
//BankInteraction(BankInteraction),
BankRequest(BankRequest),
BankInteraction(BankInteraction),
//PlayerSoldItem(PlayerSoldItem), //PlayerSoldItem(PlayerSoldItem),
//TeamInvite(TeamInvite), //TeamInvite(TeamInvite),
//AcceptTeamInvite(AcceptTeamInvite), //AcceptTeamInvite(AcceptTeamInvite),
@ -1219,8 +1220,8 @@ impl PSOPacketData for GameMessage {
TekRequest::CMD => Ok(GameMessage::TekRequest(TekRequest::from_bytes(&mut cur)?)), TekRequest::CMD => Ok(GameMessage::TekRequest(TekRequest::from_bytes(&mut cur)?)),
TekPreview::CMD => Ok(GameMessage::TekPreview(TekPreview::from_bytes(&mut cur)?)), TekPreview::CMD => Ok(GameMessage::TekPreview(TekPreview::from_bytes(&mut cur)?)),
//TekAccept::CMD => Ok(GameMessage::TekAccept(TekAccept::from_bytes(&mut cur)?)), //TekAccept::CMD => Ok(GameMessage::TekAccept(TekAccept::from_bytes(&mut cur)?)),
//BankRequest::CMD => Ok(GameMessage::BankRequest(BankRequest::from_bytes(&mut cur)?)),
//BankInteraction::CMD => Ok(GameMessage::BankInteraction(BankInteraction::from_bytes(&mut cur)?)),
BankRequest::CMD => Ok(GameMessage::BankRequest(BankRequest::from_bytes(&mut cur)?)),
BankInteraction::CMD => Ok(GameMessage::BankInteraction(BankInteraction::from_bytes(&mut cur)?)),
//PlayerSoldItem::CMD => Ok(GameMessage::PlayerSoldItem(PlayerSoldItem::from_bytes(&mut cur)?)), //PlayerSoldItem::CMD => Ok(GameMessage::PlayerSoldItem(PlayerSoldItem::from_bytes(&mut cur)?)),
//TeamInvite::CMD => Ok(GameMessage::TeamInvite(TeamInvite::from_bytes(&mut cur)?)), //TeamInvite::CMD => Ok(GameMessage::TeamInvite(TeamInvite::from_bytes(&mut cur)?)),
//AcceptTeamInvite::CMD => Ok(GameMessage::AcceptTeamInvite(AcceptTeamInvite::from_bytes(&mut cur)?)), //AcceptTeamInvite::CMD => Ok(GameMessage::AcceptTeamInvite(AcceptTeamInvite::from_bytes(&mut cur)?)),
@ -1385,8 +1386,8 @@ impl PSOPacketData for GameMessage {
GameMessage::TekRequest(data) => data.as_bytes(), GameMessage::TekRequest(data) => data.as_bytes(),
GameMessage::TekPreview(data) => data.as_bytes(), GameMessage::TekPreview(data) => data.as_bytes(),
// GameMessage::TekAccept(data) => data.as_bytes(), // GameMessage::TekAccept(data) => data.as_bytes(),
//GameMessage::BankRequest(data) => data.as_bytes(),
//GameMessage::BankInteraction(data) => data.as_bytes(),
GameMessage::BankRequest(data) => data.as_bytes(),
GameMessage::BankInteraction(data) => data.as_bytes(),
//GameMessage::PlayerSoldItem(data) => data.as_bytes(), //GameMessage::PlayerSoldItem(data) => data.as_bytes(),
//GameMessage::TeamInvite(data) => data.as_bytes(), //GameMessage::TeamInvite(data) => data.as_bytes(),
//GameMessage::AcceptTeamInvite(data) => data.as_bytes(), //GameMessage::AcceptTeamInvite(data) => data.as_bytes(),

16
src/packet/ship.rs

@ -4,6 +4,7 @@ use crate::utf8_to_utf16_array;
use crate::packet::messages::GameMessage; use crate::packet::messages::GameMessage;
//use character::character::FullCharacter; //use character::character::FullCharacter;
use crate::character::character as character; use crate::character::character as character;
use crate::character::character::BankItem;
use crate::ConsumingBlob; use crate::ConsumingBlob;
use std::io::Read; use std::io::Read;
@ -176,6 +177,21 @@ impl DirectMessage {
} }
} }
// this is a bit of a weird packet, 0x6C is in the 0x60 family in terms of function
// but this is the only packet I could find that uses it
#[pso_packet(0x6C, no_flag)]
struct BankItemList {
pub aflag: u32,
pub cmd: u8, // 0xBC
pub unknown: [u8; 3],
pub size: u32,
pub checksum: u32,
pub item_count: u32,
pub meseta: u32,
pub items: Vec<BankItem>,
}
#[pso_packet(0x6D, manual_flag)] #[pso_packet(0x6D, manual_flag)]
struct Like62ButCooler { struct Like62ButCooler {
pub flag: u32, pub flag: u32,

Loading…
Cancel
Save