From d6f607842bb91d2f76b6d677e4e899de50fa27cf Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 26 Mar 2015 21:48:29 +0300 Subject: eathena: add packet CMSG_NPC_SHOP_CLOSE 0x09d4. --- src/net/buysellhandler.h | 2 ++ src/net/eathena/buysellhandler.cpp | 6 ++++++ src/net/eathena/buysellhandler.h | 2 ++ src/net/eathena/protocol.h | 1 + src/net/tmwa/buysellhandler.cpp | 4 ++++ src/net/tmwa/buysellhandler.h | 2 ++ 6 files changed, 17 insertions(+) diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h index 2b073f7ef..ebb42d2a4 100644 --- a/src/net/buysellhandler.h +++ b/src/net/buysellhandler.h @@ -49,6 +49,8 @@ class BuySellHandler notfinal virtual void sendSellRequest(const std::string &nick, const ShopItem *const item, const int amount) const = 0; + + virtual void close() const = 0; }; } // namespace Net diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index 1d1b81788..a810feac7 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -30,6 +30,7 @@ #include "gui/windows/buydialog.h" +#include "net/eathena/messageout.h" #include "net/eathena/protocol.h" #include "resources/notifytypes.h" @@ -148,4 +149,9 @@ void BuySellHandler::sendSellRequest(const std::string &nick A_UNUSED, { } +void BuySellHandler::close() const +{ + createOutPacket(CMSG_NPC_SHOP_CLOSE); +} + } // namespace EAthena diff --git a/src/net/eathena/buysellhandler.h b/src/net/eathena/buysellhandler.h index 5e09d0abe..5a967a55f 100644 --- a/src/net/eathena/buysellhandler.h +++ b/src/net/eathena/buysellhandler.h @@ -53,6 +53,8 @@ class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler const ShopItem *const item, const int amount) const override final; + void close() const override final; + protected: static void processNpcBuy(Net::MessageIn &msg); diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index c55afa3ac..81c062f79 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -613,6 +613,7 @@ #define CMSG_NPC_IDENTIFY 0x0178 #define CMSG_NPC_SELECT_ARROW 0x01ae #define CMSG_NPC_SELECT_AUTO_SPELL 0x01ce +#define CMSG_NPC_SHOP_CLOSE 0x09d4 #define CMSG_PLAYER_MAPMOVE 0x0140 #define CMSG_REMOVE_OPTION 0x012a diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index bbf5ca3e7..e63559d20 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -217,4 +217,8 @@ void BuySellHandler::sendSellRequest(const std::string &nick, chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); } +void BuySellHandler::close() const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/buysellhandler.h b/src/net/tmwa/buysellhandler.h index 8730cab7e..6547ef05b 100644 --- a/src/net/tmwa/buysellhandler.h +++ b/src/net/tmwa/buysellhandler.h @@ -53,6 +53,8 @@ class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler const ShopItem *const item, const int amount) const override final; + void close() const override final; + protected: static void processNpcBuy(Net::MessageIn &msg); -- cgit v1.2.3-60-g2f50