Core/Packets: enabled and implemented SMSG_PVP_SEASON and dropped its retail successor implementation SMSG_SEASON_INFO (doesn't exist in Classic)

This commit is contained in:
Ovahlord
2024-08-26 21:19:12 +02:00
parent 076ff7970c
commit 92435b0934
8 changed files with 91 additions and 38 deletions

View File

@@ -17,6 +17,7 @@
#include "WorldSession.h"
#include "AccountMgr.h"
#include "ArenaPackets.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "AuctionHousePackets.h"
@@ -1109,13 +1110,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder)
// Send PVPSeason
{
WorldPackets::Battleground::SeasonInfo seasonInfo;
seasonInfo.PreviousArenaSeason = sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) - sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS);
WorldPackets::Arena::PvpSeason pvpSeason;
pvpSeason.PreviousArenaSeason = sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) - sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS);
if (sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS))
seasonInfo.CurrentArenaSeason = sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID);
pvpSeason.CurrentArenaSeason = sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID);
SendPacket(seasonInfo.Write());
SendPacket(pvpSeason.Write());
}
// send server info

View File

@@ -22,6 +22,7 @@
#include "AddonPackets.h"
#include "AdventureMapPackets.h"
#include "AreaTriggerPackets.h"
#include "ArenaPackets.h"
#include "AuctionHousePackets.h"
#include "AuthenticationPackets.h"
#include "BankPackets.h"

View File

@@ -0,0 +1,36 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "ArenaPackets.h"
#include "PacketUtilities.h"
WorldPacket const* WorldPackets::Arena::PvpSeason::Write()
{
_worldPacket << int32(Unk0);
_worldPacket << int32(Unk1);
_worldPacket << int32(CurrentArenaSeason);
_worldPacket << int32(PreviousArenaSeason);
_worldPacket << int32(CurrentArenaUsesTeams);
_worldPacket << int32(PreviousArenaUsesTeams);
_worldPacket << int32(Unk6);
_worldPacket << Bits<1>(Unk7);
_worldPacket << Bits<1>(Unk8);
_worldPacket << Bits<1>(Unk9);
_worldPacket.FlushBits();
return &_worldPacket;
}

View File

@@ -0,0 +1,48 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef ArenaPackets_h__
#define ArenaPackets_h__
#include "Packet.h"
namespace WorldPackets
{
namespace Arena
{
class PvpSeason final : public ServerPacket
{
public:
PvpSeason() : ServerPacket(SMSG_PVP_SEASON, 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1) { }
WorldPacket const* Write() override;
int32 Unk0 = 0;
int32 Unk1 = 0;
int32 CurrentArenaSeason = 0;
int32 PreviousArenaSeason = 0;
int32 CurrentArenaUsesTeams = 0;
int32 PreviousArenaUsesTeams = 0;
int32 Unk6 = 0;
bool Unk7 = 0;
bool Unk8 = 0;
bool Unk9 = 0;
};
}
}
#endif // ArenaPackets_h__

View File

@@ -17,20 +17,6 @@
#include "BattlegroundPackets.h"
WorldPacket const* WorldPackets::Battleground::SeasonInfo::Write()
{
_worldPacket << int32(MythicPlusDisplaySeasonID);
_worldPacket << int32(MythicPlusMilestoneSeasonID);
_worldPacket << int32(CurrentArenaSeason);
_worldPacket << int32(PreviousArenaSeason);
_worldPacket << int32(ConquestWeeklyProgressCurrencyID);
_worldPacket << int32(PvpSeasonID);
_worldPacket.WriteBit(WeeklyRewardChestsEnabled);
_worldPacket.FlushBits();
return &_worldPacket;
}
void WorldPackets::Battleground::AreaSpiritHealerQuery::Read()
{
_worldPacket >> HealerGuid;

View File

@@ -30,22 +30,6 @@ namespace WorldPackets
{
namespace Battleground
{
class SeasonInfo final : public ServerPacket
{
public:
SeasonInfo() : ServerPacket(SMSG_SEASON_INFO, 4 + 4 + 4 + 4 + 4 + 1) { }
WorldPacket const* Write() override;
int32 MythicPlusDisplaySeasonID = 0;
int32 MythicPlusMilestoneSeasonID = 0;
int32 PreviousArenaSeason = 0;
int32 CurrentArenaSeason = 0;
int32 PvpSeasonID = 0;
int32 ConquestWeeklyProgressCurrencyID = 0;
bool WeeklyRewardChestsEnabled = false;
};
class AreaSpiritHealerQuery final : public ClientPacket
{
public:

View File

@@ -1790,7 +1790,7 @@ void OpcodeTable::InitializeServerOpcodes()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_MATCH_START, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_MATCH_STATISTICS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_SEASON, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_SEASON, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_TIER_RECORD, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_ARENA_TEAM_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_QUERY_BATTLE_PET_NAME_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
@@ -1908,7 +1908,6 @@ void OpcodeTable::InitializeServerOpcodes()
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SCENE_OBJECT_PET_BATTLE_REPLACEMENTS_MADE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SCENE_OBJECT_PET_BATTLE_ROUND_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SCRIPT_CAST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEASON_INFO, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SELL_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_REALM);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_ITEM_PASSIVES, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
DEFINE_SERVER_OPCODE_HANDLER(SMSG_SEND_KNOWN_SPELLS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);

View File

@@ -2017,7 +2017,6 @@ enum OpcodeServer : uint16
SMSG_RETURN_APPLICANT_LIST = UNKNOWN_OPCODE,
SMSG_RETURN_RECRUITING_CLUBS = UNKNOWN_OPCODE,
SMSG_RUNEFORGE_LEGENDARY_CRAFTING_OPEN_NPC = UNKNOWN_OPCODE,
SMSG_SEASON_INFO = UNKNOWN_OPCODE,
SMSG_SETUP_COMBAT_LOG_FILE_FLUSH = UNKNOWN_OPCODE,
SMSG_SET_QUEST_REPLAY_COOLDOWN_OVERRIDE = UNKNOWN_OPCODE,
SMSG_SET_SHIPMENT_READY_RESPONSE = UNKNOWN_OPCODE,