Merge pull request #105 from diamante0018/main

fix(network): add is_server check
This commit is contained in:
Maurice Heumann 2023-01-10 10:59:30 +01:00 committed by GitHub
commit d32ed2422a

View File

@ -123,9 +123,9 @@ namespace network
return length + (socket_byte_missing() ? 1 : 0); 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<uint8_t>(game::select(0x14224E90D, 0x1405315F9), 0xEB); // don't kick clients without dw handle utils::hook::set<uint8_t>(game::select(0x14224E90D, 0x1405315F9), 0xEB); // don't kick clients without dw handle
// Remove restrictions for rcon commands if (game::is_server())
utils::hook::call(0x140538D5C_g, con_restricted_execute_buf_stub); // SVC_RemoteCommand {
// Remove restrictions for rcon commands
utils::hook::call(0x140538D5C_g, con_restricted_execute_buf_stub); // SVC_RemoteCommand
}
// TODO: Fix that // TODO: Fix that
scheduler::once(create_ip_socket, scheduler::main); scheduler::once(create_ip_socket, scheduler::main);