MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / markAsRecent

Method markAsRecent

src/game/ServerList.cpp:343–358  ·  view source on GitHub ↗

// mark server identified by host:port string as favorite void ServerList::markFav(const std::string &serverAddress, bool fav) { std::map ::iterator serverIterator; //for (int i = 0; i < (int)servers.size(); i++) { for (serverIterator = servers.begin(); serverIterator != servers.end(); serverIterator++) { ServerItem& server = (*serverIterator).second; if (serverAddr

Source from the content-addressed store, hash-verified

341}
342*/
343void ServerList::markAsRecent(ServerItem* item) {
344 std::string addrname = item->getAddrName();
345 ServerListCache::SRV_STR_MAP::iterator i = serverCache->find(addrname);
346 if (i != serverCache->end()) {
347 i->second.recent = true;
348 i->second.recentTime = item->getNow();
349 }
350
351 item->recent = true;
352 item->recentTime = item->getNow();
353
354 for (ServerCallbackList::iterator itr = recentCallbackList.begin();
355 itr != recentCallbackList.end(); ++itr) {
356 (*itr).first(item, (*itr).second);
357 }
358}
359
360void ServerList::unmarkAsRecent(ServerItem* item) {
361 std::string addrname = item->getAddrName();

Callers 1

joinInternetGame2Function · 0.80

Calls 5

getAddrNameMethod · 0.80
getNowMethod · 0.80
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected