/* * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information * * 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 (at your * option) 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 "MythicPlusPacketsCommon.h" #include "PacketOperators.h" namespace WorldPackets::MythicPlus { ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreMapSummary const& dungeonScoreMapSummary) { data << int32(dungeonScoreMapSummary.ChallengeModeID); data << float(dungeonScoreMapSummary.MapScore); data << int32(dungeonScoreMapSummary.BestRunLevel); data << int32(dungeonScoreMapSummary.BestRunDurationMS); data << uint8(dungeonScoreMapSummary.Unknown1110); data << Bits<1>(dungeonScoreMapSummary.FinishedSuccess); data.FlushBits(); return data; } ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreSummary const& dungeonScoreSummary) { data << float(dungeonScoreSummary.OverallScoreCurrentSeason); data << float(dungeonScoreSummary.LadderScoreCurrentSeason); data << Size(dungeonScoreSummary.Runs); for (DungeonScoreMapSummary const& dungeonScoreMapSummary : dungeonScoreSummary.Runs) data << dungeonScoreMapSummary; return data; } ByteBuffer& operator<<(ByteBuffer& data, MythicPlusMember const& mythicPlusMember) { data << mythicPlusMember.BnetAccountGUID; data << uint64(mythicPlusMember.GuildClubMemberID); data << mythicPlusMember.GUID; data << mythicPlusMember.GuildGUID; data << uint32(mythicPlusMember.NativeRealmAddress); data << uint32(mythicPlusMember.VirtualRealmAddress); data << int32(mythicPlusMember.ChrSpecializationID); data << int8(mythicPlusMember.RaceID); data << int32(mythicPlusMember.ItemLevel); data << int32(mythicPlusMember.CovenantID); data << int32(mythicPlusMember.SoulbindID); return data; } ByteBuffer& operator<<(ByteBuffer& data, MythicPlusRun const& mythicPlusRun) { data << int32(mythicPlusRun.MapChallengeModeID); data << uint32(mythicPlusRun.Level); data << int32(mythicPlusRun.DurationMs); data << mythicPlusRun.StartDate; data << mythicPlusRun.CompletionDate; data << int32(mythicPlusRun.Season); data.append(mythicPlusRun.KeystoneAffixIDs.data(), mythicPlusRun.KeystoneAffixIDs.size()); data << Size(mythicPlusRun.Members); data << float(mythicPlusRun.RunScore); data << int32(mythicPlusRun.Unknown_1120); for (MythicPlusMember const& member : mythicPlusRun.Members) data << member; data << Bits<1>(mythicPlusRun.Completed); data.FlushBits(); return data; } ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreBestRunForAffix const& dungeonScoreBestRunForAffix) { data << int32(dungeonScoreBestRunForAffix.KeystoneAffixID); data << float(dungeonScoreBestRunForAffix.Score); data << dungeonScoreBestRunForAffix.Run; return data; } ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreMapData const& dungeonScoreMapData) { data << int32(dungeonScoreMapData.MapChallengeModeID); data << Size(dungeonScoreMapData.BestRuns); data << float(dungeonScoreMapData.OverAllScore); for (DungeonScoreBestRunForAffix const& bestRun : dungeonScoreMapData.BestRuns) data << bestRun; return data; } ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreSeasonData const& dungeonScoreSeasonData) { data << int32(dungeonScoreSeasonData.Season); data << Size(dungeonScoreSeasonData.SeasonMaps); data << Size(dungeonScoreSeasonData.LadderMaps); data << float(dungeonScoreSeasonData.SeasonScore); data << float(dungeonScoreSeasonData.LadderScore); for (DungeonScoreMapData const& map : dungeonScoreSeasonData.SeasonMaps) data << map; for (DungeonScoreMapData const& map : dungeonScoreSeasonData.LadderMaps) data << map; return data; } ByteBuffer& operator<<(ByteBuffer& data, DungeonScoreData const& dungeonScoreData) { data << Size(dungeonScoreData.Seasons); data << int32(dungeonScoreData.TotalRuns); for (DungeonScoreSeasonData const& season : dungeonScoreData.Seasons) data << season; return data; } }