Fixed decreasing number of players when players leave.
This commit is contained in:
@@ -113,6 +113,8 @@ ServerLobbyThread::RemoveSessionFromGame(SessionWrapper session)
|
|||||||
{
|
{
|
||||||
// Just remove the session. Only for fatal errors.
|
// Just remove the session. Only for fatal errors.
|
||||||
m_gameSessionManager.RemoveSession(session.sessionData->GetSocket());
|
m_gameSessionManager.RemoveSession(session.sessionData->GetSocket());
|
||||||
|
// Update stats (if needed).
|
||||||
|
BroadcastStatisticsUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -126,6 +128,9 @@ ServerLobbyThread::CloseSessionDelayed(SessionWrapper session)
|
|||||||
|
|
||||||
boost::mutex::scoped_lock lock(m_closeSessionListMutex);
|
boost::mutex::scoped_lock lock(m_closeSessionListMutex);
|
||||||
m_closeSessionList.push_back(closeSessionData);
|
m_closeSessionList.push_back(closeSessionData);
|
||||||
|
|
||||||
|
// Update stats (if needed).
|
||||||
|
BroadcastStatisticsUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -311,6 +316,8 @@ ServerLobbyThread::ProcessLoop()
|
|||||||
{
|
{
|
||||||
// On error: Close this session.
|
// On error: Close this session.
|
||||||
m_sessionManager.RemoveSession(session.sessionData->GetSocket());
|
m_sessionManager.RemoveSession(session.sessionData->GetSocket());
|
||||||
|
// Update stats (if needed).
|
||||||
|
BroadcastStatisticsUpdate();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet.get())
|
if (packet.get())
|
||||||
|
|||||||
Reference in New Issue
Block a user