mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-16 22:37:22 +08:00
Auto Host Kick, become Host in Quere #1
This commit is contained in:
parent
f844e77a0c
commit
4d567f35a4
@ -21,12 +21,21 @@ namespace big
|
||||
{
|
||||
void bypass_battleye()
|
||||
{
|
||||
auto old = g.session.spoof_host_token_type;
|
||||
g.session.spoof_host_token_type = std::max(old, 1);
|
||||
if (old != g.session.spoof_host_token_type)
|
||||
{
|
||||
g.session.spoof_host_token_dirty = true;
|
||||
}
|
||||
g.session.kick_host_when_forcing_host = true;
|
||||
g.session.exclude_modders_from_kick_host = true; // useful
|
||||
constexpr std::array<std::uint32_t, 16> valid_hashes = {1410389794, 967, 1523678325, 472, 0, 0, 1323039495, 0, 0, 1731098795, 2256610353, 17956, 414639110, 307143837, 3443181821, 0};
|
||||
|
||||
if (auto hashes = *g_pointers->m_gta.m_game_data_hash)
|
||||
{
|
||||
for (int i = 0; i < valid_hashes.size(); i++)
|
||||
{
|
||||
hashes->m_data[i] = valid_hashes[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,25 +8,24 @@ namespace big
|
||||
static bool is_next_in_queue()
|
||||
{
|
||||
uint64_t my_host_token = g_player_service->get_self()->get_net_data()->m_host_token;
|
||||
|
||||
for (const auto& plyr : g_player_service->players() | std::ranges::views::values)
|
||||
{
|
||||
if (plyr->is_host())
|
||||
{
|
||||
continue;
|
||||
|
||||
}
|
||||
if (plyr->get_net_data()->m_host_token < my_host_token)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool bLastKickHost = false;
|
||||
void looped::session_auto_kick_host()
|
||||
{
|
||||
#if 0
|
||||
|
||||
bool kick_host = *g_pointers->m_gta.m_is_session_started && g.session.spoof_host_token_type != 0 && g.session.kick_host_when_forcing_host;
|
||||
if (kick_host && !bLastKickHost && is_next_in_queue()) [[unlikely]]
|
||||
{
|
||||
@ -43,6 +42,6 @@ namespace big
|
||||
});
|
||||
}
|
||||
bLastKickHost = kick_host;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace big
|
||||
attributes->m_param_values[2] = std::min(29u, attributes->m_param_values[2]);
|
||||
|
||||
// TODO: the logic is incorrect
|
||||
|
||||
attributes->m_param_values[0] = -0x22F37A9E;
|
||||
if (g.spoofing.spoof_session_bad_sport_status == 1)
|
||||
attributes->m_param_values[0] |= (1 << 14); // Bad Sport
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user