summaryrefslogtreecommitdiff
path: root/src/net/eathena/chathandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-06 01:29:08 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-06 01:56:54 +0300
commitf47097a4d585d91852fca51dd347faed92816839 (patch)
tree9bbde1334cfeff5e6772979a917cf1909b90a36d /src/net/eathena/chathandler.cpp
parent3acb4aa3b1248719a3896b419600864a68c65908 (diff)
downloadmv-f47097a4d585d91852fca51dd347faed92816839.tar.gz
mv-f47097a4d585d91852fca51dd347faed92816839.tar.bz2
mv-f47097a4d585d91852fca51dd347faed92816839.tar.xz
mv-f47097a4d585d91852fca51dd347faed92816839.zip
eathena: impliment packet SMSG_CHAT_ROOM_SETTINGS.
Diffstat (limited to 'src/net/eathena/chathandler.cpp')
-rw-r--r--src/net/eathena/chathandler.cpp24
1 files changed, 18 insertions, 6 deletions
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)