Unverified Commit 6e533f45 authored by Kevin Reed's avatar Kevin Reed Committed by GitHub

Merge pull request #3351 from AenBleidd/fix_multiple_local_instance

[Manager] Fix connection to second local client instance
parents 2ee3b24a fd1e7a3e
......@@ -104,6 +104,7 @@ bool CBOINCGUIApp::OnInit() {
m_bGUIVisible = true;
m_bDebugSkins = false;
m_bMultipleInstancesOK = false;
m_bHostnamePasswordSet = false;
m_bBOINCMGRAutoStarted = false;
m_iBOINCMGRDisableAutoStart = 0;
m_iShutdownCoreClient = 0;
......@@ -690,6 +691,7 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser) {
if (hostNameSpecified && passwordSpecified) {
m_bMultipleInstancesOK = true;
m_bHostnamePasswordSet = true;
}
if (parser.Found(wxT("no-daemon"))) {
......
......@@ -108,6 +108,7 @@ protected:
int m_iGUISelected;
bool m_bDebugSkins;
bool m_bMultipleInstancesOK;
bool m_bHostnamePasswordSet;
bool m_bFilterEvents;
bool m_bAboutDialogIsOpen;
bool m_bRunDaemon;
......@@ -143,6 +144,7 @@ public:
bool IsAnotherInstanceRunning() { return m_pInstanceChecker->IsAnotherRunning(); }
bool IsMgrMultipleInstance() { return m_bMultipleInstancesOK; }
bool IsHostnamePasswordSet() { return m_bHostnamePasswordSet; }
#ifdef __WXMAC__
void OnFinishInit();
......
......@@ -583,6 +583,7 @@ int CMainDocument::OnPoll() {
int iRetVal = 0;
wxString hostName = wxGetApp().GetClientHostNameArg();
wxString password = wxGetApp().GetClientPasswordArg();
bool isHostnamePasswordSet = wxGetApp().IsHostnamePasswordSet();
int portNum = wxGetApp().GetClientRPCPortArg();
wxASSERT(wxDynamicCast(m_pClientManager, CBOINCClientManager));
......@@ -592,7 +593,7 @@ int CMainDocument::OnPoll() {
m_bClientStartCheckCompleted = true;
if (IsComputerNameLocal(hostName)) {
if (wxGetApp().IsAnotherInstanceRunning()) {
if (wxGetApp().IsAnotherInstanceRunning() && !isHostnamePasswordSet) {
if (!pFrame->SelectComputer(hostName, portNum, password, true)) {
s_bSkipExitConfirmation = true;
wxCommandEvent event;
......@@ -603,7 +604,7 @@ int CMainDocument::OnPoll() {
if (wxGetApp().GetNeedRunDaemon() && IsComputerNameLocal(hostName)) {
if (m_pClientManager->StartupBOINCCore()) {
Connect(wxT("localhost"), portNum, password, TRUE, TRUE);
Connect(wxT("localhost"), portNum, password, TRUE, password.IsEmpty());
}
else {
m_pNetworkConnection->ForceDisconnect();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment