Fixed kick bug by letting the client reverse iterate over its cached player data when looking for a player name. Added several exceptions.

This commit is contained in:
lotodore
2007-11-10 22:18:31 +00:00
parent c7ab731648
commit ef84c7b81a
6 changed files with 50 additions and 33 deletions
+6 -3
View File
@@ -189,7 +189,8 @@ ServerGameThread::InternalStartGame()
++tmpPos;
++player_i;
}
assert(player_i != player_end);
if (player_i == player_end)
throw ServerException(__FILE__, __LINE__, ERR_NET_DEALER_NOT_FOUND, 0);
SetStartData(startData);
@@ -323,7 +324,8 @@ ServerGameThread::ResetComputerPlayerList()
void
ServerGameThread::GracefulRemoveSession(SessionWrapper session)
{
assert(session.sessionData.get());
if (!session.sessionData.get())
throw ServerException(__FILE__, __LINE__, ERR_NET_INVALID_SESSION, 0);
GetSessionManager().RemoveSession(session.sessionData->GetId());
boost::shared_ptr<PlayerData> tmpPlayerData = session.playerData;
@@ -378,7 +380,8 @@ ServerGameThread::ErrorRemoveSession(SessionWrapper session)
void
ServerGameThread::SessionError(SessionWrapper session, int errorCode)
{
assert(session.sessionData.get());
if (!session.sessionData.get())
throw ServerException(__FILE__, __LINE__, ERR_NET_INVALID_SESSION, 0);
ErrorRemoveSession(session);
GetLobbyThread().SessionError(session, errorCode);
}