From 0ff1cce3a289c2a813ed5db13250abbb23d2a9f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 9 Sep 2014 16:52:53 +0300 Subject: eathena: add packet CMSG_CREAYE_CHAT_ROOM 0x00d5. --- src/net/chathandler.h | 2 ++ src/net/eathena/chathandler.cpp | 13 +++++++++++++ src/net/eathena/chathandler.h | 5 +++++ src/net/eathena/protocol.h | 2 ++ src/net/tmwa/chathandler.cpp | 7 +++++++ src/net/tmwa/chathandler.h | 5 +++++ 6 files changed, 34 insertions(+) (limited to 'src/net') diff --git a/src/net/chathandler.h b/src/net/chathandler.h index b3acf6384..0246978df 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -59,6 +59,8 @@ class ChatHandler notfinal virtual void unIgnoreAll() const = 0; virtual void clear() = 0; + + virtual void createChatRoom(const std::string &title, const std::string &password, const int limit, const bool isPublic) = 0; }; } // namespace Net diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index d55a93dbb..414c6e4df 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -221,6 +221,19 @@ void ChatHandler::unIgnoreAll() const outMsg.writeInt8(1, "flag"); } +void ChatHandler::createChatRoom(const std::string &title, + const std::string &password, + const int limit, + const bool isPublic) +{ + MessageOut outMsg(CMSG_CREAYE_CHAT_ROOM); + outMsg.writeInt16(password.size() + title.size() + 5, "len"); + outMsg.writeInt16(static_cast(limit), "limit"); + outMsg.writeInt8(isPublic ? 1 : 0, "public"); + outMsg.writeString(password, 8, "password"); + outMsg.writeString(title, 36, "title"); +} + void ChatHandler::processChat(Net::MessageIn &msg) { BLOCK_START("ChatHandler::processChat") diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h index 05f2f7217..119651ef4 100644 --- a/src/net/eathena/chathandler.h +++ b/src/net/eathena/chathandler.h @@ -56,6 +56,11 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void unIgnoreAll() const override final; + void createChatRoom(const std::string &title, + const std::string &password, + const int limit, + const bool isPublic) override final; + static void processRaw(MessageOut &restrict outMsg, const std::string &restrict line); diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index c4042d7b7..82b0b0c8d 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -226,6 +226,8 @@ #define CMSG_CHAT_WHISPER 0x0096 #define CMSG_CHAT_WHO 0x00c1 +#define CMSG_CREAYE_CHAT_ROOM 0x00d5 + #define CMSG_SKILL_LEVELUP_REQUEST 0x0112 #define CMSG_STAT_UPDATE_REQUEST 0x00bb #define CMSG_SKILL_USE_BEING 0x083c diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 3648197eb..895468b4b 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -246,6 +246,13 @@ void ChatHandler::unIgnoreAll() const outMsg.writeInt8(1, "flag"); } +void ChatHandler::createChatRoom(const std::string &title A_UNUSED, + const std::string &password A_UNUSED, + const int limit A_UNUSED, + const bool isPublic A_UNUSED) +{ +} + void ChatHandler::processChat(Net::MessageIn &msg) { BLOCK_START("ChatHandler::processChat") diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index a72dfb78a..52b88ebd7 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -59,6 +59,11 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler static void processRaw(MessageOut &restrict outMsg, const std::string &restrict line); + void createChatRoom(const std::string &title, + const std::string &password, + const int limit, + const bool isPublic) override final; + protected: void processChat(Net::MessageIn &msg); -- cgit v1.2.3-60-g2f50