Adding plain text password authentication for testing.
This commit is contained in:
1 parent
97e01d6b80
commit
4856dc2a45
70 files changed
+277
-222
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user