From 8a0ac8490951429277e707607975424b6dcd12b8 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 12 Mar 2023 11:48:28 -0300 Subject: TProtocol: Rename some of the command handlers to match their names in PSOv2 --- context.h | 12 ++++++------ include/pso/TProtocol.h | 12 ++++++------ src/pso/TProtocol.cpp | 30 +++++++++++++++--------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/context.h b/context.h index db476cb..2baecea 100644 --- a/context.h +++ b/context.h @@ -206,10 +206,10 @@ typedef long ptrdiff_t; 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_recv_download_head2, TRecvDownloadHead &download_head) \ - o(handle_A7_recv_download2, TRecvDownload &download) \ + o(handle_A6_recv_vm_download_head, TRecvDownloadHead &download_head) \ + o(handle_A7_recv_vm_download, TRecvDownload &download) \ o(unused11, void) \ - o(handle_1F_recv_info_list, int entry_count, GameListEntry *entries, GameListEntry &entry_0) \ + o(handle_1F_recv_text_list, int entry_count, GameListEntry *entries, GameListEntry &entry_0) \ o(handle_B0_server_message_packet, void) \ o(handle_88_player_arrow_color_list_packet, void) \ o(handle_8A_lobby_name_packet, void) \ @@ -1413,7 +1413,7 @@ public: // 0x08 void recv_game_list(packet &pkt); // 0x1F - void recv_info_list(packet &pkt); + void recv_text_list(packet &pkt); // 0x0E void recv_start_game(packet &pkt); // 0x64 @@ -1427,9 +1427,9 @@ public: // 0x44 void recv_download_head(packet &pkt); // 0xA6 - void recv_download_head2(packet &pkt); + void recv_vm_download_head(packet &pkt); // 0xA7 - void recv_download2(packet &pkt); + void recv_vm_download(packet &pkt); // 0x13 void recv_download(packet &pkt); // 0x14 diff --git a/include/pso/TProtocol.h b/include/pso/TProtocol.h index 699068e..bcc7386 100644 --- a/include/pso/TProtocol.h +++ b/include/pso/TProtocol.h @@ -73,10 +73,10 @@ struct packet { 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_recv_download_head2, TRecvDownloadHead &download_head) \ - o(handle_A7_recv_download2, TRecvDownload &download) \ + o(handle_A6_recv_vm_download_head, TRecvDownloadHead &download_head) \ + o(handle_A7_recv_vm_download, TRecvDownload &download) \ o(unused11, void) \ - o(handle_1F_recv_info_list, int entry_count, GameListEntry *entries, GameListEntry &entry_0) \ + o(handle_1F_recv_text_list, int entry_count, GameListEntry *entries, GameListEntry &entry_0) \ o(handle_B0_server_message_packet, void) \ o(handle_88_player_arrow_color_list_packet, void) \ o(handle_8A_lobby_name_packet, void) \ @@ -173,7 +173,7 @@ public: // 0x08 void recv_game_list(packet &pkt); // 0x1F - void recv_info_list(packet &pkt); + void recv_text_list(packet &pkt); // 0x0E void recv_start_game(packet &pkt); // 0x64 @@ -187,9 +187,9 @@ public: // 0x44 void recv_download_head(packet &pkt); // 0xA6 - void recv_download_head2(packet &pkt); + void recv_vm_download_head(packet &pkt); // 0xA7 - void recv_download2(packet &pkt); + void recv_vm_download(packet &pkt); // 0x13 void recv_download(packet &pkt); // 0x14 diff --git a/src/pso/TProtocol.cpp b/src/pso/TProtocol.cpp index 415f056..19b2672 100644 --- a/src/pso/TProtocol.cpp +++ b/src/pso/TProtocol.cpp @@ -49,7 +49,7 @@ void TProtocol::recv_download(packet &pkt) { send(reinterpret_cast(&tmp2), sizeof(tmp2)); }; -void TProtocol::recv_download2(packet &pkt) { +void TProtocol::recv_vm_download(packet &pkt) { TSendDownloadHead tmp2; TRecvDownload tmp = as(TRecvDownload &, pkt); tmp.bswap(); @@ -60,14 +60,14 @@ void TProtocol::recv_download2(packet &pkt) { strncpy(tmp2.filename, tmp.filename, sizeof(tmp2.filename)); tmp2.bswap(); - if (m_recv_handlers.handle_A7_recv_download2 != nullptr) { - m_recv_handlers.handle_A7_recv_download2(tmp); + if (m_recv_handlers.handle_A7_recv_vm_download != nullptr) { + m_recv_handlers.handle_A7_recv_vm_download(tmp); } send(reinterpret_cast(&tmp2), sizeof(tmp2)); }; -void TProtocol::recv_download_head2(packet &pkt) { +void TProtocol::recv_vm_download_head(packet &pkt) { TSendDownloadHead tmp2; TRecvDownloadHead tmp = as(TRecvDownloadHead &, pkt); tmp.bswap(); @@ -78,8 +78,8 @@ void TProtocol::recv_download_head2(packet &pkt) { strncpy(tmp2.filename, tmp.filename, sizeof(tmp2.filename)); tmp2.bswap(); - if (m_recv_handlers.handle_A6_recv_download_head2 != nullptr) { - m_recv_handlers.handle_A6_recv_download_head2(tmp); + if (m_recv_handlers.handle_A6_recv_vm_download_head != nullptr) { + m_recv_handlers.handle_A6_recv_vm_download_head(tmp); } send(reinterpret_cast(&tmp2), sizeof(tmp2)); @@ -155,9 +155,9 @@ void TProtocol::recv_start_game(packet &pkt) { }; -void TProtocol::recv_info_list(packet &pkt) { - typedef TMenuList info_list; - info_list tmp = as(info_list &, pkt); +void TProtocol::recv_text_list(packet &pkt) { + typedef TMenuList text_list; + text_list tmp = as(text_list &, pkt); tmp.bswap(); m_entry_count = tmp.header.flags; @@ -166,8 +166,8 @@ void TProtocol::recv_info_list(packet &pkt) { m_game_entries[i] = tmp.entries[i]; } - if (m_recv_handlers.handle_1F_recv_info_list != nullptr) { - m_recv_handlers.handle_1F_recv_info_list(m_entry_count, m_game_entries, tmp.pad_entries[0]); + if (m_recv_handlers.handle_1F_recv_text_list != nullptr) { + m_recv_handlers.handle_1F_recv_text_list(m_entry_count, m_game_entries, tmp.pad_entries[0]); } }; @@ -279,13 +279,13 @@ int TProtocol::handle_command(struct packet *pkt) { { 0x13, &recv_download }, { 0x14, &recv_upload }, { 0x11, &recv_message }, - { 0x1F, &recv_info_list }, + { 0x1F, &recv_text_list }, { 0x1A, &recv_text }, { 0x67, &recv_start_lobby2 }, { 0xA0, &recv_dir_list }, { 0xA1, &recv_dir_list }, - { 0xA6, &recv_download_head2 }, - { 0xA7, &recv_download2 }, + { 0xA6, &recv_vm_download_head }, + { 0xA7, &recv_vm_download }, { 0xD5, &recv_text }, { 0, nullptr } }; @@ -452,7 +452,7 @@ TProtocol::TProtocol(TObject *parent, u16 sub_version, int language, char *seria m_recv_handlers.unused11 = nullptr; m_recv_handlers.handle_97_checksum_reply_packet = nullptr; m_recv_handlers.handle_B0_server_message_packet = nullptr; - m_recv_handlers.handle_1F_recv_info_list = nullptr; + m_recv_handlers.handle_1F_recv_text_list = nullptr; m_recv_handlers.handle_88_player_arrow_color_list_packet = nullptr; m_recv_handlers.handle_8A_lobby_name_packet = nullptr; m_recv_handlers.handle_C5_player_challenge_data_packet = nullptr; -- cgit v1.2.3-13-gbd6f