diff options
-rw-r--r-- | src/net/manaserv/adminhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/manaserv/chathandler.cpp | 3 | ||||
-rw-r--r-- | src/net/manaserv/manaserv_protocol.h | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/net/manaserv/adminhandler.cpp b/src/net/manaserv/adminhandler.cpp index 280b0161..178291a4 100644 --- a/src/net/manaserv/adminhandler.cpp +++ b/src/net/manaserv/adminhandler.cpp @@ -48,14 +48,12 @@ void AdminHandler::handleMessage(Net::MessageIn &msg) void AdminHandler::announce(const std::string &text) { - MessageOut msg(PCMSG_ANNOUNCE); - msg.writeString(text); - chatServerConnection->send(msg); + // TODO send warning about using @announce instead } void AdminHandler::localAnnounce(const std::string &text) { - // TODO + // TODO add @command for this } void AdminHandler::hide(bool hide) diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp index c3a9c964..9b77c0c4 100644 --- a/src/net/manaserv/chathandler.cpp +++ b/src/net/manaserv/chathandler.cpp @@ -243,8 +243,9 @@ void ChatHandler::handlePrivateMessage(Net::MessageIn &msg) void ChatHandler::handleAnnouncement(Net::MessageIn &msg) { std::string chatMsg = msg.readString(); + std::string sender = msg.readString(); Event event(Event::Announcement); - event.setString("message", chatMsg); + event.setString("message", sender + " : " + chatMsg); event.trigger(Event::ChatChannel); } diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h index 2dc270c4..800eb452 100644 --- a/src/net/manaserv/manaserv_protocol.h +++ b/src/net/manaserv/manaserv_protocol.h @@ -205,11 +205,10 @@ enum { // Chat CPMSG_ERROR = 0x0401, // B error - CPMSG_ANNOUNCEMENT = 0x0402, // S text + CPMSG_ANNOUNCEMENT = 0x0402, // S text, S sender CPMSG_PRIVMSG = 0x0403, // S user, S text CPMSG_PUBMSG = 0x0404, // W channel, S user, S text PCMSG_CHAT = 0x0410, // S text, W channel - PCMSG_ANNOUNCE = 0x0411, // S text PCMSG_PRIVMSG = 0x0412, // S user, S text PCMSG_WHO = 0x0415, // - CPMSG_WHO_RESPONSE = 0x0416, // { S user } @@ -252,6 +251,7 @@ enum { GCMSG_STORE_POST = 0x05A5, // D sender id, S receiver name, S letter, { W attachment item id, W quantity } CGMSG_STORE_POST_RESPONSE = 0x05A6, // D id, B error GAMSG_TRANSACTION = 0x0600, // D character id, D action, S message + GAMSG_ANNOUNCE = 0x0603, // S text, W senderid, S sendername XXMSG_INVALID = 0x7FFF }; |