From 21a671a5de9876ae79112b7a6da1259c2198300f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 Dec 2014 13:30:25 +0300 Subject: eathena: add partial support for packet SMSG_NPC_CASH_SHOP_OPEN 0x0287. --- src/net/eathena/cashshophandler.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/net/eathena/cashshophandler.cpp') diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp index 5e105babe..39db23b04 100644 --- a/src/net/eathena/cashshophandler.cpp +++ b/src/net/eathena/cashshophandler.cpp @@ -20,6 +20,8 @@ #include "net/eathena/cashshophandler.h" +#include "net/eathena/protocol.h" + #include "debug.h" extern Net::CashShopHandler *cashShopHandler; @@ -32,6 +34,7 @@ CashShopHandler::CashShopHandler() : { static const uint16_t _messages[] = { + SMSG_NPC_CASH_SHOP_OPEN, 0 }; handledMessages = _messages; @@ -42,9 +45,27 @@ void CashShopHandler::handleMessage(Net::MessageIn &msg) { switch (msg.getId()) { + case SMSG_NPC_CASH_SHOP_OPEN: + processCashShopOpen(msg); + break; + default: break; } } +void CashShopHandler::processCashShopOpen(Net::MessageIn &msg) +{ + const int count = (msg.readInt16("len") - 12) / 11; + msg.readInt32("cash points"); + msg.readInt32("kafra points"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("price"); + msg.readInt32("discount price"); + msg.readUInt8("item type"); + msg.readInt16("item id"); + } +} + } // namespace EAthena -- cgit v1.2.3-70-g09d2