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:
@@ -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