From 5f9e53cb962078bf2d13786157fbf31465d4e864 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Sep 2014 21:52:47 +0300 Subject: Add server feature haveEmailOnRegister. --- src/net/eathena/serverfeatures.cpp | 5 +++++ src/net/eathena/serverfeatures.h | 2 ++ src/net/serverfeatures.h | 2 ++ src/net/tmwa/loginhandler.cpp | 5 ++++- src/net/tmwa/serverfeatures.cpp | 5 +++++ src/net/tmwa/serverfeatures.h | 2 ++ 6 files changed, 20 insertions(+), 1 deletion(-) (limited to 'src/net') 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 -- cgit v1.2.3-60-g2f50