diff --git a/src/backend/looped/session/harass_players.cpp b/src/backend/looped/session/harass_players.cpp new file mode 100644 index 00000000..7fb79462 --- /dev/null +++ b/src/backend/looped/session/harass_players.cpp @@ -0,0 +1,23 @@ +#include "backend/looped_command.hpp" +#include "natives.hpp" +#include "services/players/player_service.hpp" + +namespace big +{ + class harass_players : looped_command + { + using looped_command::looped_command; + + virtual void on_enable() override + { + for (auto& player : g_player_service->players()) + NETWORK::NETWORK_CONCEAL_PLAYER(player.second->id(), false, false); // disable interior instance separation + } + + virtual void on_tick() override + { + } + }; + + harass_players g_harass_players("harass", "HARASS_PLAYERS", "HARASS_PLAYERS_DESC", g.session.harass_players); +} diff --git a/src/core/settings.hpp b/src/core/settings.hpp index 0d465d0c..b10a62fc 100644 --- a/src/core/settings.hpp +++ b/src/core/settings.hpp @@ -68,6 +68,7 @@ namespace big int player_count = 0; CNetGamePlayer* m_syncing_player = nullptr; + std::uint8_t m_sync_target_player = -1; eNetObjType m_syncing_object_type = (eNetObjType)-1; int m_remote_controller_vehicle = -1; @@ -447,6 +448,8 @@ namespace big bool semi_godmode_all = false; bool wanted_level_all = false; bool vehicle_fix_all = false; + bool harass_players = false; + bool spam_killfeed = false; bool show_cheating_message = false; bool anonymous_bounty = true; diff --git a/src/function_types.hpp b/src/function_types.hpp index 2e5ee3cf..52d1cd26 100644 --- a/src/function_types.hpp +++ b/src/function_types.hpp @@ -212,4 +212,6 @@ namespace big::functions using can_create_vehicle = bool (*)(); using get_searchlight = void* (*) (CPed*); + + using get_sector_data = void (*) (rage::fvector3* coords, std::uint16_t* x, std::uint16_t* y, std::uint16_t* z, rage::fvector3* sector_pos); } diff --git a/src/gta/net_game_event.hpp b/src/gta/net_game_event.hpp index 8006f8ee..e0050935 100644 --- a/src/gta/net_game_event.hpp +++ b/src/gta/net_game_event.hpp @@ -295,7 +295,7 @@ namespace rage float max = (1 << length) - 1; int integer = (int)((value / divisor) * max); - Write(length, integer); + Write(integer, length); } inline float ReadSignedFloat(int length, float divisor) @@ -311,7 +311,7 @@ namespace rage float max = (1 << (length - 1)) - 1; int integer = (int)((value / divisor) * max); - WriteSigned(length, integer); + WriteSigned(integer, length); } public: diff --git a/src/gta_pointers.hpp b/src/gta_pointers.hpp index 7721011d..7ee34585 100644 --- a/src/gta_pointers.hpp +++ b/src/gta_pointers.hpp @@ -109,7 +109,6 @@ namespace big PVOID m_native_return; PVOID m_ctext_file_ptr; PVOID m_get_label_text; - functions::write_player_game_state_data_node m_write_player_game_state_data_node; ChatData** m_chat_data; ScInfo* m_sc_info; @@ -128,8 +127,6 @@ namespace big functions::get_gameplay_cam_coords m_get_gameplay_cam_coords; - PVOID m_write_player_gamer_data_node; - functions::trigger_script_event m_trigger_script_event; // Bitbuffer Read/Write START @@ -262,16 +259,11 @@ namespace big PVOID m_receive_pickup; - PVOID m_write_player_camera_data_node; - PVOID m_send_player_card_stats; bool* m_force_player_card_refresh; PVOID m_serialize_stats; - PVOID m_write_player_creation_data_node; - PVOID m_write_player_appearance_data_node; - PVOID m_enumerate_audio_devices; PVOID m_direct_sound_capture_create; bool* m_refresh_audio_input; @@ -376,8 +368,11 @@ namespace big functions::get_searchlight m_get_searchlight; GenericPool** m_vehicle_allocator; // this is not a normal pool - - PVOID m_write_physical_script_game_state_data_node; + + PVOID m_write_node_data; + PVOID m_can_send_node_to_player; + PVOID m_write_node; + functions::get_sector_data m_get_sector_data; }; #pragma pack(pop) static_assert(sizeof(gta_pointers) % 8 == 0, "Pointers are not properly aligned"); diff --git a/src/hooking/hooking.cpp b/src/hooking/hooking.cpp index 01231919..652790bd 100644 --- a/src/hooking/hooking.cpp +++ b/src/hooking/hooking.cpp @@ -42,8 +42,6 @@ namespace big detour_hook_helper::add("GLT", g_pointers->m_gta.m_get_label_text); - detour_hook_helper::add("WPGSDN", g_pointers->m_gta.m_write_player_game_state_data_node); - detour_hook_helper::add("GTS", g_pointers->m_gta.m_gta_thread_start); detour_hook_helper::add("GTK", g_pointers->m_gta.m_gta_thread_kill); detour_hook_helper::add("INT", g_pointers->m_gta.m_init_native_tables); @@ -63,7 +61,6 @@ namespace big detour_hook_helper::add("CAD", g_pointers->m_gta.m_can_apply_data); detour_hook_helper::add("GNED", g_pointers->m_gta.m_get_network_event_data); - detour_hook_helper::add("WPGDN", g_pointers->m_gta.m_write_player_gamer_data_node); detour_hook_helper::add("IDC", g_pointers->m_gta.m_invalid_decal_crash); detour_hook_helper::add("TPO", g_pointers->m_gta.m_task_parachute_object); @@ -102,14 +99,9 @@ namespace big detour_hook_helper::add("RPI", g_pointers->m_gta.m_receive_pickup); - detour_hook_helper::add("WPCDN", g_pointers->m_gta.m_write_player_camera_data_node); - detour_hook_helper::add("SPCS", g_pointers->m_gta.m_send_player_card_stats); detour_hook_helper::add("SS", g_pointers->m_gta.m_serialize_stats); - detour_hook_helper::add("WPCDN", g_pointers->m_gta.m_write_player_creation_data_node); - detour_hook_helper::add("WPADN", g_pointers->m_gta.m_write_player_appearance_data_node); - detour_hook_helper::add("GMI", g_pointers->m_gta.m_get_model_info); detour_hook_helper::add("TJC", g_pointers->m_gta.m_taskjump_constructor); @@ -145,9 +137,10 @@ namespace big detour_hook_helper::add("FI", g_pointers->m_gta.m_format_int); detour_hook_helper::add("SLC", g_pointers->m_gta.m_searchlight_crash); - - detour_hook_helper::add("WPSGSDN", g_pointers->m_gta.m_write_physical_script_game_state_data_node); + detour_hook_helper::add("WND", g_pointers->m_gta.m_write_node_data); + detour_hook_helper::add("CSNTP", g_pointers->m_gta.m_can_send_node_to_player); + detour_hook_helper::add("WN", g_pointers->m_gta.m_write_node); g_hooking = this; } diff --git a/src/hooking/hooking.hpp b/src/hooking/hooking.hpp index f694c908..b5b47d93 100644 --- a/src/hooking/hooking.hpp +++ b/src/hooking/hooking.hpp @@ -57,6 +57,7 @@ namespace rage class netEventMgr; class json_serializer; class netGameEvent; + class netSyncDataNode; } namespace big @@ -101,9 +102,7 @@ namespace big static eAckCode received_clone_sync(CNetworkObjectMgr* mgr, CNetGamePlayer* src, CNetGamePlayer* dst, eNetObjType object_type, uint16_t object_id, rage::datBitBuffer* bufer, uint16_t unk, uint32_t timestamp); static bool can_apply_data(rage::netSyncTree* tree, rage::netObject* object); - static void write_player_gamer_data_node(rage::netObject* player, CPlayerGamerDataNode* node); - static void write_player_game_state_data_node(rage::netObject* player, CPlayerGameStateDataNode* node); - + static void invalid_mods_crash_detour(int64_t a1, int64_t a2, int a3, char a4); static void invalid_decal(uintptr_t a1, int a2); static int task_parachute_object(uint64_t _this, int a2, int a3); static int task_ambient_clips(uint64_t _this, int a2, int a3); @@ -141,14 +140,9 @@ namespace big static bool receive_pickup(rage::netObject* netobject, void* unk, CPed* ped); - static void write_player_camera_data_node(rage::netObject* player, CPlayerCameraDataNode* node); - static rage::netGameEvent* send_player_card_stats(rage::netGameEvent* a1, CPlayerCardStats* stats); static void serialize_stats(CStatsSerializationContext* context, rage::joaat_t* stats, uint32_t stat_count); - static void write_player_creation_data_node(rage::netObject* player, CPlayerCreationDataNode* node); - static void write_player_appearance_data_node(rage::netObject* player, CPlayerAppearanceDataNode* node); - static __int64 task_jump_constructor(uint64_t a1, int a2); static void* task_fall_constructor(uint64_t a1, int a2); @@ -197,9 +191,10 @@ namespace big static void format_int(int64_t integer_to_format, char* format_string, size_t size_always_64, bool use_commas); + static void write_node_data(void* data_node, rage::netObject* net_object, rage::datBitBuffer* buffer, void* log, bool update); + static bool can_send_node_to_player(void* node, rage::netObject* object, std::uint8_t player, int sync_type, int a5, int a6); + static bool write_node(rage::netSyncDataNode* node, int sync_type, int a3, rage::netObject* object, rage::datBitBuffer* buffer, int a6, void* log, std::uint8_t player, int* a9, int* a10); static void searchlight_crash(void* a1, CPed* ped); - - static void write_physical_script_game_state_data_node(rage::CPhysical* this_ptr, CPhysicalScriptGameStateDataNode* node); }; class minhook_keepalive diff --git a/src/hooks/spoofing/can_send_node_to_player.cpp b/src/hooks/spoofing/can_send_node_to_player.cpp new file mode 100644 index 00000000..338cca3d --- /dev/null +++ b/src/hooks/spoofing/can_send_node_to_player.cpp @@ -0,0 +1,31 @@ +#include "hooking/hooking.hpp" +#include "util/sync_trees.hpp" +#include "services/players/player_service.hpp" + +namespace big +{ + bool hooks::can_send_node_to_player(void* node, rage::netObject* object, std::uint8_t player, int sync_type, int a5, int a6) + { + if (g.session.harass_players) + { + auto& type = sync_node_finder::find(reinterpret_cast(node)); + + if (type == sync_node_id("CPedGameStateDataNode") || type == sync_node_id("CSectorDataNode") || type == sync_node_id("CPlayerSectorPosNode")) + { + return true; + } + } + + if (auto plyr = g_player_service->get_by_id(player); (plyr && plyr->spam_killfeed) || g.session.spam_killfeed) + { + auto& type = sync_node_finder::find(reinterpret_cast(node)); + + if (type == sync_node_id("CPedHealthDataNode")) + { + return true; + } + } + + return g_hooking->get_original()(node, object, player, sync_type, a5, a6); + } +} \ No newline at end of file diff --git a/src/hooks/spoofing/write_node.cpp b/src/hooks/spoofing/write_node.cpp new file mode 100644 index 00000000..e22f2123 --- /dev/null +++ b/src/hooks/spoofing/write_node.cpp @@ -0,0 +1,42 @@ +#include "hooking/hooking.hpp" +#include "util/sync_trees.hpp" +#include "services/players/player_service.hpp" +#include + +namespace big +{ + bool hooks::write_node(rage::netSyncDataNode* node, int sync_type, int a3, rage::netObject* object, rage::datBitBuffer* buffer, int a6, void* log, std::uint8_t player, int* a9, int* a10) + { + uint64_t old_sync_cache_val = 0; + g.m_sync_target_player = player; + + if (g.session.harass_players) + { + auto& type = sync_node_finder::find(reinterpret_cast(node)); + + if (type == sync_node_id("CPedGameStateDataNode") || type == sync_node_id("CSectorDataNode") || type == sync_node_id("CPlayerSectorPosNode")) + { + std::swap(old_sync_cache_val, node->pad4); + node->flags |= 1; + } + } + + if (auto plyr = g_player_service->get_by_id(player); (plyr && plyr->spam_killfeed) || g.session.spam_killfeed) + { + auto& type = sync_node_finder::find(reinterpret_cast(node)); + + if (type == sync_node_id("CPedHealthDataNode")) + { + std::swap(old_sync_cache_val, node->pad4); + node->flags |= 1; + } + } + + bool ret_val = g_hooking->get_original()(node, sync_type, a3, object, buffer, a6, log, player, a9, a10); + + if (old_sync_cache_val) + std::swap(old_sync_cache_val, node->pad4); + + return ret_val; + } +} \ No newline at end of file diff --git a/src/hooks/spoofing/write_physical_script_game_state_data_node.cpp b/src/hooks/spoofing/write_physical_script_game_state_data_node.cpp deleted file mode 100644 index 111da230..00000000 --- a/src/hooks/spoofing/write_physical_script_game_state_data_node.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "hooking/hooking.hpp" -#include "util/model_info.hpp" - -#include - -namespace big -{ - void hooks::write_physical_script_game_state_data_node(rage::CPhysical* this_ptr, CPhysicalScriptGameStateDataNode* node) - { - g_hooking->get_original()(this_ptr, node); - - auto this_vehicle = (*(CVehicle*(__fastcall**)(char*))(*((DWORD64*)this_ptr - 38) + 0xC0))((char*)this_ptr - 304); - - if (g.spoofing.spoof_hide_veh_god && g_local_player && self::veh) - { - if (g_local_player->m_vehicle && g_local_player->m_vehicle == this_vehicle) - { - node->m_godmode = false; - node->m_bullet_proof = false; - node->m_fire_proof = false; - node->m_smoke_proof = false; - node->m_steam_proof = false; - node->m_collision_proof = false; - node->m_explosion_proof = false; - node->m_melee_proof = false; - } - } - } -} diff --git a/src/hooks/spoofing/write_player_appearance_data_node.cpp b/src/hooks/spoofing/write_player_appearance_data_node.cpp deleted file mode 100644 index 48c2d8ab..00000000 --- a/src/hooks/spoofing/write_player_appearance_data_node.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "hooking/hooking.hpp" -#include "util/model_info.hpp" - -#include - -namespace big -{ - void hooks::write_player_appearance_data_node(rage::netObject* player, CPlayerAppearanceDataNode* node) - { - g_hooking->get_original()(player, node); - - if (g.spoofing.spoof_player_model) - { - if (const auto model_hash = rage::joaat(g.spoofing.player_model); model_info::does_model_exist(model_hash)) - { - node->m_model_hash = model_hash; - } - node->m_has_head_blend_data = false; - node->components.m_component_bitset = 0; - } - } -} diff --git a/src/hooks/spoofing/write_player_camera_data_node.cpp b/src/hooks/spoofing/write_player_camera_data_node.cpp deleted file mode 100644 index e483b215..00000000 --- a/src/hooks/spoofing/write_player_camera_data_node.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "hooking/hooking.hpp" -#include "services/players/player_service.hpp" -#include "util/globals.hpp" - -#include -#include - -namespace big -{ - void hooks::write_player_camera_data_node(rage::netObject* player, CPlayerCameraDataNode* node) - { - g_hooking->get_original()(player, node); - - if (g.spoofing.spoof_hide_spectate && g.player.spectating) - { - node->m_free_cam_pos_x += 50.0f; - node->m_free_cam_pos_y -= 50.0f; - node->m_camera_x -= 50.0f; - } - } -} diff --git a/src/hooks/spoofing/write_player_creation_data_node.cpp b/src/hooks/spoofing/write_player_creation_data_node.cpp deleted file mode 100644 index b5ab4bc4..00000000 --- a/src/hooks/spoofing/write_player_creation_data_node.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "hooking/hooking.hpp" - -#include - -namespace big -{ - void hooks::write_player_creation_data_node(rage::netObject* player, CPlayerCreationDataNode* node) - { - g_hooking->get_original()(player, node); - - if (g.spoofing.spoof_player_model) - node->m_model = rage::joaat(g.spoofing.player_model); - } -} diff --git a/src/hooks/spoofing/write_player_game_state_data_node.cpp b/src/hooks/spoofing/write_player_game_state_data_node.cpp deleted file mode 100644 index 8d0a843e..00000000 --- a/src/hooks/spoofing/write_player_game_state_data_node.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "hooking/hooking.hpp" -#include "services/players/player_service.hpp" -#include "util/globals.hpp" - -#include - -namespace big -{ - static bool is_in_cutscene() - { - if (g_local_player && g_local_player->m_player_info) - return g_local_player->m_player_info->m_game_state == eGameState::InMPCutscene; - return false; - } - - static bool is_in_interior() - { - int id = 0; - if (auto self_ptr = g_player_service->get_self(); self_ptr->is_valid()) - id = self_ptr->id(); - return globals::get_interior_from_player(id) != 0; - } - - void hooks::write_player_game_state_data_node(rage::netObject* player, CPlayerGameStateDataNode* node) - { - g_hooking->get_original()(player, node); - - if (g.spoofing.spoof_hide_god && !is_in_cutscene() && !is_in_interior()) - { - node->m_is_invincible = false; - node->m_bullet_proof = false; - node->m_collision_proof = false; - node->m_explosion_proof = false; - node->m_fire_proof = false; - node->m_melee_proof = false; - node->m_steam_proof = false; - node->m_water_proof = false; - } - - if (g.spoofing.spoof_hide_spectate) - { - node->m_is_spectating = false; - node->m_spectating_net_id = 0; - } - } -} diff --git a/src/hooks/spoofing/write_player_gamer_data_node.cpp b/src/hooks/spoofing/write_player_gamer_data_node.cpp deleted file mode 100644 index b3205dd9..00000000 --- a/src/hooks/spoofing/write_player_gamer_data_node.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "hooking/hooking.hpp" - -#include - -namespace big -{ - void hooks::write_player_gamer_data_node(rage::netObject* player, CPlayerGamerDataNode* node) - { - g_hooking->get_original()(player, node); - - if (g.spoofing.spoof_crew_data) - { - node->m_clan_data.m_clan_member_id = 1; - node->m_clan_data.m_clan_id = 41564112; - node->m_clan_data.m_clan_id_2 = 41564112; - node->m_clan_data.m_clan_color = 420; - node->m_clan_data.m_clan_member_count = 15; - node->m_clan_data.m_clan_created_time = 420; - - strcpy(node->m_clan_data.m_clan_tag, g.spoofing.crew_tag.c_str()); - node->m_clan_data.m_is_system_clan = g.spoofing.rockstar_crew; - node->m_clan_data.m_is_clan_open = g.spoofing.square_crew_tag; - - if (g.spoofing.rockstar_crew) - { - strcpy(node->m_clan_data.m_clan_name, "Rockstar"); - } - } - } -} diff --git a/src/native_hooks/all_scripts.hpp b/src/native_hooks/all_scripts.hpp index af9ae1a0..b3a7c177 100644 --- a/src/native_hooks/all_scripts.hpp +++ b/src/native_hooks/all_scripts.hpp @@ -115,6 +115,12 @@ namespace big PED::APPLY_DAMAGE_TO_PED(ped, damage, damage_armor_first, p3, p4); } + void NETWORK_CONCEAL_PLAYER(rage::scrNativeCallContext* ctx) + { + if (!g.session.harass_players) + NETWORK::NETWORK_CONCEAL_PLAYER(ctx->get_arg(0), ctx->get_arg(1), ctx->get_arg(2)); + } + void RETURN_TRUE(rage::scrNativeCallContext* src) { src->set_return_value(TRUE); diff --git a/src/native_hooks/native_hooks.cpp b/src/native_hooks/native_hooks.cpp index 60d77e06..91f45bfe 100644 --- a/src/native_hooks/native_hooks.cpp +++ b/src/native_hooks/native_hooks.cpp @@ -102,6 +102,7 @@ namespace big add_native_detour(NativeIndex::REGISTER_SCRIPT_VARIABLE, all_scripts::DO_NOTHING); add_native_detour(NativeIndex::UNREGISTER_SCRIPT_VARIABLE, all_scripts::DO_NOTHING); add_native_detour(NativeIndex::FORCE_CHECK_SCRIPT_VARIABLES, all_scripts::DO_NOTHING); + add_native_detour(NativeIndex::NETWORK_CONCEAL_PLAYER, all_scripts::NETWORK_CONCEAL_PLAYER); add_native_detour("shop_controller"_J, NativeIndex::IS_PED_SHOOTING, all_scripts::RETURN_FALSE); // prevent exploit reports add_native_detour("shop_controller"_J, NativeIndex::SET_WARNING_MESSAGE_WITH_HEADER, shop_controller::SET_WARNING_MESSAGE_WITH_HEADER); diff --git a/src/pointers.cpp b/src/pointers.cpp index a7a317cd..e9d54800 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -294,15 +294,6 @@ namespace big g_pointers->m_gta.m_write_bitbuf_array = ptr.add(1).rip().as(); } }, - // Write Player Game State Data Node - { - "WPGSDN", - "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC 30 0F B7 81", - [](memory::handle ptr) - { - g_pointers->m_gta.m_write_player_game_state_data_node = ptr.as(); - } - }, // Ptr To Handle { "PTH", @@ -384,15 +375,6 @@ namespace big g_pointers->m_gta.m_give_pickup_rewards = ptr.sub(0x28).as(); } }, - // Write Player Gamer Data Node - { - "WPGDN", - "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 81 C1 ? ? ? ? 48 8B DA E8", - [](memory::handle ptr) - { - g_pointers->m_gta.m_write_player_gamer_data_node = ptr.as(); - } - }, // Receive Net Message { "RNM", @@ -1067,15 +1049,6 @@ namespace big g_pointers->m_gta.m_receive_pickup = ptr.as(); } }, - // Write Player Camera Data Node - { - "WPCDN", - "48 8B C4 48 89 58 20 55 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 B0 48 81 EC 50 01 00 00 4C", - [](memory::handle ptr) - { - g_pointers->m_gta.m_write_player_camera_data_node = ptr.as(); - } - }, // Send Player Card Stats { "SPCS", @@ -1103,24 +1076,6 @@ namespace big g_pointers->m_gta.m_serialize_stats = ptr.as(); } }, - // Write Player Creation Data Node - { - "WPCDN", - "48 83 EC 38 48 8B 81 F0", - [](memory::handle ptr) - { - g_pointers->m_gta.m_write_player_creation_data_node = ptr.as(); - } - }, - // Write Player Appearance Data Node - { - "WPADN", - "48 8B C4 48 89 50 10 48 89 48 08 53", - [](memory::handle ptr) - { - g_pointers->m_gta.m_write_player_appearance_data_node = ptr.as(); - } - }, // Enumerate Audio Devices { "EAD", @@ -1777,13 +1732,40 @@ namespace big g_pointers->m_gta.m_vehicle_allocator = ptr.add(3).rip().as(); } }, - // Write Physical Script Game State Data Node + // Write Node Data { - "WPSGSDN", - "48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 20 4C 8D B1 D0 FE", + "WND", + "48 8B 89 A8 00 00 00 4C 8B 11 49 FF 62 10", [](memory::handle ptr) { - g_pointers->m_gta.m_write_physical_script_game_state_data_node = ptr.as(); + g_pointers->m_gta.m_write_node_data = ptr.as(); + } + }, + // Can Send Node To Player + { + "CSNTP", + "44 8B C3 FF 90 B0 00 00 00", + [](memory::handle ptr) + { + g_pointers->m_gta.m_can_send_node_to_player = ptr.sub(0x2E).as(); + } + }, + // Write Node + { + "WN", + "49 89 43 C8 E8 E2 FB 50 00", + [](memory::handle ptr) + { + g_pointers->m_gta.m_write_node = ptr.sub(0x49).as(); + } + }, + // Get Sector Data + { + "GSD", + "40 53 48 83 EC 20 F3 0F 10 59 08", + [](memory::handle ptr) + { + g_pointers->m_gta.m_get_sector_data = ptr.as(); } } >(); // don't leave a trailing comma at the end diff --git a/src/services/players/player.hpp b/src/services/players/player.hpp index 206513a2..a7d50c19 100644 --- a/src/services/players/player.hpp +++ b/src/services/players/player.hpp @@ -100,6 +100,8 @@ namespace big bool trigger_desync_kick = false; bool trigger_end_session_kick = false; + bool spam_killfeed = false; + int spectating_player = -1; protected: diff --git a/src/util/sync_trees.hpp b/src/util/sync_trees.hpp index 1e1d5f27..873f5374 100644 --- a/src/util/sync_trees.hpp +++ b/src/util/sync_trees.hpp @@ -1,5 +1,6 @@ #pragma once #include "gta/enums.hpp" +#include "pointers.hpp" namespace big { @@ -38,6 +39,7 @@ namespace big static constexpr size_t sync_tree_count = size_t(eNetObjType::NET_OBJ_TYPE_TRAIN) + 1; std::array sync_trees_sync_node_addr_to_ids; + sync_node_vft_to_ids global_node_identifier; std::array sync_trees_node_array_index_to_node_id = { { @@ -517,9 +519,20 @@ namespace big public: static const sync_node_id& find(eNetObjType obj_type, uintptr_t addr) { + if (!is_initialized()) [[unlikely]] + init(); + return finder.sync_trees_sync_node_addr_to_ids[(int)obj_type][addr]; } + static const sync_node_id& find(uintptr_t addr) + { + if (!is_initialized()) [[unlikely]] + init(); + + return finder.global_node_identifier[addr]; + } + static sync_node_vft_to_ids& get_object_nodes(eNetObjType obj_type) { return finder.sync_trees_sync_node_addr_to_ids[(int)obj_type]; @@ -551,6 +564,7 @@ namespace big const sync_node_id node_id = finder.sync_trees_node_array_index_to_node_id[i][j]; finder.sync_trees_sync_node_addr_to_ids[i][addr] = node_id; + finder.global_node_identifier.emplace(addr, node_id); } } diff --git a/src/views/network/view_network.cpp b/src/views/network/view_network.cpp index 367c3af8..c4f078b9 100644 --- a/src/views/network/view_network.cpp +++ b/src/views/network/view_network.cpp @@ -308,6 +308,8 @@ namespace big ImGui::Checkbox("NEVER_WANTED"_T.data(), &g.session.never_wanted_all); ImGui::Checkbox("SEMI_GODMODE"_T.data(), &g.session.semi_godmode_all); ImGui::Checkbox("VIEW_NET_SESSION_FIX_VEHICLE"_T.data(), &g.session.vehicle_fix_all); + components::command_checkbox<"harass">(); + ImGui::Checkbox("SPAM_KILLFEED"_T.data(), &g.session.spam_killfeed); ImGui::Checkbox("EXPLOSION_KARMA"_T.data(), &g.session.explosion_karma); ImGui::Checkbox("DAMAGE_KARMA"_T.data(), &g.session.damage_karma); ImGui::Checkbox("DISABLE_PEDS"_T.data(), &g.session.disable_peds); diff --git a/src/views/network/view_session_browser.cpp b/src/views/network/view_session_browser.cpp index 1dade9de..2121e545 100644 --- a/src/views/network/view_session_browser.cpp +++ b/src/views/network/view_session_browser.cpp @@ -41,10 +41,11 @@ namespace big if (ImGui::IsItemHovered()) { - auto tool_tip = std::format("{}: {}\n{}: {}\n{}: {}\n{}: {}", "SESSION_BROWSER_NUM_PLAYERS"_T, session.attributes.player_count, + auto tool_tip = std::format("{}: {}\n{}: {}\n{}: {}\n{}: {}\n{}: {:X}", "SESSION_BROWSER_NUM_PLAYERS"_T, session.attributes.player_count, "REGION"_T, regions[session.attributes.region].name, "LANGUAGE"_T, languages[session.attributes.language].name, - "SESSION_BROWSER_HOST_RID"_T, session.info.m_net_player_data.m_gamer_handle.m_rockstar_id); + "SESSION_BROWSER_HOST_RID"_T, session.info.m_net_player_data.m_gamer_handle.m_rockstar_id, + "SESSION_BROWSER_DISCRIMINATOR"_T, session.attributes.discriminator); ImGui::SetTooltip(tool_tip.c_str()); } } diff --git a/src/views/players/player/player_toxic.cpp b/src/views/players/player/player_toxic.cpp index b7dcccb4..d840eed1 100644 --- a/src/views/players/player/player_toxic.cpp +++ b/src/views/players/player/player_toxic.cpp @@ -104,6 +104,8 @@ namespace big if (ImGui::IsItemHovered()) ImGui::SetTooltip("PLAYER_TOXIC_BRING_PLAYER_OUT_GOD"_T.data()); + ImGui::Checkbox("SPAM_KILLFEED"_T.data(), &g_player_service->get_selected()->spam_killfeed); + static int bounty_value = 0; ImGui::SetNextItemWidth(300); ImGui::SliderInt("BOUNTY"_T.data(), &bounty_value, 0, 10000);