summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/gui/windows/charselectdialog.cpp5
-rw-r--r--src/gui/windows/registerdialog.cpp5
-rw-r--r--src/net/ea/loginhandler.h4
-rw-r--r--src/net/eathena/loginhandler.h2
-rw-r--r--src/net/loginhandler.h8
-rw-r--r--src/net/registrationoptions.h37
-rw-r--r--src/net/tmwa/loginhandler.cpp8
9 files changed, 55 insertions, 16 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4480067e5..1272714af 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -498,6 +498,7 @@ SET(SRCS
net/partyhandler.h
net/pethandler.h
net/playerhandler.h
+ net/registrationoptions.h
net/sdltcpnet.cpp
net/sdltcpnet.h
net/serverinfo.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 5a2ce04af..e1362e8ae 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -610,6 +610,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
net/partyhandler.h \
net/pethandler.h \
net/playerhandler.h \
+ net/registrationoptions.h \
net/sdltcpnet.cpp \
net/sdltcpnet.h \
net/serverinfo.h \
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 8dccde964..167bd37f1 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -48,6 +48,7 @@
#include "net/logindata.h"
#include "net/loginhandler.h"
#include "net/net.h"
+#include "net/registrationoptions.h"
#include "debug.h"
@@ -96,7 +97,7 @@ CharSelectDialog::CharSelectDialog(LoginData *const data):
placer(0, 0, mSwitchLoginButton);
int n = 1;
- if (optionalActions & Net::LoginHandler::Unregister)
+ if (optionalActions & Net::RegistrationOptions::Unregister)
{
// TRANSLATORS: char select dialog. button.
mUnregisterButton = new Button(this, _("Unregister"),
@@ -108,7 +109,7 @@ CharSelectDialog::CharSelectDialog(LoginData *const data):
placer(n, 0, mChangePasswordButton);
n ++;
- if (optionalActions & Net::LoginHandler::ChangeEmail)
+ if (optionalActions & Net::RegistrationOptions::ChangeEmail)
{
// TRANSLATORS: char select dialog. button.
mChangeEmailButton = new Button(this, _("Change Email"),
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index b396f591f..edcac1bda 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -42,6 +42,7 @@
#include "net/logindata.h"
#include "net/loginhandler.h"
#include "net/net.h"
+#include "net/registrationoptions.h"
#include "utils/delete2.h"
#include "utils/gettext.h"
@@ -91,7 +92,7 @@ RegisterDialog::RegisterDialog(LoginData *const data) :
int row = 3;
- if (optionalActions & Net::LoginHandler::SetGenderOnRegister)
+ if (optionalActions & Net::RegistrationOptions::SetGenderOnRegister)
{
// TRANSLATORS: register dialog. button.
mMaleButton = new RadioButton(this, _("Male"), "sex", true);
@@ -114,7 +115,7 @@ RegisterDialog::RegisterDialog(LoginData *const data) :
row++;
}
- if (optionalActions & Net::LoginHandler::SetEmailOnRegister)
+ if (optionalActions & Net::RegistrationOptions::SetEmailOnRegister)
{
// TRANSLATORS: register dialog. label.
Label *const emailLabel = new Label(this, _("Email:"));
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