TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
QueryPackets.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
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 QueryPackets_h__
19 #define QueryPackets_h__
20 
21 #include "Packet.h"
22 #include "Creature.h"
23 #include "NPCHandler.h"
24 #include "G3D/Vector3.h"
25 #include "DB2Stores.h"
26 
27 class Player;
28 
29 namespace WorldPackets
30 {
31  namespace Query
32  {
33  class QueryCreature final : public ClientPacket
34  {
35  public:
37 
38  void Read() override;
39 
41  };
42 
44  {
45  std::string Title;
46  std::string TitleAlt;
47  std::string CursorName;
51  float HpMulti = 0.0f;
52  float EnergyMulti = 0.0f;
53  bool Leader = false;
54  std::vector<int32> QuestItems;
60  std::string Name[MAX_CREATURE_NAMES];
62  };
63 
64  class QueryCreatureResponse final : public ServerPacket
65  {
66  public:
68 
69  WorldPacket const* Write() override;
70 
71  bool Allow = false;
74  };
75 
77  {
80  };
81 
82  class QueryPlayerName final : public ClientPacket
83  {
84  public:
86 
87  void Read() override;
88 
90  };
91 
93  {
94  bool Initialize(ObjectGuid const& guid, Player const* player = nullptr);
95 
96  bool IsDeleted = false;
100  std::string Name;
107  };
108 
110  {
111  public:
113 
114  WorldPacket const* Write() override;
115 
117  uint8 Result = 0; // 0 - full packet, != 0 - only guid
119  };
120 
121  class QueryPageText final : public ClientPacket
122  {
123  public:
125 
126  void Read() override;
127 
130  };
131 
132  class QueryPageTextResponse final : public ServerPacket
133  {
134  public:
136 
137  WorldPacket const* Write() override;
138 
140  {
141  uint32 ID = 0;
143  std::string Text;
144  };
145 
146  bool Allow = false;
149  };
150 
151  class QueryNPCText final : public ClientPacket
152  {
153  public:
155 
156  void Read() override;
157 
160  };
161 
162  class QueryNPCTextResponse final : public ServerPacket
163  {
164  public:
166 
167  WorldPacket const* Write() override;
168 
170  bool Allow = false;
173  };
174 
175  class DBQueryBulk final : public ClientPacket
176  {
177  public:
179  {
182  };
183 
185 
186  void Read() override;
187 
189  std::vector<DBQueryRecord> Queries;
190  };
191 
192  class DBReply final : public ServerPacket
193  {
194  public:
196 
197  WorldPacket const* Write() override;
198 
202  bool Allow = false;
204  };
205 
206  class HotfixNotifyBlob final : public ServerPacket
207  {
208  public:
210 
211  WorldPacket const* Write() override;
212 
213  HotfixData const* Hotfixes = nullptr;
214  };
215 
216  class QueryGameObject final : public ClientPacket
217  {
218  public:
220 
221  void Read() override;
222 
225  };
226 
228  {
229  std::string Name[4];
230  std::string IconName;
231  std::string CastBarCaption;
232  std::string UnkString;
236  float Size = 0.0f;
237  std::vector<int32> QuestItems;
239 
240  size_t GetDataSize() const
241  {
242  // [1..3] always empty '\0' '\0' '\0' '\0' QuestItems counter
243  return sizeof(Type) + sizeof(DisplayID) + (Name->size() + (4 * 1)) + (IconName.size() + 1) + (CastBarCaption.size() + 1) + (UnkString.size() + 1) + sizeof(Data) + sizeof(Size) + sizeof(uint8) + (QuestItems.size() * sizeof(int32)) + sizeof(Expansion);
244  }
245  };
246 
248  {
249  public:
251 
252  WorldPacket const* Write() override;
253 
255  bool Allow = false;
257  };
258 
260  {
261  public:
263 
264  void Read() override { }
265  };
266 
267  class CorpseLocation final : public ServerPacket
268  {
269  public:
271 
272  WorldPacket const* Write() override;
273 
278  bool Valid = false;
279  };
280 
281  class QueryCorpseTransport final : public ClientPacket
282  {
283  public:
285 
286  void Read() override;
287 
289  };
290 
291  class CorpseTransportQuery final : public ServerPacket
292  {
293  public:
295 
296  WorldPacket const* Write() override;
297 
299  float Facing = 0.0f;
300  };
301 
302  class QueryTime final : public ClientPacket
303  {
304  public:
305  QueryTime(WorldPacket&& packet) : ClientPacket(CMSG_QUERY_TIME, std::move(packet)) { }
306 
307  void Read() override { }
308  };
309 
310  class QueryTimeResponse final : public ServerPacket
311  {
312  public:
314 
315  WorldPacket const* Write() override;
316 
317  time_t CurrentTime = time_t(0);
319  };
320 
321  class QuestPOIQuery final : public ClientPacket
322  {
323  public:
325 
326  void Read() override;
327 
330  };
331 
333  {
334  int32 X = 0;
335  int32 Y = 0;
336  };
337 
339  {
352  std::vector<QuestPOIBlobPoint> QuestPOIBlobPointStats;
353  };
354 
356  {
358  std::vector<QuestPOIBlobData> QuestPOIBlobDataStats;
359  };
360 
361  class QuestPOIQueryResponse final : public ServerPacket
362  {
363  public:
365 
366  WorldPacket const* Write() override;
367 
368  std::vector<QuestPOIData> QuestPOIDataStats;
369  };
370 
372  {
373  public:
375 
376  void Read() override;
377 
378  std::vector<int32> QuestCompletionNPCs;
379  };
380 
382  {
384  std::vector<int32> NPCs;
385  };
386 
388  {
389  public:
391 
392  WorldPacket const* Write() override;
393 
394  std::vector<QuestCompletionNPC> QuestCompletionNPCs;
395  };
396 
397  class QueryPetName final : public ClientPacket
398  {
399  public:
401 
402  void Read() override;
403 
405  };
406 
407  class QueryPetNameResponse final : public ServerPacket
408  {
409  public:
411 
412  WorldPacket const* Write() override;
413 
415  bool Allow = false;
416 
417  bool HasDeclined = false;
420  std::string Name;
421  };
422 
423  class ItemTextQuery final : public ClientPacket
424  {
425  public:
427 
428  void Read() override;
429 
431  };
432 
434  {
435  std::string Text;
436  };
437 
438  class QueryItemTextResponse final : public ServerPacket
439  {
440  public:
442 
443  WorldPacket const* Write() override;
444 
446  bool Valid = false;
448  };
449  }
450 }
451 
454 
455 #endif // QueryPackets_h__
ObjectGuid UnitGUID
Definition: QueryPackets.h:414
float HpMulti
Definition: QueryPackets.h:51
uint32 NextPageID
Definition: QueryPackets.h:142
std::vector< QuestPOIBlobData > QuestPOIBlobDataStats
Definition: QueryPackets.h:358
Definition: QueryPackets.h:64
uint32 TextID
Definition: QueryPackets.h:159
Optional< uint32 > VirtualRealmAddress
current realm (?) (identifier made from the Index, BattleGroup and Region)
Definition: QueryPackets.h:78
Definition: QueryPackets.h:423
void Read() override
Definition: QueryPackets.cpp:96
ObjectGuid Id
Definition: QueryPackets.h:430
QuestCompletionNPCResponse()
Definition: QueryPackets.h:390
#define MAX_CREATURE_MODELS
Definition: Creature.h:73
WorldPacket const * Write() override
Definition: QueryPackets.cpp:423
ItemTextQuery(WorldPacket &&packet)
Definition: QueryPackets.h:426
std::vector< QuestPOIData > QuestPOIDataStats
Definition: QueryPackets.h:368
Definition: ByteBuffer.h:70
G3D::Vector3 Position
Definition: QueryPackets.h:275
Definition: QueryPackets.h:175
uint32 RequiredExpansion
Definition: QueryPackets.h:56
Definition: QueryPackets.h:76
Definition: Opcodes.h:932
std::string CursorName
Definition: QueryPackets.h:47
int32 Flags
Definition: QueryPackets.h:348
void Read() override
Definition: QueryPackets.h:264
Definition: QueryPackets.h:281
std::vector< HotfixNotify > HotfixData
Definition: DB2Stores.h:125
std::string TitleAlt
Definition: QueryPackets.h:46
Definition: QueryPackets.h:33
Definition: Opcodes.h:1398
ObjectGuid Player
Definition: QueryPackets.h:116
QuestPOIQueryResponse()
Definition: QueryPackets.h:364
Definition: QueryPackets.h:381
PlayerGuidLookupData Data
Definition: QueryPackets.h:118
Definition: QueryPackets.h:371
ByteBuffer Data
Definition: QueryPackets.h:203
std::string Text
Definition: QueryPackets.h:143
bool Allow
Definition: QueryPackets.h:255
std::vector< int32 > NPCs
Definition: QueryPackets.h:384
int32 MapID
Definition: QueryPackets.h:344
uint32 Expansion
Definition: QueryPackets.h:238
uint32 Type
Definition: QueryPackets.h:233
ObjectGuid Guid
Definition: QueryPackets.h:223
void Read() override
Definition: QueryPackets.cpp:245
float Facing
Definition: QueryPackets.h:299
int32 ObjectiveIndex
Definition: QueryPackets.h:341
Definition: Opcodes.h:527
int32 BlobIndex
Definition: QueryPackets.h:340
bool Allow
Definition: QueryPackets.h:170
Definition: SharedDefines.h:101
bool Allow
Definition: QueryPackets.h:71
std::string Text
Definition: QueryPackets.h:435
bool Valid
Definition: QueryPackets.h:278
int32 UnkWoD1
Definition: QueryPackets.h:351
DBReply()
Definition: QueryPackets.h:195
Definition: Opcodes.h:517
Definition: QueryPackets.h:407
Definition: QueryPackets.h:361
uint32 PageTextID
Definition: QueryPackets.h:148
uint8 Result
Definition: QueryPackets.h:117
std::string Name
Definition: QueryPackets.h:420
Definition: Opcodes.h:1118
void Read() override
Definition: QueryPackets.cpp:219
WorldPacket const * Write() override
Definition: QueryPackets.cpp:358
int32 WorldEffectID
Definition: QueryPackets.h:349
STL namespace.
void Read() override
Definition: QueryPackets.cpp:366
ByteBuffer & operator<<(ByteBuffer &data, WorldPackets::Query::PlayerGuidLookupHint const &lookupHint)
Definition: QueryPackets.cpp:101
std::vector< int32 > QuestItems
Definition: QueryPackets.h:54
Definition: QueryPackets.h:397
Definition: QueryPackets.h:192
QueryQuestCompletionNPCs(WorldPacket &&packet)
Definition: QueryPackets.h:374
std::string Name[4]
Definition: QueryPackets.h:229
QueryGameObject(WorldPacket &&packet)
Definition: QueryPackets.h:219
QueryNPCTextResponse()
Definition: QueryPackets.h:165
Definition: Opcodes.h:523
QueryTime(WorldPacket &&packet)
Definition: QueryPackets.h:305
time_t CurrentTime
Definition: QueryPackets.h:317
WorldPacket const * Write() override
Definition: QueryPackets.cpp:348
Definition: QueryPackets.h:151
Definition: Opcodes.h:1401
uint32 PageTextID
Definition: QueryPackets.h:129
ObjectGuid Transport
Definition: QueryPackets.h:274
WorldPacket const * Write() override
Definition: QueryPackets.cpp:225
uint8 ClassID
Definition: QueryPackets.h:104
std::string Name[MAX_CREATURE_NAMES]
Definition: QueryPackets.h:60
int32 WorldMapAreaID
Definition: QueryPackets.h:345
Definition: QueryPackets.h:121
Definition: QueryPackets.h:216
Definition: QueryPackets.h:302
ObjectGuid AccountID
Definition: QueryPackets.h:97
Definition: QueryPackets.h:109
#define MAX_NPC_TEXT_OPTIONS
Definition: NPCHandler.h:28
std::vector< int32 > QuestCompletionNPCs
Definition: QueryPackets.h:378
int32 Priority
Definition: QueryPackets.h:347
CreatureStats Stats
Definition: QueryPackets.h:72
HotfixNotifyBlob()
Definition: QueryPackets.h:209
Definition: Vector3.h:58
uint32 CreatureMovementInfoID
Definition: QueryPackets.h:55
std::string UnkString
Definition: QueryPackets.h:232
Definition: QueryPackets.h:321
Definition: QueryPackets.h:162
Definition: QueryPackets.h:206
int32 TimeOutRequest
Definition: QueryPackets.h:318
WorldPacket const * Write() override
Definition: QueryPackets.cpp:374
bool Allow
Definition: QueryPackets.h:202
uint32 CreatureID
Definition: QueryPackets.h:40
size_t GetDataSize() const
Definition: QueryPackets.h:240
void Read() override
Definition: QueryPackets.cpp:284
uint32 RecordID
Definition: QueryPackets.h:201
void Read() override
Definition: QueryPackets.cpp:343
Definition: Opcodes.h:1397
ObjectGuid GuidActual
Definition: QueryPackets.h:99
Definition: QueryPackets.h:355
WorldPacket const * Write() override
Definition: QueryPackets.cpp:199
Definition: Packet.h:59
uint32 CreatureID
Definition: QueryPackets.h:73
QueryPageTextResponse()
Definition: QueryPackets.h:135
#define MAX_KILL_CREDIT
Definition: Creature.h:72
QueryItemTextResponse()
Definition: QueryPackets.h:441
uint32 Flags[2]
Definition: QueryPackets.h:57
int32 QuestID
Definition: QueryPackets.h:383
WorldPacket const * Write() override
Definition: QueryPackets.cpp:259
Definition: QueryPackets.h:227
Definition: Opcodes.h:357
Definition: QueryPackets.h:92
Definition: Opcodes.h:1403
Definition: Opcodes.h:544
GameObjectStats Stats
Definition: QueryPackets.h:256
bool Allow
Definition: QueryPackets.h:146
QueryPetName(WorldPacket &&packet)
Definition: QueryPackets.h:400
WorldPacket const * Write() override
Definition: QueryPackets.cpp:29
Definition: Opcodes.h:515
Definition: Opcodes.h:518
#define MAX_CREATURE_NAMES
Definition: Creature.h:74
Definition: Opcodes.h:532
ObjectGuid UnitGUID
Definition: QueryPackets.h:404
Definition: Packet.h:46
uint32 Timestamp
Definition: QueryPackets.h:200
uint8 Sex
Definition: QueryPackets.h:103
QueryPlayerNameResponse()
Definition: QueryPackets.h:112
QueryCreatureResponse()
Definition: QueryPackets.h:67
WorldPacket const * Write() override
Definition: QueryPackets.cpp:290
uint8 Race
Definition: QueryPackets.h:102
Definition: Opcodes.h:1392
void Read() override
Definition: QueryPackets.cpp:193
ObjectGuid Player
Definition: QueryPackets.h:89
bool Allow
Definition: QueryPackets.h:415
int32_t int32
Definition: Define.h:146
uint32 BroadcastTextID[MAX_NPC_TEXT_OPTIONS]
Definition: QueryPackets.h:172
WorldPacket const * Write() override
Definition: QueryPackets.cpp:328
uint32_t uint32
Definition: Define.h:150
G3D::Vector3 Position
Definition: QueryPackets.h:298
uint32 GameObjectID
Definition: QueryPackets.h:254
ObjectGuid BnetAccountID
Definition: QueryPackets.h:98
ObjectGuid Id
Definition: QueryPackets.h:445
float EnergyMulti
Definition: QueryPackets.h:52
float Probabilities[MAX_NPC_TEXT_OPTIONS]
Definition: QueryPackets.h:171
Definition: QueryPackets.h:82
void Read() override
Definition: QueryPackets.h:307
std::vector< QuestCompletionNPC > QuestCompletionNPCs
Definition: QueryPackets.h:394
uint32 GameObjectID
Definition: QueryPackets.h:224
uint32 VirtualRealmAddress
Definition: QueryPackets.h:101
QuestPOIQuery(WorldPacket &&packet)
Definition: QueryPackets.h:324
boost::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Common.h:170
ItemTextCache Item
Definition: QueryPackets.h:447
bool Initialize(ObjectGuid const &guid, Player const *player=nullptr)
Definition: QueryPackets.cpp:116
uint8 Level
Definition: QueryPackets.h:105
Definition: QueryPackets.h:438
Definition: Opcodes.h:1396
int32 QuestObjectiveID
Definition: QueryPackets.h:342
Definition: Opcodes.h:1404
uint32 TableHash
Definition: QueryPackets.h:188
int32 X
Definition: QueryPackets.h:334
int32 MapID
Definition: QueryPackets.h:277
bool HasDeclined
Definition: QueryPackets.h:417
Definition: QueryPackets.h:433
Definition: QueryPackets.h:247
Definition: QueryPackets.h:338
Definition: BattlegroundMgr.h:57
QueryNPCText(WorldPacket &&packet)
Definition: QueryPackets.h:154
DeclinedName DeclinedNames
Definition: QueryPackets.h:106
int32 QuestID
Definition: QueryPackets.h:357
Definition: Opcodes.h:944
QueryPetNameResponse()
Definition: QueryPackets.h:410
Definition: SharedDefines.h:166
uint32 Timestamp
Definition: QueryPackets.h:419
ObjectGuid Transport
Definition: QueryPackets.h:288
int32 Classification
Definition: QueryPackets.h:50
std::vector< QuestPOIBlobPoint > QuestPOIBlobPointStats
Definition: QueryPackets.h:352
Definition: Opcodes.h:233
CorpseLocation()
Definition: QueryPackets.h:270
QueryCorpseTransport(WorldPacket &&packet)
Definition: QueryPackets.h:284
WorldPacket const * Write() override
Definition: QueryPackets.cpp:271
WorldPacket const * Write() override
Definition: QueryPackets.cpp:443
Definition: QueryPackets.h:291
std::string Title
Definition: QueryPackets.h:45
QueryGameObjectResponse()
Definition: QueryPackets.h:250
PageTextInfo Info
Definition: QueryPackets.h:147
HotfixData const * Hotfixes
Definition: QueryPackets.h:213
int32 QuestObjectID
Definition: QueryPackets.h:343
Definition: QueryPackets.h:310
uint32 TableHash
Definition: QueryPackets.h:199
std::vector< int32 > QuestItems
Definition: QueryPackets.h:237
Definition: QueryPackets.h:332
int32_t int32
Definition: g3dmath.h:167
bool Leader
Definition: QueryPackets.h:53
uint8_t uint8
Definition: Define.h:152
QueryPageText(WorldPacket &&packet)
Definition: QueryPackets.h:124
Optional< uint32 > NativeRealmAddress
original realm (?) (identifier made from the Index, BattleGroup and Region)
Definition: QueryPackets.h:79
std::string NameAlt[MAX_CREATURE_NAMES]
Definition: QueryPackets.h:61
CreatureFamily
Definition: SharedDefines.h:3576
void Read() override
Definition: QueryPackets.cpp:468
Definition: Opcodes.h:528
void Read() override
Definition: QueryPackets.cpp:438
int32 MissingQuestCount
Definition: QueryPackets.h:328
ObjectGuid GUID
Definition: QueryPackets.h:180
int32 Y
Definition: QueryPackets.h:335
std::vector< DBQueryRecord > Queries
Definition: QueryPackets.h:189
Definition: Opcodes.h:1393
float Size
Definition: QueryPackets.h:236
Definition: ObjectGuid.h:189
Definition: Opcodes.h:1417
QueryTimeResponse()
Definition: QueryPackets.h:313
int32 Floor
Definition: QueryPackets.h:346
DBQueryBulk(WorldPacket &&packet)
Definition: QueryPackets.h:184
std::string IconName
Definition: QueryPackets.h:230
Definition: Unit.h:1101
WorldPacket const * Write() override
Definition: QueryPackets.cpp:483
ObjectGuid ItemGUID
Definition: QueryPackets.h:128
uint32 ProxyCreatureID[MAX_KILL_CREDIT]
Definition: QueryPackets.h:58
bool Valid
Definition: QueryPackets.h:446
Type
Type of JSON value.
Definition: rapidjson.h:642
Definition: Opcodes.h:1400
Definition: Opcodes.h:526
Definition: QueryPackets.h:132
uint32 TextID
Definition: QueryPackets.h:169
uint32 DisplayID
Definition: QueryPackets.h:234
QueryCreature(WorldPacket &&packet)
Definition: QueryPackets.h:36
DeclinedName DeclinedNames
Definition: QueryPackets.h:418
std::string CastBarCaption
Definition: QueryPackets.h:231
Definition: QueryPackets.h:267
QueryCorpseLocationFromClient(WorldPacket &&packet)
Definition: QueryPackets.h:262
Definition: WorldPacket.h:26
WorldPacket const * Write() override
Definition: QueryPackets.cpp:182
QueryPlayerName(WorldPacket &&packet)
Definition: QueryPackets.h:85
int32 PlayerConditionID
Definition: QueryPackets.h:350
std::string Name
Definition: QueryPackets.h:100
bool IsDeleted
Definition: QueryPackets.h:96
uint32 RecordID
Definition: QueryPackets.h:181
Definition: Opcodes.h:934
Data
Definition: molten_core.h:69
void Read() override
Definition: QueryPackets.cpp:24
Definition: QueryPackets.h:43
uint32 CreatureDisplayID[MAX_CREATURE_MODELS]
Definition: QueryPackets.h:59
CreatureType
Definition: SharedDefines.h:3552
Definition: SharedDefines.h:95
ObjectGuid Guid
Definition: QueryPackets.h:158
void Read() override
Definition: QueryPackets.cpp:412
CorpseTransportQuery()
Definition: QueryPackets.h:294
int32 MissingQuestPOIs[50]
Definition: QueryPackets.h:329
Definition: Opcodes.h:524
int32 ActualMapID
Definition: QueryPackets.h:276
#define MAX_GAMEOBJECT_DATA
Definition: SharedDefines.h:2117