Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Client/core/CCommandFuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ void CCommandFuncs::Reconnect(const char* szParameters)
// Start the connect
if (CCore::GetSingleton().GetConnectManager()->Reconnect(strHost.c_str(), usPort, strPassword.c_str(), false))
{
if (CCore::GetSingleton().GetConnectManager()->WasQuickConnect())
{
CCore::GetSingleton().GetConnectManager()->SetQuickConnect(false);
}
CCore::GetSingleton().GetConsole()->Printf(_("reconnect: Reconnecting to %s:%u..."), strHost.c_str(), usPort);
}
else
Expand Down
3 changes: 2 additions & 1 deletion Client/core/CConnectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ CConnectManager::CConnectManager()
m_bIsConnecting = false;
m_bSave = true;
m_tConnectStarted = 0;

m_bQuickConnect = false;

m_pOnCancelClick = new GUI_CALLBACK(&CConnectManager::Event_OnCancelClick, this);

m_pServerItem = NULL;
Expand Down
5 changes: 5 additions & 0 deletions Client/core/CConnectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ class CConnectManager

bool Abort();

bool WasQuickConnect() const { return m_bQuickConnect; }

void DoPulse();

void OnServerExists();

void SetQuickConnect(bool bQuick) { m_bQuickConnect = bQuick; }

static void OpenServerFirewall(in_addr Address, ushort usHttpPort = 80, bool bHighPriority = false);

static bool StaticProcessPacket(unsigned char ucPacketID, class NetBitStreamInterface& bitStream);
Expand All @@ -52,6 +56,7 @@ class CConnectManager
bool m_bSave;
time_t m_tConnectStarted;
bool m_bHasTriedSecondConnect;
bool m_bQuickConnect;

GUI_CALLBACK* m_pOnCancelClick;

Expand Down
10 changes: 8 additions & 2 deletions Client/core/CMainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,9 @@ bool CMainMenu::OnMenuClick(CGUIMouseEventArgs Args)
AskUserIfHeWantsToDisconnect(m_pHoveredItem->menuType);
return true;
}

case MENU_ITEM_QUICK_CONNECT:
AskUserIfHeWantsToDisconnect(m_pHoveredItem->menuType);
return true;
break;
default:
break;
Expand Down Expand Up @@ -914,7 +916,8 @@ bool CMainMenu::OnQuickConnectButtonClick(CGUIElement* pElement, bool left)
ShowNetworkNotReadyWindow();
return true;
}


g_pCore->GetConnectManager()->SetQuickConnect(true);
g_pCore->GetCommands()->Execute("reconnect", "");
}
else
Expand Down Expand Up @@ -1262,6 +1265,9 @@ void CMainMenu::WantsToDisconnectCallBack(void* pData, uint uiButton)
case MENU_ITEM_DISCONNECT:
OnDisconnectButtonClick();
break;
case MENU_ITEM_QUICK_CONNECT:
OnQuickConnectButtonClick(nullptr, true);
break;
default:
break;
}
Expand Down