diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-28 21:29:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-28 21:29:09 +0300 |
commit | 510d030cbf0cca87e81801b1f484c24e8d4b7940 (patch) | |
tree | 3c90786df7b3b98590bdfd3acd958c6901856a8b | |
parent | b3fb42d3225282bc146847488a74536953a2d726 (diff) | |
download | manaplus-510d030cbf0cca87e81801b1f484c24e8d4b7940.tar.gz manaplus-510d030cbf0cca87e81801b1f484c24e8d4b7940.tar.bz2 manaplus-510d030cbf0cca87e81801b1f484c24e8d4b7940.tar.xz manaplus-510d030cbf0cca87e81801b1f484c24e8d4b7940.zip |
Build markethandler only if eathena enabled.
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | src/gui/windows/buydialog.cpp | 4 | ||||
-rw-r--r-- | src/net/markethandler.h | 3 | ||||
-rw-r--r-- | src/net/net.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/markethandler.h | 3 |
8 files changed, 20 insertions, 14 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38d74913d..a00a4552e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -539,7 +539,6 @@ SET(SRCS net/ea/inventoryitem.h net/logindata.h net/loginhandler.h - net/markethandler.h net/mercenaryhandler.h net/messagehandler.h net/messagein.cpp @@ -1337,8 +1336,6 @@ SET(SRCS_TMWA net/tmwa/itemhandler.h net/tmwa/loginhandler.cpp net/tmwa/loginhandler.h - net/tmwa/markethandler.cpp - net/tmwa/markethandler.h net/tmwa/mercenaryhandler.cpp net/tmwa/mercenaryhandler.h net/tmwa/messagehandler.cpp @@ -1393,6 +1390,8 @@ SET(SRCS_TMWAEATHENA net/tmwa/homunculushandler.h net/tmwa/mailhandler.cpp net/tmwa/mailhandler.h + net/tmwa/markethandler.cpp + net/tmwa/markethandler.h ) SET(SRCS_EATHENA @@ -1425,6 +1424,7 @@ SET(SRCS_EATHENA net/friendshandler.h net/homunculushandler.h net/mailhandler.h + net/markethandler.h net/eathena/adminhandler.cpp net/eathena/adminhandler.h net/eathena/auctionhandler.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 72c23b5a1..a5851cea7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -666,7 +666,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ net/logindata.h \ net/loginhandler.h \ net/mercenaryhandler.h \ - net/markethandler.h \ net/messagehandler.h \ net/messagein.cpp \ net/messagein.h \ @@ -1268,8 +1267,6 @@ manaplus_SOURCES += \ net/tmwa/itemhandler.h \ net/tmwa/loginhandler.cpp \ net/tmwa/loginhandler.h \ - net/tmwa/markethandler.cpp \ - net/tmwa/markethandler.h \ net/tmwa/mercenaryhandler.cpp \ net/tmwa/mercenaryhandler.h \ net/tmwa/messagehandler.cpp \ @@ -1324,7 +1321,9 @@ manaplus_SOURCES += net/tmwa/auctionhandler.cpp \ net/tmwa/homunculushandler.cpp \ net/tmwa/homunculushandler.h \ net/tmwa/mailhandler.cpp \ - net/tmwa/mailhandler.h + net/tmwa/mailhandler.h \ + net/tmwa/markethandler.cpp \ + net/tmwa/markethandler.h endif manaplus_CXXFLAGS += -DEATHENA_SUPPORT @@ -1357,6 +1356,7 @@ manaplus_SOURCES += gui/windows/bankwindow.cpp \ net/friendshandler.h \ net/homunculushandler.h \ net/mailhandler.h \ + net/markethandler.h \ net/eathena/adminhandler.cpp \ net/eathena/adminhandler.h \ net/eathena/auctionhandler.cpp \ diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index b19b88c18..e404a335b 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -447,6 +447,7 @@ void BuyDialog::action(const ActionEvent &event) } else if (mNpcId != Nick) { +#ifdef EATHENA_SUPPORT if (mNpcId == Market) { marketHandler->buyItem(item->getId(), @@ -456,7 +457,6 @@ void BuyDialog::action(const ActionEvent &event) item->increaseQuantity(-mAmountItems); item->update(); } -#ifdef EATHENA_SUPPORT else if (mNpcId == Cash) { cashShopHandler->buyItem(item->getPrice(), @@ -464,8 +464,8 @@ void BuyDialog::action(const ActionEvent &event) item->getColor(), mAmountItems); } -#endif else +#endif { npcHandler->buyItem(mNpcId, item->getId(), diff --git a/src/net/markethandler.h b/src/net/markethandler.h index a80cfcea0..f98b1b18d 100644 --- a/src/net/markethandler.h +++ b/src/net/markethandler.h @@ -21,6 +21,8 @@ #ifndef NET_MARKETHANDLER_H #define NET_MARKETHANDLER_H +#ifdef EATHENA_SUPPORT + #include <string> #include "localconsts.h" @@ -46,4 +48,5 @@ class MarketHandler notfinal extern Net::MarketHandler *marketHandler; +#endif // EATHENA_SUPPORT #endif // NET_MARKETHANDLER_H diff --git a/src/net/net.cpp b/src/net/net.cpp index 9c6d7df07..7b7afd157 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -50,6 +50,7 @@ namespace Net class FriendsHandler; class HomunculusHandler; class MailHandler; + class MarketHandler; #endif class AdminHandler; class BeingHandler; @@ -60,7 +61,6 @@ namespace Net class GeneralHandler; class GuildHandler; class InventoryHandler; - class MarketHandler; class MercenaryHandler; class NpcHandler; class PartyHandler; @@ -102,9 +102,9 @@ Net::FamilyHandler *familyHandler = nullptr; Net::FriendsHandler *friendsHandler = nullptr; Net::HomunculusHandler *homunculusHandler = nullptr; Net::MailHandler *mailHandler = nullptr; +Net::MarketHandler *marketHandler = nullptr; #endif Net::QuestHandler *questHandler = nullptr; -Net::MarketHandler *marketHandler = nullptr; Net::VendingHandler *vendingHandler = nullptr; Net::SearchStoreHandler *searchStoreHandler = nullptr; diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index a1b1f45bc..5acf3040c 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -115,9 +115,9 @@ GeneralHandler::GeneralHandler() : mFriendsHandler(new FriendsHandler), mHomunculusHandler(new HomunculusHandler), mMailHandler(new MailHandler), + mMarketHandler(new MarketHandler), #endif mMercenaryHandler(new MercenaryHandler), - mMarketHandler(new MarketHandler), mVendingHandler(new VendingHandler), mSearchStoreHandler(new SearchStoreHandler) { @@ -245,9 +245,9 @@ void GeneralHandler::load() mNetwork->registerHandler(mFriendsHandler); mNetwork->registerHandler(mHomunculusHandler); mNetwork->registerHandler(mMailHandler); + mNetwork->registerHandler(mMarketHandler); #endif mNetwork->registerHandler(mMercenaryHandler); - mNetwork->registerHandler(mMarketHandler); mNetwork->registerHandler(mVendingHandler); mNetwork->registerHandler(mSearchStoreHandler); } diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index dcd717b70..c037da7c2 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -91,9 +91,9 @@ class GeneralHandler final : public MessageHandler, MessageHandlerPtr mFriendsHandler; MessageHandlerPtr mHomunculusHandler; MessageHandlerPtr mMailHandler; + MessageHandlerPtr mMarketHandler; #endif MessageHandlerPtr mMercenaryHandler; - MessageHandlerPtr mMarketHandler; MessageHandlerPtr mVendingHandler; MessageHandlerPtr mSearchStoreHandler; }; diff --git a/src/net/tmwa/markethandler.h b/src/net/tmwa/markethandler.h index 5ac55d993..bf817ac04 100644 --- a/src/net/tmwa/markethandler.h +++ b/src/net/tmwa/markethandler.h @@ -21,6 +21,8 @@ #ifndef NET_TMWA_MARKETHANDLER_H #define NET_TMWA_MARKETHANDLER_H +#ifdef EATHENA_SUPPORT + #include "net/markethandler.h" #include "net/tmwa/messagehandler.h" @@ -47,4 +49,5 @@ class MarketHandler final : public MessageHandler, } // namespace TmwAthena +#endif // EATHENA_SUPPORT #endif // NET_TMWA_MARKETHANDLER_H |