diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-05 21:40:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-06 01:56:15 +0300 |
commit | b956661094109ae89ea87550cec5a9a6ed9eaa90 (patch) | |
tree | eb08269175d0ab08d16d1884e713578c4a71bf24 /src/net/eathena | |
parent | cb847e9e671f6d65f177686ae8544525c8f53763 (diff) | |
download | plus-b956661094109ae89ea87550cec5a9a6ed9eaa90.tar.gz plus-b956661094109ae89ea87550cec5a9a6ed9eaa90.tar.bz2 plus-b956661094109ae89ea87550cec5a9a6ed9eaa90.tar.xz plus-b956661094109ae89ea87550cec5a9a6ed9eaa90.zip |
eathena: impliment packet SMSG_CHAT_ROOM_LEAVE.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/chathandler.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 3038628ab..f4dd9c937 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -710,10 +710,36 @@ void ChatHandler::processChatRoomJoinAck(Net::MessageIn &msg) void ChatHandler::processChatRoomLeave(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; msg.readInt16("users"); - msg.readString(24, "name"); - msg.readUInt8("flag"); // 0 - left, 1 - kicked + const std::string name = msg.readString(24, "name"); + const int status = msg.readUInt8("flag"); // 0 - left, 1 - kicked + switch(status) + { + case 0: + NotifyManager::notify(NotifyTypes::ROOM_LEAVE, name); + break; + case 1: + NotifyManager::notify(NotifyTypes::ROOM_KICKED, name); + break; + default: + UNIMPLIMENTEDPACKET; + break; + } + if (name == localPlayer->getName()) + { + if (chatWindow) + chatWindow->joinRoom(false); + PlayerInfo::setRoomName(std::string()); + if (localPlayer) + localPlayer->setChat(nullptr); + } + else + { + Being *const being = actorManager->findBeingByName( + name, ActorType::Player); + if (being) + being->setChat(nullptr); + } } void ChatHandler::joinChannel(const std::string &channel) |