summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 21:52:47 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 21:52:47 +0300
commit5f9e53cb962078bf2d13786157fbf31465d4e864 (patch)
tree7c1f9b3c3a08d8149175359e8f2beae751bb7cc5 /src/net/tmwa
parentf91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91 (diff)
downloadmanaverse-5f9e53cb962078bf2d13786157fbf31465d4e864.tar.gz
manaverse-5f9e53cb962078bf2d13786157fbf31465d4e864.tar.bz2
manaverse-5f9e53cb962078bf2d13786157fbf31465d4e864.tar.xz
manaverse-5f9e53cb962078bf2d13786157fbf31465d4e864.zip
Add server feature haveEmailOnRegister.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/loginhandler.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index f60a7d934..35321b1b8 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -25,6 +25,9 @@
#include "client.h"
#include "logger.h"
+#include "net/net.h"
+#include "net/serverfeatures.h"
+
#include "net/tmwa/messageout.h"
#include "net/tmwa/network.h"
#include "net/tmwa/protocol.h"
@@ -264,7 +267,7 @@ void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const
int LoginHandler::supportedOptionalActions() const
{
- return serverVersion >= 7
+ return Net::getServerFeatures()->haveEmailOnRegister()
? Net::RegistrationOptions::SetEmailOnRegister
| Net::RegistrationOptions::SetGenderOnRegister
: Net::RegistrationOptions::SetGenderOnRegister;
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index aaba467ac..73791e6c8 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -119,4 +119,9 @@ bool ServerFeatures::haveMonsterAttackRange() const
return serverVersion > 0;
}
+bool ServerFeatures::haveEmailOnRegister() const
+{
+ return serverVersion >= 7;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index c5b3fddaa..6c8776e8e 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -67,6 +67,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveOtherGender() const override final;
bool haveMonsterAttackRange() const override final;
+
+ bool haveEmailOnRegister() const override final;
};
} // namespace TmwAthena