From c7ee545ce92e0ad1b44c4f9ce1b9de54dcfae4bf Mon Sep 17 00:00:00 2001 From: Accelerator Date: Tue, 7 May 2024 20:08:42 +0300 Subject: [PATCH] 2.0.1 Always reply to a lobby request if the server is already reserved. --- l4d1_offsets_linux.h | 1 + l4d1_offsets_win32.h | 1 + l4d2_offsets_linux.h | 1 + l4d2_offsets_win32.h | 1 + l4dtoolz_mm.cpp | 6 +++++- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/l4d1_offsets_linux.h b/l4d1_offsets_linux.h index d9b7626..b5be70b 100644 --- a/l4d1_offsets_linux.h +++ b/l4d1_offsets_linux.h @@ -3,6 +3,7 @@ const char* engine_dll = "engine.so"; int slots_offs = 94; // m_numGameSlots (in CGameServer::ExecGameTypeCfg) +int reserved_offs = 360; // IsReserved() (in CBaseServer::ReplyReservationRequest) int reservation_idx = 60; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable int maxhuman_idx = 132; // CTerrorGameRules::GetMaxHumanPlayers vtable diff --git a/l4d1_offsets_win32.h b/l4d1_offsets_win32.h index 663440e..b008942 100644 --- a/l4d1_offsets_win32.h +++ b/l4d1_offsets_win32.h @@ -3,6 +3,7 @@ int sv_offs = 6; // IServer pointer (in IVEngineServer::CreateFakeClient) int slots_offs = 96; // m_numGameSlots (in CGameServer::ExecGameTypeCfg) +int reserved_offs = 46; // IsReserved() (in CBaseServer::ReplyReservationRequest) int reservation_idx = 59; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable int maxhuman_idx = 131; // CTerrorGameRules::GetMaxHumanPlayers vtable diff --git a/l4d2_offsets_linux.h b/l4d2_offsets_linux.h index fc4b19b..5e17e03 100644 --- a/l4d2_offsets_linux.h +++ b/l4d2_offsets_linux.h @@ -3,6 +3,7 @@ const char* engine_dll = "engine_srv.so"; int slots_offs = 95; // m_numGameSlots (in CGameServer::ExecGameTypeCfg) +int reserved_offs = 364; // IsReserved() (in CBaseServer::ReplyReservationRequest) int reservation_idx = 62; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable int maxhuman_idx = 137; // CTerrorGameRules::GetMaxHumanPlayers vtable diff --git a/l4d2_offsets_win32.h b/l4d2_offsets_win32.h index 0ad164f..b18d00b 100644 --- a/l4d2_offsets_win32.h +++ b/l4d2_offsets_win32.h @@ -3,6 +3,7 @@ int sv_offs = 8; // IServer pointer (in IVEngineServer::CreateFakeClient) int slots_offs = 96; // m_numGameSlots (in CGameServer::ExecGameTypeCfg) +int reserved_offs = 46; // IsReserved() (in CBaseServer::ReplyReservationRequest) int reservation_idx = 61; // CBaseServer::ReplyReservationRequest(netadr_s&, bf_read&) vtable int maxhuman_idx = 136; // CTerrorGameRules::GetMaxHumanPlayers vtable diff --git a/l4dtoolz_mm.cpp b/l4dtoolz_mm.cpp index 0c54555..b49b686 100644 --- a/l4dtoolz_mm.cpp +++ b/l4dtoolz_mm.cpp @@ -74,6 +74,10 @@ void Hook_ApplyGameSettings(KeyValues *pKV) void Hook_ReplyReservationRequest(netadr_s& adr, CBitRead& inmsg) { if (sv_force_unreserved.GetInt()) { + if (g_pGameIServer != NULL) { + if (*(uint64_t*)(((uint**)g_pGameIServer)+reserved_offs) != 0) + RETURN_META(MRES_IGNORED); + } RETURN_META(MRES_SUPERCEDE); } RETURN_META(MRES_IGNORED); @@ -235,7 +239,7 @@ const char *l4dtoolz::GetLicense() const char *l4dtoolz::GetVersion() { - return "2.0.0"; + return "2.0.1"; } const char *l4dtoolz::GetDate()