diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-01 17:59:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-03-01 17:59:15 +0300 |
commit | c735249c6bc90c0e723c42e7c5b1276579609ec9 (patch) | |
tree | 631089153777345ec85b2c36c4da6a4777ee6fe8 /src/net/tmwa | |
parent | 4f9bf0141d5b96372eec33a545ba546a9622426c (diff) | |
download | plus-c735249c6bc90c0e723c42e7c5b1276579609ec9.tar.gz plus-c735249c6bc90c0e723c42e7c5b1276579609ec9.tar.bz2 plus-c735249c6bc90c0e723c42e7c5b1276579609ec9.tar.xz plus-c735249c6bc90c0e723c42e7c5b1276579609ec9.zip |
Move requestSellList from ea namespace into eathena and tmwa.
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); |