From f273adabf671749b1253c4babd307df5fea61f72 Mon Sep 17 00:00:00 2001 From: diamante0018 Date: Mon, 28 Jul 2025 15:55:44 +0200 Subject: [PATCH] chore: update --- src/client/component/demonware.cpp | 2 +- src/client/component/fastfiles.cpp | 3 ++- src/client/game/demonware/keys.cpp | 2 +- src/client/game/demonware/servers/auth3_server.cpp | 6 +++--- src/client/game/demonware/servers/lobby_server.cpp | 11 ++++++----- src/client/game/demonware/service.hpp | 2 +- src/client/game/demonware/services/bdStorage.cpp | 8 ++++---- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/client/component/demonware.cpp b/src/client/component/demonware.cpp index cbbc7c2..00c91b1 100644 --- a/src/client/component/demonware.cpp +++ b/src/client/component/demonware.cpp @@ -117,7 +117,7 @@ namespace demonware { hostent* WINAPI gethostbyname_stub(const char* name) { -#ifdef DEBUG +#ifdef DW_DEBUG printf("[ network ]: [gethostbyname]: \"%s\"\n", name); #endif diff --git a/src/client/component/fastfiles.cpp b/src/client/component/fastfiles.cpp index f587379..07af1f8 100644 --- a/src/client/component/fastfiles.cpp +++ b/src/client/component/fastfiles.cpp @@ -166,9 +166,10 @@ namespace fastfiles utils::hook::inject(0x14026FFAC, xmodel_pool + 8); utils::hook::inject(0x14027463C, xmodel_pool + 8); utils::hook::inject(0x140274689, xmodel_pool + 8); + // Reallocate asset pools // Disabled because it causes a crash in the main menu once you rejoin a server after - // disconnecting and map rotating. + // disconnecting and waiting for the server to map rotating. #if 0 reallocate_asset_pool(); reallocate_asset_pool(); diff --git a/src/client/game/demonware/keys.cpp b/src/client/game/demonware/keys.cpp index b5ad226..645ef2d 100644 --- a/src/client/game/demonware/keys.cpp +++ b/src/client/game/demonware/keys.cpp @@ -89,7 +89,7 @@ namespace demonware std::memcpy(data.m_dec_key, &out_3[40], 16); std::memcpy(data.m_enc_key, &out_3[56], 16); -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW] Response id: %s\n", utils::string::dump_hex(std::string(&out_2[8], 8)).data()); printf("[DW] Hash verify: %s\n", utils::string::dump_hex(std::string(&out_3[20], 20)).data()); printf("[DW] AES dec key: %s\n", utils::string::dump_hex(std::string(&out_3[40], 16)).data()); diff --git a/src/client/game/demonware/servers/auth3_server.cpp b/src/client/game/demonware/servers/auth3_server.cpp index 4cff2d6..2e5bf78 100644 --- a/src/client/game/demonware/servers/auth3_server.cpp +++ b/src/client/game/demonware/servers/auth3_server.cpp @@ -38,7 +38,7 @@ namespace demonware { if (packet.starts_with("POST /auth/")) { -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [auth]: user requested authentication.\n"); #endif return; @@ -81,7 +81,7 @@ namespace demonware } } -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [auth]: authenticating user %s\n", token.data() + 64); #endif @@ -160,7 +160,7 @@ namespace demonware raw_reply reply(result); this->send_reply(&reply); -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [auth]: user successfully authenticated.\n"); #endif } diff --git a/src/client/game/demonware/servers/lobby_server.cpp b/src/client/game/demonware/servers/lobby_server.cpp index c2d0483..1d6b8c3 100644 --- a/src/client/game/demonware/servers/lobby_server.cpp +++ b/src/client/game/demonware/servers/lobby_server.cpp @@ -56,7 +56,7 @@ namespace demonware } else if (size == 0xC8) { -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [lobby]: received client_header_ack.\n"); #endif @@ -72,7 +72,7 @@ namespace demonware raw_reply reply(packet_2); this->send_reply(&reply); -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [lobby]: sending server_header_ack.\n"); #endif return; @@ -89,7 +89,7 @@ namespace demonware if (type == 0x82) { -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [lobby]: received client_auth.\n"); #endif std::string packet_3(packet.data(), packet.size() - 8); // this 8 are client hash check? @@ -104,7 +104,7 @@ namespace demonware raw_reply reply(response); this->send_reply(&reply); -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [lobby]: sending server_auth_done.\n"); #endif return; @@ -163,8 +163,9 @@ namespace demonware } else { +#ifdef DW_DEBUG printf("[DW]: [lobby]: missing service '%s'\n", utils::string::va("%d", id)); - +#endif // return no error byte_buffer buffer(data); uint8_t task_id; diff --git a/src/client/game/demonware/service.hpp b/src/client/game/demonware/service.hpp index ada7e84..dde96f0 100644 --- a/src/client/game/demonware/service.hpp +++ b/src/client/game/demonware/service.hpp @@ -51,7 +51,7 @@ namespace demonware if (it != this->tasks_.end()) { -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW] %s: executing task '%d'\n", name_.data(), this->task_id_); #endif diff --git a/src/client/game/demonware/services/bdStorage.cpp b/src/client/game/demonware/services/bdStorage.cpp index 49c90b0..1ba8555 100644 --- a/src/client/game/demonware/services/bdStorage.cpp +++ b/src/client/game/demonware/services/bdStorage.cpp @@ -75,7 +75,7 @@ namespace demonware } } -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [bdStorage]: missing publisher file: %s\n", name.data()); #endif @@ -118,7 +118,7 @@ namespace demonware std::string filename; buffer->read_string(&filename); -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [bdStorage]: loading publisher file: %s\n", filename.data()); #endif @@ -126,7 +126,7 @@ namespace demonware if (this->load_publisher_resource(filename, data)) { -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [bdStorage]: sending publisher file: %s, size: %lld\n", filename.data(), data.size()); #endif @@ -185,7 +185,7 @@ namespace demonware buffer->read_uint64(&owner); buffer->read_string(&platform); -#ifdef DEBUG +#ifdef DW_DEBUG printf("[DW]: [bdStorage]: user file: %s, %s, %s\n", game.data(), filename.data(), platform.data()); #endif