diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-20 18:04:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-20 18:04:19 +0300 |
commit | d4b88a7ebce6222c34928c49925f972515593e89 (patch) | |
tree | ab3c8136bcc06ec84194738c83bef8af6df62752 /src/net | |
parent | 6bf4a5aa68afb7d95632880c001286f2a721e1f5 (diff) | |
download | manaplus-d4b88a7ebce6222c34928c49925f972515593e89.tar.gz manaplus-d4b88a7ebce6222c34928c49925f972515593e89.tar.bz2 manaplus-d4b88a7ebce6222c34928c49925f972515593e89.tar.xz manaplus-d4b88a7ebce6222c34928c49925f972515593e89.zip |
Move registrationoptions into separate file.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/loginhandler.h | 4 | ||||
-rw-r--r-- | src/net/eathena/loginhandler.h | 2 | ||||
-rw-r--r-- | src/net/loginhandler.h | 8 | ||||
-rw-r--r-- | src/net/registrationoptions.h | 37 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 8 |
5 files changed, 47 insertions, 12 deletions
diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h index d8bffc0be..053e8500a 100644 --- a/src/net/ea/loginhandler.h +++ b/src/net/ea/loginhandler.h @@ -25,6 +25,8 @@ #include "net/loginhandler.h" +#include "net/registrationoptions.h" + #include "net/ea/token.h" #include <string> @@ -47,7 +49,7 @@ class LoginHandler : public Net::LoginHandler virtual ~LoginHandler(); int supportedOptionalActions() const override A_WARN_UNUSED - { return SetGenderOnRegister; } + { return Net::RegistrationOptions::SetGenderOnRegister; } virtual bool isRegistrationEnabled() const override final A_WARN_UNUSED; diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h index a1d791fdf..8be4f1397 100644 --- a/src/net/eathena/loginhandler.h +++ b/src/net/eathena/loginhandler.h @@ -52,7 +52,7 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler void disconnect() override final; int supportedOptionalActions() const override final A_WARN_UNUSED - { return SetGenderOnRegister; } + { return Net::RegistrationOptions::SetGenderOnRegister; } unsigned int getMaxPasswordLength() const override final A_WARN_UNUSED { return 24; } diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index b00ffffe2..8992d7ba3 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -36,14 +36,6 @@ namespace Net class LoginHandler { public: - enum OptionalAction - { - Unregister = 0x1, - ChangeEmail = 0x2, - SetEmailOnRegister = 0x4, - SetGenderOnRegister = 0x8 - }; - void setServer(const ServerInfo &server) { mServer = server; } diff --git a/src/net/registrationoptions.h b/src/net/registrationoptions.h new file mode 100644 index 000000000..7ab4021bb --- /dev/null +++ b/src/net/registrationoptions.h @@ -0,0 +1,37 @@ +/* + * The ManaPlus Client + * Copyright (C) 2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef NET_REGISTRATIONOPTIONS_H +#define NET_REGISTRATIONOPTIONS_H + +namespace Net +{ + enum RegistrationOptions + { + Unregister = 0x1, + ChangeEmail = 0x2, + SetEmailOnRegister = 0x4, + SetGenderOnRegister = 0x8 + }; +} // namespace Net + +#endif // NET_REGISTRATIONOPTIONS_H diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 3797a7a54..eccbf0928 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -25,6 +25,8 @@ #include "client.h" #include "logger.h" +#include "net/registrationoptions.h" + #include "net/tmwa/messageout.h" #include "net/tmwa/network.h" #include "net/tmwa/protocol.h" @@ -264,8 +266,10 @@ void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const int LoginHandler::supportedOptionalActions() const { - return serverVersion >= 7 ? SetEmailOnRegister | SetGenderOnRegister - : SetGenderOnRegister; + return serverVersion >= 7 + ? Net::RegistrationOptions::SetEmailOnRegister + | Net::RegistrationOptions::SetGenderOnRegister + : Net::RegistrationOptions::SetGenderOnRegister; } } // namespace TmwAthena |