summaryrefslogtreecommitdiff
path: root/src/auctionmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-04 20:05:48 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-04 20:05:48 +0300
commit62ec17f6e489ec50f17219444468aeb8969dc961 (patch)
tree350d7edb5c26c282a4e1906544536d68831228ac /src/auctionmanager.cpp
parent71d924d7dcdac067f02a317e9353ee067dbd0bde (diff)
parentfd484fc70fca32ff9065b91c175089b65aa3fd26 (diff)
downloadplus-stripped1.1.9.4.tar.gz
plus-stripped1.1.9.4.tar.bz2
plus-stripped1.1.9.4.tar.xz
plus-stripped1.1.9.4.zip
Merge branch 'master' into strippedstripped1.1.9.4
Conflicts: data/fonts/mplus-1p-bold.ttf data/fonts/mplus-1p-regular.ttf src/guichan/basiccontainer.cpp src/guichan/include/guichan/basiccontainer.hpp src/guichan/widgets/window.cpp
Diffstat (limited to 'src/auctionmanager.cpp')
-rw-r--r--src/auctionmanager.cpp89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/auctionmanager.cpp b/src/auctionmanager.cpp
new file mode 100644
index 000000000..b360279ba
--- /dev/null
+++ b/src/auctionmanager.cpp
@@ -0,0 +1,89 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2011 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 "actorspritemanager.h"
+#include "client.h"
+#include "configuration.h"
+#include "localplayer.h"
+
+#include "net/chathandler.h"
+#include "net/net.h"
+
+#include "utils/gettext.h"
+#include "utils/stringutils.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;
+ if (mEnableAuctionBot)
+ auctionManager = new AuctionManager();
+}
+
+void AuctionManager::send(std::string msg)
+{
+ Net::getChatHandler()->privateMessage("AuctionBot", msg);
+}
+
+bool AuctionManager::processAuctionMessage(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(std::string mail)
+{
+ Net::getChatHandler()->privateMessage("AuctionBot", "!mail " + mail);
+}