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
+4 -2
View File
@@ -608,7 +608,8 @@ ServerLobbyThread::HandleNetPacketJoinGame(SessionWrapper session, const NetPack
void
ServerLobbyThread::EstablishSession(SessionWrapper session)
{
assert(session.playerData.get());
if (!session.playerData.get())
throw ServerException(__FILE__, __LINE__, ERR_NET_INVALID_SESSION, 0);
// Send ACK to client.
boost::shared_ptr<NetPacket> initAck(new NetPacketInitAck);
NetPacketInitAck::Data initAckData;
@@ -640,7 +641,8 @@ ServerLobbyThread::EstablishSession(SessionWrapper session)
void
ServerLobbyThread::RequestPlayerAvatar(SessionWrapper session)
{
assert(session.playerData.get());
if (!session.playerData.get())
throw ServerException(__FILE__, __LINE__, ERR_NET_INVALID_SESSION, 0);
// Ask the client to send its avatar.
boost::shared_ptr<NetPacket> retrieveAvatar(new NetPacketRetrieveAvatar);
NetPacketRetrieveAvatar::Data retrieveAvatarData;