diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-24 13:30:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-24 13:31:53 +0300 |
commit | 21a671a5de9876ae79112b7a6da1259c2198300f (patch) | |
tree | e08a381563f199dafb2bded63b985404c3f6d4be /src/net/eathena/cashshophandler.cpp | |
parent | c312bd7e397cb7d54731d1184873bb70f5a9e403 (diff) | |
download | manaplus-21a671a5de9876ae79112b7a6da1259c2198300f.tar.gz manaplus-21a671a5de9876ae79112b7a6da1259c2198300f.tar.bz2 manaplus-21a671a5de9876ae79112b7a6da1259c2198300f.tar.xz manaplus-21a671a5de9876ae79112b7a6da1259c2198300f.zip |
eathena: add partial support for packet SMSG_NPC_CASH_SHOP_OPEN 0x0287.
Diffstat (limited to 'src/net/eathena/cashshophandler.cpp')
-rw-r--r-- | src/net/eathena/cashshophandler.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 |