summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/logindata.h19
-rw-r--r--src/net/tmwa/loginhandler.cpp6
2 files changed, 19 insertions, 6 deletions
diff --git a/src/net/logindata.h b/src/net/logindata.h
index 7f729559..4a1c1a9f 100644
--- a/src/net/logindata.h
+++ b/src/net/logindata.h
@@ -31,12 +31,11 @@ class LoginData
public:
/**
* Constructor
- *
- * Initialize character slots to 3 for TmwAthena compatibility
*/
- LoginData():
- characterSlots(3)
- {}
+ LoginData()
+ {
+ resetCharacterSlots();
+ }
std::string username;
std::string password;
@@ -53,6 +52,14 @@ public:
unsigned short characterSlots; /**< The number of character slots */
+ /**
+ * Initialize character slots to 3 for TmwAthena compatibility
+ */
+ void resetCharacterSlots()
+ {
+ characterSlots = 3; // Default value, used for TmwAthena.
+ }
+
void clear()
{
username.clear();
@@ -62,7 +69,7 @@ public:
email.clear();
captchaResponse.clear();
gender = GENDER_UNSPECIFIED;
- characterSlots = 3; // Default value, used for TmwAthena.
+ resetCharacterSlots();
}
};
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index e58acb4d..00b7b145 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -235,6 +235,12 @@ void LoginHandler::getRegistrationDetails()
void LoginHandler::loginAccount(LoginData *loginData)
{
+ // Since we're attempting to use the tAthena protocol,
+ // let's reset the character slots to the good value,
+ // in case we just logged out a Manaserv server
+ // with a different config.
+ loginData->resetCharacterSlots();
+
sendLoginRegister(loginData->username, loginData->password);
}