mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-04 00:23:27 +08:00
Use the timestamp when validating cache version (#2834)
This commit is contained in:
parent
0f8cec4604
commit
1dc46b1fa9
@ -89,7 +89,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
cache_file.load();
|
cache_file.load();
|
||||||
|
|
||||||
if (cache_file.up_to_date(mem_region.size()))
|
if (cache_file.up_to_date(mem_region.timestamp()))
|
||||||
{
|
{
|
||||||
LOG(INFO) << batch_name.str << " pointers cache is up to date, using it.";
|
LOG(INFO) << batch_name.str << " pointers cache is up to date, using it.";
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ namespace big
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto file_version = memory::module("GTA5.exe").size();
|
const auto file_version = memory::module("GTA5.exe").timestamp();
|
||||||
|
|
||||||
return m_peds_cache.up_to_date(file_version) && m_vehicles_cache.up_to_date(file_version) && m_weapons_cache.up_to_date(file_version);
|
return m_peds_cache.up_to_date(file_version) && m_vehicles_cache.up_to_date(file_version) && m_weapons_cache.up_to_date(file_version);
|
||||||
}
|
}
|
||||||
@ -522,7 +522,7 @@ namespace big
|
|||||||
|
|
||||||
LOG(VERBOSE) << "Starting cache saving procedure...";
|
LOG(VERBOSE) << "Starting cache saving procedure...";
|
||||||
g_thread_pool->push([this, peds = std::move(peds), vehicles = std::move(vehicles), weapons = std::move(weapons), weapon_components = std::move(weapon_components)] {
|
g_thread_pool->push([this, peds = std::move(peds), vehicles = std::move(vehicles), weapons = std::move(weapons), weapon_components = std::move(weapon_components)] {
|
||||||
const auto file_version = memory::module("GTA5.exe").size();
|
const auto file_version = memory::module("GTA5.exe").timestamp();
|
||||||
|
|
||||||
{
|
{
|
||||||
const auto data_size = sizeof(ped_item) * peds.size();
|
const auto data_size = sizeof(ped_item) * peds.size();
|
||||||
|
@ -31,7 +31,7 @@ namespace big
|
|||||||
|
|
||||||
m_cache_file.load();
|
m_cache_file.load();
|
||||||
|
|
||||||
if (m_cache_file.up_to_date(memory::module("GTA5.exe").size()))
|
if (m_cache_file.up_to_date(memory::module("GTA5.exe").timestamp()))
|
||||||
{
|
{
|
||||||
LOG(INFO) << "Loading tunables from cache";
|
LOG(INFO) << "Loading tunables from cache";
|
||||||
m_loading = true;
|
m_loading = true;
|
||||||
@ -107,7 +107,7 @@ namespace big
|
|||||||
data_ptr += sizeof(tunable_save_struct);
|
data_ptr += sizeof(tunable_save_struct);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cache_file.set_header_version(memory::module("GTA5.exe").size());
|
m_cache_file.set_header_version(memory::module("GTA5.exe").timestamp());
|
||||||
m_cache_file.set_data(std::move(data), data_size);
|
m_cache_file.set_data(std::move(data), data_size);
|
||||||
m_cache_file.write();
|
m_cache_file.write();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user