From 5b896ca505255c8f3f567cea87fad93444a6b2fd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Sep 2018 06:13:20 +0300 Subject: Add packet CMSG_ACHIEVEMENT_GET_REWARD 0x0a25. --- src/net/tmwa/achievementhandler.cpp | 42 +++++++++++++++++++++++++++++++++++++ src/net/tmwa/achievementhandler.h | 42 +++++++++++++++++++++++++++++++++++++ src/net/tmwa/generalhandler.cpp | 3 +++ src/net/tmwa/generalhandler.h | 2 ++ 4 files changed, 89 insertions(+) create mode 100644 src/net/tmwa/achievementhandler.cpp create mode 100644 src/net/tmwa/achievementhandler.h (limited to 'src/net/tmwa') diff --git a/src/net/tmwa/achievementhandler.cpp b/src/net/tmwa/achievementhandler.cpp new file mode 100644 index 000000000..fb92effab --- /dev/null +++ b/src/net/tmwa/achievementhandler.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/tmwa/achievementhandler.h" + +#include "debug.h" + +namespace TmwAthena +{ + +AchievementHandler::AchievementHandler() +{ + achievementHandler = this; +} + +AchievementHandler::~AchievementHandler() +{ + achievementHandler = nullptr; +} + +void AchievementHandler::requestReward(const int achId A_UNUSED) const +{ +} + +} // namespace TmwAthena diff --git a/src/net/tmwa/achievementhandler.h b/src/net/tmwa/achievementhandler.h new file mode 100644 index 000000000..a7d9fa8d1 --- /dev/null +++ b/src/net/tmwa/achievementhandler.h @@ -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 . + */ + +#ifndef NET_TMWA_ACHIEVEMENTHANDLER_H +#define NET_TMWA_ACHIEVEMENTHANDLER_H + +#include "net/achievementhandler.h" + +namespace TmwAthena +{ +class AchievementHandler final : public Net::AchievementHandler +{ + public: + AchievementHandler(); + + A_DELETE_COPY(AchievementHandler) + + ~AchievementHandler() override final; + + void requestReward(const int achId) const override final; +}; + +} // namespace TmwAthena + +#endif // NET_TMWA_ACHIEVEMENTHANDLER_H diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 9a1701fc1..99865f61d 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/achievementhandler.h" #include "net/tmwa/attendancehandler.h" #include "net/tmwa/bankhandler.h" #include "net/tmwa/battlegroundhandler.h" @@ -99,6 +100,7 @@ GeneralHandler::GeneralHandler() : mQuestHandler(new QuestHandler), mServerFeatures(new ServerFeatures), mAuctionHandler(new AuctionHandler), + mAchievementHandler(new AchievementHandler), mAttendanceHandler(new AttendanceHandler), mBankHandler(new BankHandler), mBattleGroundHandler(new BattleGroundHandler), @@ -145,6 +147,7 @@ GeneralHandler::~GeneralHandler() delete2(mQuestHandler); delete2(mServerFeatures); delete2(mAuctionHandler); + delete2(mAchievementHandler); delete2(mAttendanceHandler); delete2(mBankHandler); delete2(mBattleGroundHandler); diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index ef2d98969..1be9b9f97 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 AchievementHandler; class AttendanceHandler; class BankHandler; class BattleGroundHandler; @@ -113,6 +114,7 @@ class GeneralHandler final : public Net::GeneralHandler QuestHandler *mQuestHandler; ServerFeatures *mServerFeatures; AuctionHandler *mAuctionHandler; + AchievementHandler *mAchievementHandler; AttendanceHandler *mAttendanceHandler; BankHandler *mBankHandler; BattleGroundHandler *mBattleGroundHandler; -- cgit v1.2.3-60-g2f50