From 08d9fbf5d4fb388bc186729a1174bf4aef0f8095 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 22 Aug 2015 16:27:04 +0300 Subject: Impliment packet SMSG_PLAYER_CART_ADD_ERROR. --- src/enums/resources/notifytypes.h | 2 ++ src/net/eathena/inventoryhandler.cpp | 14 +++++++++++--- src/resources/notifications.h | 8 ++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/enums/resources/notifytypes.h b/src/enums/resources/notifytypes.h index 19703fa75..e30b5844c 100644 --- a/src/enums/resources/notifytypes.h +++ b/src/enums/resources/notifytypes.h @@ -179,6 +179,8 @@ namespace NotifyTypes REFINE_FAILURE, REFINE_DOWNGRADE, REFINE_UNKNOWN, + CART_ADD_WEIGHT_ERROR, + CART_ADD_COUNT_ERROR, TYPE_END }; diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 45ea1bc3a..0b3b12b5e 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -1278,9 +1278,17 @@ void InventoryHandler::processFavoriteItem(Net::MessageIn &msg) void InventoryHandler::processCartAddError(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - - msg.readUInt8("flag"); + switch(msg.readUInt8("flag")) + { + case 0: + NotifyManager::notify(NotifyTypes::CART_ADD_WEIGHT_ERROR); + break; + case 1: + NotifyManager::notify(NotifyTypes::CART_ADD_COUNT_ERROR); + break; + default: + break; + } } void InventoryHandler::processBindItem(Net::MessageIn &msg) diff --git a/src/resources/notifications.h b/src/resources/notifications.h index 40c377b4e..cf509b104 100644 --- a/src/resources/notifications.h +++ b/src/resources/notifications.h @@ -641,6 +641,14 @@ namespace NotifyManager // TRANSLATORS: notification message N_("Refine unknown for item %s."), NotifyFlags::STRING}, + {"cart add weight error", + // TRANSLATORS: notification message + N_("You can't add item to card because weight too high."), + NotifyFlags::EMPTY}, + {"cart add count error", + // TRANSLATORS: notification message + N_("You can't add item to card because too many items."), + NotifyFlags::EMPTY}, }; } // namespace NotifyManager #endif // RESOURCES_NOTIFICATIONS_H -- cgit v1.2.3-70-g09d2