summaryrefslogtreecommitdiff
path: root/src/account-server
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-11-18 19:50:22 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-11-18 19:50:22 +0100
commitd62fdc6d7b84e19c8adb72bca35c0b5b0dfe5405 (patch)
treeed5e7b6104889f9da9ad18afcfc34987a25b2ab0 /src/account-server
parent7b187929881570281036b779a518f3f4608b51a8 (diff)
downloadmanaserv-d62fdc6d7b84e19c8adb72bca35c0b5b0dfe5405.tar.gz
manaserv-d62fdc6d7b84e19c8adb72bca35c0b5b0dfe5405.tar.bz2
manaserv-d62fdc6d7b84e19c8adb72bca35c0b5b0dfe5405.tar.xz
manaserv-d62fdc6d7b84e19c8adb72bca35c0b5b0dfe5405.zip
Made the server return the number of slots in the login/register responses.
Reviewed-by: CodyMartin.
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/accounthandler.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index e50c817f..44946405 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -44,7 +44,15 @@
#include "utils/string.h"
#include "utils/xml.h"
-static void addUpdateHost(MessageOut *msg)
+/**
+ * Adds server specific info to the current message
+ *
+ * The info are made of:
+ * (String) Update Host URL (or "")
+ * (String) Client Data URL (or "")
+ * (Byte) Number of maximum character slots (empty or not)
+ */
+static void addServerInfo(MessageOut *msg)
{
std::string updateHost = Configuration::getValue("net_defaultUpdateHost",
"");
@@ -56,6 +64,9 @@ static void addUpdateHost(MessageOut *msg)
*/
std::string dataUrl = Configuration::getValue("net_clientDataUrl", "");
msg->writeString(dataUrl);
+
+ // Send the number of available slots (empty or not)
+ msg->writeInt8(Configuration::getValue("account_maxCharacters", 3));
}
// List of attributes that the client can send at account creation.
@@ -378,7 +389,7 @@ void AccountHandler::handleLoginMessage(AccountClient &client, MessageIn &msg)
client.status = CLIENT_CONNECTED;
reply.writeInt8(ERRMSG_OK);
- addUpdateHost(&reply);
+ addServerInfo(&reply);
client.send(reply); // Acknowledge login
// Return information about available characters
@@ -521,7 +532,7 @@ void AccountHandler::handleRegisterMessage(AccountClient &client,
storage->addAccount(acc);
reply.writeInt8(ERRMSG_OK);
- addUpdateHost(&reply);
+ addServerInfo(&reply);
// Associate account with connection
client.setAccount(acc);