Synchronize on network game start, so that everyone has received all avatars and player names before the game starts. Store all computer players in a separate list on the server for name retrieval.

This commit is contained in:
lotodore
2007-10-07 21:23:37 +00:00
parent d16312111f
commit 0d0d8dc810
18 changed files with 452 additions and 64 deletions
+18
View File
@@ -292,6 +292,24 @@ SessionManager::ForEach(boost::function<void (SessionWrapper)> func)
}
}
unsigned
SessionManager::CountReadySessions() const
{
unsigned counter = 0;
boost::mutex::scoped_lock lock(m_sessionMapMutex);
SessionMap::const_iterator i = m_sessionMap.begin();
SessionMap::const_iterator end = m_sessionMap.end();
while (i != end)
{
if ((*i).second.sessionData->IsReady())
++counter;
++i;
}
return counter;
}
void
SessionManager::Clear()
{