Remove useless kicks (#3061)

This commit is contained in:
tiCkuhAr 2024-05-06 14:11:35 -06:00 committed by GitHub
parent 1066aefa03
commit dfca5c7567
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 12 additions and 107 deletions

View File

@ -11,15 +11,7 @@ command.call_player(somePlayerIndex, "spawn", {joaat("adder")})
For a complete list of available command functions, please refer to the command table documentation.
## Command Count: 213
### bailkick
BAIL_KICK_DESC
Arg Count: 1
### bailkickall
BAIL_KICK_DESC
Arg Count: 0
## Command Count: 209
### breakup
BREAKUP_KICK_DESC
@ -45,14 +37,6 @@ Arg Count: 1
Host kick that only works when host
Arg Count: 1
### nfkick
NULL_FUNCTION_KICK_DESC
Arg Count: 1
### nfkickall
NULL_FUNCTION_KICK_DESC
Arg Count: 0
### oomkick
OOM_KICK_CMD_DESC
Arg Count: 1

View File

@ -1,13 +1,9 @@
[20:46:19.2951571][INFO/command.cpp:48] Command | bailkick | BAIL_KICK | BAIL_KICK_DESC | 1
[20:46:19.2954010][INFO/command.cpp:48] Command | bailkickall | BAIL_KICK | BAIL_KICK_DESC | 0
[20:46:19.2954096][INFO/command.cpp:48] Command | breakup | BREAKUP_KICK | BREAKUP_KICK_DESC | 1
[20:46:19.2954208][INFO/command.cpp:48] Command | breakupcheating | BREAKUP_KICK_SHOW_CHEATING | BREAKUP_KICK_SHOW_CHEATING_DESC | 0
[20:46:19.2954534][INFO/command.cpp:48] Command | desync | COMPLAINT_KICK | COMPLAINT_KICK_DESC | 1
[20:46:19.2954565][INFO/command.cpp:48] Command | desyncall | COMPLAINT_KICK | COMPLAINT_KICK_DESC | 0
[20:46:19.2954673][INFO/command.cpp:48] Command | endkick | END_KICK | END_KICK_DESC | 1
[20:46:19.2954710][INFO/command.cpp:48] Command | hostkick | Host Kick | Host kick that only works when host | 1
[20:46:19.2954760][INFO/command.cpp:48] Command | nfkick | NULL_FUNCTION_KICK | NULL_FUNCTION_KICK_DESC | 1
[20:46:19.2954789][INFO/command.cpp:48] Command | nfkickall | NULL_FUNCTION_KICK | NULL_FUNCTION_KICK_DESC | 0
[20:46:19.2954887][INFO/command.cpp:48] Command | oomkick | OOM_KICK_CMD | OOM_KICK_CMD_DESC | 1
[20:46:19.2955047][INFO/command.cpp:48] Command | shkick | SCRIPT_HOST_KICK | SCRIPT_HOST_KICK_DESC | 1
[20:46:19.2955089][INFO/command.cpp:48] Command | clearwanted | CLEAR_WANTED_LEVEL | CLEAR_WANTED_LEVEL_DESC | 1
@ -210,4 +206,4 @@
[20:46:19.5970941][INFO/command.cpp:48] Command | orbitaldrone | Toggle Orbital Drone | Enables/Disables the orbital drone | 0
[20:46:19.5971135][INFO/command.cpp:48] Command | player_db_auto_update_states | Auto Update Player Online States | Toggling this feature will automatically update the player online states every 5minutes. | 0
[20:46:19.5971390][INFO/command.cpp:48] Command | vehiclecontrol | Vehicle controller | Enables/Disables the vehicle controller. | 0
[20:46:19.5972044][INFO/command.cpp:48] Command | cmdexecutor | Toggle Command Executor | Toggles the command executor window | 0
[20:46:19.5972044][INFO/command.cpp:48] Command | cmdexecutor | Toggle Command Executor | Toggles the command executor window | 0

View File

@ -1,35 +0,0 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include <script/globals/GPBD_FM_3.hpp>
namespace big
{
class bail_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
{
if (!player)
return;
const size_t arg_count = 4;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::NetworkBail,
(int64_t)self::id,
1 << player->id(),
scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[player->id()].ScriptEventReplayProtectionCounter};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::NetworkBail);
}
};
bail_kick g_bail_kick("bailkick", "BAIL_KICK", "BAIL_KICK_DESC", 0);
}

View File

@ -17,20 +17,16 @@ namespace big
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
{
dynamic_cast<player_command*>(command::get("nfkick"_J))->call(player, {});
if (g_player_service->get_self()->is_host())
dynamic_cast<player_command*>(command::get("breakup"_J))->call(player, {}),
dynamic_cast<player_command*>(command::get("hostkick"_J))->call(player, {});
dynamic_cast<player_command*>(command::get("oomkick"_J))->call(player, {});
dynamic_cast<player_command*>(command::get("endkick"_J))->call(player, {});
script::get_current()->yield(700ms);
if (g_player_service->get_self()->is_host())
dynamic_cast<player_command*>(command::get("hostkick"_J))->call(player, {});
if (player && !g_player_service->get_self()->is_host() && player->is_valid() && !player->is_host())
dynamic_cast<player_command*>(command::get("desync"_J))->call(player, {});
if (g_player_service->get_self()->is_host())
dynamic_cast<player_command*>(command::get("breakup"_J))->call(player, {}),
NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id());
}
};

View File

@ -1,29 +0,0 @@
#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.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
{
if (!player)
return;
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);
}

View File

@ -129,12 +129,7 @@ namespace big
if (g.session.kick_chat_spammers
&& !(player->is_trusted || (player->is_friend() && g.session.trust_friends) || g.session.trust_session))
{
if (g_player_service->get_self()->is_host())
dynamic_cast<player_command*>(command::get("breakup"_J))->call(player, {}),
dynamic_cast<player_command*>(command::get("hostkick"_J))->call(player, {});
dynamic_cast<player_command*>(command::get("endkick"_J))->call(player, {});
dynamic_cast<player_command*>(command::get("nfkick"_J))->call(player, {});
dynamic_cast<player_command*>(command::get("multikick"_J))->call(player, {});
}
return true;
}

View File

@ -28,15 +28,13 @@ namespace big
components::command_checkbox<"breakupcheating">();
components::player_command_button<"multikick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"nfkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"oomkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"shkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"endkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"desync">(g_player_service->get_selected());
ImGui::EndListBox();
@ -44,4 +42,4 @@ namespace big
ImGui::EndGroup();
}
}
}