summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/achievementhandler.cpp47
-rw-r--r--src/net/eathena/achievementhandler.h42
-rw-r--r--src/net/eathena/generalhandler.cpp3
-rw-r--r--src/net/eathena/generalhandler.h2
-rw-r--r--src/net/eathena/packetsout.inc2
5 files changed, 96 insertions, 0 deletions
diff --git a/src/net/eathena/achievementhandler.cpp b/src/net/eathena/achievementhandler.cpp
new file mode 100644
index 000000000..b0279a908
--- /dev/null
+++ b/src/net/eathena/achievementhandler.cpp
@@ -0,0 +1,47 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include "net/eathena/achievementhandler.h"
+
+#include "net/eathena/messageout.h"
+#include "net/eathena/protocolout.h"
+
+#include "debug.h"
+
+namespace EAthena
+{
+
+AchievementHandler::AchievementHandler()
+{
+ achievementHandler = this;
+}
+
+AchievementHandler::~AchievementHandler()
+{
+ achievementHandler = nullptr;
+}
+
+void AchievementHandler::requestReward(const int achId) const
+{
+ createOutPacket(CMSG_ACHIEVEMENT_GET_REWARD);
+ outMsg.writeInt32(achId, "ach id");
+}
+
+} // namespace EAthena
diff --git a/src/net/eathena/achievementhandler.h b/src/net/eathena/achievementhandler.h
new file mode 100644
index 000000000..b58342a75
--- /dev/null
+++ b/src/net/eathena/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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NET_EATHENA_ACHIEVEMENTHANDLER_H
+#define NET_EATHENA_ACHIEVEMENTHANDLER_H
+
+#include "net/achievementhandler.h"
+
+namespace EAthena
+{
+class AchievementHandler final : public Net::AchievementHandler
+{
+ public:
+ AchievementHandler();
+
+ A_DELETE_COPY(AchievementHandler)
+
+ ~AchievementHandler() override final;
+
+ void requestReward(const int achId) const override final;
+};
+
+} // namespace EAthena
+
+#endif // NET_EATHENA_ACHIEVEMENTHANDLER_H
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index 3963f6423..940a27fd8 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/achievementhandler.h"
#include "net/eathena/attendancehandler.h"
#include "net/eathena/bankhandler.h"
#include "net/eathena/battlegroundhandler.h"
@@ -102,6 +103,7 @@ GeneralHandler::GeneralHandler() :
mMail2Handler(new Mail2Handler),
mMailHandler(new MailHandler),
mAuctionHandler(new AuctionHandler),
+ mAchievementHandler(new AchievementHandler),
mAttendanceHandler(new AttendanceHandler),
mCashShopHandler(new CashShopHandler),
mFamilyHandler(new FamilyHandler),
@@ -148,6 +150,7 @@ GeneralHandler::~GeneralHandler()
delete2(mMail2Handler);
delete2(mMailHandler);
delete2(mAuctionHandler);
+ delete2(mAchievementHandler);
delete2(mAttendanceHandler);
delete2(mCashShopHandler);
delete2(mFamilyHandler);
diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h
index 485670194..044279102 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 AchievementHandler;
class AttendanceHandler;
class BankHandler;
class BattleGroundHandler;
@@ -116,6 +117,7 @@ class GeneralHandler final : public Net::GeneralHandler
Mail2Handler *mMail2Handler;
MailHandler *mMailHandler;
AuctionHandler *mAuctionHandler;
+ AchievementHandler *mAchievementHandler;
AttendanceHandler *mAttendanceHandler;
CashShopHandler *mCashShopHandler;
FamilyHandler *mFamilyHandler;
diff --git a/src/net/eathena/packetsout.inc b/src/net/eathena/packetsout.inc
index 3ea0fb61c..a4208a16f 100644
--- a/src/net/eathena/packetsout.inc
+++ b/src/net/eathena/packetsout.inc
@@ -341,6 +341,7 @@ packet(CMSG_PET_EVOLUTION, 0x0000, 0, nullptr);
packet(CMSG_PLAYER_SET_TITLE, 0x0000, 0, nullptr);
packet(CMSG_CHANGE_DRESS, 0x0000, 0, nullptr);
packet(CMSG_INSTANCE_COMMAND, 0x0000, 0, nullptr);
+packet(CMSG_ACHIEVEMENT_GET_REWARD, 0x0000, 0, nullptr);
#else
// 20040713
if (packetVersion >= 20040713)
@@ -1318,6 +1319,7 @@ if (packetVersion >= 20140611)
// new packets
packet(CMSG_ROULETTE_GENERATE, 0x0a1f, 2, clif->pRouletteGenerate);
packet(CMSG_ROULETTE_RECV_ITEM, 0x0a21, 6, clif->pRouletteRecvItem);
+ packet(CMSG_ACHIEVEMENT_GET_REWARD, 0x0a25, 6, clif->pAchievementGetReward);
// changed packets
packet(CMSG_ROULETTE_OPEN, 0x0a19, 2, clif->pRouletteOpen);
packet(CMSG_ROULETTE_CLOSE, 0x0a1d, 2, clif->pRouletteClose);