From 54549699119b4dad7a8c18fe31e9bf7d35db70c0 Mon Sep 17 00:00:00 2001 From: Uladzislau Nikalayevich Date: Fri, 31 Jan 2025 19:12:42 +0300 Subject: [PATCH] Remove old hacks --- .../deathmatch/logic/CClientObjectManager.cpp | 21 +------- .../deathmatch/logic/CClientObjectManager.h | 1 - Client/multiplayer_sa/CMultiplayerSA.h | 1 - ...ltiplayerSA_ObjectStreamerOptimization.cpp | 50 ------------------- Client/sdk/multiplayer/CMultiplayer.h | 1 - 5 files changed, 2 insertions(+), 72 deletions(-) diff --git a/Client/mods/deathmatch/logic/CClientObjectManager.cpp b/Client/mods/deathmatch/logic/CClientObjectManager.cpp index 45cc2a0408..c59483b4db 100644 --- a/Client/mods/deathmatch/logic/CClientObjectManager.cpp +++ b/Client/mods/deathmatch/logic/CClientObjectManager.cpp @@ -230,22 +230,7 @@ void CClientObjectManager::OnDestruction(CClientObject* pObject) void CClientObjectManager::UpdateLimitInfo() { m_iEntryInfoNodeEntries = g_pMultiplayer->EntryInfoNodePool_NoOfUsedSpaces(); - m_iPointerNodeSingleLinkEntries = g_pMultiplayer->PtrNodeSingleLinkPool_NoOfUsedSpaces(); m_iPointerNodeDoubleLinkEntries = g_pMultiplayer->PtrNodeDoubleLinkPool_NoOfUsedSpaces(); - - /* - CPools* pPools = g_pGame->GetPools(); - unsigned int nEntryInfoNodeEntries = pPools->GetEntryInfoNodePool()->GetNumberOfUsedSpaces(); - unsigned int nPointerNodeSingleLinkEntries = pPools->GetPointerNodeSingleLinkPool()->GetNumberOfUsedSpaces(); - unsigned int nPointerNodeDoubleLinkEntries = pPools->GetPointerNodeDoubleLinkPool()->GetNumberOfUsedSpaces(); - - g_pCore->ChatPrintf("%d = %d ### %d = %d ### %d = %d", false, nEntryInfoNodeEntries, m_iEntryInfoNodeEntries, nPointerNodeSingleLinkEntries, - m_iPointerNodeSingleLinkEntries, nPointerNodeDoubleLinkEntries, m_iPointerNodeDoubleLinkEntries); - - assert(nEntryInfoNodeEntries == m_iEntryInfoNodeEntries); - assert(nPointerNodeSingleLinkEntries == m_iPointerNodeSingleLinkEntries); - assert(nPointerNodeDoubleLinkEntries == m_iPointerNodeDoubleLinkEntries); - */ } bool CClientObjectManager::StaticIsObjectLimitReached() @@ -278,8 +263,7 @@ bool CClientObjectManager::IsHardObjectLimitReached() return true; // If we've run out of either of these limit, don't allow more objects - if (m_iEntryInfoNodeEntries >= MAX_ENTRY_INFO_NODES_MTA || m_iPointerNodeSingleLinkEntries >= MAX_POINTER_SINGLE_LINKS_MTA || - m_iPointerNodeDoubleLinkEntries >= MAX_POINTER_DOUBLE_LINKS_MTA) + if (m_iEntryInfoNodeEntries >= MAX_ENTRY_INFO_NODES_MTA || m_iPointerNodeDoubleLinkEntries >= MAX_POINTER_DOUBLE_LINKS_MTA) { if (!m_bDoneLimitWarning) { @@ -287,9 +271,8 @@ bool CClientObjectManager::IsHardObjectLimitReached() SString strMessage( "CClientObjectManager reached limit -" " ENTRY_INFO_NODES:%d/%d" - " POINTER_SINGLE_LINKS:%d/%d" " POINTER_DOUBLE_LINKS:%d/%d", - m_iEntryInfoNodeEntries, MAX_ENTRY_INFO_NODES_MTA, m_iPointerNodeSingleLinkEntries, MAX_POINTER_SINGLE_LINKS_MTA, + m_iEntryInfoNodeEntries, MAX_ENTRY_INFO_NODES_MTA, m_iPointerNodeDoubleLinkEntries, MAX_POINTER_DOUBLE_LINKS_MTA); g_pCore->GetConsole()->Echo(strMessage); AddReportLog(7430, strMessage); diff --git a/Client/mods/deathmatch/logic/CClientObjectManager.h b/Client/mods/deathmatch/logic/CClientObjectManager.h index 113e33db9b..7be7aa70ab 100644 --- a/Client/mods/deathmatch/logic/CClientObjectManager.h +++ b/Client/mods/deathmatch/logic/CClientObjectManager.h @@ -56,7 +56,6 @@ class CClientObjectManager void UpdateLimitInfo(); int m_iEntryInfoNodeEntries; - int m_iPointerNodeSingleLinkEntries; int m_iPointerNodeDoubleLinkEntries; uint m_uiMaxStreamedInCount; uint m_uiMaxLowLodStreamedInCount; diff --git a/Client/multiplayer_sa/CMultiplayerSA.h b/Client/multiplayer_sa/CMultiplayerSA.h index 0dd642cb4b..b4339fae47 100644 --- a/Client/multiplayer_sa/CMultiplayerSA.h +++ b/Client/multiplayer_sa/CMultiplayerSA.h @@ -354,7 +354,6 @@ class CMultiplayerSA : public CMultiplayer DWORD GetLastAnimArrayAddress() { return m_dwLastAnimArrayAddress; } unsigned int EntryInfoNodePool_NoOfUsedSpaces() const noexcept override; - unsigned int PtrNodeSingleLinkPool_NoOfUsedSpaces() const noexcept override; unsigned int PtrNodeDoubleLinkPool_NoOfUsedSpaces() const noexcept override; CVector m_vecAkimboTarget; diff --git a/Client/multiplayer_sa/CMultiplayerSA_ObjectStreamerOptimization.cpp b/Client/multiplayer_sa/CMultiplayerSA_ObjectStreamerOptimization.cpp index 2fb73247c3..976eefb98b 100644 --- a/Client/multiplayer_sa/CMultiplayerSA_ObjectStreamerOptimization.cpp +++ b/Client/multiplayer_sa/CMultiplayerSA_ObjectStreamerOptimization.cpp @@ -11,7 +11,6 @@ #include "StdInc.h" static unsigned int CEntryInfoNodePool_UsedSpaces = 0; -static unsigned int CPtrNodeSingleLinkPool_UsedSpaces = 0; static unsigned int CPtrNodeDoubleLinkPool_UsedSpaces = 0; #define HOOKPOS_CEntryInfoNodePool__New 0x536D6E @@ -55,46 +54,6 @@ static void _declspec(naked) HOOK_CEntryInfoList__Flush() } } -#define HOOKPOS_CPtrNodeSingleLinkPool__New 0x55229B -#define HOOKSIZE_CPtrNodeSingleLinkPool__New 0x5 -static void _declspec(naked) HOOK_CPtrNodeSingleLinkPool__New() -{ - _asm { - inc CPtrNodeSingleLinkPool_UsedSpaces - - lea eax, [ecx+eax*8] - pop esi - ret - } -} -#define HOOKPOS_CPtrNodeSingleLink__operator_delete 0x5523AA -#define HOOKSIZE_CPtrNodeSingleLink__operator_delete 0x5 -static const unsigned int RETURN_CPtrNodeSingleLink__operator_delete = 0x5523AF; -static void _declspec(naked) HOOK_CPtrNodeSingleLink__operator_delete() -{ - _asm { - dec CPtrNodeSingleLinkPool_UsedSpaces - - or bl, 0x80 - mov [ecx], bl - jmp RETURN_CPtrNodeSingleLink__operator_delete - } -} - -#define HOOKPOS_CPtrListSingleLink__Flush 0x55244D -#define HOOKSIZE_CPtrListSingleLink__Flush 0x6 -static const unsigned int RETURN_CPtrListSingleLink__Flush = 0x552453; -static void _declspec(naked) HOOK_CPtrListSingleLink__Flush() -{ - _asm { - dec CPtrNodeSingleLinkPool_UsedSpaces - - or byte ptr [edx+eax], 0x80 - add edx, eax - jmp RETURN_CPtrListSingleLink__Flush - } -} - #define HOOKPOS_CPtrNodeDoubleLinkPool__New 0x55233E #define HOOKSIZE_CPtrNodeDoubleLinkPool__New 0x6 static void _declspec(naked) HOOK_CPtrNodeDoubleLinkPool__New() @@ -142,10 +101,6 @@ void CMultiplayerSA::InitHooks_ObjectStreamerOptimization() EZHookInstall(CEntryInfoNode__operator_delete); EZHookInstall(CEntryInfoList__Flush); - EZHookInstall(CPtrNodeSingleLinkPool__New); - EZHookInstall(CPtrNodeSingleLink__operator_delete); - EZHookInstall(CPtrListSingleLink__Flush); - EZHookInstall(CPtrNodeDoubleLinkPool__New); EZHookInstall(CPtrNodeDoubleLink__operator_delete); EZHookInstall(CPtrListDoubleLink__Flush); @@ -156,11 +111,6 @@ unsigned int CMultiplayerSA::EntryInfoNodePool_NoOfUsedSpaces() const noexcept return CEntryInfoNodePool_UsedSpaces; } -unsigned int CMultiplayerSA::PtrNodeSingleLinkPool_NoOfUsedSpaces() const noexcept -{ - return CPtrNodeSingleLinkPool_UsedSpaces; -} - unsigned int CMultiplayerSA::PtrNodeDoubleLinkPool_NoOfUsedSpaces() const noexcept { return CPtrNodeDoubleLinkPool_UsedSpaces; diff --git a/Client/sdk/multiplayer/CMultiplayer.h b/Client/sdk/multiplayer/CMultiplayer.h index 33e349ea71..d9dd4ab571 100644 --- a/Client/sdk/multiplayer/CMultiplayer.h +++ b/Client/sdk/multiplayer/CMultiplayer.h @@ -460,6 +460,5 @@ class CMultiplayer virtual DWORD GetLastAnimArrayAddress() = 0; virtual unsigned int EntryInfoNodePool_NoOfUsedSpaces() const noexcept = 0; - virtual unsigned int PtrNodeSingleLinkPool_NoOfUsedSpaces() const noexcept = 0; virtual unsigned int PtrNodeDoubleLinkPool_NoOfUsedSpaces() const noexcept = 0; };