From 0b236e4e04a6d89d34925ce9d2875c002e135b23 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Feb 2013 16:40:55 +0300 Subject: Remove auction bot support. This bot for long time offline in tmw and possible will be never online. --- src/CMakeLists.txt | 2 -- src/Makefile.am | 2 -- src/auctionmanager.cpp | 91 ------------------------------------------------- src/auctionmanager.h | 60 -------------------------------- src/client.cpp | 2 -- src/commands.cpp | 7 ---- src/commands.h | 2 -- src/game.cpp | 10 ------ src/gui/setup_other.cpp | 3 -- src/gui/shopwindow.cpp | 28 --------------- src/gui/shopwindow.h | 2 -- 11 files changed, 209 deletions(-) delete mode 100644 src/auctionmanager.cpp delete mode 100644 src/auctionmanager.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef635351a..349a0a12c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -513,8 +513,6 @@ SET(SRCS animationdelayload.h animationparticle.cpp animationparticle.h - auctionmanager.cpp - auctionmanager.h avatar.cpp avatar.h being.cpp diff --git a/src/Makefile.am b/src/Makefile.am index ddc6776d2..6a70ab4d5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -519,8 +519,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ animationdelayload.h \ animationparticle.cpp \ animationparticle.h \ - auctionmanager.cpp \ - auctionmanager.h \ avatar.cpp \ avatar.h \ being.cpp \ diff --git a/src/auctionmanager.cpp b/src/auctionmanager.cpp deleted file mode 100644 index 348866e19..000000000 --- a/src/auctionmanager.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2013 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 . - */ - -#include "auctionmanager.h" - -#include "actorspritemanager.h" -#include "client.h" -#include "configuration.h" -#include "localplayer.h" - -#include "net/chathandler.h" -#include "net/net.h" - -#include "utils/gettext.h" - -#include "debug.h" - -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 (Net::getChatHandler()) - Net::getChatHandler()->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 (Net::getChatHandler()) - Net::getChatHandler()->privateMessage("AuctionBot", "!mail " + mail); -} diff --git a/src/auctionmanager.h b/src/auctionmanager.h deleted file mode 100644 index d82f1beb0..000000000 --- a/src/auctionmanager.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2013 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 . - */ - -#ifndef AUCTIONMANAGER_H -#define AUCTIONMANAGER_H - -#include "utils/dtor.h" - -#include -#include -#include - -#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 371dab3d8..9763c3300 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -24,7 +24,6 @@ #include "client.h" -#include "auctionmanager.h" #include "chatlogger.h" #include "configuration.h" #include "depricatedevent.h" @@ -1096,7 +1095,6 @@ int Client::gameExec() #endif GuildManager::init(); - AuctionManager::init(); if (!mConfigAutoSaved) { diff --git a/src/commands.cpp b/src/commands.cpp index b085cbd7c..25835ace9 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -22,7 +22,6 @@ #include "commandhandler.h" -#include "auctionmanager.h" #include "actorspritemanager.h" #include "client.h" #include "configuration.h" @@ -708,12 +707,6 @@ impHandler1(hack) Net::getChatHandler()->sendRaw(args); } -impHandler1(mail) -{ - if (auctionManager && auctionManager->getEnableAuctionBot()) - auctionManager->sendMail(args); -} - impHandler0(priceLoad) { if (shopWindow) diff --git a/src/commands.h b/src/commands.h index a83dc0577..0b413561f 100644 --- a/src/commands.h +++ b/src/commands.h @@ -84,7 +84,6 @@ namespace Commands decHandler(imitation); decHandler(heal); decHandler(navigate); - decHandler(mail); decHandler(hack); decHandler(priceLoad); decHandler(priceSave); @@ -160,7 +159,6 @@ static const CommandInfo commands[] = {"heal", &Commands::heal}, {"navigate", &Commands::navigate}, {"imitation", &Commands::imitation}, - {"mail", &Commands::mail}, {"trade", &Commands::trade}, {"priceload", &Commands::priceLoad}, {"pricesave", &Commands::priceSave}, diff --git a/src/game.cpp b/src/game.cpp index ef053bd8f..e599d5459 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -25,7 +25,6 @@ #include "main.h" #include "actorspritemanager.h" -#include "auctionmanager.h" #include "animatedsprite.h" #include "client.h" #include "commandhandler.h" @@ -148,7 +147,6 @@ EffectManager *effectManager = nullptr; SpellManager *spellManager = nullptr; Viewport *viewport = nullptr; /**< Viewport on the map. */ GuildManager *guildManager = nullptr; -AuctionManager *auctionManager = nullptr; ChatTab *localChatTab = nullptr; ChatTab *debugChatTab = nullptr; @@ -168,7 +166,6 @@ static void initEngines() actorSpriteManager = new ActorSpriteManager; commandHandler = new CommandHandler; effectManager = new EffectManager; - AuctionManager::init(); GuildManager::init(); particleEngine = new Particle(nullptr); @@ -310,9 +307,6 @@ static void destroyGuiWindows() if (whoIsOnline) whoIsOnline->setAllowUpdate(false); - if (auctionManager) - auctionManager->clear(); - if (guildManager) guildManager->clear(); @@ -353,9 +347,6 @@ static void destroyGuiWindows() DepricatedEvent::trigger(CHANNEL_GAME, DepricatedEvent(EVENT_GUIWINDOWSUNLOADED)); - if (auctionManager && AuctionManager::getEnableAuctionBot()) - auctionManager->reload(); - if (guildManager && GuildManager::getEnableGuildBot()) guildManager->reload(); } @@ -460,7 +451,6 @@ Game::~Game() del_0(mCurrentMap) del_0(spellManager) del_0(spellShortcut) - del_0(auctionManager) del_0(guildManager) #ifdef USE_MUMBLE del_0(mumbleManager) diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp index 965382f71..707d5fa4a 100644 --- a/src/gui/setup_other.cpp +++ b/src/gui/setup_other.cpp @@ -198,9 +198,6 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : new SetupItemLabel(_("Bots support"), "", this); - new SetupItemCheckBox(_("Enable auction bot support"), "", - "enableAuctionBot", this, "enableAuctionBotEvent", false); - new SetupItemCheckBox(_("Enable guild bot support and disable native " "guild support"), "", "enableGuildBot", this, "enableGuildBotEvent", false); diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index d2cb0f0ea..dfecdbbe5 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -39,7 +39,6 @@ #include "gui/widgets/tradetab.h" #include "actorspritemanager.h" -#include "auctionmanager.h" #include "client.h" #include "configuration.h" #include "confirmdialog.h" @@ -89,12 +88,10 @@ ShopWindow::ShopWindow(): mBuyAddButton(new Button(this, _("Add"), "add buy", this)), mBuyDeleteButton(new Button(this, _("Delete"), "delete buy", this)), mBuyAnnounceButton(new Button(this, _("Announce"), "announce buy", this)), - mBuyAuctionButton(nullptr), mSellAddButton(new Button(this, _("Add"), "add sell", this)), mSellDeleteButton(new Button(this, _("Delete"), "delete sell", this)), mSellAnnounceButton(new Button(this, _("Announce"), "announce sell", this)), - mSellAuctionButton(nullptr), mAnnounceLinks(new CheckBox(this, _("Show links in announce"), false, this, "link announce")), mSelectedItem(-1), @@ -145,21 +142,6 @@ ShopWindow::ShopWindow(): placer(0, 7, mAnnounceLinks, 8); placer(15, 7, mCloseButton); - if (auctionManager && auctionManager->getEnableAuctionBot()) - { - mBuyAuctionButton = new Button(this, - _("Auction"), "auction buy", this); - mSellAuctionButton = new Button(this, - _("Auction"), "auction sell", this); - placer(4, 6, mBuyAuctionButton); - placer(12, 6, mSellAuctionButton); - } - else - { - mBuyAuctionButton = nullptr; - mSellAuctionButton = nullptr; - } - Layout &layout = getLayout(); layout.setRowHeight(0, Layout::AUTO_SET); @@ -232,16 +214,6 @@ void ShopWindow::action(const gcn::ActionEvent &event) { announce(mSellShopItems, SELL); } - else if (eventId == "auction buy" && mBuyShopItems - && mBuyShopItems->getNumberOfElements() > 0) - { - Net::getChatHandler()->privateMessage("AuctionBot", "!pull4144 seek"); - } - else if (eventId == "auction sell" && mSellShopItems - && mSellShopItems->getNumberOfElements() > 0) - { - Net::getChatHandler()->privateMessage("AuctionBot", "!pull4144 offer"); - } if (mSelectedItem < 1) return; diff --git a/src/gui/shopwindow.h b/src/gui/shopwindow.h index 9b7e64572..383016029 100644 --- a/src/gui/shopwindow.h +++ b/src/gui/shopwindow.h @@ -155,11 +155,9 @@ class ShopWindow final : public Window, public gcn::ActionListener, Button *mBuyAddButton; Button *mBuyDeleteButton; Button *mBuyAnnounceButton; - Button *mBuyAuctionButton; Button *mSellAddButton; Button *mSellDeleteButton; Button *mSellAnnounceButton; - Button *mSellAuctionButton; CheckBox *mAnnounceLinks; int mSelectedItem; -- cgit v1.2.3-60-g2f50