From 6d3287e7c3ab94b5d6d9b9ca168578f49b0bfecc Mon Sep 17 00:00:00 2001 From: RubberDuckShobe <42943070+RubberDuckShobe@users.noreply.github.com> Date: Mon, 30 Oct 2023 23:47:04 +0100 Subject: [PATCH] upgrade the horrible errors to critical in logs --- CMakeLists.txt | 8 -------- include/nethook.hpp | 2 +- include/utility.hpp | 31 ------------------------------- src/dllmain.cpp | 6 +++--- 4 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 include/utility.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fa7485..070084b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,17 +89,9 @@ find_package(imgui REQUIRED CONFIG) # Target: wavebreakerclient set(wavebreakerclient_SOURCES - "src/D3D9Hook.cpp" - "src/DInputHook.cpp" - "src/WindowsMessageHook.cpp" "src/dllmain.cpp" - "include/D3D9Hook.hpp" - "include/DInputHook.hpp" - "include/WindowsMessageHook.hpp" "include/config.hpp" "include/nethook.hpp" - "include/overlay.hpp" - "include/utility.hpp" cmake.toml ) diff --git a/include/nethook.hpp b/include/nethook.hpp index 9627dbd..1c0de70 100644 --- a/include/nethook.hpp +++ b/include/nethook.hpp @@ -92,7 +92,7 @@ namespace wavebreaker g_httpopenrequesta_hook = safetyhook::create_inline((void *)HttpOpenRequestA, (void *)OpenRequestHook); if (!g_getserver_hook || !g_getserverunicode_hook || !g_internetconnecta_hook || !g_httpopenrequesta_hook) { - spdlog::error("Failed to attach hook(s). Hook addresses: {0:p} {1:p} {2:p} {3:p}", fmt::ptr(&g_getserver_hook), fmt::ptr(&g_getserverunicode_hook), fmt::ptr(&g_internetconnecta_hook), fmt::ptr(&g_httpopenrequesta_hook)); + spdlog::critical("Failed to attach hook(s). Hook addresses: {0:p} {1:p} {2:p} {3:p}", fmt::ptr(&g_getserver_hook), fmt::ptr(&g_getserverunicode_hook), fmt::ptr(&g_internetconnecta_hook), fmt::ptr(&g_httpopenrequesta_hook)); throw std::runtime_error("Hook failed"); } } diff --git a/include/utility.hpp b/include/utility.hpp deleted file mode 100644 index 04ab5e7..0000000 --- a/include/utility.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#include - -namespace wavebreaker -{ - namespace utility - { - bool is_key_down(int key) - { - return (GetAsyncKeyState(key) & (1 << 15)) != 0; - } - - bool was_key_pressed(int key) - { - static bool keys[0xFF]{false}; - - if (is_key_down(key) && !keys[key]) - { - keys[key] = true; - - return true; - } - - if (!is_key_down(key)) - { - keys[key] = false; - } - - return false; - } - } -} \ No newline at end of file diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 5097760..ce65f7e 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -22,7 +22,7 @@ uint32_t __stdcall init(void *args) spdlog::set_default_logger(logger); spdlog::set_level(spdlog::level::info); spdlog::flush_on(spdlog::level::debug); - spdlog::info("Init"); + spdlog::info("Initializing Wavebreaker client."); try { @@ -30,7 +30,7 @@ uint32_t __stdcall init(void *args) } catch (const std::exception &e) { - spdlog::error("Exception thrown when loading config: {}", e.what()); + spdlog::critical("Exception thrown when loading config: {}", e.what()); MessageBoxA(nullptr, "Wavebreaker client config error!", "Error", MB_OK | MB_ICONERROR); return 1; } @@ -42,7 +42,7 @@ uint32_t __stdcall init(void *args) } while (!GetModuleHandleA("HTTP_Fetch_Unicode.dll") || !GetModuleHandleA("17C5B19F-4273-423C-A158-CA6F73046D43.dll")) - Sleep(100); + Sleep(125); try {