diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-07 14:42:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-07 15:26:06 +0300 |
commit | 9f37c6e32dedd9b91aae09038de5e3fa1ab84513 (patch) | |
tree | 56367610011c7c5fe741b56b5afdb732eb66be62 | |
parent | f52847a08113f09459d620cc5d91193b38d7a064 (diff) | |
download | manaverse-9f37c6e32dedd9b91aae09038de5e3fa1ab84513.tar.gz manaverse-9f37c6e32dedd9b91aae09038de5e3fa1ab84513.tar.bz2 manaverse-9f37c6e32dedd9b91aae09038de5e3fa1ab84513.tar.xz manaverse-9f37c6e32dedd9b91aae09038de5e3fa1ab84513.zip |
eathena: add packet CMSG_VENDING_BUY 0x0134.
-rw-r--r-- | src/net/eathena/protocol.h | 1 | ||||
-rw-r--r-- | src/net/eathena/vendinghandler.cpp | 14 | ||||
-rw-r--r-- | src/net/eathena/vendinghandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/vendinghandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/vendinghandler.h | 4 | ||||
-rw-r--r-- | src/net/vendinghandler.h | 4 |
6 files changed, 33 insertions, 0 deletions
diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index ff985053b..f10ec6163 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -535,5 +535,6 @@ #define CMSG_VENDING_CLOSE 0x012e #define CMSG_VENDING_LIST_REQ 0x0130 +#define CMSG_VENDING_BUY 0x0134 #endif // NET_EATHENA_PROTOCOL_H diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp index 0b145e3e7..e16e26fd8 100644 --- a/src/net/eathena/vendinghandler.cpp +++ b/src/net/eathena/vendinghandler.cpp @@ -168,4 +168,18 @@ void VendingHandler::open(const Being *const being) const outMsg.writeInt32(being->getId(), "account id"); } +void VendingHandler::buy(const Being *const being, + const int index, + const int amount) const +{ + if (!being) + return; + + createOutPacket(CMSG_VENDING_BUY); + outMsg.writeInt16(12, "len"); + outMsg.writeInt32(being->getId(), "account id"); + outMsg.writeInt16(amount, "amount"); + outMsg.writeInt16(index, "index"); +} + } // namespace EAthena diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h index 7e0bb8368..ef18f4ce2 100644 --- a/src/net/eathena/vendinghandler.h +++ b/src/net/eathena/vendinghandler.h @@ -41,6 +41,10 @@ class VendingHandler final : public MessageHandler, void open(const Being *const being) const override final; + void buy(const Being *const being, + const int index, + const int amount) const override final; + protected: static void processOpenReq(Net::MessageIn &msg); diff --git a/src/net/tmwa/vendinghandler.cpp b/src/net/tmwa/vendinghandler.cpp index b32238c1f..b638ba6ee 100644 --- a/src/net/tmwa/vendinghandler.cpp +++ b/src/net/tmwa/vendinghandler.cpp @@ -50,4 +50,10 @@ void VendingHandler::open(const Being *const being A_UNUSED) const { } +void VendingHandler::buy(const Being *const being A_UNUSED, + const int index A_UNUSED, + const int amount A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/vendinghandler.h b/src/net/tmwa/vendinghandler.h index 1bbc42d06..fee23c0be 100644 --- a/src/net/tmwa/vendinghandler.h +++ b/src/net/tmwa/vendinghandler.h @@ -41,6 +41,10 @@ class VendingHandler final : public MessageHandler, void close() const override final; void open(const Being *const being) const override final; + + void buy(const Being *const being, + const int index, + const int amount) const override final; }; } // namespace TmwAthena diff --git a/src/net/vendinghandler.h b/src/net/vendinghandler.h index fb3ef4b4a..af8f39acc 100644 --- a/src/net/vendinghandler.h +++ b/src/net/vendinghandler.h @@ -39,6 +39,10 @@ class VendingHandler notfinal virtual void close() const = 0; virtual void open(const Being *const being) const = 0; + + virtual void buy(const Being *const being, + const int index, + const int amount) const = 0; }; } // namespace Net |