diff --git a/src/spice2x/avs/ea3.cpp b/src/spice2x/avs/ea3.cpp index 31f959f..2c804c5 100644 --- a/src/spice2x/avs/ea3.cpp +++ b/src/spice2x/avs/ea3.cpp @@ -41,6 +41,7 @@ namespace avs { int HTTP11 = -1; int URL_SLASH = -1; int PCB_TYPE = -1; + bool EA3_DEBUG_VERBOSE = false; // handle std::string VERSION_STR = "unknown"; @@ -412,6 +413,11 @@ namespace avs { log_fatal("avs-ea3", "no PCBID set (try using -p to specify PCBID)"); } + // remove since it can expose pcbid in logged requests + if (!EA3_DEBUG_VERBOSE) { + avs::core::property_search_remove_safe(ea3_config, nullptr, "/ea3/debug/verbose"); + } + // remember IDs char pcbid_buffer[256] { 0 }; char accountid_buffer[256] { 0 }; diff --git a/src/spice2x/avs/ea3.h b/src/spice2x/avs/ea3.h index 267daf8..d4a8d1a 100644 --- a/src/spice2x/avs/ea3.h +++ b/src/spice2x/avs/ea3.h @@ -28,6 +28,7 @@ namespace avs { extern int HTTP11; extern int URL_SLASH; extern int PCB_TYPE; + extern bool EA3_DEBUG_VERBOSE; // handle extern std::string VERSION_STR; diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index 1733b5f..5902f01 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -365,6 +365,9 @@ int main_implementation(int argc, char *argv[]) { if (options[launcher::Options::VerboseAVSLogging].value_bool()) { hooks::avs::config::LOG = true; } + if (options[launcher::Options::AllowEA3Verbose].value_bool()) { + avs::ea3::EA3_DEBUG_VERBOSE = true; + } if (options[launcher::Options::spice2x_AutoOrientation].is_active()) { GRAPHICS_ADJUST_ORIENTATION = (graphics_orientation)options[launcher::Options::spice2x_AutoOrientation].value_uint32(); diff --git a/src/spice2x/launcher/options.cpp b/src/spice2x/launcher/options.cpp index 338b955..34fd1ad 100644 --- a/src/spice2x/launcher/options.cpp +++ b/src/spice2x/launcher/options.cpp @@ -1672,6 +1672,16 @@ static const std::vector OPTION_DEFINITIONS = { .type = OptionType::Bool, .category = "Debug Log", }, + { + // AllowEA3Verbose + .title = "Allow EA3 Verbose Debug Logging", + .name = "ea3verbose", + .desc = "This option is only useful for network developers; leave this OFF.\n\n" + "By default, ea3/debug/verbose node is removed by spice to prevent exposing PCBID in the logs. " + "When this is enabled, ea3/debug/verbose node in the XML will be kept and exposed to the game", + .type = OptionType::Bool, + .category = "Debug Log", + }, { .title = "Disable Colored Output", .name = "nocolor", @@ -2375,7 +2385,7 @@ static const std::vector OPTION_DEFINITIONS = { .type = OptionType::Bool, .category = "Development", .disabled = true, - }, + } }; const std::vector &launcher::get_categories(Options::OptionsCategory category) { diff --git a/src/spice2x/launcher/options.h b/src/spice2x/launcher/options.h index 7892563..95dcea6 100644 --- a/src/spice2x/launcher/options.h +++ b/src/spice2x/launcher/options.h @@ -188,6 +188,7 @@ namespace launcher { DebugCreateFile, VerboseGraphicsLogging, VerboseAVSLogging, + AllowEA3Verbose, DisableColoredOutput, DisableACPHook, DisableSignalHandling,