diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 9b764a1d..f4b7ec6a 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -42,9 +42,7 @@ namespace big // Net Array Handler m_net_array_handler_hook("NAH", g_pointers->m_net_array_handler, &hooks::net_array_handler), - - // Increment Stat Event - m_increment_stat_hook("ISE", g_pointers->m_increment_stat_event, &hooks::increment_stat_event), + // Is DLC Present m_is_dlc_present_hook("IDP", g_pointers->m_is_dlc_present, &hooks::is_dlc_present), @@ -101,8 +99,6 @@ namespace big m_player_has_joined_hook.enable(); m_player_has_left_hook.enable(); - m_increment_stat_hook.enable(); - m_received_event_hook.enable(); m_send_net_info_to_lobby.enable(); @@ -128,8 +124,6 @@ namespace big m_received_event_hook.disable(); - m_increment_stat_hook.disable(); - m_player_has_joined_hook.disable(); m_player_has_left_hook.disable(); diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index b855dcc5..e045e651 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -36,7 +36,6 @@ namespace big static void player_join(CNetworkObjectMgr* _this, CNetGamePlayer* net_player); static void player_leave(CNetworkObjectMgr* _this, CNetGamePlayer* net_player); - static bool increment_stat_event(CNetworkIncrementStatEvent* net_event_struct, CNetGamePlayer* sender, int64_t a3); static bool is_dlc_present(Hash dlc_hash); static void received_event( @@ -50,7 +49,10 @@ namespace big rage::datBitBuffer* bit_buffer ); + // these two aren't actually hooks, just helper functions for hooks + static bool increment_stat_event(CNetworkIncrementStatEvent* net_event_struct, CNetGamePlayer* sender); static bool scripted_game_event(CScriptedGameEvent* scripted_game_event, CNetGamePlayer* player); + static bool send_net_info_to_lobby(rage::netPlayerData* player, int64_t a2, int64_t a3, DWORD* a4); static bool receive_net_message(void* netConnectionManager, void* a2, rage::netConnection::InFrame* frame); static void get_network_event_data(__int64 a1, rage::CEventNetwork* net_event); @@ -99,8 +101,7 @@ namespace big detour_hook m_player_has_joined_hook; detour_hook m_player_has_left_hook; - - detour_hook m_increment_stat_hook; + detour_hook m_is_dlc_present_hook; detour_hook m_received_event_hook; diff --git a/BigBaseV2/src/hooks/protections/increment_stat_event.cpp b/BigBaseV2/src/hooks/protections/increment_stat_event.cpp index 2f549fa8..d555caf0 100644 --- a/BigBaseV2/src/hooks/protections/increment_stat_event.cpp +++ b/BigBaseV2/src/hooks/protections/increment_stat_event.cpp @@ -2,16 +2,21 @@ namespace big { - bool hooks::increment_stat_event(CNetworkIncrementStatEvent* net_event, CNetGamePlayer* sender, int64_t a3) + bool hooks::increment_stat_event(CNetworkIncrementStatEvent* net_event, CNetGamePlayer* sender) { switch (net_event->m_stat) { - case RAGE_JOAAT("MPPLY_GAME_EXPLOITS"): + case RAGE_JOAAT("MPPLY_BAD_CREW_STATUS"): + case RAGE_JOAAT("MPPLY_BAD_CREW_MOTTO"): + case RAGE_JOAAT("MPPLY_BAD_CREW_NAME"): + case RAGE_JOAAT("MPPLY_BAD_CREW_EMBLEM"): case RAGE_JOAAT("MPPLY_EXPLOITS"): - case RAGE_JOAAT("MPPLY_VC_HATE"): + case RAGE_JOAAT("MPPLY_GAME_EXPLOITS"): case RAGE_JOAAT("MPPLY_TC_ANNOYINGME"): case RAGE_JOAAT("MPPLY_TC_HATE"): - const std::string report = fmt::format("From: {}", sender->get_name()); + case RAGE_JOAAT("MPPLY_VC_ANNOYINGME"): + case RAGE_JOAAT("MPPLY_VC_HATE"): + const auto report = fmt::format("From: {}", sender->get_name()); if (g->notifications.reports.log) LOG(INFO) << "Blocked report; " << report; @@ -22,6 +27,6 @@ namespace big return true; } - return g_hooking->m_increment_stat_hook.get_original()(net_event, sender, a3); + return false; } } \ No newline at end of file diff --git a/BigBaseV2/src/hooks/protections/received_event.cpp b/BigBaseV2/src/hooks/protections/received_event.cpp index ff0aa652..c91fad8e 100644 --- a/BigBaseV2/src/hooks/protections/received_event.cpp +++ b/BigBaseV2/src/hooks/protections/received_event.cpp @@ -31,6 +31,20 @@ namespace big switch ((RockstarEvent)event_id) { + case RockstarEvent::NETWORK_INCREMENT_STAT_EVENT: + { + const auto increment_stat_event = std::make_unique(); + buffer->ReadDword(&increment_stat_event->m_stat, 0x20); + buffer->ReadDword(&increment_stat_event->m_amount, 0x20); + if (hooks::increment_stat_event(increment_stat_event.get(), source_player)) + { + g_pointers->m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset); + + return; + } + buffer->Seek(0); + break; + } case RockstarEvent::SCRIPT_ENTITY_STATE_CHANGE_EVENT: { uint16_t entity; @@ -151,6 +165,8 @@ namespace big return; } + default: + break; } return g_hooking->m_received_event_hook.get_original()(event_manager, source_player, target_player, event_id, event_index, event_handled_bitset, unk, buffer); diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index 7867b848..56e1d7b0 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -107,12 +107,6 @@ namespace big m_gta_thread_kill = ptr.as(); }); - // Increment Stat Event - main_batch.add("ISE", "48 83 EC 60 8B 79 30 4C 8B F1", [this](memory::handle ptr) - { - m_increment_stat_event = ptr.sub(0x15).as(); - }); - // Trigger Script Event main_batch.add("TSE", "45 8B F0 41 8B F9 48 8B EA", [this](memory::handle ptr) { diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index 714e414c..1d7e40ff 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -71,8 +71,6 @@ namespace big functions::get_gameplay_cam_coords* m_get_gamplay_cam_coords; functions::give_pickup_rewards* m_give_pickup_rewards{}; - - functions::increment_stat_event* m_increment_stat_event{}; functions::trigger_script_event* m_trigger_script_event{};