From a143251ee20a65b43c6d85d9f15bddf06dbc8804 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Sep 2014 18:23:33 +0300 Subject: Add server feature haveServerIgnore. --- src/net/tmwa/chathandler.cpp | 4 ++-- src/net/tmwa/serverfeatures.cpp | 5 +++++ src/net/tmwa/serverfeatures.h | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index c979536ae..46e2fca13 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -238,7 +238,7 @@ void ChatHandler::processRaw(MessageOut &restrict outMsg, void ChatHandler::ignoreAll() const { - if (tmwServerVersion > 0) + if (!Net::getServerFeatures()->haveServerIgnore()) return; MessageOut outMsg(CMSG_IGNORE_ALL); outMsg.writeInt8(0, "flag"); @@ -246,7 +246,7 @@ void ChatHandler::ignoreAll() const void ChatHandler::unIgnoreAll() const { - if (tmwServerVersion > 0) + if (!Net::getServerFeatures()->haveServerIgnore()) return; MessageOut outMsg(CMSG_IGNORE_ALL); outMsg.writeInt8(1, "flag"); diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp index 57292e672..b5b5fc11c 100644 --- a/src/net/tmwa/serverfeatures.cpp +++ b/src/net/tmwa/serverfeatures.cpp @@ -94,4 +94,9 @@ bool ServerFeatures::haveChatChannels() const return serverVersion >= 8; } +bool ServerFeatures::haveServerIgnore() const +{ + return tmwServerVersion == 0; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h index 230e20cf1..3ae22ffb0 100644 --- a/src/net/tmwa/serverfeatures.h +++ b/src/net/tmwa/serverfeatures.h @@ -57,6 +57,8 @@ class ServerFeatures final : public Net::ServerFeatures bool haveLookSelection() const override final; bool haveChatChannels() const override final; + + bool haveServerIgnore() const override final; }; } // namespace TmwAthena -- cgit v1.2.3-70-g09d2