summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/ea/chathandler.cpp4
-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/serverfeatures.cpp5
-rw-r--r--src/net/tmwa/serverfeatures.h2
6 files changed, 19 insertions, 1 deletions
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index 62c6b17f8..c53243dc1 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -36,6 +36,8 @@
#include "gui/widgets/tabs/gmtab.h"
#include "net/messagein.h"
+#include "net/net.h"
+#include "net/serverfeatures.h"
#include "net/ea/eaprotocol.h"
@@ -302,7 +304,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg) const
std::string sender_name = ((pos == std::string::npos)
? "" : chatMsg.substr(0, pos));
- if (tmwServerVersion > 0)
+ if (Net::getServerFeatures()->haveIncompleteChatMessages())
{
// work around for "new" tmw server
sender_name = being->getName();
diff --git a/src/net/eathena/serverfeatures.cpp b/src/net/eathena/serverfeatures.cpp
index 1e055191b..2ee68f405 100644
--- a/src/net/eathena/serverfeatures.cpp
+++ b/src/net/eathena/serverfeatures.cpp
@@ -72,4 +72,9 @@ bool ServerFeatures::haveNativeGuilds() const
return true;
}
+bool ServerFeatures::haveIncompleteChatMessages() const
+{
+ return false;
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/serverfeatures.h b/src/net/eathena/serverfeatures.h
index 6ca4df652..3aa99e40d 100644
--- a/src/net/eathena/serverfeatures.h
+++ b/src/net/eathena/serverfeatures.h
@@ -49,6 +49,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveBrokenPlayerAttackDistance() const override final;
bool haveNativeGuilds() const override final;
+
+ bool haveIncompleteChatMessages() const override final;
};
} // namespace EAthena
diff --git a/src/net/serverfeatures.h b/src/net/serverfeatures.h
index b90df0796..8f5acb0c2 100644
--- a/src/net/serverfeatures.h
+++ b/src/net/serverfeatures.h
@@ -46,6 +46,8 @@ class ServerFeatures notfinal
virtual bool haveBrokenPlayerAttackDistance() const = 0;
virtual bool haveNativeGuilds() const = 0;
+
+ virtual bool haveIncompleteChatMessages() const = 0;
};
} // namespace Net
diff --git a/src/net/tmwa/serverfeatures.cpp b/src/net/tmwa/serverfeatures.cpp
index 498d19249..31b7a16ed 100644
--- a/src/net/tmwa/serverfeatures.cpp
+++ b/src/net/tmwa/serverfeatures.cpp
@@ -74,4 +74,9 @@ bool ServerFeatures::haveNativeGuilds() const
return tmwServerVersion <= 0;
}
+bool ServerFeatures::haveIncompleteChatMessages() const
+{
+ return tmwServerVersion > 0;
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/serverfeatures.h b/src/net/tmwa/serverfeatures.h
index 3aba539dd..916fbf3db 100644
--- a/src/net/tmwa/serverfeatures.h
+++ b/src/net/tmwa/serverfeatures.h
@@ -49,6 +49,8 @@ class ServerFeatures final : public Net::ServerFeatures
bool haveBrokenPlayerAttackDistance() const override final;
bool haveNativeGuilds() const override final;
+
+ bool haveIncompleteChatMessages() const override final;
};
} // namespace TmwAthena