From f52847a08113f09459d620cc5d91193b38d7a064 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 7 Jan 2015 14:12:55 +0300 Subject: eathena: add packet CMSG_VENDING_LIST_REQ 0x0130. --- src/net/eathena/protocol.h | 1 + src/net/eathena/vendinghandler.cpp | 11 +++++++++++ src/net/eathena/vendinghandler.h | 2 ++ src/net/tmwa/vendinghandler.cpp | 4 ++++ src/net/tmwa/vendinghandler.h | 2 ++ src/net/vendinghandler.h | 4 ++++ 6 files changed, 24 insertions(+) (limited to 'src/net') diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index a6f14c109..ff985053b 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -534,5 +534,6 @@ #define CMSG_AUCTION_BUY_SELL 0x025c #define CMSG_VENDING_CLOSE 0x012e +#define CMSG_VENDING_LIST_REQ 0x0130 #endif // NET_EATHENA_PROTOCOL_H diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp index dd1d7e7cc..0b145e3e7 100644 --- a/src/net/eathena/vendinghandler.cpp +++ b/src/net/eathena/vendinghandler.cpp @@ -20,6 +20,8 @@ #include "net/eathena/vendinghandler.h" +#include "being/being.h" + #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -157,4 +159,13 @@ void VendingHandler::close() const createOutPacket(CMSG_VENDING_CLOSE); } +void VendingHandler::open(const Being *const being) const +{ + if (!being) + return; + + createOutPacket(CMSG_VENDING_LIST_REQ); + outMsg.writeInt32(being->getId(), "account id"); +} + } // namespace EAthena diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h index cf451e8fa..7e0bb8368 100644 --- a/src/net/eathena/vendinghandler.h +++ b/src/net/eathena/vendinghandler.h @@ -39,6 +39,8 @@ class VendingHandler final : public MessageHandler, void close() const override final; + void open(const Being *const being) 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 459acfaa5..b32238c1f 100644 --- a/src/net/tmwa/vendinghandler.cpp +++ b/src/net/tmwa/vendinghandler.cpp @@ -46,4 +46,8 @@ void VendingHandler::close() const { } +void VendingHandler::open(const Being *const being A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/vendinghandler.h b/src/net/tmwa/vendinghandler.h index 961f3c8df..1bbc42d06 100644 --- a/src/net/tmwa/vendinghandler.h +++ b/src/net/tmwa/vendinghandler.h @@ -39,6 +39,8 @@ class VendingHandler final : public MessageHandler, void handleMessage(Net::MessageIn &msg) override final; void close() const override final; + + void open(const Being *const being) const override final; }; } // namespace TmwAthena diff --git a/src/net/vendinghandler.h b/src/net/vendinghandler.h index e07e2c246..fb3ef4b4a 100644 --- a/src/net/vendinghandler.h +++ b/src/net/vendinghandler.h @@ -25,6 +25,8 @@ #include "localconsts.h" +class Being; + namespace Net { @@ -35,6 +37,8 @@ class VendingHandler notfinal { } virtual void close() const = 0; + + virtual void open(const Being *const being) const = 0; }; } // namespace Net -- cgit v1.2.3-60-g2f50