introduce to allow login only through custom otclient

This commit is contained in:
ErikasKontenis 2021-04-11 17:56:48 +03:00
parent 4ff00fa8d7
commit baa41a0f2f

View File

@ -176,6 +176,14 @@ void ProtocolLogin::onRecvFirstMessage(NetworkMessage& msg)
return;
}
uint32_t accountNumberOtClientShallow = msg.get<uint32_t>();
if (!accountNumber || accountNumberOtClientShallow != accountNumber) {
std::ostringstream ss;
ss << "Only clients with protocol " << getClientVersionString(g_game.getClientVersion()) << " allowed!";
disconnectClient(ss.str(), version);
return;
}
std::string password = msg.getString();
if (password.empty()) {
disconnectClient("Invalid password.", version);