From baa41a0f2f93f36b6cc299dc6750d9b2fd744bbd Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Sun, 11 Apr 2021 17:56:48 +0300 Subject: [PATCH] introduce to allow login only through custom otclient --- src/protocollogin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/protocollogin.cpp b/src/protocollogin.cpp index 02903d3..5a632e7 100644 --- a/src/protocollogin.cpp +++ b/src/protocollogin.cpp @@ -176,6 +176,14 @@ void ProtocolLogin::onRecvFirstMessage(NetworkMessage& msg) return; } + uint32_t accountNumberOtClientShallow = msg.get(); + 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);