From f47097a4d585d91852fca51dd347faed92816839 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 6 Apr 2015 01:29:08 +0300 Subject: eathena: impliment packet SMSG_CHAT_ROOM_SETTINGS. --- src/net/eathena/chathandler.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index e35fcbc8b..f7ef27cb5 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -974,14 +974,26 @@ void ChatHandler::processChatRoomAddMember(Net::MessageIn &msg) void ChatHandler::processChatRoomSettings(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; const int sz = msg.readInt16("len") - 17; - msg.readInt32("owner id"); - msg.readInt32("chat id"); - msg.readInt16("limit"); + const int ownerId = msg.readInt32("owner id"); + const int chatId = msg.readInt32("chat id"); + const int limit = msg.readInt16("limit"); msg.readInt16("users"); - msg.readUInt8("type"); - msg.readString(sz, "title"); + const int type = msg.readUInt8("type"); + const std::string &title = msg.readString(sz, "title"); + ChatObject *const chat = localPlayer->getChat(); + if (chat && chat->chatId == chatId) + { + chat->ownerId = ownerId; + chat->maxUsers = limit; + chat->type = type; + if (chat->title != title) + { + chat->title = title; + actorManager->updateRoom(chat); + chatWindow->joinRoom(true); + } + } } void ChatHandler::processChatRoomRoleChange(Net::MessageIn &msg) -- cgit v1.2.3-70-g09d2