From 76087008664d96b492fde077bb8b8e632ea30ba8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 21 Aug 2015 15:37:42 +0300 Subject: Impliment packet SMSG_PLAYER_ITEM_RENTAL_TIME (hercules). --- src/net/eathena/inventoryhandler.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 61d081434..ff5871d93 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -47,6 +47,11 @@ #include "net/ea/eaprotocol.h" #include "net/ea/equipbackend.h" +#include "resources/iteminfo.h" + +#include "utils/gettext.h" +#include "utils/stringutils.h" + #include "debug.h" extern Net::InventoryHandler *inventoryHandler; @@ -899,10 +904,13 @@ void InventoryHandler::selectEgg(const Item *const item) const void InventoryHandler::processPlayerItemRentalTime(Net::MessageIn &msg) { - UNIMPLIMENTEDPACKET; - // +++ need update item rental time - msg.readInt16("item id"); - msg.readInt32("seconds"); + const int id = msg.readInt16("item id"); + const int seconds = msg.readInt32("seconds"); + const ItemInfo &info = ItemDB::get(id); + const std::string timeStr = timeDiffToString(seconds); + NotifyManager::notify(NotifyTypes::RENTAL_TIME_LEFT, + strprintf(_("Left %s rental time for item %s."), + timeStr.c_str(), info.getName().c_str())); } void InventoryHandler::processPlayerItemRentalExpired(Net::MessageIn &msg) -- cgit v1.2.3-70-g09d2