diff options
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/chathandler.cpp | 23 | ||||
-rw-r--r-- | src/net/eathena/chathandler.h | 3 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 57d57ca6c..de66468e2 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -55,6 +55,8 @@ extern Net::ChatHandler *chatHandler; namespace EAthena { +std::string ChatHandler::mChatRoom; + ChatHandler::ChatHandler() : MessageHandler(), Ea::ChatHandler() @@ -393,11 +395,12 @@ void ChatHandler::createChatRoom(const std::string &title, { createOutPacket(CMSG_CREAYE_CHAT_ROOM); outMsg.writeInt16(static_cast<int16_t>( - password.size() + title.size() + 5), "len"); + 7 + 8 + 36), "len"); outMsg.writeInt16(static_cast<int16_t>(limit), "limit"); outMsg.writeInt8(static_cast<int8_t>(isPublic ? 1 : 0), "public"); outMsg.writeString(password, 8, "password"); outMsg.writeString(title, 36, "title"); + mChatRoom = title; } void ChatHandler::battleTalk(const std::string &text) const @@ -845,8 +848,22 @@ void ChatHandler::talkPet(const std::string &restrict text, void ChatHandler::processChatRoomCreateAck(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - msg.readUInt8("flag"); + const int result = msg.readUInt8("flag"); + switch(result) + { + case 0: + chatWindow->addChatRoomTab(mChatRoom, true); + break; + case 1: + NotifyManager::notify(NotifyTypes::ROOM_LIMIT_EXCEEDED); + break; + case 2: + NotifyManager::notify(NotifyTypes::ROOM_ALREADY_EXISTS); + break; + default: + UNIMPLIMENTEDPACKET; + break; + } } void ChatHandler::processChatRoomDestroy(Net::MessageIn &msg) diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h index 879217b41..c0807c37a 100644 --- a/src/net/eathena/chathandler.h +++ b/src/net/eathena/chathandler.h @@ -166,6 +166,9 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler static void processBattleChatMessage(Net::MessageIn &msg); static void processScriptMessage(Net::MessageIn &msg); + + private: + static std::string mChatRoom; }; } // namespace EAthena |