diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/logindata.h | 12 | ||||
-rw-r--r-- | src/net/manaserv/loginhandler.cpp | 13 | ||||
-rw-r--r-- | src/net/manaserv/loginhandler.h | 2 |
3 files changed, 23 insertions, 4 deletions
diff --git a/src/net/logindata.h b/src/net/logindata.h index 22675d5a..7f729559 100644 --- a/src/net/logindata.h +++ b/src/net/logindata.h @@ -29,6 +29,15 @@ class LoginData { public: + /** + * Constructor + * + * Initialize character slots to 3 for TmwAthena compatibility + */ + LoginData(): + characterSlots(3) + {} + std::string username; std::string password; std::string newPassword; @@ -42,6 +51,8 @@ public: bool remember; /**< Whether to store the username. */ bool registerLogin; /**< Whether an account is being registered. */ + unsigned short characterSlots; /**< The number of character slots */ + void clear() { username.clear(); @@ -51,6 +62,7 @@ public: email.clear(); captchaResponse.clear(); gender = GENDER_UNSPECIFIED; + characterSlots = 3; // Default value, used for TmwAthena. } }; diff --git a/src/net/manaserv/loginhandler.cpp b/src/net/manaserv/loginhandler.cpp index 29418124..05a51efe 100644 --- a/src/net/manaserv/loginhandler.cpp +++ b/src/net/manaserv/loginhandler.cpp @@ -251,7 +251,7 @@ void LoginHandler::handleLoginResponse(Net::MessageIn &msg) if (errMsg == ERRMSG_OK) { - readUpdateHost(msg); + readServerInfo(msg); // No worlds atm, but future use :-D Client::setState(STATE_WORLD_SELECT); } @@ -289,7 +289,7 @@ void LoginHandler::handleRegisterResponse(Net::MessageIn &msg) if (errMsg == ERRMSG_OK) { - readUpdateHost(msg); + readServerInfo(msg); Client::setState(STATE_WORLD_SELECT); } else @@ -320,7 +320,7 @@ void LoginHandler::handleRegisterResponse(Net::MessageIn &msg) } } -void LoginHandler::readUpdateHost(Net::MessageIn &msg) +void LoginHandler::readServerInfo(Net::MessageIn &msg) { // Safety check for outdated manaserv versions (remove me later) if (msg.getUnreadLength() == 0) @@ -332,6 +332,13 @@ void LoginHandler::readUpdateHost(Net::MessageIn &msg) mLoginData->updateHost = updateHost; else logger->log("Warning: server does not have an update host set!"); + + // Read the client data folder for dynamic data loading. + // This is only used by the QT client. + msg.readString(); + + // Read the number of character slots + mLoginData->characterSlots = msg.readInt8(); } void LoginHandler::connect() diff --git a/src/net/manaserv/loginhandler.h b/src/net/manaserv/loginhandler.h index d2ffbc3d..2062dcb5 100644 --- a/src/net/manaserv/loginhandler.h +++ b/src/net/manaserv/loginhandler.h @@ -80,7 +80,7 @@ class LoginHandler : public MessageHandler, public Net::LoginHandler void handleLoginResponse(Net::MessageIn &msg); void handleRegisterResponse(Net::MessageIn &msg); - void readUpdateHost(Net::MessageIn &msg); + void readServerInfo(Net::MessageIn &msg); LoginData *mLoginData; unsigned int mMinUserNameLength; |