feat(TabSettings): Added disable logging to settings
This commit is contained in:
parent
3bbe770095
commit
6b0d9c0e21
@ -6,6 +6,21 @@ namespace big
|
||||
{
|
||||
if (ImGui::BeginTabItem("Settings"))
|
||||
{
|
||||
if (ImGui::TreeNode("Dev Logging"))
|
||||
{
|
||||
auto& logging = g_settings.options["settings"]["logging"];
|
||||
|
||||
if (ImGui::Checkbox("Get Event Data", logging["get_event_data"].get<bool*>()))
|
||||
g_settings.save();
|
||||
|
||||
if (ImGui::Checkbox("Script Events", logging["script_events"].get<bool*>()))
|
||||
g_settings.save();
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::TreeNode("Protections"))
|
||||
{
|
||||
auto &protections = g_settings.options["settings"]["protections"];
|
||||
|
@ -143,14 +143,17 @@ namespace big
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* sender = g_pointers->m_get_player_name(player);
|
||||
LOG(INFO) << "Player: " << sender;
|
||||
LOG(INFO) << "Script hash: " << args[0];
|
||||
LOG(INFO) << "Script event group: " << eventGroup;
|
||||
LOG(INFO) << "Script event index: " << eventIndex;
|
||||
LOG(INFO) << "Script event argcount: " << argCount;
|
||||
for (std::uint32_t i = 0; i < argCount; i++)
|
||||
LOG(INFO) << "Script event args[" << i << "] : " << args[i];
|
||||
if (g_settings.options["settings"]["logging"]["get_event_data"])
|
||||
{
|
||||
const char* sender = g_pointers->m_get_player_name(player);
|
||||
LOG(INFO) << "Player: " << sender;
|
||||
LOG(INFO) << "Script hash: " << args[0];
|
||||
LOG(INFO) << "Script event group: " << eventGroup;
|
||||
LOG(INFO) << "Script event index: " << eventIndex;
|
||||
LOG(INFO) << "Script event argcount: " << argCount;
|
||||
for (std::uint32_t i = 0; i < argCount; i++)
|
||||
LOG(INFO) << "Script event args[" << i << "] : " << args[i];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -10,7 +10,8 @@ namespace big
|
||||
|
||||
const auto ScriptEventHash = args[0];
|
||||
|
||||
LOG(INFO) << "Received Script Event " << ScriptEventHash << " from Player " << PLAYER::GET_PLAYER_NAME(SenderID);
|
||||
if (g_settings.options["settings"]["logging"]["script_events"])
|
||||
LOG(INFO) << "Received Script Event " << ScriptEventHash << " from Player " << PLAYER::GET_PLAYER_NAME(SenderID);
|
||||
|
||||
return g_hooking->m_script_event_hook.get_original<decltype(&script_event_handler)>()(NetEventStruct, CNetGamePlayer);
|
||||
}
|
||||
|
@ -53,6 +53,10 @@ namespace big
|
||||
"force_teleport": false,
|
||||
"transaction_error": false,
|
||||
"vehicle_kick": false
|
||||
},
|
||||
"logging": {
|
||||
"get_event_data": false,
|
||||
"script_events": false
|
||||
}
|
||||
}
|
||||
})"_json;
|
||||
|
Reference in New Issue
Block a user