diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-22 21:53:16 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-22 22:02:35 +0100 |
commit | 46815a247c8d39a2fb950c508e3831e0bd61c096 (patch) | |
tree | 38ad30fc345b1a29a8e52d31a80bfece4b881d97 /src | |
parent | 18dc121ee83780cedf451dd78d5f29f6e994a266 (diff) | |
download | manaserv-46815a247c8d39a2fb950c508e3831e0bd61c096.tar.gz manaserv-46815a247c8d39a2fb950c508e3831e0bd61c096.tar.bz2 manaserv-46815a247c8d39a2fb950c508e3831e0bd61c096.tar.xz manaserv-46815a247c8d39a2fb950c508e3831e0bd61c096.zip |
Send update host also with registration response
The client would otherwise not know which update host to use after
registration.
Also, the update host is now always sent, even if it is empty. This
makes the message contents more deterministic.
Reviewed-by: Jared Adams
Diffstat (limited to 'src')
-rw-r--r-- | src/account-server/accounthandler.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index fdffd911..002803e6 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -40,6 +40,12 @@ #include "utils/tokendispenser.hpp" #include "utils/sha256.h" +static void addUpdateHost(MessageOut *msg) +{ + std::string updateHost = Configuration::getValue("defaultUpdateHost", ""); + msg->writeString(updateHost); +} + class AccountHandler : public ConnectionHandler { public: @@ -255,9 +261,7 @@ void AccountHandler::handleLoginMessage(AccountClient &client, MessageIn &msg) client.status = CLIENT_CONNECTED; reply.writeByte(ERRMSG_OK); - std::string updateHost = Configuration::getValue("defaultUpdateHost",""); - if (updateHost != "") - reply.writeString(updateHost); + addUpdateHost(&reply); client.send(reply); // Acknowledge login // Return information about available characters @@ -399,6 +403,7 @@ void AccountHandler::handleRegisterMessage(AccountClient &client, MessageIn &msg storage->addAccount(acc); reply.writeByte(ERRMSG_OK); + addUpdateHost(&reply); // Associate account with connection client.setAccount(acc); |