Feat ptr cache continued (#1227)

This commit is contained in:
Quentin E. / iDeath
2023-04-14 18:54:07 +02:00
committed by GitHub
parent a3b8e780ec
commit 5a4dc03121
133 changed files with 2488 additions and 1622 deletions

View File

@ -2,6 +2,14 @@
namespace big
{
cache_file::cache_file(file cache_file) :
m_cache_file(cache_file),
m_data(nullptr),
m_cache_version(0),
m_cache_header()
{
}
cache_file::cache_file(file cache_file, std::uint32_t cache_version) :
m_cache_file(cache_file),
m_data(nullptr),
@ -78,4 +86,9 @@ namespace big
m_cache_header.m_game_version = game_version;
m_cache_header.m_online_version = online_version;
}
}
void cache_file::set_cache_version(std::uint32_t cache_version)
{
m_cache_version = cache_version;
}
}

View File

@ -16,6 +16,12 @@ namespace big
class cache_file final
{
public:
/// <summary>
///
/// </summary>
/// <param name="cache_file">FileMgr file object</param>
cache_file(file cache_file);
/// <summary>
///
/// </summary>
@ -60,6 +66,8 @@ namespace big
/// <param name="online_version">Online Version</param>
void set_header_version(std::uint32_t game_version, float online_version);
void set_cache_version(std::uint32_t cache_version);
private:
file m_cache_file;
@ -68,4 +76,4 @@ namespace big
cache_header m_cache_header;
cache_data m_data;
};
}
}

View File

@ -62,7 +62,7 @@ namespace big
{
m_update_state = eGtaDataUpdateState::WAITING_FOR_SINGLE_PLAYER;
g_fiber_pool->queue_job([this] {
while (*g_pointers->m_game_state != eGameState::Playing)
while (*g_pointers->m_gta.m_game_state != eGameState::Playing)
{
script::get_current()->yield(100ms);
}
@ -70,7 +70,7 @@ namespace big
session::join_type(eSessionType::SOLO);
while (!*g_pointers->m_is_session_started)
while (!*g_pointers->m_gta.m_is_session_started)
{
script::get_current()->yield(100ms);
}

View File

@ -16,11 +16,11 @@ namespace big
{
std::vector<std::string> non_dlc_mounted_devices_names;
uint16_t mounted_devices_len = *g_pointers->m_fidevices_len;
uint16_t mounted_devices_len = *g_pointers->m_gta.m_fidevices_len;
if (mounted_devices_len)
{
auto devices_arr = *(uint64_t*)g_pointers->m_fidevices;
uint8_t** current_device_mount_name_ptr = *(unsigned __int8***)g_pointers->m_fidevices;
auto devices_arr = *(uint64_t*)g_pointers->m_gta.m_fidevices;
uint8_t** current_device_mount_name_ptr = *(unsigned __int8***)g_pointers->m_gta.m_fidevices;
auto device_i = 0;
while (true)
@ -56,9 +56,9 @@ namespace big
constexpr auto yield_increment = 80;
auto i = 1;
while (g_pointers->m_fipackfile_instances[i])
while (g_pointers->m_gta.m_fipackfile_instances[i])
{
auto* rpf = g_pointers->m_fipackfile_instances[i];
auto* rpf = g_pointers->m_gta.m_fipackfile_instances[i];
// its hard coded in the binary?
if (++i >= 3672)
@ -108,7 +108,7 @@ namespace big
cb(rpf_wrapper);
});
g_pointers->m_fipackfile_unmount(default_mount_name);
g_pointers->m_gta.m_fipackfile_unmount(default_mount_name);
}
}
else