From 047f46c1528700966ead8c01914b1c90ecfb2435 Mon Sep 17 00:00:00 2001 From: Yuchen Ren Date: Tue, 5 Jul 2022 14:06:24 +0800 Subject: [PATCH] ISS #72 ^> Fix long IP address causes commad "fate" error. : Using some algorithms to make a suitable string and send it to API. ^- Fix log not generated on normal version. : Modify macro definition position. --- modules/apis.hpp | 2 +- modules/init.hpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/apis.hpp b/modules/apis.hpp index 6887935..c94c4fe 100644 --- a/modules/apis.hpp +++ b/modules/apis.hpp @@ -128,7 +128,7 @@ wstring WCH_GetUniIdent() { _res.push_back(_in[i]); } } - return _res; + return L"11111" + to_wstring(stoll(_res) % 99991); } string UTF8ToANSI(string strUTF8) { diff --git a/modules/init.hpp b/modules/init.hpp index f83fe79..c60b686 100644 --- a/modules/init.hpp +++ b/modules/init.hpp @@ -109,11 +109,10 @@ void WCH_Init_Ver() { WCH_TBL->SetProgressState(WCH_Win_hWnd, TBPF_INDETERMINATE); if (MessageBoxW(NULL, (L"This " + vertype + L" of the program is only used for testing.\nAre you sure you want to start the program?\nCompile time: " + WCH_GetCompileTime()).c_str(), L"WCH WARN", MB_ICONWARNING | MB_YESNO | MB_TOPMOST) == IDNO) { _exit(0); - } else { - WCH_SetWindowStatus(true); - WCH_pre_start = false; } + WCH_SetWindowStatus(true); #endif + WCH_pre_start = false; } void WCH_Init_Log() {