Huge protection improvements and other stuff (#1963)

* feat(protections): add a fuzzer
* feat(protections): improve protections
* feat(spoofing): add warning
* feat(world): force object cleanup
* fix(weapons): fix custom weapon code
* fix(weapons): fix for #1983
This commit is contained in:
maybegreat48
2023-08-19 11:01:08 +00:00
committed by GitHub
parent 9a51d381c9
commit 5eead0436f
120 changed files with 15579 additions and 20690 deletions

View File

@ -56,6 +56,8 @@ namespace big
bool hotkey_service::update_hotkey(const std::string_view name, const key_t key)
{
static auto update_hotkey_map = [](hotkey_map& hotkey_map, rage::joaat_t name_hash, key_t new_key) -> bool {
bool processed = false;
for (auto it = hotkey_map.begin(); it != hotkey_map.end(); ++it)
{
auto hotkey = it->second;
@ -66,9 +68,9 @@ namespace big
hotkey.set_key(new_key);
hotkey_map.emplace(new_key, hotkey);
return true;
processed = true;
}
return false;
return processed;
};
const auto name_hash = rage::joaat(name);

View File

@ -1,6 +1,7 @@
#include "util/outfit.hpp"
#include "outfit_service.hpp"
#include "natives.hpp"
#include "util/outfit.hpp"
namespace big
{
@ -50,15 +51,24 @@ namespace big
if (j.contains("blend_data") && was_components_set)
{
head_blend_data blend_data = j["blend_data"];
PED::SET_PED_HEAD_BLEND_DATA(self::ped, blend_data.shape_first_id, blend_data.shape_second_id,
blend_data.shape_third_id, blend_data.skin_first_id, blend_data.skin_second_id, blend_data.skin_third_id,
blend_data.shape_mix, blend_data.skin_mix, blend_data.third_mix, blend_data.is_parent);
PED::SET_PED_HEAD_BLEND_DATA(self::ped,
blend_data.shape_first_id,
blend_data.shape_second_id,
blend_data.shape_third_id,
blend_data.skin_first_id,
blend_data.skin_second_id,
blend_data.skin_third_id,
blend_data.shape_mix,
blend_data.skin_mix,
blend_data.third_mix,
blend_data.is_parent);
}
}
void outfit_service::save_outfit(std::string filename)
{
outfit::components_t components;
outfit::props_t props;
auto model = ENTITY::GET_ENTITY_MODEL(self::ped);
for (auto& item : components.items)
{
@ -99,11 +109,16 @@ namespace big
}
head_blend_data blend_data{};
PED::GET_PED_HEAD_BLEND_DATA(self::ped, (Any*)&blend_data);
if (model == RAGE_JOAAT("mp_m_freemode_01") || model == RAGE_JOAAT("mp_f_freemode_01"))
{
PED::GET_PED_HEAD_BLEND_DATA(self::ped, (Any*)&blend_data);
j["blend_data"] = blend_data;
}
j["components"] = j_components;
j["props"] = j_props;
j["blend_data"] = blend_data;
j["model"] = model;
static folder saved_outfit_path = g_file_manager.get_project_folder("saved_outfits");
std::ofstream o(saved_outfit_path.get_file(filename).get_path());

View File

@ -60,6 +60,7 @@ namespace big
bool off_radar = false;
bool never_wanted = false;
bool semi_godmode = false;
bool fix_vehicle = false;
bool kill_loop = false;
bool explosion_loop = false;
@ -78,12 +79,11 @@ namespace big
bool m_block_permanent_vehicles = false;
bool exposed_desync_protection = false;
bool is_modder = false;
bool block_join = false;
int block_join_reason = 0;
bool is_spammer = false;
bool is_admin = false;
bool is_modder = false;
bool block_join = false;
int block_join_reason = 0;
bool is_spammer = false;
bool is_admin = false;
std::optional<uint32_t> player_time_value;
std::optional<std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>> player_time_value_received_time;
std::optional<uint32_t> time_difference;