summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-01 17:59:15 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-01 17:59:15 +0300
commitc735249c6bc90c0e723c42e7c5b1276579609ec9 (patch)
tree631089153777345ec85b2c36c4da6a4777ee6fe8 /src
parent4f9bf0141d5b96372eec33a545ba546a9622426c (diff)
downloadplus-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')
-rw-r--r--src/net/ea/buysellhandler.cpp21
-rw-r--r--src/net/ea/buysellhandler.h3
-rw-r--r--src/net/eathena/buysellhandler.cpp4
-rw-r--r--src/net/eathena/buysellhandler.h4
-rw-r--r--src/net/tmwa/buysellhandler.cpp25
-rw-r--r--src/net/tmwa/buysellhandler.h4
6 files changed, 37 insertions, 24 deletions
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);