Fixing "game does not start automatically" issue.

This commit is contained in:
lotodore
2010-09-26 06:58:49 +00:00
parent 918bd478cd
commit 04436c260b
3 changed files with 10 additions and 8 deletions
+7 -5
View File
@@ -696,14 +696,16 @@ ServerGame::ResetComputerPlayerList()
void
ServerGame::GracefulRemoveSession(SessionWrapper session, int reason)
{
if (!session.sessionData.get())
if (!session.sessionData)
throw ServerException(__FILE__, __LINE__, ERR_NET_INVALID_SESSION, 0);
GetSessionManager().RemoveSession(session.sessionData->GetId());
boost::shared_ptr<PlayerData> tmpPlayerData = session.playerData;
if (tmpPlayerData.get() && !tmpPlayerData->GetName().empty())
if (GetSessionManager().RemoveSession(session.sessionData->GetId()))
{
RemovePlayerData(tmpPlayerData, reason);
boost::shared_ptr<PlayerData> tmpPlayerData = session.playerData;
if (tmpPlayerData && !tmpPlayerData->GetName().empty())
{
RemovePlayerData(tmpPlayerData, reason);
}
}
}