From d4b88a7ebce6222c34928c49925f972515593e89 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 20 May 2014 18:04:19 +0300 Subject: Move registrationoptions into separate file. --- src/net/ea/loginhandler.h | 4 +++- src/net/eathena/loginhandler.h | 2 +- src/net/loginhandler.h | 8 -------- src/net/registrationoptions.h | 37 +++++++++++++++++++++++++++++++++++++ src/net/tmwa/loginhandler.cpp | 8 ++++++-- 5 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 src/net/registrationoptions.h (limited to 'src/net') 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 @@ -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 . + */ + +#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 -- cgit v1.2.3-60-g2f50