summaryrefslogtreecommitdiff
path: root/include/pso
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-03-10 15:03:42 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-03-10 15:06:37 -0400
commit0aab853119953c87fe76d23d695c9e0e1c267dd8 (patch)
tree1d92409551119906256bba256841c8c28768c314 /include/pso
parent2b9599035cf2da613869a4db10ac236a49fc5e4c (diff)
TProtocol: Add (and somewhat match) even more command handlers
Diffstat (limited to 'include/pso')
-rw-r--r--include/pso/TPlyCharData.h2
-rw-r--r--include/pso/TProtocol.h35
-rw-r--r--include/pso/packet_classes.h103
3 files changed, 132 insertions, 8 deletions
diff --git a/include/pso/TPlyCharData.h b/include/pso/TPlyCharData.h
index 5a7dd48..0b0c421 100644
--- a/include/pso/TPlyCharData.h
+++ b/include/pso/TPlyCharData.h
@@ -10,7 +10,7 @@
class TPlyCharData {
public:
TPlyCharData() {};
- void bswap();
+ void bswap() {};
TPlyCharData &assign(const TPlyCharData &src);
public:
TPlyInventory m_inventory;
diff --git a/include/pso/TProtocol.h b/include/pso/TProtocol.h
index c224c5d..699068e 100644
--- a/include/pso/TProtocol.h
+++ b/include/pso/TProtocol.h
@@ -20,6 +20,7 @@
EXTERN_OBJECT_NAME(TProtocol);
extern TPlyMeetUserExtension meet_user_settings;
+extern u32 game_variations[16][2];
extern void copy_packet(struct packet *pkt);
struct packet {
@@ -41,13 +42,13 @@ struct packet {
o(handle_08_recv_game_list, int entry_count, GameListEntry *entries, GameListEntry &entry_0) \
o(handle_01_recv_error, char *mesg) \
o(handle_06_recv_chat, TPlyGuildCardTag &tag, char *mesg) \
- o(handle_11_additional_info_reply_packet, void) \
+ o(handle_11_recv_message, char *mesg, u8 unused) \
o(handle_1A_D5_recv_text, char *text) \
o(handle_0E_recv_start_game, TPlyJoinLobbyData *entries, u8 entry_count, int lobby_entry_idx) \
o(unused7, void) \
- o(handle_64_join_game_packet, void) \
+ o(handle_64_recv_start_game3, TPlyJoinGame &join_data) \
o(unused8, void) \
- o(handle_67_join_lobby_packet, void) \
+ o(handle_67_recv_start_lobby2, TPlyJoinLobbyEntry *entries, u8 entry_count, int client_id, int leader_id, int lobby_number, int block_number, int smth, int event) \
o(handle_80_unused_ignored_packet, void) \
o(unused9, void) \
o(handle_65_add_player_to_game_packet, void) \
@@ -68,12 +69,12 @@ struct packet {
o(handle_D8_infoboard_packet, void) \
o(handle_A2_quest_list_packet, void) \
o(handle_A3_quest_info_packet, void) \
- o(handle_44_quest_file_list_packet, void) \
- o(handle_13_quest_data_packet, void) \
+ o(handle_44_recv_download_head, TRecvDownloadHead &download_head) \
+ o(handle_13_recv_download, TRecvDownload &download) \
o(handle_A4_downloadable_quest_menu_packet, void) \
o(handle_A5_downloadable_quest_info_packet, void) \
- o(handle_A6_download_quest_file_list_packet, void) \
- o(handle_A7_download_quest_file_data_packet, void) \
+ o(handle_A6_recv_download_head2, TRecvDownloadHead &download_head) \
+ o(handle_A7_recv_download2, TRecvDownload &download) \
o(unused11, void) \
o(handle_1F_recv_info_list, int entry_count, GameListEntry *entries, GameListEntry &entry_0) \
o(handle_B0_server_message_packet, void) \
@@ -175,6 +176,26 @@ public:
void recv_info_list(packet &pkt);
// 0x0E
void recv_start_game(packet &pkt);
+ // 0x64
+ void recv_start_game3(packet &pkt);
+ // 0x67
+ void recv_start_lobby2(packet &pkt);
+ // 0x12
+ void recv_banner(packet &pkt);
+ // 0x16
+ void recv_banner_head(packet &pkt);
+ // 0x44
+ void recv_download_head(packet &pkt);
+ // 0xA6
+ void recv_download_head2(packet &pkt);
+ // 0xA7
+ void recv_download2(packet &pkt);
+ // 0x13
+ void recv_download(packet &pkt);
+ // 0x14
+ void recv_upload(packet &pkt);
+ // 0x11
+ void recv_message(packet &pkt);
};
#endif
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;