From 0aab853119953c87fe76d23d695c9e0e1c267dd8 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Fri, 10 Mar 2023 15:03:42 -0400 Subject: TProtocol: Add (and somewhat match) even more command handlers --- include/pso/packet_classes.h | 103 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) (limited to 'include/pso/packet_classes.h') diff --git a/include/pso/packet_classes.h b/include/pso/packet_classes.h index 5147477..df47979 100644 --- a/include/pso/packet_classes.h +++ b/include/pso/packet_classes.h @@ -64,6 +64,109 @@ public: }; }; +class TPlyJoinLobbyEntry { +public: + TPlyJoinLobbyData lobby_data; + TPlyCharData char_data; +public: + void bswap() { + lobby_data.tag.bswap(); + bswap_32(&lobby_data.ip_addr); + bswap_32(&lobby_data.client_id); + char_data.bswap(); + }; +}; + +class TRecvDownload { +public: + packet_header header; + char filename[16]; + u8 data[1024]; + u32 data_size; +public: + void bswap() { + header.bswap(); + bswap_32(&data_size); + }; +}; + +class TSendDownloadHead { +public: + packet_header header; + char filename[16]; +public: + void bswap() { + header.bswap(); + }; +}; + +class TRecvDownloadHead { +public: + packet_header header; + char path[32]; + u16 unused; + u16 flags; + char filename[16]; + u32 file_size; +public: + void bswap() { + header.bswap(); + bswap_32(&file_size); + }; +}; + +class TPlyJoinLobby { +public: + packet_header header; + u8 client_id; + u8 leader_id; + u8 disable_udp; + u8 lobby_number; + u8 block_number; + u8 unknown1; + u8 event; + u8 unknown2; + u8 unused[4]; + TPlyJoinLobbyEntry entries[12]; +public: + void bswap() { + header.bswap(); + for (int i = 0; i < 12; ++i) { + entries[i].bswap(); + } + }; +}; + +class TPlyJoinGame { +public: + packet_header header; + u32 variations[16][2]; + TPlyJoinLobbyData lobby_data[4]; + u8 client_id; + u8 leader_id; + u8 disable_udp; + u8 difficulty; + u8 battle_mode; + u8 event; + u8 section_id; + u8 challenge_mode; + u32 rare_seed; + u8 episode; + u8 unknown1; + u8 solo_mode; + u8 unknown2; +public: + void bswap() { + header.bswap(); + for (int i = 0; i < 16; ++i) { + for (int j = 0; j < 2; ++j) { + bswap_32(&variations[i][j]); + } + } + bswap_32(&rare_seed); + }; +}; + class TPlyStartGame { public: packet_header header; -- cgit v1.2.3-13-gbd6f