summaryrefslogtreecommitdiff
path: root/src/net/ea/chathandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea/chathandler.cpp')
-rw-r--r--src/net/ea/chathandler.cpp29
1 files changed, 23 insertions, 6 deletions
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;