From 0055b61815f522cf932a84e39e5a38086234cc4b Mon Sep 17 00:00:00 2001 From: MrS-ibra Date: Fri, 27 Mar 2026 02:07:10 +0300 Subject: [PATCH] bugfix(lobby): Fix player list ignoring refresh interval on roster updates --- .../Source/GameNetwork/GameSpy/LobbyUtils.cpp | 23 ++----------------- .../GUICallbacks/Menus/WOLBuddyOverlay.cpp | 1 - .../GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp | 14 +++++++++-- 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index 9f93c675bb..3e132ca9f6 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -109,7 +109,7 @@ static float UpdateAndGetGameRowIndex(int lobbyID, float logicalIndex) if (!anim.alive) { // start slightly below, then glide into place - anim.currentIndex = logicalIndex + 0.3f; + anim.currentIndex = logicalIndex + 2.f; anim.targetIndex = logicalIndex; anim.alive = true; } @@ -119,7 +119,7 @@ static float UpdateAndGetGameRowIndex(int lobbyID, float logicalIndex) } // how fast to snap into place - const float t = 0.1f; + const float t = 0.2f; float delta = anim.targetIndex - anim.currentIndex; anim.currentIndex += delta * t; @@ -127,25 +127,6 @@ static float UpdateAndGetGameRowIndex(int lobbyID, float logicalIndex) return anim.currentIndex; } -// Clears animation state for IDs that no longer exist -static void CleanupMissingGameRows(const std::vector& lobbies) -{ - std::map stillPresent; - - for (const LobbyEntry& lobby : lobbies) - { - stillPresent[lobby.lobbyID] = true; - } - - for (auto it = g_gameListAnim.begin(); it != g_gameListAnim.end(); ) - { - if (stillPresent.find(it->first) == stillPresent.end()) - it = g_gameListAnim.erase(it); - else - ++it; - } -} - static NameKeyType buttonSortAlphaID = NAMEKEY_INVALID; static NameKeyType buttonSortPingID = NAMEKEY_INVALID; static NameKeyType buttonSortBuddiesID = NAMEKEY_INVALID; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index 1369d5c591..1a0d20f5e7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -598,7 +598,6 @@ void updateBuddyInfo( void ) //AsciiString strName; int numUnreadMessages = 0; - NGMP_OnlineServices_SocialInterface* pSocialInterface = NGMP_OnlineServicesManager::GetInterface(); if (pSocialInterface != nullptr) { numUnreadMessages = pSocialInterface->GetNumberUnreadChatMessagesForUser(profileID); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index 02ff0a457e..6d82b0b6e6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -90,7 +90,8 @@ static Bool raiseMessageBoxes = false; static time_t gameListRefreshTime = 0; static const time_t gameListRefreshInterval = 4000; static time_t playerListRefreshTime = 0; -static const time_t playerListRefreshInterval = 4000; +static const time_t playerListRefreshInterval = 6000; +static bool isFirstRosterUpdate = false; void setUnignoreText( WindowLayout *layout, AsciiString nick, GPProfile id); static void doSliderTrack(GameWindow *control, Int val); @@ -1247,6 +1248,7 @@ void WOLLobbyMenuInit( WindowLayout *layout, void *userData ) nextScreen = nullptr; buttonPushed = false; isShuttingDown = false; + isFirstRosterUpdate = true; SetLobbyAttemptHostJoin(FALSE); // not trying to host or join @@ -1344,7 +1346,15 @@ void WOLLobbyMenuInit( WindowLayout *layout, void *userData ) // register for roster events pRoomsInterface->RegisterForRosterNeedsRefreshCallback([]() { - refreshPlayerList(true); + if (isFirstRosterUpdate) + { + refreshPlayerList(true); + isFirstRosterUpdate = false; + } + else + { + refreshPlayerList(false); + } }); }