parent
b357aaac69
commit
9c4058e9cd
@ -10,6 +10,10 @@ struct globals {
|
||||
nlohmann::json default_options;
|
||||
nlohmann::json options;
|
||||
|
||||
struct debug {
|
||||
bool script_event_logging = false;
|
||||
};
|
||||
|
||||
struct tunables {
|
||||
bool disable_phone = false;
|
||||
bool no_idle_kick = false;
|
||||
@ -115,6 +119,7 @@ struct globals {
|
||||
CPlayer players[32];
|
||||
CPlayer selected_player;
|
||||
|
||||
debug debug{};
|
||||
tunables tunables{};
|
||||
player player{};
|
||||
protections protections{};
|
||||
@ -126,6 +131,8 @@ struct globals {
|
||||
|
||||
void from_json(const nlohmann::json& j)
|
||||
{
|
||||
this->debug.script_event_logging = j["debug"]["script_event_logging"];
|
||||
|
||||
this->protections.script_events.bounty = j["protections"]["script_events"]["bounty"];
|
||||
this->protections.script_events.ceo_ban = j["protections"]["script_events"]["ceo_ban"];
|
||||
this->protections.script_events.ceo_kick = j["protections"]["script_events"]["ceo_kick"];
|
||||
@ -187,6 +194,12 @@ struct globals {
|
||||
nlohmann::json to_json()
|
||||
{
|
||||
return nlohmann::json{
|
||||
{
|
||||
"debug",
|
||||
{
|
||||
{ "script_event_logging", this->debug.script_event_logging }
|
||||
}
|
||||
},
|
||||
{
|
||||
"protections",
|
||||
{
|
||||
|
@ -7,6 +7,8 @@ namespace big
|
||||
{
|
||||
if (ImGui::BeginTabItem("Debug"))
|
||||
{
|
||||
ImGui::Checkbox("Script Event Logging", &g.debug.script_event_logging);
|
||||
|
||||
if (ImGui::Button("Dump entrypoints"))
|
||||
{
|
||||
system::dump_entry_points();
|
||||
|
@ -115,14 +115,16 @@ namespace big
|
||||
return true;
|
||||
}
|
||||
|
||||
if (false)
|
||||
if (g.debug.script_event_logging)
|
||||
{
|
||||
LOG(INFO) << "Received Script Event";
|
||||
LOG(INFO) << "== Begin of Script Event ==";
|
||||
LOG(INFO) << "Player: " << player->get_name();
|
||||
LOG(INFO) << "Hash: " << (int64_t)hash;
|
||||
LOG(INFO) << "Hash/Arg #0: " << (int)hash;
|
||||
|
||||
for (int i = 1; i < sizeof(args); i++)
|
||||
LOG(INFO) << "Arg #" << i << ": " << args[i];
|
||||
|
||||
LOG(INFO) << "== End of Script Event ==";
|
||||
}
|
||||
|
||||
return g_hooking->m_scripted_game_event_hook.get_original<decltype(&hooks::scripted_game_event)>()(scripted_game_event, player);
|
||||
|
Reference in New Issue
Block a user