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

Method lastActivityTime

source/game/StarUniverseConnection.cpp:204–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204int64_t UniverseConnectionServer::lastActivityTime(ConnectionId clientId) const {
205 RecursiveMutexLocker connectionsLocker(m_connectionsMutex);
206 if (auto conn = m_connections.value(clientId)) {
207 connectionsLocker.unlock();
208 MutexLocker connectionLocker(conn->mutex);
209 return conn->lastActivityTime;
210 }
211 throw UniverseConnectionException::format("No such client '{}' in UniverseConnectionServer::lastRemoteActivityTime", clientId);
212}
213
214void UniverseConnectionServer::addConnection(ConnectionId clientId, UniverseConnection uc) {
215 RecursiveMutexLocker connectionsLocker(m_connectionsMutex);

Callers 1

reapConnectionsMethod · 0.80

Calls 3

formatFunction · 0.50
valueMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected