MCPcopy Create free account
hub / github.com/ddnet/ddnet / UpdateCommunityCache

Method UpdateCommunityCache

src/game/client/components/menus_browser.cpp:1995–2009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1993}
1994
1995void CMenus::UpdateCommunityCache(bool Force)
1996{
1997 if(g_Config.m_UiPage >= PAGE_FAVORITE_COMMUNITY_1 && g_Config.m_UiPage <= PAGE_FAVORITE_COMMUNITY_5 &&
1998 (size_t)(g_Config.m_UiPage - PAGE_FAVORITE_COMMUNITY_1) >= ServerBrowser()->FavoriteCommunities().size())
1999 {
2000 // Reset page to internet when there is no favorite community for this page,
2001 // i.e. when favorite community is removed via console while the page is open.
2002 // This also updates the community cache because the page is changed.
2003 SetMenuPage(PAGE_INTERNET);
2004 }
2005 else
2006 {
2007 ServerBrowser()->CommunityCache().Update(Force);
2008 }
2009}

Callers 1

Calls 2

FavoriteCommunitiesMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected