From 975ee7b516da2242ba1865923b2d3fbe208ed84a Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Thu, 27 Jul 2006 20:57:10 +0000 Subject: Modified client version to be an int. --- ChangeLog | 2 ++ src/accounthandler.cpp | 4 ++-- src/client.cpp | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d16a1d09..28100135 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2006-07-27 Eugenio Favalli * tmwserv.cbp, tmwserv.dev: Updated project files. + * src/accounthandler.cpp, src/client.cpp: Modified client version to be + an int. 2006-07-27 Guillaume Melquiond diff --git a/src/accounthandler.cpp b/src/accounthandler.cpp index a07fc2a7..2ec3c298 100644 --- a/src/accounthandler.cpp +++ b/src/accounthandler.cpp @@ -161,14 +161,14 @@ void AccountHandler::processMessage(NetComputer *comp, MessageIn &message) { case PAMSG_LOGIN: { - std::string clientVersion = message.readString(); + unsigned long clientVersion = message.readLong(); std::string username = message.readString(); std::string password = message.readString(); LOG_INFO(username << " is trying to login.", 1); result.writeShort(APMSG_LOGIN_RESPONSE); - if (clientVersion < config.getValue("clientVersion", "0.0.0")) + if (clientVersion < config.getValue("clientVersion", 0)) { LOG_INFO("Client has an unsufficient version number to login.", 1); result.writeByte(LOGIN_INVALID_VERSION); diff --git a/src/client.cpp b/src/client.cpp index 34a050ab..6685949f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) // Login msg.writeShort(PAMSG_LOGIN); // We send the client version - msg.writeString(PACKAGE_VERSION); + msg.writeLong(0); std::cout << "Account name: "; std::cin >> line; msg.writeString(line); @@ -384,7 +384,7 @@ int main(int argc, char *argv[]) // The disconnection attempt didn't succeed yet. Force disconnection. enet_peer_reset(&client->peers[0]); } - + enet_host_destroy(client); return 0; @@ -526,7 +526,7 @@ void parsePacket(char *data, int recvLength) { break; } } break; - + case APMSG_EMAIL_GET_RESPONSE: { switch (msg.readByte()) { -- cgit v1.2.3-60-g2f50