feat(GTA Cache): removed unused old code (#1663)

This commit is contained in:
Andreas Maerten
2023-07-10 00:40:47 +02:00
committed by GitHub
parent ee61858489
commit 2f1f094b89
8 changed files with 6 additions and 131 deletions

View File

@ -62,27 +62,6 @@ namespace big
m_update_state = state;
}
void gta_data_service::update_in_online()
{
m_update_state = eGtaDataUpdateState::WAITING_FOR_SINGLE_PLAYER;
g_fiber_pool->queue_job([this] {
while (*g_pointers->m_gta.m_game_state != eGameState::Playing)
{
script::get_current()->yield(100ms);
}
m_update_state = eGtaDataUpdateState::WAITING_FOR_ONLINE;
session::join_type(eSessionType::SOLO);
while (!*g_pointers->m_gta.m_is_session_started)
{
script::get_current()->yield(100ms);
}
m_update_state = eGtaDataUpdateState::UPDATING;
rebuild_cache();
});
}
void gta_data_service::update_now()
{
m_update_state = eGtaDataUpdateState::WAITING_FOR_SINGLE_PLAYER;
@ -92,14 +71,6 @@ namespace big
});
}
void gta_data_service::update_on_init()
{
m_update_state = eGtaDataUpdateState::ON_INIT_WAITING;
g_thread_pool->push([this] {
rebuild_cache();
});
}
// innefficient getters, don't care to fix right now
const ped_item& gta_data_service::ped_by_hash(std::uint32_t hash)
{
@ -501,11 +472,6 @@ namespace big
{
yim_fipackfile::for_each_fipackfile();
}
else
{
while (state() != eGtaDataUpdateState::ON_INIT_UPDATE_END)
std::this_thread::sleep_for(100ms);
}
static bool translate_lebel = false;

View File

@ -11,11 +11,7 @@ namespace big
IDLE,
NEEDS_UPDATE,
WAITING_FOR_SINGLE_PLAYER,
WAITING_FOR_ONLINE,
UPDATING,
ON_INIT_WAITING,
ON_INIT_UPDATE_START,
ON_INIT_UPDATE_END
UPDATING
};
using ped_map = std::map<std::string, ped_item>;
@ -31,9 +27,7 @@ namespace big
bool cache_needs_update() const;
eGtaDataUpdateState state() const;
void set_state(eGtaDataUpdateState state);
void update_in_online();
void update_now();
void update_on_init();
const ped_item& ped_by_hash(std::uint32_t hash);
const vehicle_item& vehicle_by_hash(std::uint32_t hash);