Adding enhancement #76 (server password). The server password is checked during init, in addition to possible player auth. It can be set as option "ServerPassword" in config.xml, on client and server.

This commit is contained in:
lotodore committed 2011-10-20 21:19:58 +00:00
1 parent 2f588ffed7
commit ddf2ca784b
7 files changed
+40 -3

No files matched your search

+9
View File
@@ -959,6 +959,15 @@ ServerLobbyThread::HandleNetPacketInit(boost::shared_ptr<SessionData> session, c
SessionError(session, ERR_NET_VERSION_NOT_SUPPORTED);
return;
}
// Check (clear text) server password.
string serverPassword;
if (initMessage.authServerPassword) {
serverPassword = STL_STRING_FROM_OCTET_STRING(*initMessage.authServerPassword);
}
if (serverPassword != m_serverConfig.readConfigString("ServerPassword")) {
SessionError(session, ERR_NET_INVALID_PASSWORD);
return;
}
string playerName;
MD5Buf avatarMD5;