From 0a6658594a5ec835328869b0a7854d923134ea86 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Sep 2018 05:07:16 +0300 Subject: Add packet SMSG_ACHIEVEMENT_LIST 0x0a23. --- src/CMakeLists.txt | 2 ++ src/Makefile.am | 2 ++ src/net/eathena/achievementrecv.cpp | 52 +++++++++++++++++++++++++++++++++++++ src/net/eathena/achievementrecv.h | 37 ++++++++++++++++++++++++++ src/net/eathena/network.cpp | 1 + src/net/eathena/packetsin.inc | 13 ++++++++++ 6 files changed, 107 insertions(+) create mode 100644 src/net/eathena/achievementrecv.cpp create mode 100644 src/net/eathena/achievementrecv.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b4433b8cc..aa4894429 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1590,6 +1590,8 @@ SET(SRCS net/roulettehandler.h net/searchstorehandler.h net/vendinghandler.h + net/eathena/achievementrecv.cpp + net/eathena/achievementrecv.h net/eathena/adminrecv.cpp net/eathena/adminrecv.h net/eathena/adminhandler.cpp diff --git a/src/Makefile.am b/src/Makefile.am index ef905997e..6a4c21411 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1900,6 +1900,8 @@ SRC += gui/windows/bankwindow.cpp \ net/roulettehandler.h \ net/searchstorehandler.h \ net/vendinghandler.h \ + net/eathena/achievementrecv.cpp \ + net/eathena/achievementrecv.h \ net/eathena/adminrecv.cpp \ net/eathena/adminrecv.h \ net/eathena/adminhandler.cpp \ diff --git a/src/net/eathena/achievementrecv.cpp b/src/net/eathena/achievementrecv.cpp new file mode 100644 index 000000000..96f1a2594 --- /dev/null +++ b/src/net/eathena/achievementrecv.cpp @@ -0,0 +1,52 @@ +/* + * 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/achievementrecv.h" + +#include "logger.h" + +#include "net/messagein.h" + +#include "debug.h" + +namespace EAthena +{ + +void AchievementRecv::processAchievementList(Net::MessageIn &msg) +{ + UNIMPLEMENTEDPACKET; + const int count = (msg.readInt16("len") - 22) / 50; + msg.readInt32("total achievements"); + msg.readInt32("total points"); + msg.readInt16("rank level"); + msg.readInt32("rank points"); + msg.readInt32("rank points need"); + for (int f = 0; f < count; f ++) + { + msg.readInt32("ach id"); + msg.readUInt8("completed"); + for (int d = 0; d < 10; d ++) + msg.readInt32("objective"); + msg.readInt32("completed at"); + msg.readUInt8("reward"); + } +} + +} // namespace EAthena diff --git a/src/net/eathena/achievementrecv.h b/src/net/eathena/achievementrecv.h new file mode 100644 index 000000000..1eaa37af1 --- /dev/null +++ b/src/net/eathena/achievementrecv.h @@ -0,0 +1,37 @@ +/* + * 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_ACHIEVEMENTRECV_H +#define NET_EATHENA_ACHIEVEMENTRECV_H + +namespace Net +{ + class MessageIn; +} // namespace Net + +namespace EAthena +{ + namespace AchievementRecv + { + void processAchievementList(Net::MessageIn &msg); + } // namespace AchievementRecv +} // namespace EAthena + +#endif // NET_EATHENA_ACHIEVEMENTRECV_H diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp index 52d8556ff..c183d842c 100644 --- a/src/net/eathena/network.cpp +++ b/src/net/eathena/network.cpp @@ -40,6 +40,7 @@ #include "net/ea/skillrecv.h" #include "net/ea/traderecv.h" +#include "net/eathena/achievementrecv.h" #include "net/eathena/adminrecv.h" #include "net/eathena/auctionrecv.h" #include "net/eathena/attendancerecv.h" diff --git a/src/net/eathena/packetsin.inc b/src/net/eathena/packetsin.inc index 639a2832a..ce07d0484 100644 --- a/src/net/eathena/packetsin.inc +++ b/src/net/eathena/packetsin.inc @@ -878,6 +878,12 @@ packet(SMSG_MAIL2_ICON, 0x09e7, 3, &Mail2Recv::processMailI // 20141119 packet(SMSG_MAIL2_ADD_ITEM_RESULT, 0x0a05, 53, &Mail2Recv::processAddItemResult, 20141119); +// 20150225 re +if (packetVersionRe >= 20141126) +{ + packet(SMSG_ACHIEVEMENT_LIST, 0x0a23, -1, &AchievementRecv::processAchievementList, 20141126); +} + // 0 // evol packets if (serverVersion > 0) @@ -914,6 +920,12 @@ if (serverVersion > 0) packet2(SMSG_CHAR_PASSWORD_RESPONSE, 0x0062, 3, &LoginRecv::processCharPasswordResponse, 0); } +// 20150225 main +if (packetVersionMain >= 20150225) +{ + packet(SMSG_ACHIEVEMENT_LIST, 0x0a23, -1, &AchievementRecv::processAchievementList, 20150225); +} + // 20150226 if (packetVersion >= 20150226) { @@ -1132,6 +1144,7 @@ if (packets_zero == true) packet(SMSG_GUILD_EXPULSION2, 0x0a82, 46, &GuildRecv::processGuildExpulsion2, 20171018); packet(SMSG_GUILD_LEAVE2, 0x0a83, 46, &GuildRecv::processGuildLeave2, 20171018); packet(SMSG_PARTY_MEMBER_DEAD, 0x0ab2, 7, &PartyRecv::processPartyMemberDead, 20171018); + packet(SMSG_ACHIEVEMENT_LIST, 0x0a23, -1, &AchievementRecv::processAchievementList, 20171018); } // 20171019 zero -- cgit v1.2.3-70-g09d2