From c112eafad03937511d0018e373018751b6ebebd8 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Fri, 11 Mar 2022 21:41:17 +0100 Subject: [PATCH] Fix client_t struct --- src/client/component/patches.cpp | 4 ++-- src/client/game/structs.hpp | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/component/patches.cpp b/src/client/component/patches.cpp index 4498e272..8cf81a71 100644 --- a/src/client/component/patches.cpp +++ b/src/client/component/patches.cpp @@ -259,10 +259,10 @@ namespace patches dvars::override::register_int("com_maxfps", 0, 0, 1000, game::DVAR_FLAG_SAVED); // Prevent clients from ending the game as non host by sending 'end_game' lui notification - // cmd_lui_notify_server_hook.create(0x140335A70, cmd_lui_notify_server_stub); + cmd_lui_notify_server_hook.create(0x140335A70, cmd_lui_notify_server_stub); // Prevent clients from sending invalid reliableAcknowledge - // utils::hook::call(0x1404899C6, sv_execute_client_message_stub); + utils::hook::call(0x1404899C6, sv_execute_client_message_stub); // "fix" for rare 'Out of memory error' error if (utils::flags::has_flag("memoryfix")) diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index e57d54c7..a20c48d7 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -1382,17 +1382,17 @@ namespace game struct clientHeader_t { int state; - char __pad0[36]; + char __pad0[44]; netadr_s remoteAddress; }; // size = ? struct client_t { clientHeader_t header; - char __pad0[3044]; + char __pad0[265164]; int reliableSequence; int reliableAcknowledge; - char __pad1[265864]; + char __pad1[265832]; gentity_s* gentity; // 268976 char name[32]; // 268984 char __pad2[8]; @@ -1401,8 +1401,10 @@ namespace game LiveClientDropType liveDropRequest; //269572 char __pad4[24]; TestClientType testClient; // 269600 - char __pad5[610012]; + char __pad5[129600]; }; // size = 661304 + + static_assert(sizeof(client_t) == 661304); } namespace sp