TrinityCore
MythicPlusPacketsCommon.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
19
20namespace WorldPackets
21{
22namespace MythicPlus
23{
24ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreMapSummary const& dungeonScoreMapSummary)
25{
26 data << int32(dungeonScoreMapSummary.ChallengeModeID);
27 data << float(dungeonScoreMapSummary.MapScore);
28 data << int32(dungeonScoreMapSummary.BestRunLevel);
29 data << int32(dungeonScoreMapSummary.BestRunDurationMS);
30 data.WriteBit(dungeonScoreMapSummary.FinishedSuccess);
31 data.FlushBits();
32
33 return data;
34}
35
36ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreSummary const& dungeonScoreSummary)
37{
38 data << float(dungeonScoreSummary.OverallScoreCurrentSeason);
39 data << float(dungeonScoreSummary.LadderScoreCurrentSeason);
40 data << uint32(dungeonScoreSummary.Runs.size());
41 for (DungeonScoreMapSummary const& dungeonScoreMapSummary : dungeonScoreSummary.Runs)
42 data << dungeonScoreMapSummary;
43
44 return data;
45}
46
47ByteBuffer& operator<<(ByteBuffer& data, MythicPlusMember const& mythicPlusMember)
48{
49 data << mythicPlusMember.BnetAccountGUID;
50 data << uint64(mythicPlusMember.GuildClubMemberID);
51 data << mythicPlusMember.GUID;
52 data << mythicPlusMember.GuildGUID;
53 data << uint32(mythicPlusMember.NativeRealmAddress);
54 data << uint32(mythicPlusMember.VirtualRealmAddress);
55 data << int32(mythicPlusMember.ChrSpecializationID);
56 data << int16(mythicPlusMember.RaceID);
57 data << int32(mythicPlusMember.ItemLevel);
58 data << int32(mythicPlusMember.CovenantID);
59 data << int32(mythicPlusMember.SoulbindID);
60
61 return data;
62}
63
64ByteBuffer& operator<<(ByteBuffer& data, MythicPlusRun const& mythicPlusRun)
65{
66 data << int32(mythicPlusRun.MapChallengeModeID);
67 data << uint32(mythicPlusRun.Level);
68 data << int32(mythicPlusRun.DurationMs);
69 data << mythicPlusRun.StartDate;
70 data << mythicPlusRun.CompletionDate;
71 data << int32(mythicPlusRun.Season);
72 data.append(mythicPlusRun.KeystoneAffixIDs.data(), mythicPlusRun.KeystoneAffixIDs.size());
73 data << uint32(mythicPlusRun.Members.size());
74 data << float(mythicPlusRun.RunScore);
75 for (MythicPlusMember const& member : mythicPlusRun.Members)
76 data << member;
77
78 data.WriteBit(mythicPlusRun.Completed);
79 data.FlushBits();
80
81 return data;
82}
83
84ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreBestRunForAffix const& dungeonScoreBestRunForAffix)
85{
86 data << int32(dungeonScoreBestRunForAffix.KeystoneAffixID);
87 data << float(dungeonScoreBestRunForAffix.Score);
88 data << dungeonScoreBestRunForAffix.Run;
89
90 return data;
91}
92
93ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreMapData const& dungeonScoreMapData)
94{
95 data << int32(dungeonScoreMapData.MapChallengeModeID);
96 data << uint32(dungeonScoreMapData.BestRuns.size());
97 data << float(dungeonScoreMapData.OverAllScore);
98 for (DungeonScoreBestRunForAffix const& bestRun : dungeonScoreMapData.BestRuns)
99 data << bestRun;
100
101 return data;
102}
103
104ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreSeasonData const& dungeonScoreSeasonData)
105{
106 data << int32(dungeonScoreSeasonData.Season);
107 data << uint32(dungeonScoreSeasonData.SeasonMaps.size());
108 data << uint32(dungeonScoreSeasonData.LadderMaps.size());
109 data << float(dungeonScoreSeasonData.SeasonScore);
110 data << float(dungeonScoreSeasonData.LadderScore);
111 for (DungeonScoreMapData const& map : dungeonScoreSeasonData.SeasonMaps)
112 data << map;
113
114 for (DungeonScoreMapData const& map : dungeonScoreSeasonData.LadderMaps)
115 data << map;
116
117 return data;
118}
119
120ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreData const& dungeonScoreData)
121{
122 data << uint32(dungeonScoreData.Seasons.size());
123 data << int32(dungeonScoreData.TotalRuns);
124 for (DungeonScoreSeasonData const& season : dungeonScoreData.Seasons)
125 data << season;
126
127 return data;
128}
129}
130}
int16_t int16
Definition: Define.h:139
int32_t int32
Definition: Define.h:138
uint64_t uint64
Definition: Define.h:141
uint32_t uint32
Definition: Define.h:142
void append(T value)
Definition: ByteBuffer.h:143
bool WriteBit(bool bit)
Definition: ByteBuffer.h:175
void FlushBits()
Definition: ByteBuffer.h:155
ByteBuffer & operator<<(ByteBuffer &data, DungeonScoreMapSummary const &dungeonScoreMapSummary)
std::vector< DungeonScoreSeasonData > Seasons
std::vector< DungeonScoreBestRunForAffix > BestRuns
std::vector< DungeonScoreMapSummary > Runs
std::vector< MythicPlusMember > Members