mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 12:07:46 +08:00
Fix Network
This commit is contained in:
parent
fa5c7cebdc
commit
c28bcb9872
@ -3,7 +3,7 @@ include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
gtav_classes
|
||||
GIT_REPOSITORY https://github.com/Mr-X-GTA/GTAV-Classes-1.git
|
||||
GIT_TAG 98c2c1959e2ba129ccb6268f24f89b49596bbd2b
|
||||
GIT_TAG 6e53c26ac9904e00e3f851826fb61367829eca26
|
||||
GIT_PROGRESS TRUE
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
|
@ -20,9 +20,7 @@ namespace big
|
||||
return;
|
||||
if (gta_util::get_network()->m_game_session_ptr->is_host())
|
||||
{
|
||||
auto& mgr = *(CNetComplaintMgr*)((uint64_t)gta_util::get_network() + 0x2E5A8);
|
||||
mgr.raise_complaint(player->get_net_data()->m_host_token);
|
||||
// TODO gta_util::get_network()->m_game_complaint_mgr.raise_complaint(player->get_net_data()->m_host_token);
|
||||
gta_util::get_network()->m_game_complaint_mgr.raise_complaint(player->get_net_data()->m_host_token);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -11,25 +11,23 @@ namespace big
|
||||
{
|
||||
void looped::system_update_desync_kick()
|
||||
{
|
||||
// TODO
|
||||
auto& mgr = *(CNetComplaintMgr*)((uint64_t)gta_util::get_network() + 0x2E5A8);
|
||||
memset(&mgr.m_host_tokens_complained, 0, 64 * sizeof(uint64_t));
|
||||
mgr.m_num_tokens_complained = 0;
|
||||
memset(>a_util::get_network()->m_game_complaint_mgr.m_host_tokens_complained, 0, 64 * sizeof(uint64_t));
|
||||
gta_util::get_network()->m_game_complaint_mgr.m_num_tokens_complained = 0;
|
||||
|
||||
for (auto& player : g_player_service->players())
|
||||
{
|
||||
if (player.second->is_valid() && player.second->trigger_desync_kick)
|
||||
{
|
||||
mgr.raise_complaint(player.second->get_net_data()->m_host_token);
|
||||
gta_util::get_network()->m_game_complaint_mgr.raise_complaint(player.second->get_net_data()->m_host_token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (gta_util::get_network()->m_game_session_state > 3 && gta_util::get_network()->m_game_session_state < 6
|
||||
&& mgr.m_num_tokens_complained && g_player_service->get_self()->is_valid()
|
||||
&& gta_util::get_network()->m_game_complaint_mgr.m_num_tokens_complained && g_player_service->get_self()->is_valid()
|
||||
&& !g_player_service->get_self()->is_host())
|
||||
{
|
||||
g_pointers->m_gta.m_reset_network_complaints(&mgr);
|
||||
g_pointers->m_gta.m_reset_network_complaints(>a_util::get_network()->m_game_complaint_mgr);
|
||||
}
|
||||
}
|
||||
}
|
@ -61,7 +61,7 @@ namespace big
|
||||
if (g.protections.kick_rejoin && !NETWORK::NETWORK_IS_ACTIVITY_SESSION() && SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH("maintransition"_J) == 0 && !STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS())
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
session::join_session(*(rage::rlSessionInfo*)((uint64_t)gta_util::get_network() + 0x1E448)); // TODO gta_util::get_network()->m_last_joined_session.m_session_info
|
||||
session::join_session(gta_util::get_network()->m_last_joined_session.m_session_info);
|
||||
});
|
||||
g_notification_service.push_warning("KICKED"_T.data(), "USER_DESYNC_KICKED_REJOIN"_T.data());
|
||||
}
|
||||
|
@ -751,7 +751,12 @@ namespace big
|
||||
{
|
||||
g_battleye_service.receive_message(player->get_net_game_player()->get_host_token(), &data, size);
|
||||
}
|
||||
else if (player && !player->bad_host)
|
||||
else if (player)
|
||||
{
|
||||
g_battleye_service.send_message_to_server(player->get_net_game_player()->get_host_token(), &data, size);
|
||||
}
|
||||
|
||||
if (player && !player->bad_host && player->is_host())
|
||||
{
|
||||
player->bad_host = true;
|
||||
g_fiber_pool->queue_job([player] {
|
||||
|
Loading…
Reference in New Issue
Block a user