diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-28 12:06:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-28 12:06:02 +0300 |
commit | a3a4d08701f03a9ce5b448d8666146afee876ada (patch) | |
tree | 7c4f5e279955993d6a2800b8ce62a1e265c05cf5 /src | |
parent | 1d886c8a482f95f92aa3f6d393435fa033eb56bb (diff) | |
download | mv-a3a4d08701f03a9ce5b448d8666146afee876ada.tar.gz mv-a3a4d08701f03a9ce5b448d8666146afee876ada.tar.bz2 mv-a3a4d08701f03a9ce5b448d8666146afee876ada.tar.xz mv-a3a4d08701f03a9ce5b448d8666146afee876ada.zip |
Remove auctionmanager.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/actions/commands.cpp | 6 | ||||
-rw-r--r-- | src/auctionmanager.cpp | 88 | ||||
-rw-r--r-- | src/auctionmanager.h | 56 | ||||
-rw-r--r-- | src/client.cpp | 2 | ||||
-rw-r--r-- | src/game.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_other.cpp | 5 | ||||
-rw-r--r-- | src/gui/windows/shopwindow.cpp | 19 |
9 files changed, 2 insertions, 187 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5adfbaae1..a7496a36c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -802,8 +802,6 @@ SET(SRCS animationdelayload.h particle/animationparticle.cpp particle/animationparticle.h - auctionmanager.cpp - auctionmanager.h avatar.cpp avatar.h being/being.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 7db751e22..8a212ba4c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -923,8 +923,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ animationdelayload.h \ particle/animationparticle.cpp \ particle/animationparticle.h \ - auctionmanager.cpp \ - auctionmanager.h \ avatar.cpp \ avatar.h \ being/being.cpp \ diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 4f3e05f86..2bcc26ad4 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -21,7 +21,6 @@ #include "actions/commands.h" #include "actormanager.h" -#include "auctionmanager.h" #include "configuration.h" #include "actions/actiondef.h" @@ -400,11 +399,6 @@ impHandler(imitation) impHandler(sendMail) { - if (auctionManager && auctionManager->getEnableAuctionBot()) - { - auctionManager->sendMail(event.args); - return true; - } return false; } diff --git a/src/auctionmanager.cpp b/src/auctionmanager.cpp deleted file mode 100644 index 38def08c7..000000000 --- a/src/auctionmanager.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "auctionmanager.h" - -#include "client.h" -#include "configuration.h" - -#include "net/chathandler.h" - -#include "debug.h" - -AuctionManager *auctionManager = nullptr; - -bool AuctionManager::mEnableAuctionBot = false; - -AuctionManager::AuctionManager() -{ -} - -AuctionManager::~AuctionManager() -{ -} - -void AuctionManager::init() -{ - if (auctionManager) - return; - - int val = serverConfig.getValue("enableAuctionBot", -1); - if (val == -1) - { - if (client->isTmw()) - val = 1; - else - val = 0; - serverConfig.setValue("enableAuctionBot", val); - } - mEnableAuctionBot = (val != 0); - if (mEnableAuctionBot) - auctionManager = new AuctionManager(); -} - -void AuctionManager::send(const std::string &msg) -{ - if (chatHandler) - chatHandler->privateMessage("AuctionBot", msg); -} - -/* -bool AuctionManager::processAuctionMessage(const std::string &msg) -{ - if (msg.size() > 4 && msg[0] == '#' && msg[1] == '#') - msg = msg.substr(3); - return false; -} -*/ - -void AuctionManager::clear() -{ -} - -void AuctionManager::reload() -{ -} - -void AuctionManager::sendMail(const std::string &mail) -{ - if (chatHandler) - chatHandler->privateMessage("AuctionBot", "!mail " + mail); -} diff --git a/src/auctionmanager.h b/src/auctionmanager.h deleted file mode 100644 index 6814d4c51..000000000 --- a/src/auctionmanager.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef AUCTIONMANAGER_H -#define AUCTIONMANAGER_H - -#include <string> - -#include "localconsts.h" - -class AuctionManager final -{ - public: - AuctionManager(); - - A_DELETE_COPY(AuctionManager) - - ~AuctionManager(); - - static void init(); - - static void send(const std::string &msg); - - static bool getEnableAuctionBot() A_WARN_UNUSED - { return mEnableAuctionBot; } - - void clear(); - - void reload(); - - static void sendMail(const std::string &mail); - - private: - static bool mEnableAuctionBot; -}; - -extern AuctionManager *auctionManager; - -#endif // AUCTIONMANAGER_H diff --git a/src/client.cpp b/src/client.cpp index 06a8a9db8..497717339 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -24,7 +24,6 @@ #include "client.h" -#include "auctionmanager.h" #include "chatlogger.h" #include "configmanager.h" #include "configuration.h" @@ -880,7 +879,6 @@ int Client::gameExec() #endif GuildManager::init(); - AuctionManager::init(); if (!mConfigAutoSaved) { diff --git a/src/game.cpp b/src/game.cpp index 9835d242e..4cc045019 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -25,7 +25,6 @@ #include "main.h" #include "actormanager.h" -#include "auctionmanager.h" #include "animatedsprite.h" #include "client.h" #include "configuration.h" @@ -141,7 +140,6 @@ static void initEngines() { actorManager = new ActorManager; effectManager = new EffectManager; - AuctionManager::init(); GuildManager::init(); particleEngine = new Particle(); @@ -301,9 +299,6 @@ static void destroyGuiWindows() if (whoIsOnline) whoIsOnline->setAllowUpdate(false); - if (auctionManager) - auctionManager->clear(); - if (guildManager) guildManager->clear(); @@ -339,9 +334,6 @@ static void destroyGuiWindows() delete2(whoIsOnline); delete2(killStats); - if (auctionManager && AuctionManager::getEnableAuctionBot()) - auctionManager->reload(); - if (guildManager && GuildManager::getEnableGuildBot()) guildManager->reload(); } @@ -433,7 +425,6 @@ Game::~Game() delete2(mCurrentMap) delete2(spellManager) delete2(spellShortcut) - delete2(auctionManager) delete2(guildManager) #ifdef USE_MUMBLE delete2(mumbleManager) diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index ad25127f7..0b8bc6448 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -291,10 +291,6 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : new SetupItemLabel(_("Bots support"), "", this); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Enable auction bot support"), "", - "enableAuctionBot", this, "enableAuctionBotEvent", false); - - // TRANSLATORS: settings option new SetupItemCheckBox(_("Enable guild bot support and disable native " "guild support"), "", "enableGuildBot", this, "enableGuildBotEvent", false); @@ -436,6 +432,5 @@ void Setup_Other::externalUpdated() { reread("showJob"); reread("enableGuildBot"); - reread("enableAuctionBot"); reread("enableBuggyServers"); } diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 540d5f65a..d72dab6b8 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -44,7 +44,6 @@ #include "gui/widgets/shoplistbox.h" #include "actormanager.h" -#include "auctionmanager.h" #include "configuration.h" #include "inventory.h" #include "item.h" @@ -169,22 +168,8 @@ ShopWindow::ShopWindow() : placer(0, 7, mAnnounceLinks, 8); placer(15, 7, mCloseButton); - if (auctionManager && auctionManager->getEnableAuctionBot()) - { - mBuyAuctionButton = new Button(this, - // TRANSLATORS: shop window button - _("Auction"), "auction buy", this); - mSellAuctionButton = new Button(this, - // TRANSLATORS: shop window button - _("Auction"), "auction sell", this); - placer(4, 6, mBuyAuctionButton); - placer(12, 6, mSellAuctionButton); - } - else - { - mBuyAuctionButton = nullptr; - mSellAuctionButton = nullptr; - } + mBuyAuctionButton = nullptr; + mSellAuctionButton = nullptr; Layout &layout = getLayout(); layout.setRowHeight(0, LayoutType::SET); |