diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-24 14:09:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-24 14:09:35 +0300 |
commit | 8f49aa549ba451768c6748ca0ffb2d5bdb5a0eaf (patch) | |
tree | 81583fc68b7886262c2caaa9d258372d15bb5852 /src/net | |
parent | 21a671a5de9876ae79112b7a6da1259c2198300f (diff) | |
download | manaplus-8f49aa549ba451768c6748ca0ffb2d5bdb5a0eaf.tar.gz manaplus-8f49aa549ba451768c6748ca0ffb2d5bdb5a0eaf.tar.bz2 manaplus-8f49aa549ba451768c6748ca0ffb2d5bdb5a0eaf.tar.xz manaplus-8f49aa549ba451768c6748ca0ffb2d5bdb5a0eaf.zip |
eathena: add packet CMSG_NPC_CASH_SHOP_BUY 0x0288.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/cashshophandler.h | 6 | ||||
-rw-r--r-- | src/net/eathena/cashshophandler.cpp | 14 | ||||
-rw-r--r-- | src/net/eathena/cashshophandler.h | 5 | ||||
-rw-r--r-- | src/net/eathena/protocol.h | 1 | ||||
-rw-r--r-- | src/net/tmwa/cashshophandler.cpp | 7 | ||||
-rw-r--r-- | src/net/tmwa/cashshophandler.h | 5 |
6 files changed, 38 insertions, 0 deletions
diff --git a/src/net/cashshophandler.h b/src/net/cashshophandler.h index 18af3f7ea..5ca5fd8af 100644 --- a/src/net/cashshophandler.h +++ b/src/net/cashshophandler.h @@ -33,6 +33,12 @@ class CashShopHandler notfinal public: virtual ~CashShopHandler() { } + + virtual void buy(const int points, + const int itemId, + const unsigned char color, + const int amount) const = 0; + }; } // namespace Net diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp index 39db23b04..56e7bac25 100644 --- a/src/net/eathena/cashshophandler.cpp +++ b/src/net/eathena/cashshophandler.cpp @@ -20,6 +20,7 @@ #include "net/eathena/cashshophandler.h" +#include "net/eathena/messageout.h" #include "net/eathena/protocol.h" #include "debug.h" @@ -68,4 +69,17 @@ void CashShopHandler::processCashShopOpen(Net::MessageIn &msg) } } +void CashShopHandler::buy(const int points, + const int itemId, + const unsigned char color A_UNUSED, + const int amount) const +{ + createOutPacket(CMSG_NPC_CASH_SHOP_BUY); + outMsg.writeInt16(10 + 4, "len"); + outMsg.writeInt32(points, "points"); + outMsg.writeInt16(1, "count"); + outMsg.writeInt16(amount, "amount"); + outMsg.writeInt16(itemId, "item id"); +} + } // namespace EAthena diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h index d0e42cc63..fa781f74a 100644 --- a/src/net/eathena/cashshophandler.h +++ b/src/net/eathena/cashshophandler.h @@ -37,6 +37,11 @@ class CashShopHandler final : public MessageHandler, void handleMessage(Net::MessageIn &msg) override final; + void buy(const int points, + const int itemId, + const unsigned char color, + const int amount) const override final; + protected: static void processCashShopOpen(Net::MessageIn &msg); }; diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 45c8e4d6e..53214e876 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -386,6 +386,7 @@ #define CMSG_NPC_SELL_REQUEST 0x00c9 #define CMSG_NPC_MARKET_CLOSE 0x09d8 #define CMSG_NPC_MARKET_BUY 0x09d6 +#define CMSG_NPC_CASH_SHOP_BUY 0x0288 #define CMSG_TRADE_REQUEST 0x00e4 #define CMSG_TRADE_RESPONSE 0x00e6 diff --git a/src/net/tmwa/cashshophandler.cpp b/src/net/tmwa/cashshophandler.cpp index 99acd6653..7eab823df 100644 --- a/src/net/tmwa/cashshophandler.cpp +++ b/src/net/tmwa/cashshophandler.cpp @@ -42,4 +42,11 @@ void CashShopHandler::handleMessage(Net::MessageIn &msg A_UNUSED) { } +void CashShopHandler::buy(const int points A_UNUSED, + const int itemId A_UNUSED, + const unsigned char color A_UNUSED, + const int amount A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/cashshophandler.h b/src/net/tmwa/cashshophandler.h index 9b7cf86e6..cbd558d9d 100644 --- a/src/net/tmwa/cashshophandler.h +++ b/src/net/tmwa/cashshophandler.h @@ -37,6 +37,11 @@ class CashShopHandler final : public MessageHandler, A_DELETE_COPY(CashShopHandler) void handleMessage(Net::MessageIn &msg) override final; + + void buy(const int points, + const int itemId, + const unsigned char color, + const int amount) const override final; }; } // namespace TmwAthena |