Reacting to authentication success.

This commit is contained in:
lotodore
2009-09-26 16:14:22 +00:00
parent 48c4c69277
commit bf51e68e77
+4 -11
View File
@@ -857,9 +857,6 @@ ServerLobbyThread::HandleNetPacketInit(SessionWrapper session, const InitMessage
SessionError(session, ERR_NET_VERSION_NOT_SUPPORTED); SessionError(session, ERR_NET_VERSION_NOT_SUPPORTED);
return; return;
} }
if (initMessage.requestedVersion.major == 5 && (initMessage.requestedVersion.minor == 0 || initMessage.requestedVersion.minor == 1))
session.sessionData->SetMaxNumPlayers(7);
else
session.sessionData->SetMaxNumPlayers(MAX_NUMBER_OF_PLAYERS); session.sessionData->SetMaxNumPlayers(MAX_NUMBER_OF_PLAYERS);
string playerName; string playerName;
@@ -885,13 +882,6 @@ ServerLobbyThread::HandleNetPacketInit(SessionWrapper session, const InitMessage
else else
SessionError(session, ERR_NET_INVALID_PASSWORD); SessionError(session, ERR_NET_INVALID_PASSWORD);
// Check the server password.
/* if (!CheckPassword(initData.password))
{
SessionError(session, ERR_NET_INVALID_PASSWORD);
return;
}*/
// Check whether the player name is correct. // Check whether the player name is correct.
// Partly, this is also done in netpacket. // Partly, this is also done in netpacket.
// However, some disallowed names are checked only here. // However, some disallowed names are checked only here.
@@ -1193,7 +1183,8 @@ ServerLobbyThread::HandleNetPacketChatRequest(SessionWrapper session, const Chat
void void
ServerLobbyThread::InitAfterLogin(SessionWrapper session) ServerLobbyThread::InitAfterLogin(SessionWrapper session)
{ {
assert(session.playerData); if (session.sessionData && session.playerData)
{
const MD5Buf &avatarMD5 = session.playerData->GetAvatarMD5(); const MD5Buf &avatarMD5 = session.playerData->GetAvatarMD5();
string avatarFileName; string avatarFileName;
if (!avatarMD5.IsZero() if (!avatarMD5.IsZero()
@@ -1217,6 +1208,7 @@ ServerLobbyThread::InitAfterLogin(SessionWrapper session)
EstablishSession(session); EstablishSession(session);
} }
} }
}
void void
ServerLobbyThread::EstablishSession(SessionWrapper session) ServerLobbyThread::EstablishSession(SessionWrapper session)
@@ -1263,6 +1255,7 @@ ServerLobbyThread::AuthenticatePlayer(SessionWrapper session, const std::string
void void
ServerLobbyThread::AuthenticationSuccess(unsigned playerId, db_id dbPlayerId) ServerLobbyThread::AuthenticationSuccess(unsigned playerId, db_id dbPlayerId)
{ {
InitAfterLogin(m_sessionManager.GetSessionByUniquePlayerId(playerId, true));
} }
void void