From 10d0f317dc31513bb2f8f1322a392d95c04b915a Mon Sep 17 00:00:00 2001 From: maybegreat48 <96936658+maybegreat48@users.noreply.github.com> Date: Tue, 3 Jan 2023 16:48:32 +0000 Subject: [PATCH] Reactions, remote kick and better protections (#807) * feat(Scripts): Complete GlobalPlayerBD * feat(Scripts): add GPBD_Kicking * feat(Scripts): start work on GPBD_FM_3 * feat(Scripts): add more to GPBD_FM_3 * feat(Scripts): complete GPBD_FM_3 * feat(Scripts): start work on GPBD_FM * feat(Scripts): improve GPBD_FM * feat(Scripts): complete GPBD_FM * feat(Reactions): Add reactions * feat(Protections): Improve protections * feat(RemoteKick): Add remote kick * feat(Stats): add KillsOnPlayers and DeathsByPlayers * fix(Classes): Fix compiler warnings --- scripts/gtav-classes.cmake | 2 +- src/backend/backend.cpp | 1 + .../commands/player/kick/bail_kick.cpp | 4 +- .../player/kick/gamer_instruction_kick.cpp | 47 ++++ .../player/kick/lost_connection_kick.cpp | 2 +- .../commands/player/toxic/explode_player.cpp | 24 ++ .../player/toxic/set_wanted_level.cpp | 12 +- src/backend/looped/looped.hpp | 1 + src/backend/looped/player/good_options.cpp | 2 +- src/backend/looped/player/toxic_options.cpp | 52 ++++ src/backend/reactions/interloper_reaction.cpp | 37 +++ src/backend/reactions/interloper_reaction.hpp | 21 ++ src/backend/reactions/reaction.cpp | 76 ++++++ src/backend/reactions/reaction.hpp | 30 +++ src/backend/script_patches.hpp | 2 +- src/common.hpp | 11 + src/core/enums.hpp | 67 +---- src/core/globals.hpp | 127 +++++----- src/function_types.hpp | 13 +- src/gta/array.hpp | 5 - src/gta/base.hpp | 4 - src/gta/enums.hpp | 220 ----------------- src/gta/extensible.hpp | 7 - src/gta/natives.hpp | 22 +- src/gta/node_list.hpp | 2 +- src/gta/player.hpp | 11 - src/gta/ref_aware.hpp | 4 - src/gta/vector.hpp | 94 ------- src/gta_util.hpp | 2 +- src/gui.cpp | 1 - src/gui/components/components.hpp | 11 - src/hooking.cpp | 2 - src/hooking.hpp | 3 +- .../misc/start_matchmaking_find_sessions.cpp | 9 +- .../protections/increment_stat_event.cpp | 10 +- src/hooks/protections/receive_net_message.cpp | 102 +++++--- src/hooks/protections/received_event.cpp | 43 +--- .../protections/script_event_handler.cpp | 233 +++++++++--------- .../protections/update_presence_attribute.cpp | 6 + src/natives.hpp | 1 - src/packet.cpp | 12 + src/packet.hpp | 2 + src/pointers.cpp | 26 +- src/pointers.hpp | 6 +- src/script_mgr.cpp | 1 - src/services/gui/gui_service.hpp | 4 +- .../matchmaking/matchmaking_service.cpp | 6 +- src/services/players/player.hpp | 11 + src/util/notify.hpp | 18 +- src/util/session.hpp | 155 +++++++++++- src/util/toxic.hpp | 2 + src/views/network/view_player_database.cpp | 5 + src/views/network/view_session.cpp | 18 +- src/views/players/player/player_info.cpp | 34 +++ src/views/players/player/player_kick.cpp | 1 + src/views/players/player/player_misc.cpp | 10 - src/views/players/player/player_toxic.cpp | 14 ++ .../settings/view_notification_settings.cpp | 111 --------- .../settings/view_protection_settings.cpp | 29 +-- src/views/settings/view_reaction_settings.cpp | 126 ++++++++++ src/views/view.hpp | 2 +- src/views/world/view_spawn_ped.cpp | 5 +- 62 files changed, 1039 insertions(+), 882 deletions(-) create mode 100644 src/backend/commands/player/kick/gamer_instruction_kick.cpp create mode 100644 src/backend/commands/player/toxic/explode_player.cpp create mode 100644 src/backend/looped/player/toxic_options.cpp create mode 100644 src/backend/reactions/interloper_reaction.cpp create mode 100644 src/backend/reactions/interloper_reaction.hpp create mode 100644 src/backend/reactions/reaction.cpp create mode 100644 src/backend/reactions/reaction.hpp delete mode 100644 src/gta/array.hpp delete mode 100644 src/gta/base.hpp delete mode 100644 src/gta/extensible.hpp delete mode 100644 src/gta/player.hpp delete mode 100644 src/gta/ref_aware.hpp delete mode 100644 src/gta/vector.hpp delete mode 100644 src/views/settings/view_notification_settings.cpp create mode 100644 src/views/settings/view_reaction_settings.cpp diff --git a/scripts/gtav-classes.cmake b/scripts/gtav-classes.cmake index 5b5707a7..77a71735 100644 --- a/scripts/gtav-classes.cmake +++ b/scripts/gtav-classes.cmake @@ -3,7 +3,7 @@ include(FetchContent) FetchContent_Declare( gtav_classes GIT_REPOSITORY https://github.com/Yimura/GTAV-Classes.git - GIT_TAG 985d0dcc4042ffb24dcb18c34ad5f42b10232510 + GIT_TAG a4a559be1abd84ffbd4d127c572cce036a8cc5ad GIT_PROGRESS TRUE CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/src/backend/backend.cpp b/src/backend/backend.cpp index 4bb3c5fe..b6fd033a 100644 --- a/src/backend/backend.cpp +++ b/src/backend/backend.cpp @@ -117,6 +117,7 @@ namespace big while (g_running) { looped::player_good_options(); + looped::player_toxic_options(); looped::player_spectate(); looped::player_remote_control_vehicle(); diff --git a/src/backend/commands/player/kick/bail_kick.cpp b/src/backend/commands/player/kick/bail_kick.cpp index 17944907..05be91b1 100644 --- a/src/backend/commands/player/kick/bail_kick.cpp +++ b/src/backend/commands/player/kick/bail_kick.cpp @@ -3,6 +3,8 @@ #include "pointers.hpp" #include "core/scr_globals.hpp" +#include