/
MiscPackets.h
228 lines (173 loc) · 6.74 KB
/
MiscPackets.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/*
* 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 MiscPackets_h__
#define MiscPackets_h__
#include "Packet.h"
#include "Position.h"
#include "ObjectGuid.h"
#include "Weather.h"
enum WeatherState : uint32;
namespace WorldPackets
{
namespace Misc
{
class BindPointUpdate final : public ServerPacket
{
public:
BindPointUpdate() : ServerPacket(SMSG_BIND_POINT_UPDATE, 20) { }
WorldPacket const* Write() override;
uint32 BindMapID = 0;
TaggedPosition<Position::XYZ> BindPosition;
uint32 BindAreaID = 0;
};
class PlayerBound final : public ServerPacket
{
public:
PlayerBound() : ServerPacket(SMSG_PLAYER_BOUND, 8 + 4) { }
PlayerBound(ObjectGuid binderId, uint32 areaId) : ServerPacket(SMSG_PLAYER_BOUND, 8 + 4), BinderID(binderId), AreaID(areaId) { }
WorldPacket const* Write() override;
ObjectGuid BinderID;
uint32 AreaID = 0;
};
class BinderConfirm final : public ServerPacket
{
public:
BinderConfirm() : ServerPacket(SMSG_BINDER_CONFIRM, 8) { }
BinderConfirm(ObjectGuid unit) : ServerPacket(SMSG_BINDER_CONFIRM, 8), Unit(unit) { }
WorldPacket const* Write() override;
ObjectGuid Unit;
};
class InvalidatePlayer final : public ServerPacket
{
public:
InvalidatePlayer() : ServerPacket(SMSG_INVALIDATE_PLAYER, 8) { }
InvalidatePlayer(ObjectGuid guid) : ServerPacket(SMSG_INVALIDATE_PLAYER, 8), Guid(guid) { }
WorldPacket const* Write() override;
ObjectGuid Guid;
};
class LoginSetTimeSpeed final : public ServerPacket
{
public:
LoginSetTimeSpeed() : ServerPacket(SMSG_LOGIN_SET_TIME_SPEED, 12) { }
WorldPacket const* Write() override;
float NewSpeed = 0.0f;
uint32 GameTime = 0;
int32 GameTimeHolidayOffset = 0;
};
class TriggerCinematic final : public ServerPacket
{
public:
TriggerCinematic() : ServerPacket(SMSG_TRIGGER_CINEMATIC, 4) { }
WorldPacket const* Write() override;
uint32 CinematicID = 0;
};
class TriggerMovie final : public ServerPacket
{
public:
TriggerMovie() : ServerPacket(SMSG_TRIGGER_MOVIE, 4) { }
WorldPacket const* Write() override;
uint32 MovieID = 0;
};
class TC_GAME_API Weather final : public ServerPacket
{
public:
Weather();
Weather(WeatherState weatherID, float intensity = 0.0f, bool abrupt = false);
WorldPacket const* Write() override;
bool Abrupt = false;
float Intensity = 0.0f;
WeatherState WeatherID = WeatherState(0);
};
class TC_GAME_API PlayMusic final : public ServerPacket
{
public:
PlayMusic() : ServerPacket(SMSG_PLAY_MUSIC, 4) { }
PlayMusic(uint32 soundKitID) : ServerPacket(SMSG_PLAY_MUSIC, 4), SoundKitID(soundKitID) { }
WorldPacket const* Write() override;
uint32 SoundKitID = 0;
};
class TC_GAME_API PlayObjectSound final : public ServerPacket
{
public:
PlayObjectSound() : ServerPacket(SMSG_PLAY_OBJECT_SOUND, 4 + 8) { }
PlayObjectSound(ObjectGuid const& sourceObjectGUID, uint32 soundKitID)
: ServerPacket(SMSG_PLAY_OBJECT_SOUND, 4 + 8), SourceObjectGUID(sourceObjectGUID), SoundKitID(soundKitID) { }
WorldPacket const* Write() override;
ObjectGuid SourceObjectGUID;
uint32 SoundKitID = 0;
};
class TC_GAME_API PlaySound final : public ServerPacket
{
public:
PlaySound() : ServerPacket(SMSG_PLAY_SOUND, 4) { }
PlaySound(uint32 soundKitID) : ServerPacket(SMSG_PLAY_SOUND, 4), SoundKitID(soundKitID) { }
WorldPacket const* Write() override;
uint32 SoundKitID = 0;
};
class CompleteCinematic final : public ClientPacket
{
public:
CompleteCinematic(WorldPacket&& packet) : ClientPacket(CMSG_COMPLETE_CINEMATIC, std::move(packet)) { }
void Read() override { }
};
class NextCinematicCamera final : public ClientPacket
{
public:
NextCinematicCamera(WorldPacket&& packet) : ClientPacket(CMSG_NEXT_CINEMATIC_CAMERA, std::move(packet)) { }
void Read() override { }
};
class CompleteMovie final : public ClientPacket
{
public:
CompleteMovie(WorldPacket&& packet) : ClientPacket(CMSG_COMPLETE_MOVIE, std::move(packet)) { }
void Read() override { }
};
class OpeningCinematic final : public ClientPacket
{
public:
OpeningCinematic(WorldPacket&& packet) : ClientPacket(CMSG_OPENING_CINEMATIC, std::move(packet)) { }
void Read() override { }
};
class OverrideLight final : public ServerPacket
{
public:
OverrideLight() : ServerPacket(SMSG_OVERRIDE_LIGHT, 4 + 4 + 4) { }
WorldPacket const* Write() override;
int32 AreaLightID = 0;
int32 TransitionMilliseconds = 0;
int32 OverrideLightID = 0;
};
class UITime final : public ServerPacket
{
public:
UITime() : ServerPacket(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4) { }
WorldPacket const* Write() override;
uint32 Time = 0;
};
class WorldTeleport final : public ClientPacket
{
public:
WorldTeleport(WorldPacket&& packet) : ClientPacket(CMSG_WORLD_TELEPORT, std::move(packet)) { }
void Read() override;
uint32 Time = 0;
uint32 MapID = 0;
TaggedPosition<Position::XYZ> Pos;
float Facing = 0.0f;
};
}
}
#endif // MiscPackets_h__