summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-29 12:36:24 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-29 12:36:24 +0300
commit23b0787ad33fc01e3a65bd53f2d8bc9f52a91224 (patch)
tree4cf293d3c4afd9a9c40b454b811a62f70a296818
parent523c9239668819844966097bd82445863d89103f (diff)
downloadmanaverse-23b0787ad33fc01e3a65bd53f2d8bc9f52a91224.tar.gz
manaverse-23b0787ad33fc01e3a65bd53f2d8bc9f52a91224.tar.bz2
manaverse-23b0787ad33fc01e3a65bd53f2d8bc9f52a91224.tar.xz
manaverse-23b0787ad33fc01e3a65bd53f2d8bc9f52a91224.zip
eathena: add packet CMSG_SET_CHAT_ROOM_OPTIONS 0x00de.
-rw-r--r--src/net/chathandler.h5
-rw-r--r--src/net/eathena/chathandler.cpp14
-rw-r--r--src/net/eathena/chathandler.h5
-rw-r--r--src/net/eathena/protocol.h1
-rw-r--r--src/net/tmwa/chathandler.cpp7
-rw-r--r--src/net/tmwa/chathandler.h5
6 files changed, 37 insertions, 0 deletions
diff --git a/src/net/chathandler.h b/src/net/chathandler.h
index fb8a1ab59..404ee6ab5 100644
--- a/src/net/chathandler.h
+++ b/src/net/chathandler.h
@@ -85,6 +85,11 @@ class ChatHandler notfinal
virtual void joinChat(const ChatObject *const chat,
const std::string &password) const = 0;
+
+ virtual void setChatRoomOptions(const int limit,
+ const bool isPublic,
+ const std::string &password,
+ const std::string &title) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp
index 78e909d62..ad30750a5 100644
--- a/src/net/eathena/chathandler.cpp
+++ b/src/net/eathena/chathandler.cpp
@@ -944,4 +944,18 @@ void ChatHandler::leaveChatRoom() const
createOutPacket(CMSG_LEAVE_CHAT_ROOM);
}
+void ChatHandler::setChatRoomOptions(const int limit,
+ const bool isPublic,
+ const std::string &password,
+ const std::string &title) const
+{
+ createOutPacket(CMSG_SET_CHAT_ROOM_OPTIONS);
+ const int sz = title.size();
+ outMsg.writeInt16(15 + sz, "len");
+ outMsg.writeInt16(static_cast<int16_t>(limit), "limit");
+ outMsg.writeInt8(static_cast<int8_t>(isPublic ? 1 : 0), "type");
+ outMsg.writeString(password, 8, "password");
+ outMsg.writeString(title, sz, "title");
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h
index 174c70bfa..89fc7f43c 100644
--- a/src/net/eathena/chathandler.h
+++ b/src/net/eathena/chathandler.h
@@ -89,6 +89,11 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
void leaveChatRoom() const override final;
+ void setChatRoomOptions(const int limit,
+ const bool isPublic,
+ const std::string &password,
+ const std::string &title) const override final;
+
protected:
static std::string extractChannelFromMessage(std::string &chatMsg);
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h
index d290e3a20..d1b37bdbf 100644
--- a/src/net/eathena/protocol.h
+++ b/src/net/eathena/protocol.h
@@ -494,6 +494,7 @@
#define CMSG_CREAYE_CHAT_ROOM 0x00d5
#define CMSG_LEAVE_CHAT_ROOM 0x00e3
+#define CMSG_SET_CHAT_ROOM_OPTIONS 0x00de
#define CMSG_SKILL_LEVELUP_REQUEST 0x0112
#define CMSG_STAT_UPDATE_REQUEST 0x00bb
diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp
index 4b426e1d8..086426901 100644
--- a/src/net/tmwa/chathandler.cpp
+++ b/src/net/tmwa/chathandler.cpp
@@ -692,4 +692,11 @@ void ChatHandler::leaveChatRoom() const
{
}
+void ChatHandler::setChatRoomOptions(const int limit A_UNUSED,
+ const bool isPublict A_UNUSED,
+ const std::string &passwordt A_UNUSED,
+ const std::string &titlet A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h
index b5b5e2a36..ab90f71d3 100644
--- a/src/net/tmwa/chathandler.h
+++ b/src/net/tmwa/chathandler.h
@@ -87,6 +87,11 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler
void leaveChatRoom() const override final;
+ void setChatRoomOptions(const int limit,
+ const bool isPublic,
+ const std::string &password,
+ const std::string &title) const override final;
+
protected:
static void processChat(Net::MessageIn &msg);