TrinityCore
Loading...
Searching...
No Matches
CombatLogPacketsCommon.h
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
18#ifndef TRINITYCORE_COMBAT_LOG_PACKETS_COMMON_H
19#define TRINITYCORE_COMBAT_LOG_PACKETS_COMMON_H
20
21#include "ObjectGuid.h"
22#include "Packet.h"
23
24class Spell;
25class Unit;
26
27namespace WorldPackets
28{
29 namespace Spells
30 {
32 {
33 SpellLogPowerData(int8 powerType, int32 amount, int32 cost) : PowerType(powerType), Amount(amount), Cost(cost) { }
34
38 };
39
41 {
48 bool HideFromCombatLog = false;
49 std::vector<SpellLogPowerData> PowerData;
50
51 void Initialize(Unit const* unit);
52 void Initialize(Spell const* spell);
53 };
54
94
100
108
109 ByteBuffer& operator<<(ByteBuffer& data, SpellCastLogData const& spellCastLogData);
110 ByteBuffer& operator<<(ByteBuffer& data, ContentTuningParams const& contentTuningParams);
112 ByteBuffer& operator<<(ByteBuffer& data, SpellCastVisual const& visual);
113 ByteBuffer& operator<<(ByteBuffer& data, SpellSupportInfo const& supportInfo);
114 }
115
116 namespace CombatLog
117 {
119 {
120 public:
121 CombatLogServerPacket(OpcodeServer opcode, size_t initialSize = 200, ConnectionType connection = CONNECTION_TYPE_DEFAULT)
122 : ServerPacket(opcode, initialSize, connection), _fullLogPacket(opcode, initialSize, connection) { }
123
124 WorldPacket const* GetFullLogPacket() const { return &_fullLogPacket; }
125 WorldPacket const* GetBasicLogPacket() const { return &_worldPacket; }
126
128
129 protected:
130 template <ByteBufferNumeric T>
131 void operator<<(T val)
132 {
133 _worldPacket << val;
134 _fullLogPacket << val;
135 }
136
137 template <typename T> requires (!ByteBufferNumeric<T>)
138 void operator<<(T const& val)
139 {
140 _worldPacket << val;
141 _fullLogPacket << val;
142 }
143
145 {
146 _worldPacket.WriteBit(false);
148 }
149
151 {
154 }
155
157
159 };
160 }
161}
162
163#endif // TRINITYCORE_COMBAT_LOG_PACKETS_COMMON_H
uint8_t uint8
Definition Define.h:156
int64_t int64
Definition Define.h:149
int16_t int16
Definition Define.h:151
int8_t int8
Definition Define.h:152
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
ConnectionType
Definition Opcodes.h:27
@ CONNECTION_TYPE_DEFAULT
Definition Opcodes.h:32
OpcodeServer
Definition Opcodes.h:1085
Spells
Definition PlayerAI.cpp:32
PowerType
bool WriteBit(bool bit)
Definition ByteBuffer.h:158
void FlushBits()
Definition ByteBuffer.h:141
Definition Spell.h:277
Definition Unit.h:635
CombatLogServerPacket(OpcodeServer opcode, size_t initialSize=200, ConnectionType connection=CONNECTION_TYPE_DEFAULT)
WorldPacket _worldPacket
Definition Packet.h:43
ByteBuffer & operator>>(ByteBuffer &data, SpellCastVisual &visual)
ByteBuffer & operator<<(ByteBuffer &data, SpellCastLogData const &spellCastLogData)
std::vector< SpellLogPowerData > PowerData
SpellLogPowerData(int8 powerType, int32 amount, int32 cost)