mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +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();
|
||||
|
||||
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.";
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
@ -522,7 +522,7 @@ namespace big
|
||||
|
||||
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)] {
|
||||
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();
|
||||
|
@ -31,7 +31,7 @@ namespace big
|
||||
|
||||
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";
|
||||
m_loading = true;
|
||||
@ -107,7 +107,7 @@ namespace big
|
||||
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.write();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user