summaryrefslogtreecommitdiff
path: root/src/net/eathena/cashshophandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-24 13:30:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-24 13:31:53 +0300
commit21a671a5de9876ae79112b7a6da1259c2198300f (patch)
treee08a381563f199dafb2bded63b985404c3f6d4be /src/net/eathena/cashshophandler.cpp
parentc312bd7e397cb7d54731d1184873bb70f5a9e403 (diff)
downloadmanaplus-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.cpp21
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