summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-29 23:18:05 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-30 16:37:02 +0300
commit194e902a7231c814a23af9e41408301f3ce413c0 (patch)
tree68249ae426bf730b5c629dd0e9524b3a73c23036 /src
parentc0d2d172cf6397329b0474e8521af666edc6f774 (diff)
downloadmanaplus-194e902a7231c814a23af9e41408301f3ce413c0.tar.gz
manaplus-194e902a7231c814a23af9e41408301f3ce413c0.tar.bz2
manaplus-194e902a7231c814a23af9e41408301f3ce413c0.tar.xz
manaplus-194e902a7231c814a23af9e41408301f3ce413c0.zip
Remove additional parameters from processChat function.
Diffstat (limited to 'src')
-rw-r--r--src/net/ea/chathandler.cpp6
-rw-r--r--src/net/ea/chathandler.h3
-rw-r--r--src/net/ea/eaprotocol.h2
-rw-r--r--src/net/eathena/chathandler.cpp2
-rw-r--r--src/net/tmwa/chathandler.cpp4
5 files changed, 10 insertions, 7 deletions
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index b92948335..f24811966 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -345,10 +345,12 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg) const
BLOCK_END("ChatHandler::processBeingChat")
}
-void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat,
- const bool channels)
+void ChatHandler::processChat(Net::MessageIn &msg)
{
BLOCK_START("ChatHandler::processChat")
+ const bool channels = msg.getId() == SMSG_PLAYER_CHAT2;
+ const bool normalChat = msg.getId() == SMSG_PLAYER_CHAT
+ || msg.getId() == SMSG_PLAYER_CHAT2;
int chatMsgLength = msg.readInt16() - 4;
std::string channel;
if (channels)
diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h
index d7865a83b..1db8d6001 100644
--- a/src/net/ea/chathandler.h
+++ b/src/net/ea/chathandler.h
@@ -54,8 +54,7 @@ class ChatHandler notfinal : public Net::ChatHandler
virtual void processBeingChat(Net::MessageIn &msg) const;
- virtual void processChat(Net::MessageIn &msg, const bool normalChat,
- const bool channels);
+ virtual void processChat(Net::MessageIn &msg);
virtual void processMVP(Net::MessageIn &msg) const;
diff --git a/src/net/ea/eaprotocol.h b/src/net/ea/eaprotocol.h
index d315083de..84fb23347 100644
--- a/src/net/ea/eaprotocol.h
+++ b/src/net/ea/eaprotocol.h
@@ -68,6 +68,8 @@ enum
static const int INVENTORY_OFFSET = 2;
static const int STORAGE_OFFSET = 1;
+#define SMSG_PLAYER_CHAT 0x008e /**< Player talks */
+#define SMSG_PLAYER_CHAT2 0x0224 /**< Player talks */
#define SMSG_BEING_CHAT2 0x0223 /**< A being talks in channels */
#define SMSG_PLAYER_INVENTORY 0x01ee
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index cc1a5907e..8a689bd47 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -75,7 +75,7 @@ void ChatHandler::handleMessage(Net::MessageIn &msg)
case SMSG_PLAYER_CHAT:
case SMSG_GM_CHAT:
- processChat(msg, msg.getId() == SMSG_PLAYER_CHAT, false);
+ processChat(msg);
break;
case SMSG_MVP:
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 65a136570..ef89d966d 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -85,11 +85,11 @@ void ChatHandler::handleMessage(Net::MessageIn &msg)
case SMSG_PLAYER_CHAT:
case SMSG_GM_CHAT:
- processChat(msg, msg.getId() == SMSG_PLAYER_CHAT, false);
+ processChat(msg);
break;
case SMSG_PLAYER_CHAT2:
- processChat(msg, true, true);
+ processChat(msg);
break;
case SMSG_MVP: