diff options
-rw-r--r-- | context.h | 68 | ||||
-rw-r--r-- | include/pso/TPlyInventory.h | 61 |
2 files changed, 122 insertions, 7 deletions
@@ -562,13 +562,6 @@ struct vec2f { float y; }; -// pso/TPlyGuildCardTag.h -struct gc_tag { - u8 tag0; - u8 tag1; - u16 tag2; -}; - // pso/TPlyDispData.h struct stats { void bswap(); @@ -622,6 +615,32 @@ struct disp_data_part2 { vec2f proportions; }; +// pso/TPlyGuildCardTag.h +struct gc_tag { + u8 tag0; + u8 tag1; + u16 tag2; +}; + +// pso/TPlyInventory.h +struct TItemData { + TItemData(); + void bswap(); + TItemData &assign(const TItemData &src); + + union { + TArray<u8, 12> data_u8; + TArray<u16, 6> data_u16; + TArray<u32, 3> data_u32; + } data1; + u32 id; + union { + TArray<u8, 4> data_u8; + TArray<u8, 2> data_u16; + u32 data_u32; + } data2; +}; + // TTcpSocket.cpp, but they're really from AVE-TCP struct at_ip4_opt { u8 ttl; @@ -783,6 +802,41 @@ private: u32 m_guildcard_number; } __packed__; +// pso/TPlyInventory.h +class TPlyInventoryItem { +public: + TPlyInventoryItem() {}; + + void bswap(); + TPlyInventoryItem &assign(const TPlyInventoryItem &src); + + PRIVATE_MEMBER_ACCESSORS_ARRAY(u8, present, 4); + PRIVATE_MEMBER_ACCESSORS(u32, flags); + PRIVATE_MEMBER_ACCESSORS(TItemData, data); +private: + TArray<u8, 4> m_present; + u32 m_flags; + TItemData m_data; +}; + +class TPlyInventory { +public: + void bswap(); + TPlyInventory &assign(const TPlyInventory &src); + + PRIVATE_MEMBER_ACCESSORS(u8, num_items); + PRIVATE_MEMBER_ACCESSORS(u8, hp_materials_used); + PRIVATE_MEMBER_ACCESSORS(u8, tp_materials_used); + PRIVATE_MEMBER_ACCESSORS(u8, language); + PRIVATE_MEMBER_ACCESSORS_ARRAY(TPlyInventoryItem, items, 30); +private: + u8 m_num_items; + u8 m_hp_materials_used; + u8 m_tp_materials_used; + u8 m_language; + TArray<TPlyInventoryItem, 30> m_items; +}; + // pso/PSOV3EncryptionTCP.h class PSOV3EncryptionTCP : public PSOV3Encryption { public: diff --git a/include/pso/TPlyInventory.h b/include/pso/TPlyInventory.h new file mode 100644 index 0000000..6143a06 --- /dev/null +++ b/include/pso/TPlyInventory.h @@ -0,0 +1,61 @@ +#ifndef TPLYINVENTORY_H +#define TPLYINVENTORY_H + +#include <global_types.h> +#include <pso/macros.h> +#include <pso/protocol.h> +#include <pso/TArray.h> + +struct TItemData { + TItemData(); + void bswap(); + TItemData &assign(const TItemData &src); + + union { + TArray<u8, 12> data_u8; + TArray<u16, 6> data_u16; + TArray<u32, 3> data_u32; + } data1; + u32 id; + union { + TArray<u8, 4> data_u8; + TArray<u8, 2> data_u16; + u32 data_u32; + } data2; +}; + +class TPlyInventoryItem { +public: + TPlyInventoryItem() {}; + + void bswap(); + TPlyInventoryItem &assign(const TPlyInventoryItem &src); + + PRIVATE_MEMBER_ACCESSORS_ARRAY(u8, present, 4); + PRIVATE_MEMBER_ACCESSORS(u32, flags); + PRIVATE_MEMBER_ACCESSORS(TItemData, data); +private: + TArray<u8, 4> m_present; + u32 m_flags; + TItemData m_data; +}; + +class TPlyInventory { +public: + void bswap(); + TPlyInventory &assign(const TPlyInventory &src); + + PRIVATE_MEMBER_ACCESSORS(u8, num_items); + PRIVATE_MEMBER_ACCESSORS(u8, hp_materials_used); + PRIVATE_MEMBER_ACCESSORS(u8, tp_materials_used); + PRIVATE_MEMBER_ACCESSORS(u8, language); + PRIVATE_MEMBER_ACCESSORS_ARRAY(TPlyInventoryItem, items, 30); +private: + u8 m_num_items; + u8 m_hp_materials_used; + u8 m_tp_materials_used; + u8 m_language; + TArray<TPlyInventoryItem, 30> m_items; +}; + +#endif |