summaryrefslogtreecommitdiff
path: root/src/account-server/accounthandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-10 20:29:58 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-11 22:28:13 +0100
commit3c828c4c7448353858a80d1c60e47d125ed3d3e4 (patch)
tree1ba38fa3f7b0a4536c0a005ab3fbbde682a34d7f /src/account-server/accounthandler.cpp
parentd65dfcfa04a622effcd4cebdfaa5e713ca7627d8 (diff)
downloadmanaserv-3c828c4c7448353858a80d1c60e47d125ed3d3e4.tar.gz
manaserv-3c828c4c7448353858a80d1c60e47d125ed3d3e4.tar.bz2
manaserv-3c828c4c7448353858a80d1c60e47d125ed3d3e4.tar.xz
manaserv-3c828c4c7448353858a80d1c60e47d125ed3d3e4.zip
Made the servers report their protocol version.
As the protocol version isn't something the maintainers should set, I removed the net_clientVersion irrelevant option, replaced by the corresponding define PROTOCOL_VERSION in the manaserv_protocol.h file. A corresponding change in the client will be made. N.B.: Now, the Enet version is also reported in the log. Reviewed-by: Jaxad.
Diffstat (limited to 'src/account-server/accounthandler.cpp')
-rw-r--r--src/account-server/accounthandler.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index 9948f1ea..5cb71c4d 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -318,7 +318,7 @@ void AccountHandler::handleLoginMessage(AccountClient &client, MessageIn &msg)
const int clientVersion = msg.readInt32();
- if (clientVersion < Configuration::getValue("net_clientVersion", 0))
+ if (clientVersion < PROTOCOL_VERSION)
{
reply.writeInt8(LOGIN_INVALID_VERSION);
client.send(reply);
@@ -458,7 +458,6 @@ void AccountHandler::handleRegisterMessage(AccountClient &client,
std::string password = msg.readString();
std::string email = msg.readString();
std::string captcha = msg.readString();
- int minClientVersion = Configuration::getValue("net_clientVersion", 0);
unsigned minNameLength = Configuration::getValue("account_minNameLength", 4);
unsigned maxNameLength = Configuration::getValue("account_maxNameLength", 15);
@@ -472,7 +471,7 @@ void AccountHandler::handleRegisterMessage(AccountClient &client,
{
reply.writeInt8(ERRMSG_FAILURE);
}
- else if (clientVersion < minClientVersion)
+ else if (clientVersion < PROTOCOL_VERSION)
{
reply.writeInt8(REGISTER_INVALID_VERSION);
}