diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-22 22:08:44 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-22 22:11:01 +0100 |
commit | dc3b7dc6001c64bd9473518299c74f292b521516 (patch) | |
tree | 4d229c54a1c95dea716fa3aa019121411e83bc8f /src | |
parent | c9dbf0842f3d06e262befb2be2d15ad24b95de85 (diff) | |
download | mana-dc3b7dc6001c64bd9473518299c74f292b521516.tar.gz mana-dc3b7dc6001c64bd9473518299c74f292b521516.tar.bz2 mana-dc3b7dc6001c64bd9473518299c74f292b521516.tar.xz mana-dc3b7dc6001c64bd9473518299c74f292b521516.zip |
Warn when receiving an empty update host
Reviewed-by: Jared Adams
Diffstat (limited to 'src')
-rw-r--r-- | src/net/manaserv/loginhandler.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp index cbc8e510..b3c70226 100644 --- a/src/net/manaserv/loginhandler.cpp +++ b/src/net/manaserv/loginhandler.cpp @@ -22,6 +22,7 @@ #include "net/manaserv/loginhandler.h" #include "client.h" +#include "log.h" #include "net/logindata.h" @@ -321,11 +322,16 @@ void LoginHandler::handleRegisterResponse(Net::MessageIn &msg) void LoginHandler::readUpdateHost(Net::MessageIn &msg) { + // Safety check for outdated manaserv versions (remove me later) + if (msg.getUnreadLength() == 0) + return; + // Set the update host when included in the message - if (msg.getUnreadLength() > 0) - { - mLoginData->updateHost = msg.readString(); - } + const std::string updateHost = msg.readString(); + if (!updateHost.empty()) + mLoginData->updateHost = updateHost; + else + logger->log("Warning: server does not have an update host set!"); } void LoginHandler::connect() |