From c92d3a993261b348869494f72772ffa95fe4e296 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Mon, 9 Jan 2023 22:51:37 +0100 Subject: [PATCH] fix(network): add is_server check --- src/client/component/network.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client/component/network.cpp b/src/client/component/network.cpp index cb879590..8407265b 100644 --- a/src/client/component/network.cpp +++ b/src/client/component/network.cpp @@ -123,9 +123,9 @@ namespace network return length + (socket_byte_missing() ? 1 : 0); } - void con_restricted_execute_buf_stub(int local_clientNum, game::ControllerIndex_t controller_index, const char* buffer) + void con_restricted_execute_buf_stub(int local_client_num, game::ControllerIndex_t controller_index, const char* buffer) { - game::Cbuf_ExecuteBuffer(local_clientNum, controller_index, buffer); + game::Cbuf_ExecuteBuffer(local_client_num, controller_index, buffer); } } @@ -233,8 +233,11 @@ namespace network utils::hook::set(game::select(0x14224E90D, 0x1405315F9), 0xEB); // don't kick clients without dw handle - // Remove restrictions for rcon commands - utils::hook::call(0x140538D5C_g, con_restricted_execute_buf_stub); // SVC_RemoteCommand + if (game::is_server()) + { + // Remove restrictions for rcon commands + utils::hook::call(0x140538D5C_g, con_restricted_execute_buf_stub); // SVC_RemoteCommand + } // TODO: Fix that scheduler::once(create_ip_socket, scheduler::main);