mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2026-10-12 02:08:05 +08:00
Fix GTA data service (#1635)
* fix(gta_data): service now parses unloaded RPF files
This commit is contained in:
1 parent
172de938cc
commit
90ff1ece84
12 files changed
+302
-445
No files matched your search
@@ -17,9 +17,13 @@ namespace big
|
||||
if (g_gta_data_service->state() == eGtaDataUpdateState::ON_INIT_UPDATE_START)
|
||||
{
|
||||
yim_fipackfile rpf_wrapper = yim_fipackfile(this_, mount_point);
|
||||
std::for_each(yim_fipackfile::m_wrapper_call_back.begin(), yim_fipackfile::m_wrapper_call_back.end(), [&rpf_wrapper](std::function<size_t(yim_fipackfile & rpf_wrapper)> cb) {
|
||||
cb(rpf_wrapper);
|
||||
});
|
||||
const auto files = rpf_wrapper.get_file_paths();
|
||||
for (const auto& file : files)
|
||||
{
|
||||
std::for_each(yim_fipackfile::m_wrapper_call_back.begin(), yim_fipackfile::m_wrapper_call_back.end(), [&rpf_wrapper, file](std::function<void(yim_fipackfile & rpf_wrapper, std::filesystem::path path)> cb) {
|
||||
cb(rpf_wrapper, file);
|
||||
});
|
||||
}
|
||||
|
||||
if (!stricmp(this_->GetName(), "BgScript.rpf"))
|
||||
{
|
||||
|
||||
@@ -166,71 +166,16 @@ namespace big
|
||||
}
|
||||
break;
|
||||
}
|
||||
case rage::eNetMessage::MsgRemoveGamersFromSessionCmd:
|
||||
{
|
||||
player_ptr pl;
|
||||
uint64_t session_id;
|
||||
buffer.ReadQWord(&session_id, 64);
|
||||
uint32_t count;
|
||||
buffer.ReadDword(&count, 6);
|
||||
for (std::uint32_t i = 0; i < count; i++)
|
||||
{
|
||||
uint64_t peer_id;
|
||||
buffer.ReadQWord(&peer_id, 64);
|
||||
for (std::uint32_t i = 0; i < gta_util::get_network()->m_game_session_ptr->m_peer_count; i++)
|
||||
{
|
||||
if (gta_util::get_network()->m_game_session_ptr->m_peers[i]->m_peer_data.m_peer_id_2 == peer_id)
|
||||
{
|
||||
pl = g_player_service->get_by_host_token(
|
||||
gta_util::get_network()->m_game_session_ptr->m_peers[i]->m_peer_data.m_host_token);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (player && pl && player->id() != pl->id() && count == 1 && frame->m_msg_id == -1)
|
||||
{
|
||||
if (g_player_service->get_self()->is_host())
|
||||
{
|
||||
g.reactions.breakup_others.process(player, pl);
|
||||
session::add_infraction(player, Infraction::BREAKUP_KICK_DETECTED);
|
||||
|
||||
if (g.reactions.breakup_others.block)
|
||||
return true;
|
||||
|
||||
if (g.reactions.breakup_others.karma)
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(player, {});
|
||||
}
|
||||
else
|
||||
{
|
||||
g.reactions.breakup_others.process(player, pl);
|
||||
session::add_infraction(player, Infraction::BREAKUP_KICK_DETECTED);
|
||||
|
||||
if (g.reactions.breakup_others.karma)
|
||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(player, {});
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case rage::eNetMessage::MsgNetComplaint:
|
||||
{
|
||||
uint64_t host_token{};
|
||||
buffer.ReadQWord(&host_token, 64);
|
||||
|
||||
std::vector<CNetGamePlayer*> players;
|
||||
|
||||
uint32_t num_of_tokens{};
|
||||
buffer.ReadDword(&num_of_tokens, 32);
|
||||
|
||||
if (player && host_token != player->get_net_data()->m_host_token && !player->exposed_desync_protection)
|
||||
{
|
||||
session::add_infraction(player, Infraction::DESYNC_PROTECTION);
|
||||
player->exposed_desync_protection = true;
|
||||
}
|
||||
|
||||
return true; // block desync kicks as host
|
||||
return true;
|
||||
}
|
||||
case rage::eNetMessage::MsgRequestObjectIds:
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user