diff --git a/src/client/component/chat.cpp b/src/client/component/chat.cpp index 9ed6f7a2..1deb03db 100644 --- a/src/client/component/chat.cpp +++ b/src/client/component/chat.cpp @@ -81,7 +81,8 @@ namespace chat client_command::add("chat", cmd_chat_f); - command::add("say", [](const command::params& params) + // Overwrite say command + utils::hook::jump(0x14052A6C0_g, +[] { if (!game::get_dvar_bool("sv_running")) { @@ -89,13 +90,17 @@ namespace chat return; } + const command::params params{}; const auto text = params.join(1); + const auto* format = reinterpret_cast(0x140E25180_g); const auto* message = utils::string::va(format, 'O', text.data()); - reinterpret_cast(0x140532CA0_g)(-1, 0, message); + + game::SV_GameSendServerCommand(-1, game::SV_CMD_CAN_IGNORE_0, message); }); - command::add("tell", [](const command::params& params) + // Overwrite tell command + utils::hook::jump(0x14052A7E0_g, +[] { if (!game::get_dvar_bool("sv_running")) { @@ -103,26 +108,23 @@ namespace chat return; } + const command::params params{}; if (params.size() < 2) { return; } const auto client = atoi(params[1]); - const auto text = params.join(2); + const auto* format = reinterpret_cast(0x140E25180_g); const auto* message = utils::string::va(format, 'O', text.data()); - reinterpret_cast(0x140532CA0_g)(client, 0, message); + + game::SV_GameSendServerCommand(client, game::SV_CMD_CAN_IGNORE_0, message); }); - // Kill say and tell commands - utils::hook::nop(0x1405299FB_g, 5); - utils::hook::nop(0x140529A21_g, 5); - utils::hook::nop(0x140529A3B_g, 5); - utils::hook::nop(0x140529A07_g, 5); - utils::hook::nop(0x140529A55_g, 5); - utils::hook::nop(0x140529A6F_g, 5); + // Kill say fallback + utils::hook::set(0x1402FF987_g, 0xEB); } else { diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 2c8c64c9..4ca629dd 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -109,8 +109,8 @@ namespace game 0x1422D0900, 0x14057B500 }; WEAK symbol Dvar_SessionModeRegisterBool{ - 0x1422D0D40, 0x14057BAA0 + const char* description)> Dvar_SessionModeRegisterBool{ + 0x1422D0D40, 0x14057BAA0 }; WEAK symbol Dvar_SessionModeSetDefaultBool{ 0x1422D0E90, 0x14057BCE0 @@ -133,7 +133,7 @@ namespace game WEAK symbol UI_CoD_Shutdown{0x141F32E10, 0x0}; WEAK symbol UI_AddMenu{0x1427018F0, 0x0}; WEAK symbol UI_CoD_GetRootNameForController{0x141F28940, 0x0}; - WEAK symbol Lua_CoD_LoadLuaFile{0x141F11A20, 0x0}; + WEAK symbol Lua_CoD_LoadLuaFile{0x141F11A20, 0x0}; WEAK symbol CG_LUIHUDRestart{0x140F7E970}; WEAK symbol CL_CheckKeepDrawingConnectScreen{0x1413CCAE0}; @@ -159,6 +159,7 @@ namespace game // SV WEAK symbol SV_Loaded{0x142252250, 0x140535460}; WEAK symbol SV_AddTestClient{0x142248F40, 0x14052E3E0}; + WEAK symbol SV_GameSendServerCommand{0x0, 0x140532CA0}; WEAK symbol SV_SendServerCommand{0x0, 0x140537F10}; WEAK symbol SV_IsTestClient{0x14224AB60, 0x14052FF40}; WEAK symbol SV_SpawnServer{