diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-18 13:14:39 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-03-18 13:17:44 +0300 |
commit | 61b29214e3b5becfccf8b9264a12019be7290a0f (patch) | |
tree | 80d04ddcb8f7a3e6dad6f731807804f21576c93a /src/net/eathena | |
parent | eb351e02c9796a94d70734e54c5eb0f01ff623e7 (diff) | |
download | plus-61b29214e3b5becfccf8b9264a12019be7290a0f.tar.gz plus-61b29214e3b5becfccf8b9264a12019be7290a0f.tar.bz2 plus-61b29214e3b5becfccf8b9264a12019be7290a0f.tar.xz plus-61b29214e3b5becfccf8b9264a12019be7290a0f.zip |
eathena: add partial support for packet SMSG_NPC_CASH_TAB_PRICE_LIST 0x08c0.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/cashshophandler.cpp | 21 | ||||
-rw-r--r-- | src/net/eathena/cashshophandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packets.h | 2 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 |
4 files changed, 25 insertions, 1 deletions
diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp index a001b1f2e..f4ac1297c 100644 --- a/src/net/eathena/cashshophandler.cpp +++ b/src/net/eathena/cashshophandler.cpp @@ -49,6 +49,7 @@ CashShopHandler::CashShopHandler() : SMSG_NPC_CASH_BUY_ACK, SMSG_NPC_CASH_POINTS, SMSG_NPC_CASH_BUY, + SMSG_NPC_CASH_TAB_PRICE_LIST, 0 }; handledMessages = _messages; @@ -76,6 +77,10 @@ void CashShopHandler::handleMessage(Net::MessageIn &msg) processCashShopBuy(msg); break; + case SMSG_NPC_CASH_TAB_PRICE_LIST: + processCashShopTabPriceList(msg); + break; + default: break; } @@ -126,6 +131,22 @@ void CashShopHandler::processCashShopBuy(Net::MessageIn &msg) msg.readInt32("kafra points"); } +void CashShopHandler::processCashShopTabPriceList(Net::MessageIn &msg) +{ + UNIMPLIMENTEDPACKET; + const int count = (msg.readInt16("len") - 10) / 6; + msg.readInt32("tab"); + const int itemsCount = msg.readInt16("count"); + if (count != itemsCount) + logger->log("error: wrong list count"); + + for (int f = 0; f < count; f ++) + { + msg.readInt16("item id"); + msg.readInt32("price"); + } +} + void CashShopHandler::buyItem(const int points, const int itemId, const unsigned char color A_UNUSED, diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h index d122b6cc9..2dd7d206f 100644 --- a/src/net/eathena/cashshophandler.h +++ b/src/net/eathena/cashshophandler.h @@ -55,6 +55,8 @@ class CashShopHandler final : public MessageHandler, static void processCashShopBuy(Net::MessageIn &msg); + static void processCashShopTabPriceList(Net::MessageIn &msg); + static BuyDialog *mBuyDialog; }; diff --git a/src/net/eathena/packets.h b/src/net/eathena/packets.h index 31100d73b..8d4278f62 100644 --- a/src/net/eathena/packets.h +++ b/src/net/eathena/packets.h @@ -230,7 +230,7 @@ int16_t packet_lengths[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 12, 10, 0, 0, 0, 0, 0, // #0x08C0 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 2af772dc6..795523e24 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -197,6 +197,7 @@ #define SMSG_NPC_CASH_BUY_ACK 0x0289 #define SMSG_NPC_CASH_POINTS 0x0845 #define SMSG_NPC_CASH_BUY 0x0849 +#define SMSG_NPC_CASH_TAB_PRICE_LIST 0x08c0 #define SMSG_NPC_AREA 0x0b0b #define SMSG_NPC_SHOW_DIGIT 0x01b1 |