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/ea/buysellhandler.cpp | 21 --------------------- src/net/ea/buysellhandler.h | 3 --- src/net/eathena/buysellhandler.cpp | 4 ++++ src/net/eathena/buysellhandler.h | 4 ++++ src/net/tmwa/buysellhandler.cpp | 25 +++++++++++++++++++++++++ src/net/tmwa/buysellhandler.h | 4 ++++ 6 files changed, 37 insertions(+), 24 deletions(-) (limited to 'src/net') diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index 7d33492ce..e5403b270 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -59,27 +59,6 @@ BuySellHandler::BuySellHandler() mBuyDialog = nullptr; } -void BuySellHandler::requestSellList(const std::string &nick) const -{ - if (nick.empty() != 0 || !shopWindow) - return; - - const std::string data("!selllist " + toString(tick_time)); -// +++ need move to tmwa -#ifdef TMWA_SUPPORT - shopWindow->setAcceptPlayer(nick); -#endif - if (config.getBoolValue("hideShopMessages")) - { - chatHandler->privateMessage(nick, data); - } - else - { - if (chatWindow) - chatWindow->addWhisper(nick, data, ChatMsgType::BY_PLAYER); - } -} - void BuySellHandler::requestBuyList(const std::string &nick) const { if (nick.empty() || !shopWindow) diff --git a/src/net/ea/buysellhandler.h b/src/net/ea/buysellhandler.h index 95fcbb204..946064277 100644 --- a/src/net/ea/buysellhandler.h +++ b/src/net/ea/buysellhandler.h @@ -37,9 +37,6 @@ class BuySellHandler notfinal : public Net::BuySellHandler A_DELETE_COPY(BuySellHandler) - virtual void requestSellList(const std::string &nick) - const override final; - virtual void requestBuyList(const std::string &nick) const override final; diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index ce8b220d5..23228addd 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -128,4 +128,8 @@ void BuySellHandler::processNpcSellResponse(Net::MessageIn &msg) } } +void BuySellHandler::requestSellList(const std::string &nick A_UNUSED) const +{ +} + } // namespace EAthena diff --git a/src/net/eathena/buysellhandler.h b/src/net/eathena/buysellhandler.h index 9f2df6089..ce5e34ae6 100644 --- a/src/net/eathena/buysellhandler.h +++ b/src/net/eathena/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); 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); -- cgit v1.2.3-60-g2f50