summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-01 18:03:03 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-01 18:03:03 +0300
commit582ca3b9024277fa845aa7d5fd180b9c304b3513 (patch)
tree52356cd3d703c648e4876f800f66aae8b18999eb /src/net
parentc735249c6bc90c0e723c42e7c5b1276579609ec9 (diff)
downloadmanaplus-582ca3b9024277fa845aa7d5fd180b9c304b3513.tar.gz
manaplus-582ca3b9024277fa845aa7d5fd180b9c304b3513.tar.bz2
manaplus-582ca3b9024277fa845aa7d5fd180b9c304b3513.tar.xz
manaplus-582ca3b9024277fa845aa7d5fd180b9c304b3513.zip
Move requestBuyList from ea namespace into eathena and tmwa.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/buysellhandler.cpp22
-rw-r--r--src/net/ea/buysellhandler.h5
-rw-r--r--src/net/eathena/buysellhandler.cpp4
-rw-r--r--src/net/eathena/buysellhandler.h3
-rw-r--r--src/net/tmwa/buysellhandler.cpp19
-rw-r--r--src/net/tmwa/buysellhandler.h3
6 files changed, 30 insertions, 26 deletions
diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp
index e5403b270..990ec8716 100644
--- a/src/net/ea/buysellhandler.cpp
+++ b/src/net/ea/buysellhandler.cpp
@@ -59,28 +59,6 @@ BuySellHandler::BuySellHandler()
mBuyDialog = nullptr;
}
-void BuySellHandler::requestBuyList(const std::string &nick) const
-{
- if (nick.empty() || !shopWindow)
- return;
-
- const std::string data("!buylist " + 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::sendBuyRequest(const std::string &nick,
const ShopItem *const item,
const int amount) const
diff --git a/src/net/ea/buysellhandler.h b/src/net/ea/buysellhandler.h
index 946064277..d3a510ec2 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 requestBuyList(const std::string &nick)
- const override final;
-
virtual void sendBuyRequest(const std::string &nick,
const ShopItem *const item,
const int amount) const override final;
@@ -48,13 +45,13 @@ class BuySellHandler notfinal : public Net::BuySellHandler
const ShopItem *const item,
const int amount) const override final;
+ protected:
static void processNpcBuySellChoice(Net::MessageIn &msg);
static void processNpcSell(Net::MessageIn &msg);
static void processNpcBuyResponse(Net::MessageIn &msg);
- protected:
static int mNpcId;
static BuyDialog *mBuyDialog;
};
diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp
index 23228addd..1caead3c7 100644
--- a/src/net/eathena/buysellhandler.cpp
+++ b/src/net/eathena/buysellhandler.cpp
@@ -132,4 +132,8 @@ void BuySellHandler::requestSellList(const std::string &nick A_UNUSED) const
{
}
+void BuySellHandler::requestBuyList(const std::string &nick A_UNUSED) const
+{
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/buysellhandler.h b/src/net/eathena/buysellhandler.h
index ce5e34ae6..f28ba322e 100644
--- a/src/net/eathena/buysellhandler.h
+++ b/src/net/eathena/buysellhandler.h
@@ -42,6 +42,9 @@ class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler
void requestSellList(const std::string &nick)
const override final;
+ void requestBuyList(const std::string &nick)
+ const override final;
+
protected:
static void processNpcBuy(Net::MessageIn &msg);
diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp
index 499cccaa6..2e5f79127 100644
--- a/src/net/tmwa/buysellhandler.cpp
+++ b/src/net/tmwa/buysellhandler.cpp
@@ -161,4 +161,23 @@ void BuySellHandler::requestSellList(const std::string &nick) const
}
}
+void BuySellHandler::requestBuyList(const std::string &nick) const
+{
+ if (nick.empty() || !shopWindow)
+ return;
+
+ const std::string data("!buylist " + 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 4197eda81..01137e5f8 100644
--- a/src/net/tmwa/buysellhandler.h
+++ b/src/net/tmwa/buysellhandler.h
@@ -42,6 +42,9 @@ class BuySellHandler final : public MessageHandler, public Ea::BuySellHandler
void requestSellList(const std::string &nick)
const override final;
+ void requestBuyList(const std::string &nick)
+ const override final;
+
protected:
static void processNpcBuy(Net::MessageIn &msg);