Files

20 lines
1.2 KiB
C++

#pragma once
#include "gateway/protocol.hpp"
#include <optional>
namespace gateway {
// Metadata for a confirmed fresh direct self-equip aura, correlated from its
// genuine server cast. The Cast GUID is an internal presentation identity.
struct AuraSelfCastContext {
Guid128 cast{},item{};
bool operator==(const AuraSelfCastContext&) const = default;
};
bool valid_self_equip_aura_context(uint32_t spell,const AuraSelfCastContext&) noexcept;
bool valid_server_self_aura_cast(uint32_t spell,const Guid128&) noexcept;
// Distinct provenance: an observed server unit self GO has no cast item.
// Never weaken the owned-item validator to represent this case.
struct AuraSlotData {uint32_t spell=0,active_flags=0;uint16_t flags=0,level=0;uint8_t applications=1;std::optional<AuraSelfCastContext> self_cast={};std::optional<uint32_t> remaining_ms={};std::optional<Guid128> server_self_cast={};std::optional<Guid128> cast_unit={};std::optional<Guid128> cast_id={};};
struct AuraSlotChange {uint16_t slot=0;std::optional<AuraSlotData> data;};
struct AuraSlotUpdate {Guid128 unit{};bool all=false;std::vector<AuraSlotChange> slots;};
Bytes forever_aura_update(const AuraSlotUpdate&);
}