From 3652f41912042501d55e7663315608e0cb8b3bf8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Aug 2015 16:39:23 +0300 Subject: Impliment packet SMSG_PLAYER_REFINE. --- src/net/eathena/inventoryhandler.cpp | 42 +++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'src/net/eathena/inventoryhandler.cpp') diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index d8a5a2a65..423679711 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -909,6 +909,7 @@ void InventoryHandler::processPlayerItemRentalTime(Net::MessageIn &msg) const ItemInfo &info = ItemDB::get(id); const std::string timeStr = timeDiffToString(seconds); NotifyManager::notify(NotifyTypes::RENTAL_TIME_LEFT, + // TRANSLATORS: notification message strprintf(_("Left %s rental time for item %s."), timeStr.c_str(), info.getName().c_str())); } @@ -1155,11 +1156,42 @@ void InventoryHandler::processPlayerIdentified(Net::MessageIn &msg) void InventoryHandler::processPlayerRefine(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - - msg.readInt16("flag"); - msg.readInt16("inv index"); - msg.readInt16("val"); + const int flag = msg.readInt16("flag"); + const int index = msg.readInt16("inv index") - INVENTORY_OFFSET; + msg.readInt16("refine"); + const Inventory *const inv = PlayerInfo::getInventory(); + const Item *item = nullptr; + int notifyType; + std::string message; + std::string itemName; + if (inv) + item = inv->getItem(index); + if (item) + { + itemName = item->getName(); + } + else + { + // TRANSLATORS: unknown item + itemName = _("Unknown item"); + } + switch (flag) + { + case 0: + notifyType = NotifyTypes::REFINE_SUCCESS; + break; + case 1: + notifyType = NotifyTypes::REFINE_FAILURE; + break; + case 2: + notifyType = NotifyTypes::REFINE_DOWNGRADE; + break; + default: + UNIMPLIMENTEDPACKET; + notifyType = NotifyTypes::REFINE_UNKNOWN; + break; + } + NotifyManager::notify(notifyType, itemName); } void InventoryHandler::processPlayerRepairList(Net::MessageIn &msg) -- cgit v1.2.3-60-g2f50