Files
ForeverCore/tests/game/PvpMatchState.cpp
T
Karrz1 ff699fb5cf Sync with WoW Forever 0.1.34: Blizzlike core
Brings forever up to date with our 0.1.34 code for the WoW Forever client 1.60.1.70862.
Blizzlike only: fixes from real game data (packet captures, live hotfixes, player caches, Wowhead and Questie data,
VMaNGOS for the vanilla world) and server fixes. No custom items or custom content; every rate and option defaults
to Blizzard's behaviour.

What is new since 2ae1313e, in short:
- Clients 70790, 70840 and 70862: message numbers, mail, guild window, charters, contact list, add-on whispers.
- Crash and exploit fixes: guild ranks, loot of emptied veins, quest lookups, taxi mask, battleground templates,
  vendor free buys, item sell price, auction house, falling out of the world, bnetserver request limit.
- Classes, talents, pets and buffs from the live game data and Blizzard's hotfixes of November.
- Quests, NPCs, spawns, trainers, loot, fishing, events, Merchant's Favor crates and writs, sealed crate turn-ins.
- Dungeon and raid scripts (Molten Core, Blackwing Lair, Zul'Gurub, Ahn'Qiraj, Shadowfang Keep, Deadmines ...).
- Pathing fixes that help pets and NPCs.
- Russian creature names, quest titles and quest texts.
- README: Blizzlike stance, branches, repack.
2026-11-09 17:27:57 +00:00

24 lines
1.0 KiB
C++

#include "tc_catch2.h"
#include "BattlegroundPackets.h"
#include "ByteBuffer.h"
// SMSG_PVP_MATCH_SET_STATE: one byte, the client's Enum.PvPMatchState (Waiting 0, StartUp 1, Engaged 2, PostRound 3, Inactive 4, Complete 5).
// The server sends Inactive when a player leaves a battleground (Battleground::RemovePlayerAtLeave): without it the 70291 client keeps its PvP
// match, and with it the restricted addon environment, active after the player is out (audit F-3).
TEST_CASE("PVP_MATCH_SET_STATE is one byte holding the client's state value", "[PvpMatchState]")
{
using namespace WorldPackets::Battleground;
CHECK(uint8(PVPMatchState::Waiting) == 0);
CHECK(uint8(PVPMatchState::StartUp) == 1);
CHECK(uint8(PVPMatchState::Engaged) == 2);
CHECK(uint8(PVPMatchState::PostRound) == 3);
CHECK(uint8(PVPMatchState::Inactive) == 4);
CHECK(uint8(PVPMatchState::Complete) == 5);
PVPMatchSetState packet(PVPMatchState::Inactive);
WorldPacket const* data = packet.Write();
REQUIRE(data->size() == 1);
CHECK(data->data()[0] == 4);
}