3
* Copyright (C) 2011-2014 The ManaPlus Developers
5
* This file is part of The ManaPlus Client.
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include "auctionmanager.h"
24
#include "configuration.h"
26
#include "net/chathandler.h"
30
AuctionManager *auctionManager = nullptr;
32
bool AuctionManager::mEnableAuctionBot = false;
34
AuctionManager::AuctionManager()
38
AuctionManager::~AuctionManager()
42
void AuctionManager::init()
47
int val = serverConfig.getValue("enableAuctionBot", -1);
54
serverConfig.setValue("enableAuctionBot", val);
56
mEnableAuctionBot = (val != 0);
57
if (mEnableAuctionBot)
58
auctionManager = new AuctionManager();
61
void AuctionManager::send(const std::string &msg)
64
chatHandler->privateMessage("AuctionBot", msg);
68
bool AuctionManager::processAuctionMessage(const std::string &msg)
70
if (msg.size() > 4 && msg[0] == '#' && msg[1] == '#')
76
void AuctionManager::clear()
80
void AuctionManager::reload()
84
void AuctionManager::sendMail(const std::string &mail)
87
chatHandler->privateMessage("AuctionBot", "!mail " + mail);