From c735249c6bc90c0e723c42e7c5b1276579609ec9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 1 Mar 2015 17:59:15 +0300 Subject: Move requestSellList from ea namespace into eathena and tmwa. --- src/net/tmwa/buysellhandler.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/net/tmwa/buysellhandler.cpp') 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 -- cgit v1.2.3-70-g09d2