diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-12 01:30:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-12 01:30:10 +0300 |
commit | 1aedc45da834c18cd33d04be0fe43245518192ff (patch) | |
tree | aec7d7b2328d6643e9f6ba3460419765304a4657 /src/net/eathena/loginhandler.cpp | |
parent | 4247e05ae8ee9e14323629701c3a11e5c2fac674 (diff) | |
download | plus-1aedc45da834c18cd33d04be0fe43245518192ff.tar.gz plus-1aedc45da834c18cd33d04be0fe43245518192ff.tar.bz2 plus-1aedc45da834c18cd33d04be0fe43245518192ff.tar.xz plus-1aedc45da834c18cd33d04be0fe43245518192ff.zip |
evol: add packet CMSG_LOGIN_REGISTER2 0x027c.
Diffstat (limited to 'src/net/eathena/loginhandler.cpp')
-rw-r--r-- | src/net/eathena/loginhandler.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index c36b6a1d1..7153468aa 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -143,14 +143,24 @@ void LoginHandler::changePassword(const std::string &restrict username void LoginHandler::sendLoginRegister(const std::string &restrict username, const std::string &restrict password, - const std::string &restrict email - A_UNUSED) const + const std::string &restrict email) const { - createOutPacket(CMSG_LOGIN_REGISTER); - outMsg.writeInt32(20, "client version"); - outMsg.writeString(username, 24, "login"); - outMsg.writeStringNoLog(password, 24, "password"); - outMsg.writeInt8(0x03, "client type"); + if (email.empty()) + { + createOutPacket(CMSG_LOGIN_REGISTER); + outMsg.writeInt32(20, "client version"); + outMsg.writeString(username, 24, "login"); + outMsg.writeStringNoLog(password, 24, "password"); + outMsg.writeInt8(0x03, "client type"); + } + else + { + createOutPacket(CMSG_LOGIN_REGISTER2); + outMsg.writeString(username, 24, "login"); + outMsg.writeStringNoLog(password, 24, "password"); + outMsg.writeInt8(0x03, "client type"); + outMsg.writeString(email, 40, "email"); + } } ServerInfo *LoginHandler::getCharServer() const @@ -258,4 +268,12 @@ void LoginHandler::processServerVersion(Net::MessageIn &msg) client->setState(STATE_LOGIN); } +int LoginHandler::supportedOptionalActions() const +{ + return serverFeatures->haveEmailOnRegister() + ? Net::RegistrationOptions::SetEmailOnRegister + | Net::RegistrationOptions::SetGenderOnRegister + : Net::RegistrationOptions::SetGenderOnRegister; +} + } // namespace EAthena |