Added error handling for networking stuff. Now checking the player action.

This commit is contained in:
lotodore
2007-10-10 22:21:24 +00:00
parent de0f16a6fc
commit 253778bf30
15 changed files with 176 additions and 85 deletions
+6 -3
View File
@@ -414,7 +414,8 @@ ServerLobbyThread::HandleNetPacketAvatarHeader(SessionWrapper session, const Net
// Session is now receiving an avatar.
session.sessionData->SetState(SessionData::ReceivingAvatar);
}
// TODO error handling
else
SessionError(session, ERR_NET_AVATAR_TOO_LARGE);
}
}
@@ -435,7 +436,7 @@ ServerLobbyThread::HandleNetPacketAvatarFile(SessionWrapper session, const NetPa
}
void
ServerLobbyThread::HandleNetPacketAvatarEnd(SessionWrapper session, const NetPacketAvatarEnd &tmpPacket)
ServerLobbyThread::HandleNetPacketAvatarEnd(SessionWrapper session, const NetPacketAvatarEnd &/*tmpPacket*/)
{
if (session.playerData.get())
{
@@ -453,7 +454,8 @@ ServerLobbyThread::HandleNetPacketAvatarEnd(SessionWrapper session, const NetPac
// Init finished - start session.
EstablishSession(session);
}
// TODO error handling
else
SessionError(session, ERR_NET_WRONG_AVATAR_SIZE);
}
}
}
@@ -505,6 +507,7 @@ ServerLobbyThread::HandleNetPacketRetrieveAvatar(SessionWrapper session, const N
NetPacketList tmpPackets;
if (GetAvatarManager().AvatarFileToNetPackets(tmpFile, request.requestId, tmpPackets))
GetSender().SendLowPrio(session.sessionData->GetSocket(), tmpPackets);
// TODO handle error
}
}