Add more spoofing options and added clang-format (#1020)

* feat(Spoofing): add spoofing
* feat(Spoofing): prepare code for player attach
* remove(PlayerAttach): isn't going to work due to netsync architecture
* fix(GUI): fix scaling
* feat(Project): add clang-format file
* feat(Classes): update classes
* fix(BlackHole): remove unnecessary cleanup
* fix(Formatting): fix formatting for initializer lists
* feat(clang-format): Set tab width and 1 space before comment

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
maybegreat48
2023-03-01 21:27:15 +00:00
committed by GitHub
parent 92aea20cd6
commit 97a8c5d60b
466 changed files with 55224 additions and 35596 deletions

View File

@ -1,18 +1,19 @@
#include "reaction.hpp"
#include "backend/player_command.hpp"
#include "services/player_database/player_database_service.hpp"
#include "fiber_pool.hpp"
#include "script.hpp"
#include "hooking.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include "services/player_database/player_database_service.hpp"
#include "util/notify.hpp"
namespace big
{
reaction::reaction(const char* event_name, const char* notify_message, const char* announce_message) :
m_event_name(event_name),
m_notify_message(notify_message),
m_announce_message(announce_message)
m_event_name(event_name),
m_notify_message(notify_message),
m_announce_message(announce_message)
{
}
@ -37,8 +38,7 @@ namespace big
if (kick)
{
g_fiber_pool->queue_job([player]
{
g_fiber_pool->queue_job([player] {
((player_command*)command::get(RAGE_JOAAT("bailkick")))->call(player, {});
((player_command*)command::get(RAGE_JOAAT("nfkick")))->call(player, {});
script::get_current()->yield(700ms);
@ -54,19 +54,24 @@ namespace big
if (announce_in_chat)
{
g_fiber_pool->queue_job([player, this]
{
g_fiber_pool->queue_job([player, this] {
char chat[255];
snprintf(chat, sizeof(chat), std::format("{} {}", g.session.chat_output_prefix, m_announce_message).data(), player->get_name());
snprintf(chat,
sizeof(chat),
std::format("{} {}", g.session.chat_output_prefix, m_announce_message).data(),
player->get_name());
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_send_chat_ptr, g_player_service->get_self()->get_net_data(), chat, false))
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_send_chat_ptr,
g_player_service->get_self()->get_net_data(),
chat,
false))
notify::draw_chat(chat, g_player_service->get_self()->get_name(), false);
});
}
if (notify)
{
char notification[500]{}; // I don't like using sprintf but there isn't an alternative afaik
char notification[500]{};// I don't like using sprintf but there isn't an alternative afaik
snprintf(notification, sizeof(notification), m_notify_message, player->get_name());
g_notification_service->push_warning("Protections", notification);
}