summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 18:23:33 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-16 18:23:33 +0300
commita143251ee20a65b43c6d85d9f15bddf06dbc8804 (patch)
tree6c0168d5fa696b29f78d275b4524fc11e43be2ed
parentb4a69fc693dcac28c84d9eee96f92d2bc56331ea (diff)
downloadmanaverse-a143251ee20a65b43c6d85d9f15bddf06dbc8804.tar.gz
manaverse-a143251ee20a65b43c6d85d9f15bddf06dbc8804.tar.bz2
manaverse-a143251ee20a65b43c6d85d9f15bddf06dbc8804.tar.xz
manaverse-a143251ee20a65b43c6d85d9f15bddf06dbc8804.zip
Add server feature haveServerIgnore.
-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/chathandler.cpp4
-rw-r--r--src/net/tmwa/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 18 insertions, 2 deletions
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index c5b738828..4cd9551cc 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -92,4 +92,9 @@ bool ServerFeatures::haveChatChannels() const
return false;
}
+bool ServerFeatures::haveServerIgnore() const
+{
+ return true;
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index 04a5ffc22..4fd393a95 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/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 EAthena
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index 3896d4a6e..1f36d6b42 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -54,6 +54,8 @@ class ServerFeatures notfinal
virtual bool haveLookSelection() const = 0;
virtual bool haveChatChannels() const = 0;
+
+ virtual bool haveServerIgnore() const = 0;
};
} // namespace Net
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