MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / NetworkGameListRemoveExpired

Function NetworkGameListRemoveExpired

src/network/network_gamelist.cpp:68–74  ·  view source on GitHub ↗

* Remove all servers that have not recently been updated. * Call this after you received all the servers from the Game Coordinator, so * the ones that are no longer listed are removed. */

Source from the content-addressed store, hash-verified

66 * the ones that are no longer listed are removed.
67 */
68void NetworkGameListRemoveExpired()
69{
70 auto it = std::remove_if(std::begin(_network_game_list), std::end(_network_game_list), [](const auto &item) { return !item->manually && item->version < _network_game_list_version; });
71 _network_game_list.erase(it, std::end(_network_game_list));
72
73 UpdateNetworkGameWindow();
74}
75
76/**
77 * Rebuild the GRFConfig's of the servers in the game list as we did

Callers 1

Receive_GC_LISTINGMethod · 0.85

Calls 4

UpdateNetworkGameWindowFunction · 0.85
beginFunction · 0.50
endFunction · 0.50
eraseMethod · 0.45

Tested by

no test coverage detected