summaryrefslogtreecommitdiff
path: root/src
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
parentf91ad9a0c39ae1c537f2769f1fdf4b0a59e8bf91 (diff)
downloadmv-5f9e53cb962078bf2d13786157fbf31465d4e864.tar.gz
mv-5f9e53cb962078bf2d13786157fbf31465d4e864.tar.bz2
mv-5f9e53cb962078bf2d13786157fbf31465d4e864.tar.xz
mv-5f9e53cb962078bf2d13786157fbf31465d4e864.zip
Add server feature haveEmailOnRegister.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/serverfeatures.cpp5
-rw-r--r--src/net/eathena/serverfeatures.h2
-rw-r--r--src/net/serverfeatures.h2
-rw-r--r--src/net/tmwa/loginhandler.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 20 insertions, 1 deletions
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index d28b7a91c..b92a6f7b4 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -117,4 +117,9 @@ bool ServerFeatures::haveMonsterAttackRange() const
return false;
}
+bool ServerFeatures::haveEmailOnRegister() const
+{
+ return false;
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index e4469868c..fc140a604 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/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 EAthena
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index 803d81b81..d1a575692 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -64,6 +64,8 @@ class ServerFeatures notfinal
virtual bool haveOtherGender() const = 0;
virtual bool haveMonsterAttackRange() const = 0;
+
+ virtual bool haveEmailOnRegister() const = 0;
};
} // namespace Net
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