From c04da3618b0a4467dacff3a4f412b66c187064c9 Mon Sep 17 00:00:00 2001 From: yuanyuanxiang <962914132@qq.com> Date: Tue, 17 Jun 2025 04:21:29 +0800 Subject: [PATCH] Revoke 14-days trail and add a revoke menu --- client/LoginServer.cpp | 2 +- client/domain_pool.h | 2 +- server/2015Remote/2015Remote.rc | Bin 80434 -> 80740 bytes server/2015Remote/2015RemoteDlg.cpp | 28 ++++++++++++++++++- server/2015Remote/2015RemoteDlg.h | 3 +- server/2015Remote/2015Remote_vs2015.vcxproj | 1 + server/2015Remote/res/Bitmap/unauthorize.bmp | Bin 0 -> 322 bytes server/2015Remote/resource.h | Bin 38706 -> 39074 bytes 8 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 server/2015Remote/res/Bitmap/unauthorize.bmp diff --git a/client/LoginServer.cpp b/client/LoginServer.cpp index 6142bd1..9aaa64c 100644 --- a/client/LoginServer.cpp +++ b/client/LoginServer.cpp @@ -275,7 +275,7 @@ LOGIN_INFOR GetLoginInfo(DWORD dwSpeed, const CONNECT_ADDRESS& conn) str = std::string(auth); str.erase(std::remove(str.begin(), str.end(), ' '), str.end()); auto list = StringToVector(str, '-', 3); - str = list[1]; + str = list[1].empty() ? "Unknown" : list[1]; } LoginInfor.AddReserved(str.c_str()); // ȨϢ bool isDefault = strlen(conn.szFlag) == 0 || strcmp(conn.szFlag, skCrypt(FLAG_GHOST)) == 0 || diff --git a/client/domain_pool.h b/client/domain_pool.h index b794dc4..e5a5744 100644 --- a/client/domain_pool.h +++ b/client/domain_pool.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include +#include std::string GetIPAddress(const char* hostName); diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc index 6cd8a3228f8bc1d0df7504e422d6412609f617b0..35d3ad12c901bbd5cd900a11c8011898a57f49b8 100644 GIT binary patch delta 70 zcmV-M0J;CN^aSMg1h78n2&7~Hm55_QXOnQ+G?Vb>6a!TNPO}5(6)2aG3IP}iP5?mw cRRB}~NSCn+0ZW%q1_2NQbpUR+^A7<(D(fH^ApigX delta 20 ccmaFzjb+mpmJN0EnableMenuItem(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); + SubMenu->EnableMenuItem(ID_ONLINE_UNAUTHORIZE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); } // 刷新菜单显示 @@ -1297,7 +1301,7 @@ bool CMy2015RemoteDlg::CheckValid() { #ifdef _DEBUG BOOL isTrail = verify.isTrail(0); #else - BOOL isTrail = verify.isTrail(14); + BOOL isTrail = verify.isTrail(-1); #endif if (!isTrail) { @@ -2931,3 +2935,25 @@ void CMy2015RemoteDlg::OnListClick(NMHDR* pNMHDR, LRESULT* pResult) *pResult = 0; } + + +void CMy2015RemoteDlg::OnOnlineUnauthorize() +{ + if (m_superPass.empty()) { + CInputDialog pass(this); + pass.Init("需要密码", "当前主控程序的密码:"); + if (pass.DoModal() != IDOK || pass.m_str.IsEmpty()) + return; + std::string masterHash(skCrypt(MASTER_HASH)); + if (hashSHA256(pass.m_str.GetBuffer()) != masterHash) { + MessageBox("密码不正确!", "错误", MB_ICONWARNING); + return; + } + m_superPass = pass.m_str; + } + + BYTE bToken[32] = { CMD_AUTHORIZATION }; + int days = -1; + memcpy(bToken + 1, &days, sizeof(days)); + SendSelectedCommand(bToken, sizeof(bToken)); +} diff --git a/server/2015Remote/2015RemoteDlg.h b/server/2015Remote/2015RemoteDlg.h index 22d80d3..798cd67 100644 --- a/server/2015Remote/2015RemoteDlg.h +++ b/server/2015Remote/2015RemoteDlg.h @@ -187,7 +187,7 @@ public: CRITICAL_SECTION m_cs; BOOL isClosed; CMenu m_MainMenu; - CBitmap m_bmOnline[11]; + CBitmap m_bmOnline[12]; bool CheckValid(); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnClose(); @@ -250,4 +250,5 @@ public: afx_msg void OnWhatIsThis(); afx_msg void OnOnlineAuthorize(); void OnListClick(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnOnlineUnauthorize(); }; diff --git a/server/2015Remote/2015Remote_vs2015.vcxproj b/server/2015Remote/2015Remote_vs2015.vcxproj index cdd6179..c03267b 100644 --- a/server/2015Remote/2015Remote_vs2015.vcxproj +++ b/server/2015Remote/2015Remote_vs2015.vcxproj @@ -382,6 +382,7 @@ + diff --git a/server/2015Remote/res/Bitmap/unauthorize.bmp b/server/2015Remote/res/Bitmap/unauthorize.bmp new file mode 100644 index 0000000000000000000000000000000000000000..c779e542abe923b4201f430be40ca85cb253691c GIT binary patch literal 322 zcmaiuu@%BF3`CXp=mT3YM|yUkQfn&ejOGC{Oe(kHpA_=wkbTnmB-^( znCz1JmbucEB2=tqY+KhVWT^GtscJ-Six2}WNjhhE?9zt^XyU`+?p_?Z`FNtE5;adV pZ2rf2;hfoDCr=~C-PmLPzWKvP<10LshbC*~6JN3?Jxwwu{sF|Ze|-P| literal 0 HcmV?d00001 diff --git a/server/2015Remote/resource.h b/server/2015Remote/resource.h index dd16c73ae54c7f1a11eb466b45d70a6c15c04403..97e301e63387bdbe5139b4b43e1c49c4b7a16faa 100644 GIT binary patch delta 111 zcmV-#0FeK(t^%U50