From a35ac2e4f9e05b379d8520db0e5bd90ad56093df Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 17 Apr 2018 22:48:38 +0300 Subject: Add empty attendance handler. --- src/net/attendancehandler.h | 45 +++++++++++++++++++++++++++++++++++ src/net/eathena/attendancehandler.cpp | 42 ++++++++++++++++++++++++++++++++ src/net/eathena/attendancehandler.h | 40 +++++++++++++++++++++++++++++++ src/net/eathena/generalhandler.cpp | 3 +++ src/net/eathena/generalhandler.h | 2 ++ src/net/net.cpp | 2 ++ src/net/tmwa/attendancehandler.cpp | 38 +++++++++++++++++++++++++++++ src/net/tmwa/attendancehandler.h | 40 +++++++++++++++++++++++++++++++ src/net/tmwa/generalhandler.cpp | 3 +++ src/net/tmwa/generalhandler.h | 2 ++ 10 files changed, 217 insertions(+) create mode 100644 src/net/attendancehandler.h create mode 100644 src/net/eathena/attendancehandler.cpp create mode 100644 src/net/eathena/attendancehandler.h create mode 100644 src/net/tmwa/attendancehandler.cpp create mode 100644 src/net/tmwa/attendancehandler.h (limited to 'src/net') diff --git a/src/net/attendancehandler.h b/src/net/attendancehandler.h new file mode 100644 index 000000000..8f956eca2 --- /dev/null +++ b/src/net/attendancehandler.h @@ -0,0 +1,45 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2018 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_ATTENDANCEHANDLER_H +#define NET_ATTENDANCEHANDLER_H + +#include "localconsts.h" + +namespace Net +{ + +class AttendanceHandler notfinal +{ + public: + AttendanceHandler() + { } + + A_DELETE_COPY(AttendanceHandler) + + virtual ~AttendanceHandler() + { } +}; + +} // namespace Net + +extern Net::AttendanceHandler *attendanceHandler; + +#endif // NET_ATTENDANCEHANDLER_H diff --git a/src/net/eathena/attendancehandler.cpp b/src/net/eathena/attendancehandler.cpp new file mode 100644 index 000000000..0eef7ea1d --- /dev/null +++ b/src/net/eathena/attendancehandler.cpp @@ -0,0 +1,42 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2018 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/eathena/attendancehandler.h" + +#include "net/eathena/messageout.h" +#include "net/eathena/protocolout.h" + +#include "debug.h" + +namespace EAthena +{ + +AttendanceHandler::AttendanceHandler() +{ + attendanceHandler = this; +} + +AttendanceHandler::~AttendanceHandler() +{ + attendanceHandler = nullptr; +} + + +} // namespace EAthena diff --git a/src/net/eathena/attendancehandler.h b/src/net/eathena/attendancehandler.h new file mode 100644 index 000000000..363c1198c --- /dev/null +++ b/src/net/eathena/attendancehandler.h @@ -0,0 +1,40 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2018 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_EATHENA_ATTENDANCEHANDLER_H +#define NET_EATHENA_ATTENDANCEHANDLER_H + +#include "net/attendancehandler.h" + +namespace EAthena +{ +class AttendanceHandler final : public Net::AttendanceHandler +{ + public: + AttendanceHandler(); + + A_DELETE_COPY(AttendanceHandler) + + ~AttendanceHandler() override final; +}; + +} // namespace EAthena + +#endif // NET_EATHENA_ATTENDANCEHANDLER_H diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 4f1d0c086..b2a640dbe 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -34,6 +34,7 @@ #include "net/eathena/adminhandler.h" #include "net/eathena/auctionhandler.h" +#include "net/eathena/attendancehandler.h" #include "net/eathena/bankhandler.h" #include "net/eathena/battlegroundhandler.h" #include "net/eathena/beinghandler.h" @@ -101,6 +102,7 @@ GeneralHandler::GeneralHandler() : mMail2Handler(new Mail2Handler), mMailHandler(new MailHandler), mAuctionHandler(new AuctionHandler), + mAttendanceHandler(new AttendanceHandler), mCashShopHandler(new CashShopHandler), mFamilyHandler(new FamilyHandler), mBankHandler(new BankHandler), @@ -145,6 +147,7 @@ GeneralHandler::~GeneralHandler() delete2(mMail2Handler); delete2(mMailHandler); delete2(mAuctionHandler); + delete2(mAttendanceHandler); delete2(mCashShopHandler); delete2(mFamilyHandler); delete2(mBankHandler); diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h index 8f6dc5166..485670194 100644 --- a/src/net/eathena/generalhandler.h +++ b/src/net/eathena/generalhandler.h @@ -48,6 +48,7 @@ class TradeHandler; class QuestHandler; class ServerFeatures; class AuctionHandler; +class AttendanceHandler; class BankHandler; class BattleGroundHandler; class BuyingStoreHandler; @@ -115,6 +116,7 @@ class GeneralHandler final : public Net::GeneralHandler Mail2Handler *mMail2Handler; MailHandler *mMailHandler; AuctionHandler *mAuctionHandler; + AttendanceHandler *mAttendanceHandler; CashShopHandler *mCashShopHandler; FamilyHandler *mFamilyHandler; BankHandler *mBankHandler; diff --git a/src/net/net.cpp b/src/net/net.cpp index e7720bb76..2d608c9eb 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -41,6 +41,7 @@ int evolPacketOffset = 0; namespace Net { class AuctionHandler; + class AttendanceHandler; class BankHandler; class BattleGroundHandler; class BuyingStoreHandler; @@ -95,6 +96,7 @@ Net::BeingHandler *beingHandler = nullptr; Net::BuySellHandler *buySellHandler = nullptr; Net::ServerFeatures *serverFeatures = nullptr; Net::AuctionHandler *auctionHandler = nullptr; +Net::AuctionHandler *attendanceHandler = nullptr; Net::BankHandler *bankHandler = nullptr; Net::BattleGroundHandler *battleGroundHandler = nullptr; Net::BuyingStoreHandler *buyingStoreHandler = nullptr; diff --git a/src/net/tmwa/attendancehandler.cpp b/src/net/tmwa/attendancehandler.cpp new file mode 100644 index 000000000..12749d325 --- /dev/null +++ b/src/net/tmwa/attendancehandler.cpp @@ -0,0 +1,38 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2018 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/attendancehandler.h" + +#include "debug.h" + +namespace TmwAthena +{ + +AttendanceHandler::AttendanceHandler() +{ + attendanceHandler = this; +} + +AttendanceHandler::~AttendanceHandler() +{ + attendanceHandler = nullptr; +} + +} // namespace TmwAthena diff --git a/src/net/tmwa/attendancehandler.h b/src/net/tmwa/attendancehandler.h new file mode 100644 index 000000000..3ec9d4b62 --- /dev/null +++ b/src/net/tmwa/attendancehandler.h @@ -0,0 +1,40 @@ +/* + * The ManaPlus Client + * Copyright (C) 2011-2018 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_ATTENDANCEHANDLER_H +#define NET_TMWA_ATTENDANCEHANDLER_H + +#include "net/attendancehandler.h" + +namespace TmwAthena +{ +class AttendanceHandler final : public Net::AttendanceHandler +{ + public: + AttendanceHandler(); + + A_DELETE_COPY(AttendanceHandler) + + ~AttendanceHandler() override final; +}; + +} // namespace TmwAthena + +#endif // NET_TMWA_ATTENDANCEHANDLER_H diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index f61342e5f..625bbbb8e 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -52,6 +52,7 @@ #include "net/tmwa/questhandler.h" #include "net/tmwa/auctionhandler.h" +#include "net/tmwa/attendancehandler.h" #include "net/tmwa/bankhandler.h" #include "net/tmwa/battlegroundhandler.h" #include "net/tmwa/buyingstorehandler.h" @@ -98,6 +99,7 @@ GeneralHandler::GeneralHandler() : mQuestHandler(new QuestHandler), mServerFeatures(new ServerFeatures), mAuctionHandler(new AuctionHandler), + mAttendanceHandler(new AttendanceHandler), mBankHandler(new BankHandler), mBattleGroundHandler(new BattleGroundHandler), mBuyingStoreHandler(new BuyingStoreHandler), @@ -142,6 +144,7 @@ GeneralHandler::~GeneralHandler() delete2(mQuestHandler); delete2(mServerFeatures); delete2(mAuctionHandler); + delete2(mAttendanceHandler); delete2(mBankHandler); delete2(mBattleGroundHandler); delete2(mBuyingStoreHandler); diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 8c80c504f..ef2d98969 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -47,6 +47,7 @@ class TradeHandler; class QuestHandler; class ServerFeatures; class AuctionHandler; +class AttendanceHandler; class BankHandler; class BattleGroundHandler; class BuyingStoreHandler; @@ -112,6 +113,7 @@ class GeneralHandler final : public Net::GeneralHandler QuestHandler *mQuestHandler; ServerFeatures *mServerFeatures; AuctionHandler *mAuctionHandler; + AttendanceHandler *mAttendanceHandler; BankHandler *mBankHandler; BattleGroundHandler *mBattleGroundHandler; BuyingStoreHandler *mBuyingStoreHandler; -- cgit v1.2.3-70-g09d2