2020-02-22 18:37:42 -05:00
|
|
|
#pragma once
|
|
|
|
#include "common.hpp"
|
|
|
|
#include "gta/player.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
class settings
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit settings() = default;
|
|
|
|
~settings() = default;
|
|
|
|
|
|
|
|
nlohmann::json options;
|
|
|
|
nlohmann::json default_options =
|
|
|
|
R"({
|
2021-01-14 22:23:38 +01:00
|
|
|
"custom_gun": {
|
|
|
|
"gravity_velocity_multiplier": 3.0,
|
|
|
|
"type": 0,
|
|
|
|
"vehicle_spawn_model": "bus"
|
|
|
|
},
|
2021-01-01 15:25:44 +01:00
|
|
|
"disable_phone": false,
|
2020-12-31 02:22:12 +01:00
|
|
|
"disable_chat_censoring": false,
|
2021-02-21 00:18:31 +01:00
|
|
|
"frame_flags": {
|
|
|
|
"explosive_ammo": false,
|
|
|
|
"explosive_melee": false,
|
|
|
|
"fire_ammo": false,
|
|
|
|
"super_jump": false
|
|
|
|
},
|
2020-12-26 15:18:41 +01:00
|
|
|
"god_mode": false,
|
2020-12-27 00:47:08 +01:00
|
|
|
"join_message": false,
|
2020-12-26 15:18:41 +01:00
|
|
|
"never_wanted": false,
|
2021-01-13 15:33:52 +01:00
|
|
|
"noclip": {
|
|
|
|
"enabled": false,
|
|
|
|
"horizontal": 5.0,
|
|
|
|
"vertical": 1.0
|
|
|
|
},
|
2020-12-26 21:56:22 +01:00
|
|
|
"no_bike_fall": false,
|
2020-12-26 16:49:21 +01:00
|
|
|
"no_idle_kick": false,
|
2020-12-26 15:18:41 +01:00
|
|
|
"off_radar": false,
|
|
|
|
"ragdoll": false,
|
2020-12-29 23:18:09 +01:00
|
|
|
"speedo_type": 0,
|
2021-02-03 19:43:56 +01:00
|
|
|
"spoofing": {
|
|
|
|
"name": {
|
|
|
|
"enabled": false,
|
|
|
|
"value": "How dare you!"
|
|
|
|
},
|
|
|
|
"ip_address": {
|
|
|
|
"enabled": false,
|
|
|
|
"address": {
|
|
|
|
"byte0": 69,
|
|
|
|
"byte1": 69,
|
|
|
|
"byte2": 69,
|
|
|
|
"byte3": 69
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"rank": {
|
|
|
|
"enabled": false,
|
|
|
|
"value": 6969
|
|
|
|
},
|
|
|
|
"rockstar_id": {
|
|
|
|
"enabled": false,
|
|
|
|
"value": 69420
|
|
|
|
}
|
|
|
|
},
|
2020-12-26 22:06:31 +01:00
|
|
|
"sticky_tyres": false,
|
2020-12-29 01:10:25 +01:00
|
|
|
"super_sprint": false,
|
2021-01-02 16:14:44 +01:00
|
|
|
"settings": {
|
|
|
|
"protections": {
|
2021-01-17 23:26:06 +01:00
|
|
|
"attach": false,
|
2021-01-17 00:47:00 +01:00
|
|
|
"cage": false,
|
|
|
|
"version_mismatch": false
|
|
|
|
},
|
|
|
|
"script_protections": {
|
2021-01-02 16:14:44 +01:00
|
|
|
"bounty": false,
|
|
|
|
"ceo_ban": false,
|
|
|
|
"ceo_kick": false,
|
|
|
|
"ceo_money": false,
|
|
|
|
"clear_wanted_level": false,
|
|
|
|
"fake_deposit": false,
|
|
|
|
"force_mission": false,
|
|
|
|
"gta_banner": false,
|
|
|
|
"kick": false,
|
|
|
|
"personal_vehicle_destroyed": false,
|
|
|
|
"remote_off_radar": false,
|
|
|
|
"rotate_cam": false,
|
|
|
|
"send_to_cutscene": false,
|
|
|
|
"send_to_island": false,
|
|
|
|
"sound_spam": false,
|
|
|
|
"spectate": false,
|
|
|
|
"force_teleport": false,
|
|
|
|
"transaction_error": false,
|
|
|
|
"vehicle_kick": false
|
2021-01-02 23:42:43 +01:00
|
|
|
},
|
|
|
|
"logging": {
|
|
|
|
"get_event_data": false,
|
|
|
|
"script_events": false
|
2021-01-02 16:14:44 +01:00
|
|
|
}
|
2021-01-17 23:26:06 +01:00
|
|
|
},
|
|
|
|
"world": {
|
|
|
|
"population": {
|
|
|
|
"enabled": false,
|
|
|
|
"pedestrians": 1.0,
|
|
|
|
"parked": 1.0,
|
|
|
|
"vehicles": 1.0
|
|
|
|
}
|
2021-01-02 16:14:44 +01:00
|
|
|
}
|
2020-02-22 18:37:42 -05:00
|
|
|
})"_json;
|
|
|
|
|
|
|
|
bool save()
|
|
|
|
{
|
|
|
|
std::string settings_file = std::getenv("appdata");
|
|
|
|
settings_file += "\\BigBaseV2\\settings.json";
|
|
|
|
|
|
|
|
std::ofstream file(settings_file, std::ios::out | std::ios::trunc);
|
|
|
|
file << options.dump(4);
|
|
|
|
file.close();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool load()
|
|
|
|
{
|
|
|
|
std::string settings_file = std::getenv("appdata");
|
|
|
|
settings_file += "\\BigBaseV2\\settings.json";
|
|
|
|
|
|
|
|
std::ifstream file(settings_file);
|
|
|
|
|
|
|
|
if (!file.is_open())
|
|
|
|
{
|
|
|
|
write_default_config();
|
|
|
|
file.open(settings_file);
|
|
|
|
}
|
|
|
|
|
|
|
|
file >> options;
|
|
|
|
|
|
|
|
bool should_save = false;
|
|
|
|
for (auto& e : default_options.items())
|
|
|
|
{
|
|
|
|
if (options.count(e.key()) == 0)
|
|
|
|
{
|
|
|
|
should_save = true;
|
|
|
|
options[e.key()] = e.value();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (should_save)
|
|
|
|
{
|
|
|
|
LOG(INFO) << "Updating settings.";
|
|
|
|
save();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool write_default_config()
|
|
|
|
{
|
|
|
|
std::string settings_file = std::getenv("appdata");
|
|
|
|
settings_file += "\\BigBaseV2\\settings.json";
|
|
|
|
|
|
|
|
std::ofstream file(settings_file, std::ios::out);
|
|
|
|
file << default_options.dump(4);
|
|
|
|
file.close();
|
|
|
|
|
|
|
|
options.clear();
|
|
|
|
options = default_options;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
inline settings g_settings;
|
|
|
|
}
|