summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-07-27 20:57:10 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-07-27 20:57:10 +0000
commit975ee7b516da2242ba1865923b2d3fbe208ed84a (patch)
tree22f5bc1cb33a231020b5587fb8da6e00bdceb762
parent9421e5ed07b24f1e9d5e71e396814bd5a21932c6 (diff)
downloadmanaserv-975ee7b516da2242ba1865923b2d3fbe208ed84a.tar.gz
manaserv-975ee7b516da2242ba1865923b2d3fbe208ed84a.tar.bz2
manaserv-975ee7b516da2242ba1865923b2d3fbe208ed84a.tar.xz
manaserv-975ee7b516da2242ba1865923b2d3fbe208ed84a.zip
Modified client version to be an int.
-rw-r--r--ChangeLog2
-rw-r--r--src/accounthandler.cpp4
-rw-r--r--src/client.cpp6
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 <elvenprogrammer@gmail.com>
* 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 <guillaume.melquiond@gmail.com>
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()) {