From fa5c7cebdcf91c18715873d158c92cb19b410e1e Mon Sep 17 00:00:00 2001 From: Mr-X-GTA <110748953+Mr-X-GTA@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:48:40 +0200 Subject: [PATCH] Fix player tracking (#10) --- src/byte_patch_manager.cpp | 3 +++ src/pointers.cpp | 9 +++++++++ src/sc_pointers.hpp | 1 + src/services/player_database/player_database_service.cpp | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/byte_patch_manager.cpp b/src/byte_patch_manager.cpp index f6fce247..6c53e629 100644 --- a/src/byte_patch_manager.cpp +++ b/src/byte_patch_manager.cpp @@ -70,6 +70,9 @@ namespace big // Patch script network check memory::byte_patch::make(g_pointers->m_gta.m_model_spawn_bypass, std::vector{0x90, 0x90})->apply(); // this is no longer integrity checked + // Increase Start Get Presence Attributes limit from 32 to 100 + memory::byte_patch::make(g_pointers->m_sc.m_num_handles_patch, std::vector{0x64})->apply(); + // Prevent the attribute task from failing memory::byte_patch::make(g_pointers->m_sc.m_read_attribute_patch, std::vector{0x90, 0x90})->apply(); memory::byte_patch::make(g_pointers->m_sc.m_read_attribute_patch_2, std::vector{0xB0, 0x01})->apply(); diff --git a/src/pointers.cpp b/src/pointers.cpp index 1144cacb..58636cbb 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -2029,6 +2029,15 @@ namespace big g_pointers->m_sc.m_start_get_presence_attributes = ptr.as(); } }, + // SGPA Num Handles Patch + { + "NHP", + "83 FD 20 0F 87 54 02 00 00", + [](memory::handle ptr) + { + g_pointers->m_sc.m_num_handles_patch = ptr.add(2).as(); + } + }, // Read Attribute Patch { "RAP", diff --git a/src/sc_pointers.hpp b/src/sc_pointers.hpp index 757540fd..e277fc67 100644 --- a/src/sc_pointers.hpp +++ b/src/sc_pointers.hpp @@ -11,6 +11,7 @@ namespace big functions::update_presence_attribute_string m_update_presence_attribute_string; functions::start_get_presence_attributes m_start_get_presence_attributes; + PVOID m_num_handles_patch; PVOID m_read_attribute_patch; PVOID m_read_attribute_patch_2; }; diff --git a/src/services/player_database/player_database_service.cpp b/src/services/player_database/player_database_service.cpp index 1fbe5378..ed1b780b 100644 --- a/src/services/player_database/player_database_service.cpp +++ b/src/services/player_database/player_database_service.cpp @@ -345,7 +345,7 @@ namespace big void player_database_service::update_player_states(bool tracked_only) { - constexpr auto bucket_size = 32; + constexpr auto bucket_size = 100; std::vector> gamer_handle_buckets{};