diff options
Diffstat (limited to 'src/net/tmwa')
-rw-r--r-- | src/net/tmwa/buysellhandler.cpp | 25 | ||||
-rw-r--r-- | src/net/tmwa/buysellhandler.h | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index 2f870c0a9..499cccaa6 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -22,6 +22,7 @@ #include "net/tmwa/buysellhandler.h" +#include "configuration.h" #include "notifymanager.h" #include "being/playerinfo.h" @@ -29,13 +30,19 @@ #include "enums/being/attributes.h" #include "gui/windows/buydialog.h" +#include "gui/windows/chatwindow.h" +#include "gui/windows/shopwindow.h" +#include "net/chathandler.h" #include "net/serverfeatures.h" #include "net/tmwa/protocol.h" #include "resources/notifytypes.h" +#include "utils/stringutils.h" +#include "utils/timer.h" + #include "debug.h" extern Net::BuySellHandler *buySellHandler; @@ -136,4 +143,22 @@ void BuySellHandler::processNpcSellResponse(Net::MessageIn &msg) } } +void BuySellHandler::requestSellList(const std::string &nick) const +{ + if (nick.empty() != 0 || !shopWindow) + return; + + const std::string data("!selllist " + toString(tick_time)); + shopWindow->setAcceptPlayer(nick); + if (config.getBoolValue("hideShopMessages")) + { + chatHandler->privateMessage(nick, data); + } + else + { + if (chatWindow) + chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); + } +} + } // namespace TmwAthena diff --git a/src/net/tmwa/buysellhandler.h b/src/net/tmwa/buysellhandler.h index b823ee2db..4197eda81 100644 --- a/src/net/tmwa/buysellhandler.h +++ b/src/net/tmwa/buysellhandler.h @@ -39,6 +39,10 @@ class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler void handleMessage(Net::MessageIn &msg) override final; + void requestSellList(const std::string &nick) + const override final; + + protected: static void processNpcBuy(Net::MessageIn &msg); static void processNpcSellResponse(Net::MessageIn &msg); |