diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-16 18:13:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-16 18:13:20 +0300 |
commit | b4a69fc693dcac28c84d9eee96f92d2bc56331ea (patch) | |
tree | 6774a684aa19dab71ba8f4ae93fcb88233707a1d | |
parent | 415d696feaa2981d555d1912f201b548c1f0ffad (diff) | |
download | manaverse-b4a69fc693dcac28c84d9eee96f92d2bc56331ea.tar.gz manaverse-b4a69fc693dcac28c84d9eee96f92d2bc56331ea.tar.bz2 manaverse-b4a69fc693dcac28c84d9eee96f92d2bc56331ea.tar.xz manaverse-b4a69fc693dcac28c84d9eee96f92d2bc56331ea.zip |
Add server feature haveChatChannels.
-rw-r--r-- | src/net/eathena/serverfeatures.cpp | 5 | ||||
-rw-r--r-- | src/net/eathena/serverfeatures.h | 2 | ||||
-rw-r--r-- | src/net/serverfeatures.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/serverfeatures.h | 2 |
6 files changed, 20 insertions, 1 deletions
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp index 9cd8a5f22..c5b738828 100644 --- a/src/net/eathena/serverfeatures.cpp +++ b/src/net/eathena/serverfeatures.cpp @@ -87,4 +87,9 @@ bool ServerFeatures::haveLookSelection() const return false; } +bool ServerFeatures::haveChatChannels() const +{ + return false; +} + } // namespace EAthena diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h index 8ead8eff1..04a5ffc22 100644 --- a/src/net/eathena/serverfeatures.h +++ b/src/net/eathena/serverfeatures.h @@ -55,6 +55,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveRaceSelection() const override final; bool haveLookSelection() const override final; + + bool haveChatChannels() const override final; }; } // namespace EAthena diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h index 553217185..3896d4a6e 100644 --- a/src/net/serverfeatures.h +++ b/src/net/serverfeatures.h @@ -52,6 +52,8 @@ class ServerFeatures notfinal virtual bool haveRaceSelection() const = 0; virtual bool haveLookSelection() const = 0; + + virtual bool haveChatChannels() const = 0; }; } // namespace Net diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 0e2b0103b..c979536ae 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -30,6 +30,9 @@ #include "gui/windows/chatwindow.h" +#include "net/net.h" +#include "net/serverfeatures.h" + #include "net/tmwa/messageout.h" #include "net/tmwa/protocol.h" @@ -126,7 +129,7 @@ void ChatHandler::talk(const std::string &restrict text, const std::string mes = std::string(localPlayer->getName()).append( " : ").append(text); - if (serverVersion >= 8 && channel.size() == 3) + if (Net::getServerFeatures()->haveChatChannels() && channel.size() == 3) { MessageOut outMsg(CMSG_CHAT_MESSAGE2); // Added + 1 in order to let eAthena parse admin commands correctly diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index 23330a02a..57292e672 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -89,4 +89,9 @@ bool ServerFeatures::haveLookSelection() const return serverVersion >= 9; } +bool ServerFeatures::haveChatChannels() const +{ + return serverVersion >= 8; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 01db18cc5..230e20cf1 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -55,6 +55,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveRaceSelection() const override final; bool haveLookSelection() const override final; + + bool haveChatChannels() const override final; }; } // namespace TmwAthena |