Adding plain text password authentication for testing.

This commit is contained in:
lotodore
2009-09-19 20:49:17 +00:00
parent 97e01d6b80
commit 4856dc2a45
70 changed files with 277 additions and 222 deletions
+11
View File
@@ -862,13 +862,24 @@ ServerLobbyThread::HandleNetPacketInit(SessionWrapper session, const InitMessage
session.sessionData->SetMaxNumPlayers(MAX_NUMBER_OF_PLAYERS);
string playerName;
string password;
MD5Buf avatarMD5;
bool guestUser = false;
if (initMessage.login.present == login_PR_anonymousLogin)
{
const AnonymousLogin_t *anonLogin = &initMessage.login.choice.anonymousLogin;
playerName = string((const char *)anonLogin->playerName.buf, anonLogin->playerName.size);
if (anonLogin->avatar)
memcpy(avatarMD5.data, anonLogin->avatar->buf, MD5_DATA_SIZE);
guestUser = true;
}
else if (initMessage.login.present == login_PR_authenticatedLogin)
{
const AuthenticatedLogin_t *authLogin = &initMessage.login.choice.authenticatedLogin;
playerName = string((const char *)authLogin->playerName.buf, authLogin->playerName.size);
password = string((const char *)authLogin->password.buf, authLogin->password.size);
if (anonLogin->avatar)
memcpy(avatarMD5.data, anonLogin->avatar->buf, MD5_DATA_SIZE);
}
else
SessionError(session, ERR_NET_INVALID_PASSWORD); // TODO not yet supported