mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-15 22:08:00 +08:00
More fixes (#71)
- Improved session multiplexer - Fixed kick from interior - Fixed explode player - Fixed force script host - Re-added null function kick - Re-added auto kick host - Removed host token spoofing
This commit is contained in:
parent
c349c9fba2
commit
22c184d6b6
@ -3,7 +3,7 @@ include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
gtav_classes
|
||||
GIT_REPOSITORY https://github.com/Mr-X-GTA/GTAV-Classes-1.git
|
||||
GIT_TAG 9ca0cb74882505d7d2c382e9a588972fd4589775
|
||||
GIT_TAG e803b20ec3d6cf20d6b254c915e088bd010f006e
|
||||
GIT_PROGRESS TRUE
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
|
24
src/backend/commands/player/kick/null_function_kick.cpp
Normal file
24
src/backend/commands/player/kick/null_function_kick.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include "backend/player_command.hpp"
|
||||
#include "pointers.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
class null_function_kick : player_command
|
||||
{
|
||||
using player_command::player_command;
|
||||
|
||||
virtual CommandAccessLevel get_access_level() override
|
||||
{
|
||||
return CommandAccessLevel::TOXIC;
|
||||
}
|
||||
|
||||
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
||||
{
|
||||
const size_t arg_count = 16;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl, (int64_t)self::id, 1 << player->id(), (int64_t)(int)-1};
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::InteriorControl);
|
||||
}
|
||||
};
|
||||
|
||||
null_function_kick g_null_function_kick("nfkick", "NULL_FUNCTION_KICK", "NULL_FUNCTION_KICK_DESC", 0);
|
||||
}
|
@ -21,10 +21,7 @@ namespace big
|
||||
{
|
||||
if (player->is_host())
|
||||
{
|
||||
constexpr size_t arg_count = 16;
|
||||
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl, (int64_t)self::id, 1 << player->id(), (int64_t)(int)-1};
|
||||
|
||||
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::InteriorControl);
|
||||
player_command::get("nfkick"_J)->call(player, {});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -23,14 +23,14 @@ namespace big
|
||||
if (scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[player->id()].PropertyData.Index != -1)
|
||||
{
|
||||
auto cxn = g_script_connection_service->create_connection("am_mp_property_int", player);
|
||||
cxn->set_host_broadcast_size(1317);
|
||||
cxn->set_host_broadcast_size(1319);
|
||||
// cxn->set_player_broadcast_size(1185);
|
||||
cxn->set_no_remote_start(true);
|
||||
cxn->set_wait_for_host_broadcast_data(true);
|
||||
cxn->set_quick_cleanup(true);
|
||||
cxn->set_debug_logging(true);
|
||||
cxn->set_broadcast_modify_callback([](rage::scrThread* thread, uint64_t* server_vars, uint64_t* client_vars) {
|
||||
server_vars[677] = 1; // this changes every update
|
||||
server_vars[679] = 1; // this changes every update
|
||||
});
|
||||
|
||||
g_fiber_pool->queue_job([cxn] {
|
||||
|
@ -1,105 +0,0 @@
|
||||
#include "backend/looped_command.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include "gta_util.hpp"
|
||||
#include "util/math.hpp"
|
||||
#include <network/Network.hpp>
|
||||
#include <network/CCommunications.hpp>
|
||||
|
||||
namespace big
|
||||
{
|
||||
void set_peer_id_upper(std::uint64_t upper)
|
||||
{
|
||||
*g_pointers->m_gta.m_peer_id &= 0xFFFFFFFF;
|
||||
*g_pointers->m_gta.m_peer_id |= (upper << 32);
|
||||
|
||||
if (gta_util::get_network()->m_game_session_ptr)
|
||||
gta_util::get_network()->m_game_session_ptr->m_local_player.m_player_data.m_peer_id = *g_pointers->m_gta.m_peer_id;
|
||||
if (gta_util::get_network()->m_transition_session_ptr)
|
||||
gta_util::get_network()->m_transition_session_ptr->m_local_player.m_player_data.m_peer_id = *g_pointers->m_gta.m_peer_id;
|
||||
|
||||
g_pointers->m_gta.m_profile_gamer_info->m_peer_id = *g_pointers->m_gta.m_peer_id;
|
||||
g_pointers->m_gta.m_player_info_gamer_info->m_peer_id = *g_pointers->m_gta.m_peer_id;
|
||||
if (g_pointers->m_gta.m_communications != nullptr)
|
||||
(*g_pointers->m_gta.m_communications)->m_voice.m_connections[0]->m_gamer_info.m_peer_id = *g_pointers->m_gta.m_peer_id;
|
||||
|
||||
if (g_local_player && g_local_player->m_player_info)
|
||||
g_local_player->m_player_info->m_net_player_data.m_peer_id = *g_pointers->m_gta.m_peer_id;
|
||||
}
|
||||
|
||||
void set_host_token(std::uint64_t token)
|
||||
{
|
||||
*g_pointers->m_gta.m_host_token = token;
|
||||
|
||||
if (gta_util::get_network()->m_game_session_ptr)
|
||||
gta_util::get_network()->m_game_session_ptr->m_local_player.m_player_data.m_host_token = token;
|
||||
if (gta_util::get_network()->m_transition_session_ptr)
|
||||
gta_util::get_network()->m_transition_session_ptr->m_local_player.m_player_data.m_host_token = token;
|
||||
|
||||
g_pointers->m_gta.m_profile_gamer_info->m_host_token = token;
|
||||
g_pointers->m_gta.m_player_info_gamer_info->m_host_token = token;
|
||||
if (g_pointers->m_gta.m_communications != nullptr)
|
||||
(*g_pointers->m_gta.m_communications)->m_voice.m_connections[0]->m_gamer_info.m_host_token = token;
|
||||
|
||||
if (g_local_player && g_local_player->m_player_info)
|
||||
g_local_player->m_player_info->m_net_player_data.m_host_token = token;
|
||||
|
||||
|
||||
set_peer_id_upper(token >> 32);
|
||||
}
|
||||
|
||||
class spoof_host_token_internal : looped_command
|
||||
{
|
||||
using looped_command::looped_command;
|
||||
|
||||
virtual void on_enable() override
|
||||
{
|
||||
g.session.original_host_token = *g_pointers->m_gta.m_host_token;
|
||||
}
|
||||
|
||||
virtual void on_tick() override
|
||||
{
|
||||
if (g.session.spoof_host_token_dirty && gta_util::get_network()->m_game_session_state == 0)
|
||||
{
|
||||
switch (g.session.spoof_host_token_type)
|
||||
{
|
||||
case 0: // Disabled
|
||||
{
|
||||
set_host_token(g.session.original_host_token);
|
||||
break;
|
||||
}
|
||||
case 1: // Legit
|
||||
{
|
||||
std::uint64_t rand_upper = math::rand(20, 230);
|
||||
set_host_token(((g.session.original_host_token) & 0xFFFFFFFF) | (rand_upper << 32));
|
||||
break;
|
||||
}
|
||||
case 2: // Aggressive
|
||||
{
|
||||
set_host_token(math::rand(10, 1000));
|
||||
break;
|
||||
}
|
||||
case 3: // Very aggressive
|
||||
{
|
||||
set_host_token(0);
|
||||
break;
|
||||
}
|
||||
case 4: // Custom
|
||||
{
|
||||
set_host_token(g.session.custom_host_token);
|
||||
break;
|
||||
}
|
||||
}
|
||||
g.session.spoof_host_token_dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void on_disable() override
|
||||
{
|
||||
if (g.session.original_host_token)
|
||||
set_host_token(g.session.original_host_token);
|
||||
}
|
||||
};
|
||||
|
||||
static bool true_ref = true;
|
||||
spoof_host_token_internal g_spoof_host_token_internal("$$spoofhosttoken", "", "", true_ref);
|
||||
}
|
@ -24,8 +24,6 @@ namespace big
|
||||
// Patch blocked explosions
|
||||
explosion_anti_cheat_bypass::m_can_blame_others =
|
||||
memory::byte_patch::make(g_pointers->m_gta.m_blame_explode.as<uint16_t*>(), 0xE990).get();
|
||||
explosion_anti_cheat_bypass::m_set_script_flag =
|
||||
memory::byte_patch::make(g_pointers->m_gta.m_blame_explode.sub(0x63).as<uint32_t*>(), 0x90909090).get();
|
||||
explosion_anti_cheat_bypass::m_can_use_blocked_explosions =
|
||||
memory::byte_patch::make(g_pointers->m_gta.m_explosion_patch.sub(12).as<uint16_t*>(), 0x9090).get();
|
||||
|
||||
|
@ -419,9 +419,6 @@ namespace big
|
||||
bool log_text_messages = false;
|
||||
bool decloak_players = false;
|
||||
bool unhide_players_from_player_list = true;
|
||||
int spoof_host_token_type = 0;
|
||||
std::uint64_t custom_host_token = 0x000000200235F2EA;
|
||||
bool hide_token_spoofing_when_host = true;
|
||||
bool force_script_host = false;
|
||||
bool player_magnet_enabled = false;
|
||||
int player_magnet_count = 32;
|
||||
@ -441,8 +438,7 @@ namespace big
|
||||
bool chat_commands = false;
|
||||
CommandAccessLevel chat_command_default_access_level = CommandAccessLevel::FRIENDLY;
|
||||
|
||||
bool kick_host_when_forcing_host = false;
|
||||
bool exclude_modders_from_kick_host = false;
|
||||
bool kick_host_to_stay_in_session = true;
|
||||
|
||||
bool explosion_karma = false;
|
||||
bool damage_karma = false;
|
||||
@ -464,8 +460,6 @@ namespace big
|
||||
script_block_opts script_block_opts;
|
||||
|
||||
// not to be saved
|
||||
std::atomic_bool spoof_host_token_dirty = true;
|
||||
std::uint64_t original_host_token = 0;
|
||||
bool join_queued = false;
|
||||
rage::rlSessionInfo info;
|
||||
bool never_wanted_all = false;
|
||||
@ -492,7 +486,7 @@ namespace big
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(chat_translator, enabled, print_result, draw_result, bypass_same_language, target_language, endpoint);
|
||||
} chat_translator{};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session, log_chat_messages, log_text_messages, decloak_players, spoof_host_token_type, custom_host_token, hide_token_spoofing_when_host, force_script_host, player_magnet_enabled, player_magnet_count, is_team, join_in_sctv_slots, kick_host_when_forcing_host, exclude_modders_from_kick_host, explosion_karma, damage_karma, disable_traffic, disable_peds, force_thunder, block_ceo_money, randomize_ceo_colors, block_jobs, block_muggers, block_ceo_raids, block_ceo_creation, send_to_apartment_idx, send_to_warehouse_idx, chat_commands, chat_command_default_access_level, anonymous_bounty, lock_session, fast_join, unhide_players_from_player_list, allow_friends_into_locked_session, trust_friends, use_spam_timer, spam_timer, spam_length, chat_translator, script_block_opts)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session, log_chat_messages, log_text_messages, decloak_players, force_script_host, player_magnet_enabled, player_magnet_count, is_team, join_in_sctv_slots, kick_host_to_stay_in_session, explosion_karma, damage_karma, disable_traffic, disable_peds, force_thunder, block_ceo_money, randomize_ceo_colors, block_jobs, block_muggers, block_ceo_raids, block_ceo_creation, send_to_apartment_idx, send_to_warehouse_idx, chat_commands, chat_command_default_access_level, anonymous_bounty, lock_session, fast_join, unhide_players_from_player_list, allow_friends_into_locked_session, trust_friends, use_spam_timer, spam_timer, spam_length, chat_translator, script_block_opts)
|
||||
} session{};
|
||||
|
||||
struct settings
|
||||
|
@ -192,13 +192,6 @@ namespace big
|
||||
PVOID m_init_native_tables;
|
||||
functions::script_vm m_script_vm;
|
||||
|
||||
functions::generate_uuid m_generate_uuid;
|
||||
uint64_t* m_host_token;
|
||||
uint64_t* m_peer_id;
|
||||
rage::rlGamerInfo* m_profile_gamer_info; // per profile gamer info
|
||||
rage::rlGamerInfo* m_player_info_gamer_info; // the gamer info that is applied to CPlayerInfo
|
||||
CCommunications** m_communications;
|
||||
|
||||
PVOID m_handle_join_request;
|
||||
functions::write_join_response_data m_write_join_response_data;
|
||||
|
||||
@ -388,8 +381,6 @@ namespace big
|
||||
void** m_dlc_manager;
|
||||
PVOID m_get_dlc_hash;
|
||||
|
||||
PVOID m_add_gamer_to_session;
|
||||
|
||||
functions::set_head_blend_data m_set_head_blend_data;
|
||||
|
||||
std::uint32_t* m_object_ids_offset;
|
||||
|
@ -153,8 +153,6 @@ namespace big
|
||||
|
||||
detour_hook_helper::add<hooks::get_dlc_hash>("GDLCH", g_pointers->m_gta.m_get_dlc_hash);
|
||||
|
||||
detour_hook_helper::add<hooks::add_gamer_to_session>("AGTS", g_pointers->m_gta.m_add_gamer_to_session);
|
||||
|
||||
detour_hook_helper::add<hooks::create_pool_item>("CPI", g_pointers->m_gta.m_create_pool_item);
|
||||
|
||||
detour_hook_helper::add<hooks::network_can_access_multiplayer>("NCAM", g_pointers->m_gta.m_network_can_access_multiplayer);
|
||||
|
@ -208,7 +208,6 @@ namespace big
|
||||
static void send_session_detail_msg(rage::netConnectionManager* mgr, rage::netConnection::InFrame* request_frame, rage::rlSessionDetailMsg* msg);
|
||||
|
||||
static std::uint32_t get_dlc_hash(void* mgr, std::uint32_t seed);
|
||||
static bool add_gamer_to_session(rage::netConnectionManager* mgr, std::uint32_t msg_id, int* req_id, RemoteGamerInfoMsg* info, int flags, void* a6);
|
||||
|
||||
static void* create_pool_item(GenericPool* pool);
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "hooking/hooking.hpp"
|
||||
#include "services/matchmaking/matchmaking_service.hpp"
|
||||
#include <network/snSession.hpp>
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -9,9 +8,6 @@ namespace big
|
||||
if (g_matchmaking_service) [[likely]]
|
||||
g_matchmaking_service->handle_session_detail_send_response(msg);
|
||||
|
||||
if (g.session.hide_token_spoofing_when_host)
|
||||
msg->m_detail.m_host_token = g.session.original_host_token;
|
||||
|
||||
g_hooking->get_original<hooks::send_session_detail_msg>()(mgr, request_frame, msg);
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
#include "hooking/hooking.hpp"
|
||||
#include "services/players/player_service.hpp"
|
||||
|
||||
#include <network/RemoteGamerInfoMsg.hpp>
|
||||
|
||||
namespace big
|
||||
{
|
||||
bool hooks::add_gamer_to_session(rage::netConnectionManager* mgr, std::uint32_t msg_id, int* req_id, RemoteGamerInfoMsg* info, int flags, void* a6)
|
||||
{
|
||||
if (g.session.hide_token_spoofing_when_host
|
||||
&& info->m_gamer_info.m_gamer_handle.m_rockstar_id == g_player_service->get_self()->get_rockstar_id())
|
||||
{
|
||||
info->m_gamer_info.m_host_token = g.session.original_host_token;
|
||||
info->m_gamer_info.m_peer_id = (info->m_gamer_info.m_peer_id & 0xFFFFFFFF) | (g.session.original_host_token & 0xFFFFFFFF00000000); // TODO: P2pSecurity info message
|
||||
}
|
||||
|
||||
return g_hooking->get_original<hooks::add_gamer_to_session>()(mgr, msg_id, req_id, info, flags, a6);
|
||||
}
|
||||
}
|
@ -144,22 +144,28 @@ namespace big
|
||||
add_native_detour("tuneables_processing"_J, NativeIndex::_NETWORK_GET_TUNABLES_REGISTRATION_FLOAT, tunables::_NETWORK_GET_TUNABLES_REGISTRATION_FLOAT);
|
||||
|
||||
// TODO: is this safe?
|
||||
add_native_detour("am_mp_hacker_den"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("am_mp_yacht"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("arena_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("armory_aircraft_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("base_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("business_hub_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("car_meet_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("carmod_shop"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("car_meet_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("clothes_shop_mp"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("clothes_shop_sp"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("fixer_hq_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("gunclub_shop"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("hacker_den_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("hacker_truck_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("hairdo_shop_mp"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("hairdo_shop_sp"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("hangar_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("juggalo_hideout_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("personal_carmod_shop"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("tuner_property_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("clothes_shop_mp"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("gunclub_shop"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("hairdo_shop_mp"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("tattoo_shop"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("tuner_property_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
add_native_detour("vinewood_premium_garage_carmod"_J, NativeIndex::FORCE_PED_AI_AND_ANIMATION_UPDATE, all_scripts::DO_NOTHING); //Fix jittering weapons.
|
||||
|
||||
for (auto& entry : *g_pointers->m_gta.m_script_program_table)
|
||||
if (entry.m_program)
|
||||
|
@ -636,60 +636,6 @@ namespace big
|
||||
g_pointers->m_gta.m_script_vm = ptr.add(1).rip().as<functions::script_vm>();
|
||||
}
|
||||
},
|
||||
// Generate UUID
|
||||
{
|
||||
"GU",
|
||||
"E8 ? ? ? ? 84 C0 74 0C 48 8B 44 24 ? 48 89 03",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_generate_uuid = ptr.add(1).rip().as<functions::generate_uuid>();
|
||||
}
|
||||
},
|
||||
// Host Token
|
||||
{
|
||||
"HT",
|
||||
"48 8B 05 ? ? ? ? 48 83 F8 FF",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_host_token = ptr.add(3).rip().as<uint64_t*>();
|
||||
}
|
||||
},
|
||||
// Peer ID
|
||||
{
|
||||
"PI",
|
||||
"48 83 F8 FF 74 0D",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_peer_id = ptr.add(9).rip().as<uint64_t*>();
|
||||
}
|
||||
},
|
||||
// Profile Gamer Info
|
||||
{
|
||||
"PGI",
|
||||
"48 8D 05 ? ? ? ? 48 8B FE",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_profile_gamer_info = ptr.add(3).rip().as<rage::rlGamerInfo*>();
|
||||
}
|
||||
},
|
||||
// Player Info Gamer Info
|
||||
{
|
||||
"PIGI",
|
||||
"E8 ? ? ? ? 48 8D 4B 20 48 8B D0 E8 ? ? ? ? 41 8A CF",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_player_info_gamer_info = ptr.add(1).rip().add(3).rip().as<rage::rlGamerInfo*>();
|
||||
}
|
||||
},
|
||||
// Communications
|
||||
{
|
||||
"C",
|
||||
"48 8B 1D ? ? ? ? 48 8D 4C 24 30",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_communications = ptr.add(3).rip().as<CCommunications**>();
|
||||
}
|
||||
},
|
||||
// Handle Join Request
|
||||
{
|
||||
"HJR",
|
||||
@ -1842,15 +1788,6 @@ namespace big
|
||||
g_pointers->m_gta.m_get_dlc_hash = ptr.sub(0xA).rip().as<PVOID>();
|
||||
}
|
||||
},
|
||||
// Add Gamer To Session
|
||||
{
|
||||
"AGTS",
|
||||
"7C E8 EB 23",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_add_gamer_to_session = ptr.add(0x23).rip().as<PVOID>();
|
||||
}
|
||||
},
|
||||
// Set Head Blend Data
|
||||
{
|
||||
"SHBD",
|
||||
|
@ -310,6 +310,14 @@ namespace big
|
||||
{
|
||||
send_message_to_server(token, message, size);
|
||||
|
||||
if (g.session.kick_host_to_stay_in_session && msg[1] == 5)
|
||||
{
|
||||
if (auto player = g_player_service->get_by_host_token(token))
|
||||
{
|
||||
player_command::get("nfkick"_J)->call(player, {});
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case REQUEST:
|
||||
|
@ -307,6 +307,16 @@ namespace big
|
||||
{
|
||||
if (msg->m_status == 5)
|
||||
{
|
||||
if (g.spoofing.multiplex_session)
|
||||
{
|
||||
msg->m_detail.m_player_count = std::max(25, (int)msg->m_detail.m_player_count);
|
||||
}
|
||||
|
||||
if (g.spoofing.spoof_session_player_count)
|
||||
{
|
||||
msg->m_detail.m_player_count = g.spoofing.session_player_count;
|
||||
}
|
||||
|
||||
if (g.spoofing.increase_player_limit)
|
||||
{
|
||||
msg->m_detail.m_player_count = std::min(29,
|
||||
|
@ -7,18 +7,15 @@ namespace big
|
||||
{
|
||||
inline static memory::byte_patch* m_can_blame_others;
|
||||
inline static memory::byte_patch* m_can_use_blocked_explosions;
|
||||
inline static memory::byte_patch* m_set_script_flag;
|
||||
|
||||
inline static void apply()
|
||||
{
|
||||
explosion_anti_cheat_bypass::m_can_blame_others->apply();
|
||||
explosion_anti_cheat_bypass::m_can_use_blocked_explosions->apply();
|
||||
explosion_anti_cheat_bypass::m_set_script_flag->apply();
|
||||
}
|
||||
|
||||
inline static void restore()
|
||||
{
|
||||
explosion_anti_cheat_bypass::m_set_script_flag->restore();
|
||||
explosion_anti_cheat_bypass::m_can_use_blocked_explosions->restore();
|
||||
explosion_anti_cheat_bypass::m_can_blame_others->restore();
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "gta_util.hpp"
|
||||
#include "misc.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "packet.hpp"
|
||||
#include "script.hpp"
|
||||
#include "script_local.hpp"
|
||||
#include "services/players/player_service.hpp"
|
||||
@ -63,21 +64,34 @@ namespace big::scripts
|
||||
{
|
||||
if (auto launcher = gta_util::find_script_thread(hash); launcher && launcher->m_net_component)
|
||||
{
|
||||
for (int i = 0; !((CGameScriptHandlerNetComponent*)launcher->m_net_component)->is_local_player_host(); i++)
|
||||
auto net_component = reinterpret_cast<CGameScriptHandlerNetComponent*>(launcher->m_net_component);
|
||||
|
||||
if (net_component->is_local_player_host())
|
||||
{
|
||||
if (i > 200)
|
||||
return false;
|
||||
|
||||
((CGameScriptHandlerNetComponent*)launcher->m_net_component)
|
||||
->send_host_migration_event(g_player_service->get_self()->get_net_game_player());
|
||||
script::get_current()->yield(10ms);
|
||||
|
||||
if (!launcher->m_stack || !launcher->m_net_component)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
net_component->do_host_migration(g_player_service->get_self()->get_net_game_player(), 0xFFFF, true);
|
||||
|
||||
packet pack;
|
||||
pack.write_message(rage::eNetMessage::MsgScriptVerifyHostAck);
|
||||
net_component->m_script_handler->get_id()->serialize(&pack.m_buffer);
|
||||
pack.write<bool>(true, 1);
|
||||
pack.write<bool>(true, 1);
|
||||
pack.write<std::uint16_t>(0xFFFF, 16);
|
||||
|
||||
for (auto& player : g_player_service->players())
|
||||
{
|
||||
if (player.second->get_net_game_player())
|
||||
{
|
||||
pack.send(player.second->get_net_game_player()->m_msg_id);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline int launcher_index_from_hash(rage::joaat_t script_hash)
|
||||
|
@ -18,7 +18,6 @@ namespace big
|
||||
{
|
||||
if (ImGui::BeginTabItem("DEBUG_TAB_MISC"_T.data()))
|
||||
{
|
||||
components::command_checkbox<"battleyeserver">();
|
||||
components::command_checkbox<"external_console">();
|
||||
|
||||
components::command_checkbox<"windowhook">("VIEW_DEBUG_MISC_DISABLE_GTA_WINDOW_HOOK"_T);
|
||||
|
@ -127,52 +127,8 @@ namespace big
|
||||
{
|
||||
ImGui::BeginGroup();
|
||||
components::small_text("FORCE_HOST"_T);
|
||||
|
||||
static constexpr auto token_spoof_types = std::to_array({"SPOOF_HOST_TOKEN_OFF", "SPOOF_HOST_TOKEN_TYPE_LEGIT", "SPOOF_HOST_TOKEN_TYPE_AGGRESSIVE", "SPOOF_HOST_TOKEN_TYPE_EXTRA_AGGRESSIVE", "SPOOF_HOST_TOKEN_TYPE_CUSTOM"});
|
||||
|
||||
ImGui::BeginDisabled(gta_util::get_network()->m_game_session_state != 0);
|
||||
|
||||
ImGui::SetNextItemWidth(300);
|
||||
if (ImGui::BeginCombo("HOST_TOKEN_SPOOFING"_T.data(),
|
||||
g_translation_service.get_translation(token_spoof_types[g.session.spoof_host_token_type]).data()))
|
||||
{
|
||||
for (int i = 0; i < token_spoof_types.size(); i++)
|
||||
{
|
||||
if (ImGui::Selectable(g_translation_service.get_translation(token_spoof_types[i]).data(), i == g.session.spoof_host_token_type))
|
||||
{
|
||||
g.session.spoof_host_token_type = i;
|
||||
g_fiber_pool->queue_job([] {
|
||||
g.session.spoof_host_token_dirty = true;
|
||||
}); // this part gets a bit racy so we're setting it in a fiber pool
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
ImGui::EndDisabled();
|
||||
|
||||
if (i == g.session.spoof_host_token_type)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
if (g.session.spoof_host_token_type != 0)
|
||||
{
|
||||
ImGui::Checkbox("HIDE_TOKEN_SPOOFING_WHEN_HOST"_T.data(), &g.session.hide_token_spoofing_when_host);
|
||||
}
|
||||
|
||||
if (g.session.spoof_host_token_type == 4)
|
||||
{
|
||||
ImGui::SetNextItemWidth(200);
|
||||
if (ImGui::InputScalar("##token_input", ImGuiDataType_U64, &g.session.custom_host_token, nullptr, nullptr, "%p", ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase))
|
||||
{
|
||||
g.session.spoof_host_token_dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::EndDisabled();
|
||||
|
||||
ImGui::Checkbox("KICK_HOST_TO_STAY_IN_SESSION"_T.data(), &g.session.kick_host_to_stay_in_session);
|
||||
|
||||
ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host);
|
||||
if (ImGui::IsItemHovered())
|
||||
|
Loading…
x
Reference in New Issue
Block a user