From 75ddffb8941594a218ec23f86b8c16b5d54b728a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 5 Apr 2015 22:03:51 +0300 Subject: eathena: impliment packet SMSG_CHAT_ROOM_ROLE_CHANGE. --- src/net/eathena/chathandler.cpp | 17 ++++++++++++++--- src/resources/notifications.h | 4 ++++ src/resources/notifytypes.h | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index f4dd9c937..6aca795c2 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -959,9 +959,20 @@ void ChatHandler::processChatRoomSettings(Net::MessageIn &msg) void ChatHandler::processChatRoomRoleChange(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - msg.readInt32("role"); - msg.readString(24, "name"); + const int role = msg.readInt32("role"); + const std::string name = msg.readString(24, "name"); + switch(role) + { + case 0: + NotifyManager::notify(NotifyTypes::ROOM_ROLE_OWNER, name); + break; + case 1: + // dont show normal role + break; + default: + UNIMPLIMENTEDPACKET; + break; + } } void ChatHandler::processMVPItem(Net::MessageIn &msg) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 8249fef28..eb2b520c6 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -531,6 +531,10 @@ namespace NotifyManager // TRANSLATORS: notification message N_("%s kicked from room."), NotifyFlags::STRING}, + {"chat room role owner", + // TRANSLATORS: notification message + N_("%s role changed to room owner."), + NotifyFlags::STRING}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index d8d10b8a3..76c0118cf 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -151,6 +151,7 @@ namespace NotifyTypes ROOM_JOINED, ROOM_LEAVE, ROOM_KICKED, + ROOM_ROLE_OWNER, TYPE_END }; -- cgit v1.2.3-70-g09d2