Add server statistics which are sent by the server to every client each time they change.

This commit is contained in:
lotodore
2007-10-20 22:22:11 +00:00
parent c5246aaef3
commit 4bc57f07d0
21 changed files with 302 additions and 3 deletions
+23
View File
@@ -860,6 +860,29 @@ ClientThread::ClearGameInfoMap()
m_gameInfoMap.clear();
}
void
ClientThread::UpdateStatData(const ServerStats &stats)
{
boost::mutex::scoped_lock lock(m_curStatsMutex);
if (stats.numberOfPlayersOnServer)
m_curStats.numberOfPlayersOnServer = stats.numberOfPlayersOnServer;
if (stats.totalPlayersEverLoggedIn)
m_curStats.totalPlayersEverLoggedIn = stats.totalPlayersEverLoggedIn;
if (stats.totalGamesEverStarted)
m_curStats.totalGamesEverStarted = stats.totalGamesEverStarted;
GetCallback().SignalNetClientStatsUpdate(m_curStats);
}
ServerStats
ClientThread::GetStatData() const
{
boost::mutex::scoped_lock lock(m_curStatsMutex);
return m_curStats;
}
bool
ClientThread::IsSessionEstablished() const
{