diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-13 19:07:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-13 19:07:55 +0300 |
commit | 3aebacaab2e110820994b7e0849bf65fa24c7c8c (patch) | |
tree | a71d29a6e12ed2ef72ebc469527c2dfb3c9b7687 /src/net/tmwa | |
parent | 78bda42e4b456ad7118b8e46a07c77371f90b615 (diff) | |
download | manaverse-3aebacaab2e110820994b7e0849bf65fa24c7c8c.tar.gz manaverse-3aebacaab2e110820994b7e0849bf65fa24c7c8c.tar.bz2 manaverse-3aebacaab2e110820994b7e0849bf65fa24c7c8c.tar.xz manaverse-3aebacaab2e110820994b7e0849bf65fa24c7c8c.zip |
Split processChat into two functions with net code and without.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 7 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 93f1d9815..962d21363 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -290,7 +290,12 @@ void ChatHandler::processChat(Net::MessageIn &msg) return; } - std::string chatMsg = msg.readRawString(chatMsgLength, "message"); + processChatContinue(msg.readRawString(chatMsgLength, "message"), channel); +} + +void ChatHandler::processChatContinue(std::string chatMsg, + const std::string &channel) +{ const size_t pos = chatMsg.find(" : ", 0); bool allow(true); diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index 83b23774b..0fbf6711a 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -73,6 +73,9 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler protected: void processChat(Net::MessageIn &msg); + void processChatContinue(std::string chatMsg, + const std::string &channel); + void processGmChat(Net::MessageIn &msg); void processWhisper(Net::MessageIn &msg) const; |