summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/adminhandler.cpp3
-rw-r--r--src/net/ea/chathandler.cpp29
-rw-r--r--src/net/ea/chathandler.h6
3 files changed, 29 insertions, 9 deletions
diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp
index f6450a225..ca3fd034d 100644
--- a/src/net/ea/adminhandler.cpp
+++ b/src/net/ea/adminhandler.cpp
@@ -31,7 +31,8 @@
namespace Ea
{
-const std::string GENERAL_CHANNEL = "\000\000\000";
+//const std::string GENERAL_CHANNEL = "\000\000\000";
+const std::string GENERAL_CHANNEL = "";
void AdminHandler::kickName(const std::string &name)
{
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index 7be94ca3e..3a2c6ec2e 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -258,15 +258,25 @@ void ChatHandler::processWhisper(Net::MessageIn &msg)
}
}
-void ChatHandler::processBeingChat(Net::MessageIn &msg)
+void ChatHandler::processBeingChat(Net::MessageIn &msg, const bool channels)
{
if (!actorSpriteManager)
return;
- const int chatMsgLength = msg.readInt16() - 8;
+ int chatMsgLength = msg.readInt16() - 8;
Being *const being = actorSpriteManager->findBeing(msg.readInt32());
+ if (!being)
+ return;
+
+ if (channels)
+ {
+ chatMsgLength -= 3;
+ msg.readInt8(); // channel
+ msg.readInt8(); // channel
+ msg.readInt8(); // channel
+ }
- if (!being || chatMsgLength <= 0)
+ if (chatMsgLength <= 0)
return;
std::string chatMsg = msg.readRawString(chatMsgLength);
@@ -307,10 +317,17 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg)
}
}
-void ChatHandler::processChat(Net::MessageIn &msg, bool normalChat)
+void ChatHandler::processChat(Net::MessageIn &msg, bool normalChat,
+ bool channels)
{
- const int chatMsgLength = msg.readInt16() - 4;
-
+ int chatMsgLength = msg.readInt16() - 4;
+ if (channels)
+ {
+ chatMsgLength -= 3;
+ msg.readInt8(); // channel
+ msg.readInt8(); // channel
+ msg.readInt8(); // channel
+ }
if (chatMsgLength <= 0)
return;
diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h
index 301289084..c9bdd3029 100644
--- a/src/net/ea/chathandler.h
+++ b/src/net/ea/chathandler.h
@@ -75,9 +75,11 @@ class ChatHandler : public Net::ChatHandler
virtual void processWhisper(Net::MessageIn &msg);
- virtual void processBeingChat(Net::MessageIn &msg);
+ virtual void processBeingChat(Net::MessageIn &msg,
+ const bool channels);
- virtual void processChat(Net::MessageIn &msg, bool normalChat);
+ virtual void processChat(Net::MessageIn &msg, bool normalChat,
+ bool channels);
virtual void processMVP(Net::MessageIn &msg);