From e5f3943f6ede9aa6e4bbc1cfc7116d27c1839ee8 Mon Sep 17 00:00:00 2001 From: Lukas Kitsche Date: Thu, 22 Sep 2022 19:24:20 +0200 Subject: [PATCH] refresh serverbrowser when disconnecting / abort --- src/game/client/components/menus.cpp | 18 ++++++++++++++++++ src/game/client/components/menus_ingame.cpp | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index a6c3a4f4b..92a00c37b 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1783,6 +1783,24 @@ int CMenus::Render() { Client()->Disconnect(); m_Popup = POPUP_NONE; + if(g_Config.m_UiPage == PAGE_INTERNET) + ServerBrowser()->Refresh(IServerBrowser::TYPE_INTERNET); + else if(g_Config.m_UiPage == PAGE_LAN) + ServerBrowser()->Refresh(IServerBrowser::TYPE_LAN); + else if(g_Config.m_UiPage == PAGE_FAVORITES) + ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES); + else if(g_Config.m_UiPage == PAGE_DDNET) + { + // start a new server list request + Client()->RequestDDNetInfo(); + ServerBrowser()->Refresh(IServerBrowser::TYPE_DDNET); + } + else if(g_Config.m_UiPage == PAGE_KOG) + { + // start a new server list request + Client()->RequestDDNetInfo(); + ServerBrowser()->Refresh(IServerBrowser::TYPE_KOG); + } } if(Client()->MapDownloadTotalsize() > 0) diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index a82447be1..b23c70660 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -61,6 +61,24 @@ void CMenus::RenderGame(CUIRect MainView) else { Client()->Disconnect(); + if(g_Config.m_UiPage == PAGE_INTERNET) + ServerBrowser()->Refresh(IServerBrowser::TYPE_INTERNET); + else if(g_Config.m_UiPage == PAGE_LAN) + ServerBrowser()->Refresh(IServerBrowser::TYPE_LAN); + else if(g_Config.m_UiPage == PAGE_FAVORITES) + ServerBrowser()->Refresh(IServerBrowser::TYPE_FAVORITES); + else if(g_Config.m_UiPage == PAGE_DDNET) + { + // start a new server list request + Client()->RequestDDNetInfo(); + ServerBrowser()->Refresh(IServerBrowser::TYPE_DDNET); + } + else if(g_Config.m_UiPage == PAGE_KOG) + { + // start a new server list request + Client()->RequestDDNetInfo(); + ServerBrowser()->Refresh(IServerBrowser::TYPE_KOG); + } } }