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 6a2cd866c0
commit 9ccb77e8eb
467 changed files with 55742 additions and 36204 deletions

View File

@ -1,11 +1,12 @@
#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 "core/scr_globals.hpp"
#include "services/player_database/player_database_service.hpp"
#include "views/view.hpp"
#include <script/globals/GPBD_FM.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -13,10 +14,10 @@ namespace big
{
if (ImGui::TreeNode("INFO"_T.data()))
{
ImGui::Text("PLAYER_INFO_ID"_T.data(), g_player_service->get_selected()->id());
ImGui::Text("PLAYER_INFO_SESSION_HOST"_T.data(), g_player_service->get_selected()->is_host() ? "YES"_T.data() : "NO"_T.data());
ImGui::Text("PLAYER_INFO_SESSION_HOST"_T.data(),
g_player_service->get_selected()->is_host() ? "YES"_T.data() : "NO"_T.data());
ImGui::Separator();
@ -26,18 +27,18 @@ namespace big
}
uint32_t ped_damage_bits = 0;
uint32_t ped_task_flag = 0;
uint32_t ped_health = 0;
uint32_t ped_maxhealth = 0;
uint32_t ped_task_flag = 0;
uint32_t ped_health = 0;
uint32_t ped_maxhealth = 0;
uint32_t veh_damage_bits = 0;
std::string mode_str = "";
std::string mode_str = "";
if (CPed* ped = g_player_service->get_selected()->get_ped(); ped != nullptr)
{
ped_damage_bits = ped->m_damage_bits;
ped_task_flag = ped->m_ped_task_flag;
ped_health = ped->m_health;
ped_maxhealth = ped->m_maxhealth;
ped_task_flag = ped->m_ped_task_flag;
ped_health = ped->m_health;
ped_maxhealth = ped->m_maxhealth;
}
if (ped_damage_bits & (uint32_t)eEntityProofs::GOD)
@ -113,29 +114,21 @@ namespace big
ImGui::SameLine();
ImGui::PushID("##rid");
if (ImGui::Button("COPY"_T.data())) ImGui::SetClipboardText(std::to_string(net_player_data->m_gamer_handle.m_rockstar_id).data());
if (ImGui::Button("COPY"_T.data()))
ImGui::SetClipboardText(std::to_string(net_player_data->m_gamer_handle.m_rockstar_id).data());
ImGui::PopID();
auto ip = g_player_service->get_selected()->get_ip_address();
auto ip = g_player_service->get_selected()->get_ip_address();
auto port = g_player_service->get_selected()->get_port();
ImGui::Text(
"PLAYER_INFO_IP"_T.data(),
ip.m_field1,
ip.m_field2,
ip.m_field3,
ip.m_field4,
port
);
ImGui::Text("PLAYER_INFO_IP"_T.data(), ip.m_field1, ip.m_field2, ip.m_field3, ip.m_field4, port);
ImGui::SameLine();
ImGui::PushID("##ip");
if (ImGui::Button("COPY"_T.data())) ImGui::SetClipboardText(std::format("{}.{}.{}.{}:{}", ip.m_field1,
ip.m_field2,
ip.m_field3,
ip.m_field4,
port).data());
if (ImGui::Button("COPY"_T.data()))
ImGui::SetClipboardText(
std::format("{}.{}.{}.{}:{}", ip.m_field1, ip.m_field2, ip.m_field3, ip.m_field4, port).data());
ImGui::PopID();
}
@ -145,7 +138,7 @@ namespace big
if (id != -1)
{
auto& stats = scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PlayerStats;
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)
@ -157,24 +150,27 @@ namespace big
ImGui::Text("PLAYER_INFO_BANK"_T.data(), stats.Money - stats.WalletBalance);
ImGui::Text("PLAYER_INFO_TOTAL_MONEY"_T.data(), stats.Money);
ImGui::Text("PLAYER_INFO_RANK"_T.data(), stats.Rank, stats.RP);
ImGui::Text("Health: %d (MaxHealth: %d)", ped_health, ped_maxhealth); // TODO: translate
ImGui::Text("Health: %d (MaxHealth: %d)", ped_health, ped_maxhealth);// TODO: translate
ImGui::Text("PLAYER_INFO_KD"_T.data(), stats.KdRatio);
ImGui::Text("PLAYER_INFO_KILLS"_T.data(), stats.KillsOnPlayers);
ImGui::Text("PLAYER_INFO_DEATHS"_T.data(), stats.DeathsByPlayers);
ImGui::Text("PLAYER_INFO_PROSTITUTES"_T.data(), stats.ProstitutesFrequented);
ImGui::Text("PLAYER_INFO_LAP_DANCES"_T.data(), stats.LapDancesBought);
ImGui::Text("PLAYER_INFO_MISSIONS_CREATED"_T.data(), stats.MissionsCreated);
ImGui::Text("PLAYER_INFO_METLDOWN_COMPLETE"_T.data(), scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].MeltdownComplete ? "YES"_T.data() : "NO"_T.data()); // curious to see if anyone has actually played singleplayer
ImGui::Text("PLAYER_INFO_METLDOWN_COMPLETE"_T.data(),
scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].MeltdownComplete ? "YES"_T.data() : "NO"_T.data());// curious to see if anyone has actually played singleplayer
ImGui::Separator();
}
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(), COMMAND_ACCESS_LEVELS[g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)]))
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(),
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)
{
if (ImGui::Selectable(name, type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)))
if (ImGui::Selectable(name,
type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)))
{
g.session.chat_command_default_access_level = type;
g_player_database_service->get_or_create_player(g_player_service->get_selected())->command_access_level = type;