From 4b5f5a0718db7074c32be2fff266a6bf77dbb518 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 5 Apr 2015 22:18:33 +0300 Subject: eathena: impliment packet SMSG_CHAT_ROOM_JOIN_FAILED. --- src/net/eathena/chathandler.cpp | 31 +++++++++++++++++++++++++++++-- src/resources/notifications.h | 28 ++++++++++++++++++++++++++++ src/resources/notifytypes.h | 7 +++++++ 3 files changed, 64 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 6aca795c2..a8f9709ed 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -932,8 +932,35 @@ void ChatHandler::processChatRoomDestroy(Net::MessageIn &msg) void ChatHandler::processChatRoomJoinFailed(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - msg.readUInt8("flag"); + const int result = msg.readUInt8("flag"); + switch(result) + { + case 0: + NotifyManager::notify(NotifyTypes::ROOM_ERROR_FULL); + break; + case 1: + NotifyManager::notify(NotifyTypes::ROOM_ERROR_WRONG_PASSWORD); + break; + case 2: + NotifyManager::notify(NotifyTypes::ROOM_ERROR_KICKED); + break; + case 3: + break; + case 4: + NotifyManager::notify(NotifyTypes::ROOM_ERROR_ZENY); + break; + case 5: + NotifyManager::notify(NotifyTypes::ROOM_ERROR_LOW_LEVEL); + break; + case 6: + NotifyManager::notify(NotifyTypes::ROOM_ERROR_HIGH_LEVEL); + break; + case 7: + NotifyManager::notify(NotifyTypes::ROOM_ERROR_RACE); + break; + default: + UNIMPLIMENTEDPACKET; + } } void ChatHandler::processChatRoomAddMember(Net::MessageIn &msg) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index eb2b520c6..5f3eeb5d5 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -535,6 +535,34 @@ namespace NotifyManager // TRANSLATORS: notification message N_("%s role changed to room owner."), NotifyFlags::STRING}, + {"chat room error full", + // TRANSLATORS: notification message + N_("Room join failed. Room full."), + NotifyFlags::EMPTY}, + {"chat room error password", + // TRANSLATORS: notification message + N_("Room join failed. Wrong password."), + NotifyFlags::EMPTY}, + {"chat room error kicked", + // TRANSLATORS: notification message + N_("Room join failed. Kicked from room."), + NotifyFlags::EMPTY}, + {"chat room error zeny", + // TRANSLATORS: notification message + N_("Room join failed. Not enought money."), + NotifyFlags::EMPTY}, + {"chat room error low level", + // TRANSLATORS: notification message + N_("Room join failed. Too low level."), + NotifyFlags::EMPTY}, + {"chat room error high level", + // TRANSLATORS: notification message + N_("Room join failed. Too high level."), + NotifyFlags::EMPTY}, + {"chat room error race", + // TRANSLATORS: notification message + N_("Room join failed. Wrong race."), + NotifyFlags::EMPTY}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H diff --git a/src/resources/notifytypes.h b/src/resources/notifytypes.h index 76c0118cf..0b1a9285b 100644 --- a/src/resources/notifytypes.h +++ b/src/resources/notifytypes.h @@ -152,6 +152,13 @@ namespace NotifyTypes ROOM_LEAVE, ROOM_KICKED, ROOM_ROLE_OWNER, + ROOM_ERROR_FULL, + ROOM_ERROR_WRONG_PASSWORD, + ROOM_ERROR_KICKED, + ROOM_ERROR_ZENY, + ROOM_ERROR_LOW_LEVEL, + ROOM_ERROR_HIGH_LEVEL, + ROOM_ERROR_RACE, TYPE_END }; -- cgit v1.2.3-70-g09d2