Feature: Support compression option when building client
This commit is contained in:
Binary file not shown.
@@ -1239,20 +1239,11 @@ LRESULT CMy2015RemoteDlg::OnPasswordCheck(WPARAM wParam, LPARAM lParam) {
|
||||
isChecking = true;
|
||||
if (!CheckValid(-1))
|
||||
{
|
||||
CInputDialog dlg(this);
|
||||
dlg.m_str = m_superPass.c_str();
|
||||
dlg.Init("输入密码", "输入主控程序的密码:");
|
||||
dlg.DoModal();
|
||||
if (hashSHA256(dlg.m_str.GetString()) != GetPwdHash()) {
|
||||
KillTimer(TIMER_CHECK);
|
||||
m_nMaxConnection = 2;
|
||||
THIS_APP->UpdateMaxConnection(m_nMaxConnection);
|
||||
int tm = THIS_CFG.GetInt("settings", "Notify", 10);
|
||||
THIS_CFG.SetInt("settings", "Notify", tm - 1);
|
||||
}
|
||||
else {
|
||||
m_superPass = dlg.m_str.GetString();
|
||||
}
|
||||
KillTimer(TIMER_CHECK);
|
||||
m_nMaxConnection = 2;
|
||||
THIS_APP->UpdateMaxConnection(m_nMaxConnection);
|
||||
int tm = THIS_CFG.GetInt("settings", "Notify", 10);
|
||||
THIS_CFG.SetInt("settings", "Notify", tm - 1);
|
||||
}
|
||||
isChecking = false;
|
||||
return S_OK;
|
||||
|
||||
@@ -77,6 +77,7 @@ void CBuildDlg::DoDataExchange(CDataExchange* pDX)
|
||||
DDX_Control(pDX, IDC_COMBO_RUNTYPE, m_ComboRunType);
|
||||
DDX_Control(pDX, IDC_COMBO_PROTO, m_ComboProto);
|
||||
DDX_Control(pDX, IDC_COMBO_ENCRYPT, m_ComboEncrypt);
|
||||
DDX_Control(pDX, IDC_COMBO_COMPRESS, m_ComboCompress);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +90,8 @@ END_MESSAGE_MAP()
|
||||
|
||||
// CBuildDlg <20><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
std::string ReleaseUPX();
|
||||
void run_upx_async(HWND hwnd, const std::string& upx, const std::string& file, bool isCompress);
|
||||
|
||||
void CBuildDlg::OnBnClickedOk()
|
||||
{
|
||||
@@ -216,7 +219,14 @@ void CBuildDlg::OnBnClickedOk()
|
||||
File.Close();
|
||||
CString tip = index == IndexTestRun_DLL ? "\r\n<EFBFBD><EFBFBD>ʾ: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\"ServerDll.dll\"<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>" : "";
|
||||
tip += g_ConnectAddress.protoType==PROTO_KCP ? "\n<EFBFBD><EFBFBD>ʾ: ʹ<><CAB9>KCPЭ<50><D0AD><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD><C9B7><EFBFBD><F1A3ACB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>UDPЭ<50><D0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ1<CEAA><31>" : "";
|
||||
MessageBox("<EFBFBD><EFBFBD><EFBFBD>ɳɹ<EFBFBD>! <20>ļ<EFBFBD>λ<EFBFBD><CEBB>:\r\n"+ strSeverFile + tip, "<EFBFBD><EFBFBD>ʾ", MB_ICONINFORMATION);
|
||||
std::string upx;
|
||||
if(m_ComboCompress.GetCurSel() == CLIENT_COMPRESS_UPX) upx = ReleaseUPX();
|
||||
if (!upx.empty())
|
||||
{
|
||||
run_upx_async(GetParent()->GetSafeHwnd(), upx, strSeverFile.GetString(), true);
|
||||
MessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>UPXѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>\r\n<EFBFBD>ļ<EFBFBD>λ<EFBFBD><EFBFBD>: " + strSeverFile + tip, "<EFBFBD><EFBFBD>ʾ", MB_ICONINFORMATION);
|
||||
}else
|
||||
MessageBox("<EFBFBD><EFBFBD><EFBFBD>ɳɹ<EFBFBD>! <20>ļ<EFBFBD>λ<EFBFBD><CEBB>:\r\n"+ strSeverFile + tip, "<EFBFBD><EFBFBD>ʾ", MB_ICONINFORMATION);
|
||||
SAFE_DELETE_ARRAY(szBuffer);
|
||||
if (index == IndexTestRun_DLL) return;
|
||||
}
|
||||
@@ -278,6 +288,10 @@ BOOL CBuildDlg::OnInitDialog()
|
||||
m_ComboEncrypt.InsertString(PROTOCOL_HELL, "HELL");
|
||||
m_ComboEncrypt.SetCurSel(PROTOCOL_SHINE);
|
||||
|
||||
m_ComboCompress.InsertString(CLIENT_COMPRESS_NONE, "<EFBFBD><EFBFBD>");
|
||||
m_ComboCompress.InsertString(CLIENT_COMPRESS_UPX, "UPX");
|
||||
m_ComboCompress.SetCurSel(CLIENT_COMPRESS_NONE);
|
||||
|
||||
m_OtherItem.ShowWindow(SW_HIDE);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
|
||||
@@ -35,4 +35,5 @@ public:
|
||||
CComboBox m_ComboProto;
|
||||
CComboBox m_ComboEncrypt;
|
||||
afx_msg void OnHelpParameters();
|
||||
CComboBox m_ComboCompress;
|
||||
};
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user