From eee2f72b047262cbb6478c67f2e5293a85ce79e4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 Dec 2013 17:56:43 +0300 Subject: allow to owner talk from own pet. New chat command: /talkpet text --- src/net/chathandler.h | 3 +++ src/net/ea/chathandler.cpp | 8 ++++++++ src/net/ea/chathandler.h | 3 +++ 3 files changed, 14 insertions(+) (limited to 'src/net') diff --git a/src/net/chathandler.h b/src/net/chathandler.h index aab74e85a..db866ac3b 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -39,6 +39,9 @@ class ChatHandler virtual void talk(const std::string &restrict text, const std::string &restrict channel) const = 0; + virtual void talkPet(const std::string &restrict text, + const std::string &restrict channel) const = 0; + virtual void talkRaw(const std::string &text) const = 0; virtual void me(const std::string &restrict text, diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index 698a03ef4..2bfee7ad2 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -70,6 +70,14 @@ void ChatHandler::me(const std::string &restrict text, talk(action, channel); } +void ChatHandler::talkPet(const std::string &restrict text, + const std::string &restrict channel) const +{ + // here need string duplication + std::string action = strprintf("\302\202\303 %s", text.c_str()); + talk(action, channel); +} + void ChatHandler::processWhisperResponse(Net::MessageIn &msg) { BLOCK_START("ChatHandler::processWhisperResponse") diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index cba709577..b2e38fede 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -38,6 +38,9 @@ class ChatHandler : public Net::ChatHandler A_DELETE_COPY(ChatHandler) + void talkPet(const std::string &restrict text, + const std::string &restrict channel) const override final; + void me(const std::string &restrict text, const std::string &restrict channel) const override final; -- cgit v1.2.3-60-g2f50