mirror of
https://github.com/yuanyuanxiang/SimpleRemoter.git
synced 2026-01-21 23:13:08 +08:00
Fix: Remove FRPC settings file before re-write it
This commit is contained in:
@@ -519,7 +519,7 @@ DWORD WINAPI StartClient(LPVOID lParam)
|
||||
LOGIN_INFOR login = GetLoginInfo(GetTickCount64() - dwTickCount, settings);
|
||||
while (ClientObject->IsRunning() && ClientObject->IsConnected() && !ClientObject->SendLoginInfo(login))
|
||||
WAIT_n(app.m_bIsRunning(&app), 5 + time(0)%10, 200);
|
||||
while (ClientObject->IsRunning() && ClientObject->IsConnected()) WAIT_n(app.m_bIsRunning(&app), 10, 200);
|
||||
WAIT_n(app.m_bIsRunning(&app)&& ClientObject->IsRunning() && ClientObject->IsConnected(), 10, 200);
|
||||
|
||||
do {
|
||||
Manager->SendHeartbeat();
|
||||
|
||||
@@ -1306,7 +1306,9 @@ void CMy2015RemoteDlg::ApplyFrpSettings()
|
||||
auto master = THIS_CFG.GetStr("settings", "master");
|
||||
if (master.empty()) return;
|
||||
|
||||
config cfg(GetFrpSettingsPath());
|
||||
std::string path = GetFrpSettingsPath();
|
||||
DeleteFileA(path.c_str());
|
||||
config cfg(path);
|
||||
cfg.SetStr("common", "server_addr", master);
|
||||
cfg.SetInt("common", "server_port", THIS_CFG.GetInt("frp", "server_port", 7000));
|
||||
cfg.SetStr("common", "token", THIS_CFG.GetStr("frp", "token"));
|
||||
@@ -2719,7 +2721,7 @@ LRESULT CMy2015RemoteDlg::OnOpenScreenSpyDialog(WPARAM wParam, LPARAM lParam)
|
||||
auto mainCtx = clientID ? FindHost(clientID) : NULL;
|
||||
CDialogBase* dlg = dlgID ? (DialogBase*)dlgID : NULL;
|
||||
if (mainCtx) ContextObject->SetPeerName(mainCtx->GetClientData(ONLINELIST_IP).GetString());
|
||||
if (dlg) {
|
||||
if (dlg && GetRemoteWindow(dlg->GetSafeHwnd())) {
|
||||
return dlg->UpdateContext(ContextObject);
|
||||
}
|
||||
return OpenDialog<CScreenSpyDlg, IDD_DIALOG_SCREEN_SPY, SW_SHOWMAXIMIZED>(wParam, lParam);
|
||||
@@ -3948,7 +3950,7 @@ void SetClipboardText(const char* utf8Text)
|
||||
|
||||
CDialogBase* CMy2015RemoteDlg::GetRemoteWindow(HWND hWnd)
|
||||
{
|
||||
if (!::IsWindow(hWnd)) return FALSE;
|
||||
if (!::IsWindow(hWnd)) return NULL;
|
||||
EnterCriticalSection(&m_cs);
|
||||
auto find = m_RemoteWnds.find(hWnd);
|
||||
auto ret = find == m_RemoteWnds.end() ? NULL : find->second;
|
||||
|
||||
@@ -195,8 +195,11 @@ public:
|
||||
}
|
||||
|
||||
ContextObject->hDlg = Dlg;
|
||||
if(id == IDD_DIALOG_SCREEN_SPY)
|
||||
m_RemoteWnds[Dlg->GetSafeHwnd()]=(CDialogBase*)Dlg;
|
||||
if (id == IDD_DIALOG_SCREEN_SPY) {
|
||||
EnterCriticalSection(&m_cs);
|
||||
m_RemoteWnds[Dlg->GetSafeHwnd()] = (CDialogBase*)Dlg;
|
||||
LeaveCriticalSection(&m_cs);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user