MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / pruneChallenges

Method pruneChallenges

source/server/StarServerQueryThread.cpp:197–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197void ServerQueryThread::pruneChallenges() {
198 int64_t now = Time::monotonicMilliseconds();
199 if (now < m_lastChallengeCheck + challengeCheckInterval) {
200 return;
201 }
202
203 auto expire = now - challengeCheckInterval;
204 auto it = makeSMutableMapIterator(m_validChallenges);
205 while (it.hasNext()) {
206 auto const& pair = it.next();
207 if (pair.second->before(expire)) {
208 it.remove();
209 }
210 }
211 m_lastChallengeCheck = now;
212}
213
214void ServerQueryThread::run() {
215 HostAddressWithPort udpAddress;

Callers

nothing calls this directly

Calls 5

makeSMutableMapIteratorFunction · 0.85
beforeMethod · 0.80
hasNextMethod · 0.45
nextMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected