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:
1 parent
2f588ffed7
commit
ddf2ca784b
7 files changed
+40
-3
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user