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
This commit is contained in:
maybegreat48
2023-01-03 16:48:32 +00:00
committed by GitHub
parent 3db41c60f0
commit 10d0f317dc
62 changed files with 1039 additions and 882 deletions

View File

@ -123,6 +123,11 @@ namespace big
}
}
components::button("Kick", []
{
session::kick_by_rockstar_id(current_player.rockstar_id);
});
components::button("Join Session", []
{
session::join_by_rockstar_id(current_player.rockstar_id);

View File

@ -9,9 +9,11 @@
#include "core/data/apartment_names.hpp"
#include "core/data/warehouse_names.hpp"
#include "core/data/command_access_levels.hpp"
#include <network/Network.hpp>
#include "hooking.hpp"
#include <network/Network.hpp>
#include <script/globals/GPBD_FM_3.hpp>
namespace big
{
void view::session()
@ -22,6 +24,11 @@ namespace big
{
session::join_by_rockstar_id(rid);
});
ImGui::SameLine();
components::button("Kick by RID", []
{
session::kick_by_rockstar_id(rid);
});
static char username[20];
ImGui::InputText("Input Username", username, sizeof(username));
@ -29,7 +36,12 @@ namespace big
{
session::join_by_username(username);
};
ImGui::SameLine();
if (components::button("Kick by Username"))
{
session::kick_by_username(username);
};
static char base64[500]{};
ImGui::InputText("Session Info", base64, sizeof(base64));
components::button("Join Session Info", []
@ -200,6 +212,8 @@ namespace big
}
components::command_button<"killall">({ }, "Kill Everyone");
ImGui::SameLine();
components::command_button<"explodeall">({ }, "Explode Everyone");
ImGui::SameLine();

View File

@ -1,6 +1,11 @@
#include "views/view.hpp"
#include "services/player_database/player_database_service.hpp"
#include "core/data/command_access_levels.hpp"
#include "core/scr_globals.hpp"
#include "core/data/language_codes.hpp"
#include <script/globals/GlobalPlayerBD.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GPBD_FM.hpp>
namespace big
{
@ -119,6 +124,35 @@ namespace big
net_player_data->m_external_port).data());
}
ImGui::Separator();
auto id = g_player_service->get_selected()->id();
if (id != -1)
{
auto& stats = scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PlayerStats;
auto& boss_goon = scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[id].BossGoon;
if (boss_goon.Language >= 0 && boss_goon.Language < 13)
ImGui::Text("Language: %s", languages[boss_goon.Language].name);
ImGui::Text("CEO Name: %s", boss_goon.GangName);
ImGui::Text("MC Name: %s", boss_goon.MCName);
ImGui::Text("Money In Wallet: %d", stats.WalletBalance);
ImGui::Text("Money In Bank: %d", stats.Money - stats.WalletBalance);
ImGui::Text("Total Money: %d", stats.Money);
ImGui::Text("Rank: %d (RP %d)", stats.Rank, stats.RP);
ImGui::Text("K/D Ratio: %f", stats.KdRatio);
ImGui::Text("Kills On Players: %d", stats.KillsOnPlayers);
ImGui::Text("Deaths By Players: %d", stats.DeathsByPlayers);
ImGui::Text("Prostitutes Frequented: %d", stats.ProstitutesFrequented);
ImGui::Text("Lap Dances Bought: %d", stats.LapDancesBought);
ImGui::Text("Missions Created: %d", stats.MissionsCreated);
ImGui::Text("Meltdown Complete: %s", scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].MeltdownComplete ? "Yes" : "No"); // curious to see if anyone has actually played singleplayer
ImGui::Separator();
}
if (ImGui::BeginCombo("Chat Command Permissions", COMMAND_ACCESS_LEVELS[g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)

View File

@ -20,6 +20,7 @@ namespace big
components::player_command_button<"bailkick">(g_player_service->get_selected());
components::player_command_button<"nfkick">(g_player_service->get_selected());
components::player_command_button<"oomkick">(g_player_service->get_selected());
components::player_command_button<"gikick">(g_player_service->get_selected());
components::player_command_button<"shkick">(g_player_service->get_selected());
components::player_command_button<"endkick">(g_player_service->get_selected());
components::player_command_button<"desync">(g_player_service->get_selected());

View File

@ -1,14 +1,4 @@
#include "views/view.hpp"
#include "util/teleport.hpp"
#include "core/scr_globals.hpp"
#include "util/ped.hpp"
#include "util/vehicle.hpp"
#include "util/globals.hpp"
#include "services/pickups/pickup_service.hpp"
#include "gta/net_object_mgr.hpp"
#include "util/scripts.hpp"
#include "util/session.hpp"
#include "script_function.hpp"
namespace big
{

View File

@ -11,6 +11,8 @@ namespace big
if (ImGui::TreeNode("Toxic"))
{
components::player_command_button<"kill">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"explode">(g_player_service->get_selected(), {});
components::player_command_button<"ceokick">(g_player_service->get_selected(), {});
ImGui::SameLine();
@ -122,6 +124,18 @@ namespace big
if (ImGui::IsItemHovered())
ImGui::SetTooltip("This cannot be reversed. Use with caution");
ImGui::Checkbox("Kill Loop", &g_player_service->get_selected()->kill_loop);
ImGui::SameLine();
ImGui::Checkbox("Explosion Loop", &g_player_service->get_selected()->explosion_loop);
ImGui::SameLine();
ImGui::Checkbox("Freeze Loop", &g_player_service->get_selected()->freeze_loop);
ImGui::Checkbox("Ragdoll Loop", &g_player_service->get_selected()->ragdoll_loop);
ImGui::SameLine();
ImGui::Checkbox("Rotate Cam Loop", &g_player_service->get_selected()->rotate_cam_loop);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Also brings the player out of godmode if the event isn't blocked");
ImGui::TreePop();
}
}

View File

@ -1,111 +0,0 @@
#include "views/view.hpp"
namespace big
{
void draw_pair_option(const std::string_view name, decltype(g.notifications.gta_thread_kill)& option)
{
ImGui::Text("%s", name.data());
ImGui::PushID(name.data());
ImGui::Checkbox("Log", &option.log);
ImGui::Checkbox("Notify", &option.notify);
ImGui::PopID();
}
void view::notification_settings()
{
components::sub_title("GTA Threads");
draw_pair_option("Terminate", g.notifications.gta_thread_kill);
draw_pair_option("Start", g.notifications.gta_thread_start);
components::sub_title("Network Player Manager");
ImGui::Text("Player Join");
ImGui::Checkbox("Above Map", &g.notifications.player_join.above_map);
ImGui::Checkbox("Log", &g.notifications.player_join.log);
ImGui::Checkbox("Notify", &g.notifications.player_join.notify);
draw_pair_option("Player Leave", g.notifications.player_leave);
draw_pair_option("Init", g.notifications.network_player_mgr_init);
draw_pair_option("Shutdown", g.notifications.network_player_mgr_shutdown);
components::sub_title("Received Event");
auto& received_event = g.notifications.received_event;
ImGui::BeginGroup();
draw_pair_option("Clear Ped Tasks", received_event.clear_ped_task);
draw_pair_option("Kick Votes Notification", received_event.kick_vote);
draw_pair_option("Detect Modder Events", received_event.modder_detect);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Report Cash Spawn", received_event.report_cash_spawn);
draw_pair_option("Request Control Event", received_event.request_control_event);
draw_pair_option("Vehicle Temp Action", received_event.vehicle_temp_action);
ImGui::EndGroup();
components::sub_title("Script Event Handler");
auto& script_event_handler = g.notifications.script_event_handler;
ImGui::BeginGroup();
draw_pair_option("Bounty", script_event_handler.bounty);
draw_pair_option("CEO Ban", script_event_handler.ceo_ban);
draw_pair_option("CEO Kick", script_event_handler.ceo_kick);
draw_pair_option("CEO Money", script_event_handler.ceo_money);
draw_pair_option("Destroy Personal Vehicle", script_event_handler.personal_vehicle_destroyed);
draw_pair_option("Fake Deposit", script_event_handler.fake_deposit);
draw_pair_option("Force Mission", script_event_handler.force_mission);
draw_pair_option("Force Teleport", script_event_handler.force_teleport);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("GTA Banner", script_event_handler.gta_banner);
draw_pair_option("MC Teleport", script_event_handler.mc_teleport);
draw_pair_option("Network Bail", script_event_handler.network_bail);
draw_pair_option("Remote Off Radar", script_event_handler.remote_off_radar);
draw_pair_option("Rotate Cam", script_event_handler.rotate_cam);
draw_pair_option("Send to Cutscene", script_event_handler.send_to_cutscene);
draw_pair_option("Send to Location", script_event_handler.send_to_location);
draw_pair_option("Sound Spam", script_event_handler.sound_spam);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Spectate", script_event_handler.spectate);
draw_pair_option("Transaction Error", script_event_handler.transaction_error);
draw_pair_option("TSE Crash", script_event_handler.crash);
draw_pair_option("TSE Freeze", script_event_handler.tse_freeze);
draw_pair_option("TSE Sender Mismatch", script_event_handler.tse_sender_mismatch);
draw_pair_option("Vehicle Kick", script_event_handler.vehicle_kick);
draw_pair_option("Wanted Level", script_event_handler.clear_wanted_level);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Teleport To Warehouse", script_event_handler.teleport_to_warehouse);
draw_pair_option("Start Activity", script_event_handler.start_activity);
draw_pair_option("Null Function Kick", script_event_handler.null_function_kick);
draw_pair_option("Send SMS", script_event_handler.send_sms);
ImGui::EndGroup();
components::sub_title("Other");
draw_pair_option("Reports", g.notifications.reports);
draw_pair_option("Transaction Error / Rate Limit", g.notifications.transaction_rate_limit);
draw_pair_option("Mismatch sync type", g.notifications.mismatch_sync_type);
draw_pair_option("Out of allowed range sync type", g.notifications.out_of_allowed_range_sync_type);
draw_pair_option("Invalid sync", g.notifications.invalid_sync);
}
}

View File

@ -6,24 +6,12 @@ namespace big
{
ImGui::BeginGroup();
ImGui::Checkbox("Bounty", &g.protections.script_events.bounty);
ImGui::Checkbox("CEO Ban", &g.protections.script_events.ceo_ban);
ImGui::Checkbox("CEO Kick", &g.protections.script_events.ceo_kick);
ImGui::Checkbox("CEO Money", &g.protections.script_events.ceo_money);
ImGui::Checkbox("TSE Crash", &g.protections.script_events.crash);
ImGui::Checkbox("Fake Deposit", &g.protections.script_events.fake_deposit);
ImGui::Checkbox("Force Mission", &g.protections.script_events.force_mission);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Force Teleport", &g.protections.script_events.force_teleport);
ImGui::Checkbox("GTA Banner", &g.protections.script_events.gta_banner);
ImGui::Checkbox("MC Teleport", &g.protections.script_events.mc_teleport);
ImGui::Checkbox("Network Bail", &g.protections.script_events.network_bail);
ImGui::Checkbox("Personal Vehicle Destroyed", &g.protections.script_events.personal_vehicle_destroyed);
ImGui::Checkbox("Remote Off Radar", &g.protections.script_events.remote_off_radar);
ImGui::Checkbox("Rotate Cam", &g.protections.script_events.rotate_cam);
ImGui::EndGroup();
ImGui::SameLine();
@ -32,20 +20,25 @@ namespace big
ImGui::Checkbox("Send to Cutscene", &g.protections.script_events.send_to_cutscene);
ImGui::Checkbox("Send to Location", &g.protections.script_events.send_to_location);
ImGui::Checkbox("Sound Spam", &g.protections.script_events.sound_spam);
ImGui::Checkbox("Spectate", &g.protections.script_events.spectate);
ImGui::Checkbox("Transaction Error", &g.protections.script_events.transaction_error);
ImGui::Checkbox("Vehicle Kick", &g.protections.script_events.vehicle_kick);
ImGui::Checkbox("Wanted Level", &g.protections.script_events.clear_wanted_level);
ImGui::Checkbox("Personal Vehicle Destroyed", &g.protections.script_events.personal_vehicle_destroyed);
ImGui::Checkbox("Remote Off Radar", &g.protections.script_events.remote_off_radar);
ImGui::Checkbox("Rotate Cam", &g.protections.script_events.rotate_cam);
ImGui::Checkbox("Teleport To Warehouse", &g.protections.script_events.teleport_to_warehouse);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Teleport To Warehouse", &g.protections.script_events.teleport_to_warehouse);
ImGui::Checkbox("Start Activity", &g.protections.script_events.start_activity);
ImGui::Checkbox("Send SMS", &g.protections.script_events.send_sms);
components::script_patch_checkbox("Script Host Kick", &g.protections.script_host_kick);
ImGui::Checkbox("Spectate", &g.protections.script_events.spectate);
ImGui::Checkbox("Vehicle Kick", &g.protections.script_events.vehicle_kick);
ImGui::Checkbox("Wanted Level", &g.protections.script_events.clear_wanted_level);
ImGui::Checkbox("Desync Kick", &g.protections.desync_kick);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("RID Join", &g.protections.rid_join);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("This will block anyone trying to join, kick or crash you with your Rockstar ID, including your friends");

View File

@ -0,0 +1,126 @@
#include "views/view.hpp"
namespace big
{
void draw_pair_option(const std::string_view name, decltype(g.notifications.gta_thread_kill)& option)
{
ImGui::Text("%s", name.data());
ImGui::PushID(name.data());
ImGui::Checkbox("Log", &option.log);
ImGui::Checkbox("Notify", &option.notify);
ImGui::PopID();
}
void draw_reaction(reaction& reaction)
{
if (ImGui::TreeNode(reaction.m_event_name))
{
ImGui::Checkbox("Announce In Chat", &reaction.announce_in_chat);
ImGui::Checkbox("Notify", &reaction.notify);
ImGui::Checkbox("Log", &reaction.log);
ImGui::Checkbox("Add Player To Database", &reaction.add_to_player_db);
if (reaction.add_to_player_db)
ImGui::Checkbox("Block Joins", &reaction.block_joins);
ImGui::Checkbox("Kick Player", &reaction.kick);
ImGui::TreePop();
}
}
// TODO code duplication
void draw_interloper_reaction(interloper_reaction& reaction)
{
if (ImGui::TreeNode(reaction.m_event_name))
{
ImGui::Checkbox("Announce In Chat", &reaction.announce_in_chat);
ImGui::Checkbox("Notify", &reaction.notify);
ImGui::Checkbox("Log", &reaction.log);
ImGui::Checkbox("Add Attacker To Database", &reaction.add_to_player_db);
if (reaction.add_to_player_db)
ImGui::Checkbox("Block Joins", &reaction.block_joins);
ImGui::Checkbox("Kick Attacker", &reaction.kick);
if (reaction.m_blockable || reaction.m_karmaable)
ImGui::Separator();
if (reaction.m_blockable)
ImGui::Checkbox("Block", &reaction.block);
if (reaction.m_karmaable)
ImGui::Checkbox("Karma", &reaction.karma);
ImGui::TreePop();
}
}
void view::reaction_settings()
{
components::title("Reactions");
draw_reaction(g.reactions.bounty);
draw_reaction(g.reactions.ceo_money);
draw_reaction(g.reactions.clear_wanted_level);
draw_reaction(g.reactions.crash);
draw_reaction(g.reactions.destroy_personal_vehicle);
draw_reaction(g.reactions.fake_deposit);
draw_reaction(g.reactions.force_mission);
draw_reaction(g.reactions.force_teleport);
draw_reaction(g.reactions.give_collectible);
draw_reaction(g.reactions.gta_banner);
draw_reaction(g.reactions.mc_teleport);
draw_reaction(g.reactions.network_bail);
draw_reaction(g.reactions.null_function_kick);
draw_reaction(g.reactions.personal_vehicle_destroyed);
draw_reaction(g.reactions.remote_off_radar);
draw_reaction(g.reactions.rotate_cam);
draw_reaction(g.reactions.send_to_cutscene);
draw_reaction(g.reactions.send_to_location);
draw_reaction(g.reactions.sound_spam);
draw_reaction(g.reactions.spectate_notification);
draw_reaction(g.reactions.start_activity);
draw_reaction(g.reactions.teleport_to_warehouse);
draw_reaction(g.reactions.transaction_error);
draw_reaction(g.reactions.tse_freeze);
draw_reaction(g.reactions.tse_sender_mismatch);
draw_reaction(g.reactions.vehicle_kick);
ImGui::Separator();
draw_reaction(g.reactions.clear_ped_tasks);
draw_reaction(g.reactions.remote_ragdoll);
draw_reaction(g.reactions.kick_vote);
draw_reaction(g.reactions.modder_detection);
draw_reaction(g.reactions.report);
draw_reaction(g.reactions.report_cash_spawn);
draw_reaction(g.reactions.request_control_event);
ImGui::Separator();
draw_reaction(g.reactions.lost_connection_kick);
draw_reaction(g.reactions.gamer_instruction_kick);
draw_interloper_reaction(g.reactions.lost_connection_kick_others);
draw_interloper_reaction(g.reactions.breakup_others);
components::title("Notifications");
components::sub_title("GTA Threads");
draw_pair_option("Terminate", g.notifications.gta_thread_kill);
draw_pair_option("Start", g.notifications.gta_thread_start);
components::sub_title("Network Player Manager");
ImGui::Text("Player Join");
ImGui::Checkbox("Above Map", &g.notifications.player_join.above_map);
ImGui::Checkbox("Log", &g.notifications.player_join.log);
ImGui::Checkbox("Notify", &g.notifications.player_join.notify);
draw_pair_option("Player Leave", g.notifications.player_leave);
draw_pair_option("Init", g.notifications.network_player_mgr_init);
draw_pair_option("Shutdown", g.notifications.network_player_mgr_shutdown);
components::sub_title("Other");
draw_pair_option("Transaction Error / Rate Limit", g.notifications.transaction_rate_limit);
draw_pair_option("Mismatch sync type", g.notifications.mismatch_sync_type);
draw_pair_option("Out of allowed range sync type", g.notifications.out_of_allowed_range_sync_type);
draw_pair_option("Invalid sync", g.notifications.invalid_sync);
}
}

View File

@ -19,7 +19,7 @@ namespace big
static void gui_settings();
static void handling_current_profile();
static void handling_saved_profiles();
static void notification_settings();
static void reaction_settings();
static void protection_settings();
static void heading();
static void mobile();

View File

@ -131,8 +131,9 @@ namespace big
weapon.m_weapon_type == weapon_type_arr[selected_ped_weapon_type]
) {
if (
selected_ped_weapon_hash == 0 ||
weapon.m_hash == selected_ped_weapon_hash
(selected_ped_weapon_hash == 0 ||
weapon.m_hash == selected_ped_weapon_hash)
&& weapon.m_hash != RAGE_JOAAT("WEAPON_UNARMED")
) {
WEAPON::GIVE_WEAPON_TO_PED(ped, weapon.m_hash, 9999, false, selected_ped_weapon_hash != 0);
}