From 4a879f52c53c4fb9542319bc1f5864998a1fbb22 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 25 Jan 2019 22:01:11 +0300 Subject: Add packet CMSG_NPC_BARTER_CLOSE 0x0b12 --- src/net/tmwa/barterhandler.cpp | 43 +++++++++++++++++++++++++++++++++++++++++ src/net/tmwa/barterhandler.h | 42 ++++++++++++++++++++++++++++++++++++++++ src/net/tmwa/generalhandler.cpp | 3 +++ src/net/tmwa/generalhandler.h | 2 ++ 4 files changed, 90 insertions(+) create mode 100644 src/net/tmwa/barterhandler.cpp create mode 100644 src/net/tmwa/barterhandler.h (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/barterhandler.cpp b/src/net/tmwa/barterhandler.cpp new file mode 100644 index 000000000..04fb20de3 --- /dev/null +++ b/src/net/tmwa/barterhandler.cpp @@ -0,0 +1,43 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2019 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 "net/tmwa/barterhandler.h" + +#include "debug.h" + +namespace TmwAthena +{ + +BarterHandler::BarterHandler() : + Net::BarterHandler() +{ + barterHandler = this; +} + +BarterHandler::~BarterHandler() +{ + barterHandler = nullptr; +} + +void BarterHandler::close() const +{ +} + +} // namespace TmwAthena diff --git a/src/net/tmwa/barterhandler.h b/src/net/tmwa/barterhandler.h new file mode 100644 index 000000000..359e4ec72 --- /dev/null +++ b/src/net/tmwa/barterhandler.h @@ -0,0 +1,42 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2019 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 NET_TMWA_BARTERHANDLER_H +#define NET_TMWA_BARTERHANDLER_H + +#include "net/barterhandler.h" + +namespace TmwAthena +{ +class BarterHandler final : public Net::BarterHandler +{ + public: + BarterHandler(); + + A_DELETE_COPY(BarterHandler) + + ~BarterHandler() override final; + + void close() const override final; +}; + +} // namespace TmwAthena + +#endif // NET_TMWA_BARTERHANDLER_H diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index b85c7658c..994be2ce7 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -55,6 +55,7 @@ #include "net/tmwa/achievementhandler.h" #include "net/tmwa/attendancehandler.h" #include "net/tmwa/bankhandler.h" +#include "net/tmwa/barterhandler.h" #include "net/tmwa/battlegroundhandler.h" #include "net/tmwa/buyingstorehandler.h" #include "net/tmwa/cashshophandler.h" @@ -114,6 +115,7 @@ GeneralHandler::GeneralHandler() : mMailHandler(new MailHandler), mMapHandler(new MapHandler), mMarketHandler(new MarketHandler), + mBarterHandler(new BarterHandler), mMercenaryHandler(new MercenaryHandler), mRouletteHandler(new RouletteHandler), mSearchStoreHandler(new SearchStoreHandler), @@ -161,6 +163,7 @@ GeneralHandler::~GeneralHandler() delete2(mMailHandler) delete2(mMapHandler) delete2(mMarketHandler) + delete2(mBarterHandler) delete2(mMercenaryHandler) delete2(mRouletteHandler) delete2(mSearchStoreHandler) diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index d3961fcab..b2ded08a5 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -28,6 +28,7 @@ namespace TmwAthena { class AdminHandler; +class BarterHandler; class BeingHandler; class BuySellHandler; class CharServerHandler; @@ -128,6 +129,7 @@ class GeneralHandler final : public Net::GeneralHandler MailHandler *mMailHandler; MapHandler *mMapHandler; MarketHandler *mMarketHandler; + BarterHandler *mBarterHandler; MercenaryHandler *mMercenaryHandler; RouletteHandler *mRouletteHandler; SearchStoreHandler *mSearchStoreHandler; -- cgit v1.2.3-60-g2f50