feat(launcher): add About log export shortcut and runtime logging toggle
Launcher release / release (push) Waiting to run
Launcher release / release (push) Waiting to run
Add a quick ZIP log export button to the About page (also bundling the latest embedded browser -browser.log while excluding player saves) and add a runtime logging toggle under Settings -> Diagnostics that controls launcher file logs, local server traffic logs, and wto_ws.log via log=0 in wto_ws.cfg. Update the v0.1.2 release note accordingly.
This commit is contained in:
1 parent
2d5e268083
commit
fb7d07f4f9
21 files changed
+230
-37
No files matched your search
@@ -4,6 +4,7 @@
|
||||
* wto_ws.cfg, written by the build into the game copy (@wto/patcher network-hook.ts):
|
||||
* port=<local server port> without a valid port the hooks still answer every host name
|
||||
* locally but refuse every connection that would leave the machine
|
||||
* log=0|1 optional, defaults to 1; when 0, wto_ws.log is not opened
|
||||
* exe.time_date_stamp=0x... the executable the native values were resolved for
|
||||
* exe.size_of_image=0x...
|
||||
* native.<name>=<value> what the LocalMP modules need from the executable: RVAs of
|
||||
@@ -33,6 +34,7 @@ typedef struct NativeValue {
|
||||
static wchar_t g_folder[MAX_PATH];
|
||||
static CRITICAL_SECTION g_log_lock;
|
||||
static FILE *g_log;
|
||||
static int g_log_enabled = 1;
|
||||
static NativeValue g_native[NATIVE_VALUES_MAX];
|
||||
static size_t g_native_count;
|
||||
static int64_t g_exe_time_date_stamp = -1;
|
||||
@@ -98,6 +100,8 @@ static void read_settings(void)
|
||||
line[strcspn(line, "\r\n")] = '\0';
|
||||
if (strncmp(line, "port=", 5) == 0)
|
||||
read_port(line + 5);
|
||||
else if (strncmp(line, "log=", 4) == 0)
|
||||
g_log_enabled = atoi(line + 4) != 0;
|
||||
else if (strncmp(line, "exe.time_date_stamp=", 20) == 0)
|
||||
parse_value(line + 20, &g_exe_time_date_stamp);
|
||||
else if (strncmp(line, "exe.size_of_image=", 18) == 0)
|
||||
@@ -140,7 +144,7 @@ void config_load(HMODULE self)
|
||||
InitializeCriticalSection(&g_log_lock);
|
||||
find_folder(self);
|
||||
read_settings();
|
||||
if (_snwprintf_s(path, MAX_PATH, _TRUNCATE, L"%swto_ws.log", g_folder) >= 0)
|
||||
if (g_log_enabled && _snwprintf_s(path, MAX_PATH, _TRUNCATE, L"%swto_ws.log", g_folder) >= 0)
|
||||
g_log = _wfsopen(path, L"w", _SH_DENYWR);
|
||||
log_line("wto_ws: local server port %u%s", g_service_port, g_service_port ? "" : " (none: outside connections are refused)");
|
||||
log_line("wto_ws: %u native value(s) for the LocalMP modules", (unsigned)g_native_count);
|
||||
|
||||
Reference in new issue
Block a user