OregonCore  revision 3611e8a-git
Your Favourite TBC server
MiscHandler.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore 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 #include "Common.h"
19 #include "Language.h"
20 #include "Database/DatabaseEnv.h"
21 #include "Database/DatabaseImpl.h"
22 #include "WorldPacket.h"
23 #include "Opcodes.h"
24 #include "Log.h"
25 #include "Player.h"
26 #include "GossipDef.h"
27 #include "World.h"
28 #include "ObjectMgr.h"
29 #include "WorldSession.h"
30 #include "LootMgr.h"
31 #include "Chat.h"
32 #include "zlib.h"
33 #include "MapManager.h"
34 #include "ObjectAccessor.h"
35 #include "Object.h"
36 #include "Battleground.h"
37 #include "OutdoorPvP.h"
38 #include "SpellAuras.h"
39 #include "SocialMgr.h"
40 #include "ScriptMgr.h"
41 #include "CreatureAI.h"
42 #include "GameObjectAI.h"
43 #include "AccountMgr.h"
44 
46 {
47  DEBUG_LOG("WORLD: Recvd CMSG_REPOP_REQUEST Message");
48 
49  recv_data.read_skip<uint8>();
50 
52  return;
53 
54  // the world update order is sessions, players, creatures
55  // the netcode runs in parallel with all of these
56  // creatures can kill players
57  // so if the server is lagging enough the player can
58  // release spirit after he's killed but before he is updated
59  if (GetPlayer()->getDeathState() == JUST_DIED)
60  {
61  DEBUG_LOG("HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
62  GetPlayer()->KillPlayer();
63  }
64 
65  //this is spirit release confirm?
69 }
70 
72 {
73  DEBUG_LOG("WORLD: CMSG_GOSSIP_SELECT_OPTION");
74 
75  uint32 gossipListId;
76  uint32 menuId;
77  uint64 guid;
78  std::string code = "";
79 
80  recv_data >> guid >> menuId >> gossipListId;
81 
82  if (_player->PlayerTalkClass->GossipOptionCoded(gossipListId))
83  {
84  // recheck
85  sLog.outBasic("reading string");
86  recv_data >> code;
87  sLog.outBasic("string read: %s", code.c_str());
88  }
89 
90  Creature* unit = NULL;
91  GameObject* go = NULL;
92  if (IS_CREATURE_GUID(guid))
93  {
95  if (!unit)
96  {
97  DEBUG_LOG("WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
98  return;
99  }
100  }
101  else if (IS_GAMEOBJECT_GUID(guid))
102  {
103  go = _player->GetMap()->GetGameObject(guid);
104  if (!go)
105  {
106  DEBUG_LOG("WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid)));
107  return;
108  }
109  }
110  else
111  {
112  DEBUG_LOG("WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid)));
113  return;
114  }
115 
116  // remove fake death
117  if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
119 
120  if (!code.empty())
121  {
122  if (unit)
123  {
124  unit->AI()->sGossipSelectCode(_player, menuId, gossipListId, code.c_str());
125  if (!sScriptMgr.GossipSelectWithCode(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str()))
126  _player->OnGossipSelect(unit, gossipListId, menuId);
127  }
128  else
129  {
130  go->AI()->GossipSelectCode(_player, menuId, gossipListId, code.c_str());
131  sScriptMgr.GOSelectWithCode(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str());
132  }
133  }
134  else
135  {
136  if (unit)
137  {
138  unit->AI()->sGossipSelect(_player, menuId, gossipListId);
139  if (!sScriptMgr.GossipSelect(_player, unit, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId)))
140  _player->OnGossipSelect(unit, gossipListId, menuId);
141  }
142  else
143  {
144  go->AI()->GossipSelect(_player, menuId, gossipListId);
146  }
147  }
148 }
149 
151 {
152  DEBUG_LOG("WORLD: Recvd CMSG_WHO Message");
153 
154  uint32 matchcount = 0;
155 
156  uint32 level_min, level_max, racemask, classmask, zones_count, str_count;
157  uint32 zoneids[10]; // 10 is client limit
158  std::string player_name, guild_name;
159 
160  recv_data >> level_min; // maximal player level, default 0
161  recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL)
162  recv_data >> player_name; // player name, case sensitive...
163 
164  recv_data >> guild_name; // guild name, case sensitive...
165 
166  recv_data >> racemask; // race mask
167  recv_data >> classmask; // class mask
168  recv_data >> zones_count; // zones count, client limit = 10 (2.0.10)
169 
170  if (zones_count > 10)
171  return; // can't be received from real client or broken packet
172 
173  for (uint32 i = 0; i < zones_count; ++i)
174  {
175  uint32 temp;
176  recv_data >> temp; // zone id, 0 if zone is unknown...
177  zoneids[i] = temp;
178  DEBUG_LOG("Zone %u: %u", i, zoneids[i]);
179  }
180 
181  recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10)
182 
183  if (str_count > 4)
184  return; // can't be received from real client or broken packet
185 
186  DEBUG_LOG("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count);
187 
188  std::wstring str[4]; // 4 is client limit
189  for (uint32 i = 0; i < str_count; ++i)
190  {
191  std::string temp;
192  recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)?
193 
194  if (!Utf8toWStr(temp, str[i]))
195  continue;
196 
197  wstrToLower(str[i]);
198 
199  DEBUG_LOG("String %u: %s", i, temp.c_str());
200  }
201 
202  std::wstring wplayer_name;
203  std::wstring wguild_name;
204  if (!(Utf8toWStr(player_name, wplayer_name) && Utf8toWStr(guild_name, wguild_name)))
205  return;
206  wstrToLower(wplayer_name);
207  wstrToLower(wguild_name);
208 
209  // client send in case not set max level value 100 but Oregon supports 255 max level,
210  // update it to show GMs with characters after 100 level
211  if (level_max >= MAX_LEVEL)
212  level_max = STRONG_MAX_LEVEL;
213 
214  uint32 team = _player->GetTeam();
215  uint32 security = GetSecurity();
216  bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
217  bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST);
218  bool hideInArena = sWorld.getConfig(CONFIG_ARENA_HIDE_FROM_SOCIAL);
219  uint32 displaycount = 0;
220 
221  WorldPacket data(SMSG_WHO, 50); // guess size
222  data << uint32(matchcount); // placeholder, count of players matching criteria
223  data << uint32(displaycount); // placeholder, count of players displayed
224 
227  for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
228  {
229  if (security == SEC_PLAYER)
230  {
231  // player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST
232  if (itr->second->GetTeam() != team && !allowTwoSideWhoList)
233  continue;
234 
235  // player can see MODERATOR, GAME MASTER, ADMINISTRATOR only if CONFIG_GM_IN_WHO_LIST
236  if ((itr->second->GetSession()->GetSecurity() > SEC_PLAYER && !gmInWhoList))
237  continue;
238  }
239 
240  //do not process players which are not in world
241  if (!(itr->second->IsInWorld()))
242  continue;
243 
244  // check if target is globally visible for player
245  if (!(itr->second->IsVisibleGloballyFor(_player)))
246  continue;
247 
248  // check if target's level is in level range
249  uint32 lvl = itr->second->getLevel();
250  if (lvl < level_min || lvl > level_max)
251  continue;
252 
253  // check if class matches classmask
254  uint32 class_ = itr->second->getClass();
255  if (!(classmask & (1 << class_)))
256  continue;
257 
258  // check if race matches racemask
259  uint32 race = itr->second->getRace();
260  if (!(racemask & (1 << race)))
261  continue;
262 
263  uint32 pzoneid;
264  if (hideInArena && itr->second->InBattleground())
265  {
266  if (itr->second->GetBattlegroundEntryPoint().GetMapId() == MAPID_INVALID)
267  pzoneid = 0; // unknown
268  else
269  pzoneid = MapManager::Instance().GetZoneId(itr->second->GetBattlegroundEntryPoint().GetMapId(),
270  itr->second->GetBattlegroundEntryPoint().GetPositionX(), itr->second->GetBattlegroundEntryPoint().GetPositionY(),
271  itr->second->GetBattlegroundEntryPoint().GetPositionZ());
272  }
273  else
274  pzoneid = itr->second->GetZoneId();
275 
276  uint8 gender = itr->second->getGender();
277 
278  bool z_show = true;
279  for (uint32 i = 0; i < zones_count; ++i)
280  {
281  if (zoneids[i] == pzoneid)
282  {
283  z_show = true;
284  break;
285  }
286 
287  z_show = false;
288  }
289  if (!z_show)
290  continue;
291 
292  std::string pname = itr->second->GetName();
293  std::wstring wpname;
294  if (!Utf8toWStr(pname, wpname))
295  continue;
296  wstrToLower(wpname);
297 
298  if (!(wplayer_name.empty() || wpname.find(wplayer_name) != std::wstring::npos))
299  continue;
300 
301  std::string gname = sObjectMgr.GetGuildNameById(itr->second->GetGuildId());
302  std::wstring wgname;
303  if (!Utf8toWStr(gname, wgname))
304  continue;
305  wstrToLower(wgname);
306 
307  if (!(wguild_name.empty() || wgname.find(wguild_name) != std::wstring::npos))
308  continue;
309 
310  std::string aname;
311  if (AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(itr->second->GetZoneId()))
312  aname = areaEntry->area_name[GetSessionDbcLocale()];
313 
314  bool s_show = true;
315  for (uint32 i = 0; i < str_count; ++i)
316  {
317  if (!str[i].empty())
318  {
319  if (wgname.find(str[i]) != std::wstring::npos ||
320  wpname.find(str[i]) != std::wstring::npos ||
321  Utf8FitTo(aname, str[i]))
322  {
323  s_show = true;
324  break;
325  }
326  s_show = false;
327  }
328  }
329  if (!s_show)
330  continue;
331 
332  // 49 is maximum player count sent to client - can be overridden
333  // through config, but is unstable
334  if ((++matchcount) == sWorld.getConfig(CONFIG_MAX_WHO))
335  continue;
336 
337  data << pname; // player name
338  data << gname; // guild name
339  data << uint32(lvl); // player level
340  data << uint32(class_); // player class
341  data << uint32(race); // player race
342  data << uint8(gender); // player gender
343  data << uint32(pzoneid); // player zone id
344 
345  ++displaycount;
346  }
347 
348  data.put(0, displaycount); // insert right count, count of matches
349  data.put(4, matchcount); // insert right count, count displayed
350 
351  SendPacket(&data);
352  DEBUG_LOG("WORLD: Send SMSG_WHO Message");
353 }
354 
356 {
357  DEBUG_LOG("WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity());
358 
359  if (uint64 lguid = GetPlayer()->GetLootGUID())
360  DoLootRelease(lguid);
361 
362  //Can not logout if...
363  if (GetPlayer()->IsInCombat() || //...is in combat
364  GetPlayer()->duel || //...is in Duel
365  GetPlayer()->HasAura(9454, 0) || //...is frozen by GM via freeze command
366  //...is jumping ...is falling
367  GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLINGFAR))
368  {
369  WorldPacket data(SMSG_LOGOUT_RESPONSE, (2 + 4)) ;
370  data << (uint8)0xC;
371  data << uint32(0);
372  data << uint8(0);
373  SendPacket(&data);
374  LogoutRequest(0);
375  return;
376  }
377 
378  //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in OregonCore.conf
379  if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() ||
380  GetSecurity() >= sWorld.getConfig(CONFIG_INSTANT_LOGOUT))
381  {
382  LogoutPlayer(true);
383  return;
384  }
385 
386  // not set flags if player can't free move to prevent lost state at logout cancel
387  if (GetPlayer()->CanFreeMove())
388  {
389  if (GetPlayer()->getStandState() == UNIT_STAND_STATE_STAND)
391 
392  WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8 + 4)); // guess size
393  data << GetPlayer()->GetPackGUID();
394  data << (uint32)2;
395  SendPacket(&data);
397  }
398 
400  data << uint32(0);
401  data << uint8(0);
402  SendPacket(&data);
403  LogoutRequest(time(NULL));
404 }
405 
407 {
408  DEBUG_LOG("WORLD: Recvd CMSG_PLAYER_LOGOUT Message");
409 }
410 
412 {
413  DEBUG_LOG("WORLD: Recvd CMSG_LOGOUT_CANCEL Message");
414 
415  // Player have already logged out serverside, too late to cancel
416  if (!GetPlayer())
417  return;
418 
419  LogoutRequest(0);
420 
422  SendPacket(&data);
423 
424  // not remove flags if can't free move - its not set in Logout request code.
425  if (GetPlayer()->CanFreeMove())
426  {
428  data.Initialize(SMSG_FORCE_MOVE_UNROOT, 8); // guess size
429  data << GetPlayer()->GetPackGUID();
430  data << uint32(0);
431  SendPacket(&data);
432 
435 
438  }
439 
440  DEBUG_LOG("WORLD: sent SMSG_LOGOUT_CANCEL_ACK Message");
441 }
442 
444 {
445  // this opcode can be used in two ways: Either set explicit new status or toggle old status
446  if (recv_data.size() == 1)
447  {
448  bool newPvPStatus;
449  recv_data >> newPvPStatus;
451  }
452  else
454 
455  if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
456  {
457  if (!GetPlayer()->IsPvP() || GetPlayer()->pvpInfo.endTimer != 0)
458  GetPlayer()->UpdatePvP(true, true);
459  }
460  else
461  {
462  if (!GetPlayer()->pvpInfo.inHostileArea && GetPlayer()->IsPvP())
463  GetPlayer()->pvpInfo.endTimer = time(NULL); // start toggle-off
464  }
465 }
466 
468 {
469  uint32 newZone;
470  recv_data >> newZone;
471 
472  DEBUG_LOG("WORLD: Recvd ZONE_UPDATE: %u", newZone);
473 
474  GetPlayer()->UpdateZone(newZone);
475 
476  GetPlayer()->SendInitWorldStates(true, newZone);
477 }
478 
480 {
481  // When this packet send?
482  uint64 guid ;
483  recv_data >> guid;
484 
486 
487  // update reputation list if need
488  Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
489  if (!unit)
490  return;
491 
492  if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->getFaction()))
493  _player->GetReputationMgr().SetVisible(factionTemplateEntry);
494 }
495 
497 {
498  uint64 guid;
499  recv_data >> guid;
500 
501  _player->SetSelection(guid);
502 }
503 
505 {
506  // DEBUG_LOG("WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop
507  uint32 animstate;
508  recv_data >> animstate;
509 
510  _player->SetStandState(animstate);
511 }
512 
514 {
515  DEBUG_LOG("WORLD: Received CMSG_CONTACT_LIST");
516  uint32 unk;
517  recv_data >> unk;
518  DEBUG_LOG("unk value is %u", unk);
520 }
521 
523 {
524  DEBUG_LOG("WORLD: Received CMSG_ADD_FRIEND");
525 
526  std::string friendName = GetOregonString(LANG_FRIEND_IGNORE_UNKNOWN);
527  std::string friendNote;
528 
529  recv_data >> friendName;
530 
531  recv_data >> friendNote;
532 
533  if (!normalizePlayerName(friendName))
534  return;
535 
536  CharacterDatabase.escape_string(friendName); // prevent SQL injection - normal name don't must changed by this call
537 
538  DEBUG_LOG("WORLD: %s asked to add friend : '%s'",
539  GetPlayer()->GetName(), friendName.c_str());
540 
541  CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddFriendOpcodeCallBack, GetAccountId(), friendNote, "SELECT guid, race, account FROM characters WHERE name = '%s'", friendName.c_str());
542 }
543 
544 void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, uint32 accountId, std::string friendNote)
545 {
546  uint64 friendGuid;
547  uint64 friendAccountId;
548  uint32 team;
549  FriendsResult friendResult;
550 
551  WorldSession* session = sWorld.FindSession(accountId);
552 
553  if (!session || !session->GetPlayer())
554  return;
555 
556  friendResult = FRIEND_NOT_FOUND;
557  friendGuid = 0;
558 
559  if (result)
560  {
561  friendGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
562  team = Player::TeamForRace((*result)[1].GetUInt8());
563  friendAccountId = (*result)[2].GetUInt32();
564 
565  if (session->GetSecurity() >= SEC_MODERATOR || sWorld.getConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr->GetSecurity(friendAccountId, realmID) < SEC_MODERATOR)
566  {
567  if (friendGuid)
568  {
569  if (friendGuid == session->GetPlayer()->GetGUID())
570  friendResult = FRIEND_SELF;
571  else if (session->GetPlayer()->GetTeam() != team && !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && session->GetSecurity() < SEC_MODERATOR)
572  friendResult = FRIEND_ENEMY;
573  else if (session->GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid)))
574  friendResult = FRIEND_ALREADY;
575  else
576  {
577  Player* pFriend = ObjectAccessor::FindPlayer(friendGuid);
578  if (pFriend && pFriend->IsVisibleGloballyFor(session->GetPlayer()))
579  friendResult = FRIEND_ADDED_ONLINE;
580  else
581  friendResult = FRIEND_ADDED_OFFLINE;
582  if (!session->GetPlayer()->GetSocial()->AddToSocialList(GUID_LOPART(friendGuid), false))
583  {
584  friendResult = FRIEND_LIST_FULL;
585  sLog.outDebug("WORLD: %s's friend list is full.", session->GetPlayer()->GetName());
586  }
587  }
588  session->GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote);
589  }
590  }
591  }
592 
593  sSocialMgr.SendFriendStatus(session->GetPlayer(), friendResult, GUID_LOPART(friendGuid), false);
594 
595  DEBUG_LOG("WORLD: Sent (SMSG_FRIEND_STATUS)");
596 }
597 
599 {
600  uint64 FriendGUID;
601 
602  DEBUG_LOG("WORLD: Received CMSG_DEL_FRIEND");
603 
604  recv_data >> FriendGUID;
605 
606  _player->GetSocial()->RemoveFromSocialList(GUID_LOPART(FriendGUID), false);
607 
608  sSocialMgr.SendFriendStatus(GetPlayer(), FRIEND_REMOVED, GUID_LOPART(FriendGUID), false);
609 
610  DEBUG_LOG("WORLD: Sent motd (SMSG_FRIEND_STATUS)");
611 }
612 
614 {
615  DEBUG_LOG("WORLD: Received CMSG_ADD_IGNORE");
616 
617  std::string IgnoreName = GetOregonString(LANG_FRIEND_IGNORE_UNKNOWN);
618 
619  recv_data >> IgnoreName;
620 
621  if (!normalizePlayerName(IgnoreName))
622  return;
623 
624  CharacterDatabase.escape_string(IgnoreName); // prevent SQL injection - normal name don't must changed by this call
625 
626  DEBUG_LOG("WORLD: %s asked to Ignore: '%s'",
627  GetPlayer()->GetName(), IgnoreName.c_str());
628 
629  CharacterDatabase.AsyncPQuery(&WorldSession::HandleAddIgnoreOpcodeCallBack, GetAccountId(), "SELECT guid FROM characters WHERE name = '%s'", IgnoreName.c_str());
630 }
631 
633 {
634  uint64 IgnoreGuid;
635  FriendsResult ignoreResult;
636 
637  WorldSession* session = sWorld.FindSession(accountId);
638 
639  if (!session || !session->GetPlayer())
640  return;
641 
642  ignoreResult = FRIEND_IGNORE_NOT_FOUND;
643  IgnoreGuid = 0;
644 
645  if (result)
646  {
647  IgnoreGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
648 
649  if (IgnoreGuid)
650  {
651  if (IgnoreGuid == session->GetPlayer()->GetGUID()) //not add yourself
652  ignoreResult = FRIEND_IGNORE_SELF;
653  else if (session->GetPlayer()->GetSocial()->HasIgnore(GUID_LOPART(IgnoreGuid)))
654  ignoreResult = FRIEND_IGNORE_ALREADY;
655  else
656  {
657  ignoreResult = FRIEND_IGNORE_ADDED;
658 
659  // ignore list full
660  if (!session->GetPlayer()->GetSocial()->AddToSocialList(GUID_LOPART(IgnoreGuid), true))
661  ignoreResult = FRIEND_IGNORE_FULL;
662  }
663  }
664  }
665 
666  sSocialMgr.SendFriendStatus(session->GetPlayer(), ignoreResult, GUID_LOPART(IgnoreGuid), false);
667 
668  DEBUG_LOG("WORLD: Sent (SMSG_FRIEND_STATUS)");
669 }
670 
672 {
673  uint64 IgnoreGUID;
674 
675  DEBUG_LOG("WORLD: Received CMSG_DEL_IGNORE");
676 
677  recv_data >> IgnoreGUID;
678 
679  _player->GetSocial()->RemoveFromSocialList(GUID_LOPART(IgnoreGUID), true);
680 
681  sSocialMgr.SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, GUID_LOPART(IgnoreGUID), false);
682 
683  DEBUG_LOG("WORLD: Sent motd (SMSG_FRIEND_STATUS)");
684 }
685 
687 {
688  uint64 guid;
689  std::string note;
690  recv_data >> guid >> note;
691  _player->GetSocial()->SetFriendNote(guid, note);
692 }
693 
695 {
696  uint32 suggestion, contentlen, typelen;
697  std::string content, type;
698 
699  recv_data >> suggestion >> contentlen >> content;
700  recv_data >> typelen >> type;
701 
702  #ifdef OREGON_DEBUG
703  if (suggestion == 0)
704  DEBUG_LOG("WORLD: Received CMSG_BUG [Bug Report] \n %s \n %s", type.c_str(), content.c_str());
705  else
706  DEBUG_LOG("WORLD: Received CMSG_BUG [Suggestion]");
707  #endif
708 
711  CharacterDatabase.PExecute("INSERT INTO bugreport (type,content) VALUES('%s', '%s')", type.c_str(), content.c_str());
712 }
713 
715 {
716  DEBUG_LOG("WORLD: Received CMSG_RECLAIM_CORPSE");
717 
718  uint64 guid;
719  recv_data >> guid;
720 
721  if (GetPlayer()->IsAlive())
722  return;
723 
724  // do not allow corpse reclaim in arena
725  if (GetPlayer()->InArena())
726  return;
727 
728  // body not released yet
729  if (!GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
730  return;
731 
732  Corpse* corpse = GetPlayer()->GetCorpse();
733 
734  if (!corpse)
735  return;
736 
737  // prevent resurrect before 30-sec delay after body release not finished
738  if (corpse->GetGhostTime() + GetPlayer()->GetCorpseReclaimDelay(corpse->GetType() == CORPSE_RESURRECTABLE_PVP) > uint32(time(NULL)))
739  return;
740 
741  if (!corpse->IsWithinDistInMap(GetPlayer(), CORPSE_RECLAIM_RADIUS, true))
742  return;
743 
744  // resurrect
745  GetPlayer()->ResurrectPlayer(GetPlayer()->InBattleground() ? 1.0f : 0.5f);
746 
747  // spawn bones
749 }
750 
752 {
753  DEBUG_LOG("WORLD: Received CMSG_RESURRECT_RESPONSE");
754 
755  uint64 guid;
756  uint8 status;
757  recv_data >> guid;
758  recv_data >> status;
759 
760  if (GetPlayer()->IsAlive())
761  return;
762 
763  if (status == 0)
764  {
765  GetPlayer()->clearResurrectRequestData(); // reject
766  return;
767  }
768 
769  if (!GetPlayer()->isRessurectRequestedBy(guid))
770  return;
771 
773 }
774 
776 {
777  DEBUG_LOG("WORLD: Received CMSG_AREATRIGGER");
778 
779  uint32 triggerId;
780  recv_data >> triggerId;
781 
782  DEBUG_LOG("Trigger ID:%u", triggerId);
783 
784  if (GetPlayer()->isInFlight())
785  {
786  DEBUG_LOG("Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), triggerId);
787  return;
788  }
789 
790  AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId);
791  if (!atEntry)
792  {
793  DEBUG_LOG("Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), triggerId);
794  return;
795  }
796 
797  if (!GetPlayer()->IsInAreaTriggerRadius(atEntry))
798  {
799  DEBUG_LOG("Player '%s' (GUID: %u) too far, ignore Area Trigger ID: %u",
800  GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), triggerId);
801  return;
802  }
803 
804  if (sScriptMgr.AreaTrigger(GetPlayer(), atEntry))
805  return;
806 
807  if (GetPlayer()->IsAlive())
808  if (uint32 questId = sObjectMgr.GetQuestForAreaTrigger(triggerId))
811 
812  if (sObjectMgr.IsTavernAreaTrigger(triggerId))
813  {
814  // set resting flag we are in the inn
816 
817  if (sWorld.IsFFAPvPRealm())
818  GetPlayer()->SetFFAPvP(false);
819 
820  return;
821  }
822 
823  if (Battleground* bg = GetPlayer()->GetBattleground())
824  if (bg->GetStatus() == STATUS_IN_PROGRESS)
825  bg->HandleAreaTrigger(GetPlayer(), triggerId);
826 
827  if (OutdoorPvP* pvp = GetPlayer()->GetOutdoorPvP())
828  if (pvp->HandleAreaTrigger(_player, triggerId))
829  return;
830 
831  AreaTrigger const* at = sObjectMgr.GetAreaTrigger(triggerId);
832  if (!at)
833  return;
834 
835  uint32 testTwo = 1;
836  bool teleported = false;
837  if (GetPlayer()->GetMapId() != at->target_mapId)
838  {
839  if (at->access_id)
840  if (AccessRequirement const* arEntry = sObjectMgr.GetAccessRequirement(at->access_id))
841  if (!GetPlayer()->Satisfy(arEntry, at->target_mapId, true))
842  return;
843 
845  {
846  bool reviveAtTrigger = false; // should we revive the player if he is trying to enter the correct instance?
847  switch (denyReason)
848  {
850  sLog.outDebug("MAP: Player '%s' attempted to enter map with id %d which has no entry", GetPlayer()->GetName(), at->target_mapId);
851  break;
853  sLog.outDebug("MAP: Player '%s' attempted to enter dungeon map %d but no instance template was found", GetPlayer()->GetName(), at->target_mapId);
854  break;
856  sLog.outDebug("MAP: Player '%s' attempted to enter instance map %d but the requested difficulty was not found", GetPlayer()->GetName(), at->target_mapId);
857  if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId))
859  break;
861  {
862  WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
863  data << uint32(0);
864  data << uint32(1); // You must be in a raid group to enter this instance.
865  GetPlayer()->GetSession()->SendPacket(&data);
866  sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance map %d", GetPlayer()->GetName(), at->target_mapId);
867  reviveAtTrigger = true;
868  break;
869  }
871  {
872  sLog.outDebug("MAP: Player '%s' does not have a corpse in instance map %d and cannot enter", GetPlayer()->GetName(), at->target_mapId);
873  break;
874  }
876  if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId))
877  {
878  char const* mapName = entry->name[GetPlayer()->GetSession()->GetSessionDbcLocale()];
879  sLog.outDebug("MAP: Player '%s' cannot enter instance map '%s' because their permanent bind is incompatible with their groups.", GetPlayer()->GetName(), mapName);
880  // @todo figure out how to get player localized difficulty string (e.g. "10 player", "Heroic" etc)
881  ChatHandler(GetPlayer()->GetSession()).PSendSysMessage(GetPlayer()->GetSession()->GetOregonString(LANG_INSTANCE_BIND_MISMATCH), mapName);
882  }
883  reviveAtTrigger = true;
884  break;
887  sLog.outDebug("MAP: Player '%s' cannot enter instance map %d because he has exceeded the maximum number of instances per hour.", GetPlayer()->GetName(), at->target_mapId);
888  reviveAtTrigger = true;
889  break;
892  reviveAtTrigger = true;
893  break;
896  reviveAtTrigger = true;
897  break;
898  default:
899  break;
900  }
901 
902  // check if the player is touching the areatrigger leading to the map his corpse is on
903  if (reviveAtTrigger)
904  {
905  if (!GetPlayer()->IsAlive())
906  {
907  if (Corpse* corpse = GetPlayer()->GetCorpse())
908  {
909  uint32 instance_map = corpse->GetMapId();
910  do
911  {
912  if (instance_map == at->target_mapId)
913  break;
914 
915  InstanceTemplate const* instance = sObjectMgr.GetInstanceTemplate(instance_map);
916  instance_map = instance ? instance->parent : 0;
917  } while (instance_map);
918 
919  if (instance_map)
920  {
921  GetPlayer()->ResurrectPlayer(0.5f, false);
923  }
924  }
925  }
926  }
927 
928  return;
929  }
930  }
931 
932  if (!teleported)
934 }
935 
937 {
938  DEBUG_LOG("WORLD: Received CMSG_UPDATE_ACCOUNT_DATA");
939  // not yet implemented. Needs to be backported from TC2
940  recv_data.rpos(recv_data.wpos()); // prevent warnings spam
941 }
942 
944 {
945  DEBUG_LOG("WORLD: Received CMSG_REQUEST_ACCOUNT_DATA");
946  // not yet implemented. Needs to be backported from TC2
947  recv_data.rpos(recv_data.wpos()); // prevent warnings spam
948 }
949 
951 {
952  DEBUG_LOG("WORLD: Received CMSG_SET_ACTION_BUTTON");
953  uint8 button, misc, type;
954  uint16 action;
955  recv_data >> button >> action >> misc >> type;
956  DEBUG_LOG("BUTTON: %u ACTION: %u TYPE: %u MISC: %u", button, action, type, misc);
957  if (action == 0)
958  {
959  DEBUG_LOG("MISC: Remove action from button %u", button);
960  GetPlayer()->removeActionButton(button);
961  }
962  else
963  {
964  if (type == ACTION_BUTTON_MACRO || type == ACTION_BUTTON_CMACRO)
965  {
966  DEBUG_LOG("MISC: Added Macro %u into button %u", action, button);
967  GetPlayer()->addActionButton(button, action, type, misc);
968  }
969  else if (type == ACTION_BUTTON_SPELL)
970  {
971  DEBUG_LOG("MISC: Added Action %u into button %u", action, button);
972  GetPlayer()->addActionButton(button, action, type, misc);
973  }
974  else if (type == ACTION_BUTTON_ITEM)
975  {
976  DEBUG_LOG("MISC: Added Item %u into button %u", action, button);
977  GetPlayer()->addActionButton(button, action, type, misc);
978  }
979  else
980  sLog.outError("MISC: Unknown action button type %u for action %u into button %u", type, action, button);
981  }
982 }
983 
985 {
986  // If player has sight bound to visual waypoint NPC we should remove it
988 }
989 
991 {
992  // Sent by client when cinematic actually begun. So we begin the server side process
994 }
995 
997 {
998  /* WorldSession::Update(getMSTime());*/
999  DEBUG_LOG("WORLD: Time Lag/Synchronization Resent/Update");
1000 
1001  recv_data.read_skip<uint64>();
1002  recv_data.read_skip<uint32>();
1003  /*
1004  uint64 guid;
1005  uint32 time_skipped;
1006  recv_data >> guid;
1007  recv_data >> time_skipped;
1008  DEBUG_LOG("WORLD: CMSG_MOVE_TIME_SKIPPED");
1009 
1010  // TODO
1011  must be need use in Oregon
1012  We substract server Lags to move time (AntiLags)
1013  for exmaple
1014  GetPlayer()->ModifyLastMoveTime(-int32(time_skipped));
1015  */
1016 }
1017 
1019 {
1020  DEBUG_LOG("WORLD: CMSG_MOVE_FEATHER_FALL_ACK");
1021 
1022  // no used
1023  recv_data.rpos(recv_data.wpos()); // prevent warnings spam
1024 }
1025 
1027 {
1028  // no used
1029  recv_data.rpos(recv_data.wpos()); // prevent warnings spam
1030 
1031  /*
1032  recv_data.hexlike();
1033 
1034  recv_data >> guid;
1035  recv_data >> unknown1;
1036  recv_data >> unknown2;
1037  recv_data >> PositionX;
1038  recv_data >> PositionY;
1039  recv_data >> PositionZ;
1040  recv_data >> Orientation;
1041  */
1042 }
1043 
1045 {
1046  // no used
1047  recv_data.rpos(recv_data.wpos()); // prevent warnings spam
1048 
1049  /*
1050  DEBUG_LOG("WORLD: CMSG_FORCE_MOVE_ROOT_ACK");
1051 
1052  recv_data >> guid;
1053  recv_data >> unknown1;
1054  recv_data >> unknown2;
1055  recv_data >> PositionX;
1056  recv_data >> PositionY;
1057  recv_data >> PositionZ;
1058  recv_data >> Orientation;
1059  */
1060 }
1061 
1063 {
1064  uint8 ActionBar;
1065  recv_data >> ActionBar;
1066 
1067  if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED)
1068  {
1069  if (ActionBar != 0)
1070  sLog.outError("WorldSession::HandleSetActionBar in not logged state with value: %u, ignored", uint32(ActionBar));
1071  return;
1072  }
1073 
1074  GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, ActionBar);
1075 }
1076 
1078 {
1079  WorldPacket data(SMSG_PLAYED_TIME, 4 + 4);
1080  data << uint32(_player->GetTotalPlayedTime());
1081  data << uint32(_player->GetLevelPlayedTime());
1082  SendPacket(&data);
1083 }
1084 
1086 {
1087  uint64 guid;
1088  recv_data >> guid;
1089  DEBUG_LOG("Inspected guid is (GUID: %u TypeId: %u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
1090 
1091  Player* player = sObjectMgr.GetPlayer(guid);
1092  if (!player) // wrong player
1093  return;
1094 
1095  if (!GetPlayer()->IsWithinDistInMap(player, INSPECT_DISTANCE, false))
1096  return;
1097 
1098  if (_player->IsHostileTo(player))
1099  return;
1100 
1101  uint32 talent_points = 0x3D;
1102  uint32 guid_size = player->GetPackGUID().size();
1103  WorldPacket data(SMSG_INSPECT_TALENT, 4 + talent_points);
1104  data << player->GetPackGUID();
1105  data << uint32(talent_points);
1106 
1107  // fill by 0 talents array
1108  for (uint32 i = 0; i < talent_points; ++i)
1109  data << uint8(0);
1110 
1112  {
1113  // find class talent tabs (all players have 3 talent tabs)
1114  uint32 const* talentTabIds = GetTalentTabPages(player->getClass());
1115 
1116  uint32 talentTabPos = 0; // pos of first talent rank in tab including all prev tabs
1117  for (uint32 i = 0; i < 3; ++i)
1118  {
1119  uint32 talentTabId = talentTabIds[i];
1120 
1121  // fill by real data
1122  for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
1123  {
1124  TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentId);
1125  if (!talentInfo)
1126  continue;
1127 
1128  // skip another tab talents
1129  if (talentInfo->TalentTab != talentTabId)
1130  continue;
1131 
1132  // find talent rank
1133  uint32 curtalent_maxrank = 0;
1134  for (uint32 k = 5; k > 0; --k)
1135  {
1136  if (talentInfo->RankID[k - 1] && player->HasSpell(talentInfo->RankID[k - 1]))
1137  {
1138  curtalent_maxrank = k;
1139  break;
1140  }
1141  }
1142 
1143  // not learned talent
1144  if (!curtalent_maxrank)
1145  continue;
1146 
1147  // 1 rank talent bit index
1148  uint32 curtalent_index = talentTabPos + GetTalentInspectBitPosInTab(talentId);
1149 
1150  uint32 curtalent_rank_index = curtalent_index + curtalent_maxrank - 1;
1151 
1152  // slot/offset in 7-bit bytes
1153  uint32 curtalent_rank_slot7 = curtalent_rank_index / 7;
1154  uint32 curtalent_rank_offset7 = curtalent_rank_index % 7;
1155 
1156  // rank pos with skipped 8 bit
1157  uint32 curtalent_rank_index2 = curtalent_rank_slot7 * 8 + curtalent_rank_offset7;
1158 
1159  // slot/offset in 8-bit bytes with skipped high bit
1160  uint32 curtalent_rank_slot = curtalent_rank_index2 / 8;
1161  uint32 curtalent_rank_offset = curtalent_rank_index2 % 8;
1162 
1163  // apply mask
1164  uint32 val = data.read<uint8>(guid_size + 4 + curtalent_rank_slot);
1165  val |= (1 << curtalent_rank_offset);
1166  data.put<uint8>(guid_size + 4 + curtalent_rank_slot, val & 0xFF);
1167  }
1168 
1169  talentTabPos += GetTalentTabInspectBitSize(talentTabId);
1170  }
1171  }
1172 
1173  SendPacket(&data);
1174 }
1175 
1177 {
1178  uint64 guid;
1179  recv_data >> guid;
1180 
1181  Player* player = sObjectMgr.GetPlayer(guid);
1182 
1183  if (!player)
1184  {
1185  sLog.outError("InspectHonorStats: WTF, player not found...");
1186  return;
1187  }
1188 
1189  if (!GetPlayer()->IsWithinDistInMap(player, INSPECT_DISTANCE, false))
1190  return;
1191 
1192  WorldPacket data(MSG_INSPECT_HONOR_STATS, 8 + 1 + 4 * 4);
1193  data << uint64(player->GetGUID());
1194  data << uint8(player->GetHighestPvPRankIndex());
1195  data << uint32(player->GetUInt32Value(PLAYER_FIELD_KILLS));
1199  SendPacket(&data);
1200 }
1201 
1203 {
1204  // write in client console: worldport 469 452 6454 2536 180 or /console worldport 469 452 6454 2536 180
1205  // Received opcode CMSG_WORLD_TELEPORT
1206  // Time is ***, map=469, x=452.000000, y=6454.000000, z=2536.000000, orient=3.141593
1207 
1208  uint32 time;
1209  uint32 mapid;
1210  float PositionX;
1211  float PositionY;
1212  float PositionZ;
1213  float Orientation;
1214 
1215  recv_data >> time; // time in m.sec.
1216  recv_data >> mapid;
1217  recv_data >> PositionX;
1218  recv_data >> PositionY;
1219  recv_data >> PositionZ;
1220  recv_data >> Orientation; // o (3.141593 = 180 degrees)
1221 
1222  DEBUG_LOG("Received opcode CMSG_WORLD_TELEPORT");
1223 
1224  if (GetPlayer()->isInFlight())
1225  {
1226  sLog.outDebug("Player '%s' (GUID: %u) in flight, ignore worldport command.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
1227  return;
1228  }
1229 
1230  DEBUG_LOG("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time / IN_MILLISECONDS, mapid, PositionX, PositionY, PositionZ, Orientation);
1231 
1232  if (GetSecurity() >= SEC_ADMINISTRATOR)
1233  GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation);
1234  else
1236 
1237  DEBUG_LOG("Received worldport command from player %s", GetPlayer()->GetName());
1238 }
1239 
1241 {
1242  DEBUG_LOG("Received opcode CMSG_WHOIS");
1243  std::string charname;
1244  recv_data >> charname;
1245 
1247  {
1249  return;
1250  }
1251 
1252  if (charname.empty() || !normalizePlayerName (charname))
1253  {
1255  return;
1256  }
1257 
1258  Player* plr = sObjectMgr.GetPlayer(charname.c_str(), true);
1259 
1260  if (!plr)
1261  {
1263  return;
1264  }
1265 
1266  uint32 accid = plr->GetSession()->GetAccountId();
1267 
1268  QueryResult_AutoPtr result = LoginDatabase.PQuery("SELECT username,email,last_ip FROM account WHERE id=%u", accid);
1269  if (!result)
1270  {
1272  return;
1273  }
1274 
1275  Field* fields = result->Fetch();
1276  std::string acc = fields[0].GetCppString();
1277  if (acc.empty())
1278  acc = "Unknown";
1279  std::string email = fields[1].GetCppString();
1280  if (email.empty())
1281  email = "Unknown";
1282  std::string lastip = fields[2].GetCppString();
1283  if (lastip.empty())
1284  lastip = "Unknown";
1285 
1286  std::string msg = charname + "'s " + "account is " + acc + ", e-mail: " + email + ", last ip: " + lastip;
1287 
1288  WorldPacket data(SMSG_WHOIS, msg.size() + 1);
1289  data << msg;
1290  _player->GetSession()->SendPacket(&data);
1291 
1292  DEBUG_LOG("Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str());
1293 }
1294 
1296 {
1297  DEBUG_LOG("WORLD: CMSG_REPORT_SPAM");
1298  if (sLog.IsOutDebug())
1299  recv_data.hexlike();
1300 
1301  uint8 spam_type; // 0 - mail, 1 - chat
1302  uint64 spammer_guid;
1303  uint32 unk1 = 0;
1304  uint32 unk2 = 0;
1305  uint32 unk3 = 0;
1306  uint32 unk4 = 0;
1307  std::string description = "";
1308  recv_data >> spam_type; // unk 0x01 const, may be spam type (mail/chat)
1309  recv_data >> spammer_guid; // player guid
1310  switch (spam_type)
1311  {
1312  case 0:
1313  recv_data >> unk1; // const 0
1314  recv_data >> unk2; // probably mail id
1315  recv_data >> unk3; // const 0
1316  break;
1317  case 1:
1318  recv_data >> unk1; // probably language
1319  recv_data >> unk2; // message type?
1320  recv_data >> unk3; // probably channel id
1321  recv_data >> unk4; // unk random value
1322  recv_data >> description; // spam description string (messagetype, channel name, player name, message)
1323  break;
1324  }
1325 
1326  // NOTE: all chat messages from this spammer automatically ignored by spam reporter until logout in case chat spam.
1327  // if it's mail spam - ALL mails from this spammer automatically removed by client
1328 
1329  // Complaint Received message
1331  data << uint8(0);
1332  SendPacket(&data);
1333 
1334  DEBUG_LOG("REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str());
1335 }
1336 
1338 {
1339  DEBUG_LOG("CMSG_REALM_SPLIT");
1340 
1341  uint32 unk;
1342  std::string split_date = "01/01/01";
1343  recv_data >> unk;
1344 
1345  WorldPacket data(SMSG_REALM_SPLIT, 4 + 4 + split_date.size() + 1);
1346  data << unk;
1347  data << uint32(0x00000000); // realm split state
1348  // split states:
1349  // 0x0 realm normal
1350  // 0x1 realm split
1351  // 0x2 realm split pending
1352  data << split_date;
1353  SendPacket(&data);
1354  //DEBUG_LOG("response sent %u", unk);
1355 }
1356 
1358 {
1359  DEBUG_LOG("WORLD: CMSG_FAR_SIGHT");
1360 
1361  uint8 apply;
1362  recv_data >> apply;
1363 
1364  switch (apply)
1365  {
1366  case 0:
1367  DEBUG_LOG("Player %u set vision to self", _player->GetGUIDLow());
1369  break;
1370  case 1:
1371  DEBUG_LOG("Added FarSight of target " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow());
1372  if (WorldObject* target = _player->GetViewpoint())
1373  _player->SetSeer(target);
1374  else
1375  sLog.outError("Player %s requests invalid seer", _player->GetName());
1376  break;
1377  default:
1378  DEBUG_LOG("Unhandled mode in CMSG_FAR_SIGHT: %u", apply);
1379  return;
1380  }
1381 
1383 }
1384 
1386 {
1387  DEBUG_LOG("CMSG_SET_TITLE");
1388 
1389  int32 title;
1390  recv_data >> title;
1391 
1392  // -1 at none
1393  if (title > 0 && title < MAX_TITLE_INDEX)
1394  {
1395  if (!GetPlayer()->HasTitle(title))
1396  return;
1397  }
1398  else
1399  title = 0;
1400 
1402 }
1403 
1405 {
1406  DEBUG_LOG("CMSG_TIME_SYNC_RESP");
1407 
1408  uint32 counter, clientTicks;
1409  recv_data >> counter >> clientTicks;
1410 
1411  #ifdef OREGON_DEBUG
1412  if (counter != _player->m_timeSyncCounter - 1)
1413  DEBUG_LOG("Wrong time sync counter from player %s (cheater?)", _player->GetName());
1414 
1415  DEBUG_LOG("Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient);
1416 
1417  uint32 ourTicks = clientTicks + (getMSTime() - _player->m_timeSyncServer);
1418 
1419  // diff should be small
1420  DEBUG_LOG("Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency());
1421  #endif
1422 
1423  _player->m_timeSyncClient = clientTicks;
1424 }
1425 
1427 {
1428  DEBUG_LOG("WORLD: CMSG_RESET_INSTANCES");
1429 
1430  if (Group* pGroup = _player->GetGroup())
1431  {
1432  if (pGroup->IsLeader(_player->GetGUID()))
1433  pGroup->ResetInstances(INSTANCE_RESET_ALL, _player);
1434  }
1435  else
1437 }
1438 
1440 {
1441  DEBUG_LOG("MSG_SET_DUNGEON_DIFFICULTY");
1442 
1443  uint32 mode;
1444  recv_data >> mode;
1445 
1446  DungeonDifficulty difficulty = DungeonDifficulty(mode);
1447 
1448  if (difficulty == _player->GetDifficulty())
1449  return;
1450 
1451  if (difficulty > DIFFICULTY_HEROIC)
1452  {
1453  DEBUG_LOG("WorldSession::HandleDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
1454  return;
1455  }
1456 
1457  // cannot reset while in an instance
1458  Map* map = _player->GetMap();
1459  if (map && map->IsDungeon())
1460  {
1461  DEBUG_LOG("WorldSession::HandleDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
1462  return;
1463  }
1464 
1466  return;
1467 
1468  Group* pGroup = _player->GetGroup();
1469  if (pGroup)
1470  {
1471  if (pGroup->IsLeader(_player->GetGUID()))
1472  {
1473  // the difficulty is set even if the instances can't be reset
1474  //_player->SendDungeonDifficulty(true);
1476  pGroup->SetDifficulty(difficulty);
1477  }
1478  }
1479  else
1480  {
1482  _player->SetDifficulty(difficulty);
1483  }
1484 }
1485 
1487 {
1488  DEBUG_LOG("WORLD: CMSG_CANCEL_MOUNT_AURA");
1489 
1490  //If player is not mounted, so go out :)
1491  if (!_player->IsMounted()) // not blizz like; no any messages on blizz
1492  {
1494  return;
1495  }
1496 
1497  if (_player->isInFlight()) // not blizz like; no any messages on blizz
1498  {
1500  return;
1501  }
1502 
1503  _player->Dismount();
1505 }
1506 
1508 {
1509  DEBUG_LOG("WORLD: CMSG_REQUEST_PET_INFO");
1510 
1511  if (_player->GetPet())
1513  else if (_player->GetCharm())
1515 }
1516 
1518 {
1519  uint8 mode;
1520  recv_data >> mode;
1521 
1522  DEBUG_LOG("Client used \"/timetest %d\" command", mode);
1523 }
1524 
1525 
1527 {
1528  DEBUG_LOG("WORLD: CMSG_SET_GRANTABLE_LEVELS");
1529 }
1530 
1532 {
1533  DEBUG_LOG("WORLD: CMSG_GRANT_LEVEL");
1534 
1535  uint64 guid = recv_data.readPackGUID();
1536 
1537  Player* buddy = sObjectMgr.GetPlayer(guid);
1538  if (!buddy || !buddy->IsInWorld())
1539  {
1541  return;
1542  }
1543  else if (sObjectMgr.GetRAFLinkStatus(GetPlayer(), buddy) != RAF_LINK_REFERRED)
1544  {
1546  return;
1547  }
1548  else if (buddy->getLevel() >= sWorld.getConfig(CONFIG_RAF_LEVEL_LIMIT))
1549  {
1551  return;
1552  }
1553  else if (!buddy->IsInPartyWith(GetPlayer()))
1554  {
1556  return;
1557  }
1558  else if (buddy->GetDistance(GetPlayer()) > 90.f)
1559  {
1561  return;
1562  }
1563  else if (GetPlayer()->getLevel() <= buddy->getLevel())
1564  {
1566  return;
1567  }
1568 
1569  // We allow opposite faction grant levels, based on setting in configs,
1570  // player cannot invite opposite faction so we just need to check for the same group
1571 
1572  else if (GetPlayer()->GetFullGrantableLevels() == 0)
1573  {
1575  return;
1576  }
1577 
1579  packet << GetPlayer()->GetPackGUID();
1580  buddy->GetSession()->SendPacket(&packet);
1581 }
1582 
1584 {
1585  DEBUG_LOG("WORLD: CMSG_ACCEPT_GRANT_LEVEL");
1586 
1587  uint64 guid = recv_data.readPackGUID();
1588 
1589  Player* buddy = sObjectMgr.GetPlayer(guid);
1590  if (!buddy || !buddy->IsInWorld())
1591  {
1593  return;
1594  }
1595  else if (sObjectMgr.GetRAFLinkStatus(GetPlayer(), buddy) != RAF_LINK_REFERRER)
1596  return;
1597  else if (GetPlayer()->getLevel() >= sWorld.getConfig(CONFIG_RAF_LEVEL_LIMIT))
1598  return;
1599  else if (!buddy->IsInPartyWith(GetPlayer()))
1600  {
1602  return;
1603  }
1604  else if (buddy->GetDistance(GetPlayer()) > 90.f)
1605  {
1607  return;
1608  }
1609  else if (GetPlayer()->getLevel() >= buddy->getLevel())
1610  return;
1611 
1612  // We allow opposite faction grant levels, based on setting in configs,
1613  // player cannot invite opposite faction so we just need to check for the same group
1614 
1615  else if (buddy->GetFullGrantableLevels() == 0)
1616  return;
1617 
1618  if (GetPlayer()->getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
1619  return;
1620 
1621  buddy->SetGrantableLevels(buddy->GetGrantableLevels() - 1.f);
1622  GetPlayer()->GiveLevel(GetPlayer()->getLevel() + 1.f, true);
1623 }
1624 
1626 {
1627  DEBUG_LOG("WORLD: CMSG_REFER_A_FRIEND");
1628 }
1629 
bool Utf8FitTo(const std::string &str, std::wstring search)
Definition: Util.cpp:458
void HandleLogoutCancelOpcode(WorldPacket &recvPacket)
AreaTableEntry const * GetAreaEntryByAreaID(uint32 area_id)
Definition: DBCStores.cpp:623
void removeActionButton(uint8 button)
Definition: Player.cpp:5693
void SendNotification(const char *format,...) ATTR_PRINTF(2
virtual void sGossipSelect(Player *, uint32, uint32)
Definition: UnitAI.h:112
void ResurectUsingRequestData()
Definition: Player.cpp:19934
void RepopAtGraveyard()
Definition: Player.cpp:4606
Group * GetGroup()
Definition: Player.h:2589
GameObjectAI * AI() const
Definition: GameObject.h:836
void HandleAreaTriggerOpcode(WorldPacket &recvPacket)
Definition: Corpse.h:48
const uint32 & GetUInt32Value(uint16 index) const
Definition: Object.h:228
void HandleSetTargetOpcode(WorldPacket &recvPacket)
void HandleMoveUnRootAck(WorldPacket &recvPacket)
uint32 GetLevelPlayedTime()
Definition: Player.h:1060
void read_skip()
Definition: ByteBuffer.h:276
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: Player.cpp:13641
#define GUID_LOPART(x)
Definition: ObjectGuid.h:110
void SetStandState(uint8 state)
Definition: Unit.cpp:11872
#define MAX_TITLE_INDEX
Definition: Player.h:416
#define MAPID_INVALID
Definition: Object.h:565
uint32 GetZoneId(uint32 mapid, float x, float y, float z)
Definition: MapManager.h:56
void CharmSpellInitialize()
Definition: Player.cpp:17421
void HandleRequestAccountData(WorldPacket &recvPacket)
PlayerMenu * PlayerTalkClass
Definition: Player.h:2194
Map * GetMap() const
Definition: Object.h:829
Map::EnterState PlayerCannotEnter(uint32 mapid, Player *player, bool loginCheck=false)
Definition: MapManager.cpp:153
void LogoutRequest(time_t requestTime)
Definition: WorldSession.h:141
void HandleUpdateAccountData(WorldPacket &recvPacket)
void HandleDungeonDifficultyOpcode(WorldPacket &recv_data)
void HandleCorpseReclaimOpcode(WorldPacket &recvPacket)
static void HandleAddFriendOpcodeCallBack(QueryResult_AutoPtr result, uint32 accountId, std::string friendNote)
uint32 getFaction() const
Definition: Unit.h:1111
void SendSocialList()
Definition: SocialMgr.cpp:119
HashMapHolder< Player >::MapType & GetPlayers()
void SendInitWorldStates(bool force=false, uint32 forceZoneId=0)
Definition: Player.cpp:7721
QueryResult_AutoPtr PQuery(const char *format,...) ATTR_PRINTF(2
Definition: Database.cpp:400
uint32 GetFullGrantableLevels() const
Definition: Player.h:1280
virtual bool GossipSelect(Player *, uint32, uint32)
Definition: GameObjectAI.h:45
void addActionButton(uint8 button, uint16 action, uint8 type, uint8 misc)
Definition: Player.cpp:5651
void HandleGossipSelectOptionOpcode(WorldPacket &recvPacket)
Definition: MiscHandler.cpp:71
Definition: Field.h:24
void HandleSetGrantableLevels(WorldPacket &recv_data)
void Dismount()
Definition: Unit.cpp:9229
void SendTransferAborted(uint32 mapid, uint16 reason)
Definition: Player.cpp:19122
bool HasIgnore(uint32 ignore_guid)
Definition: SocialMgr.cpp:162
bool IsInPartyWith(Unit const *unit) const
Definition: Unit.cpp:13257
virtual bool GossipSelectCode(Player *, uint32, uint32, char const *)
Definition: GameObjectAI.h:46
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
void RemoveSpellsCausingAura(AuraType auraType)
Definition: Unit.cpp:648
const uint64 & GetUInt64Value(uint16 index) const
Definition: Object.h:234
void HandleTogglePvP(WorldPacket &recvPacket)
void EndCinematic()
uint32 getMSTime()
Definition: Timer.h:32
void HandleReferAFriend(WorldPacket &recv_data)
uint32 m_timeSyncClient
Definition: Player.h:2955
bool AddToSocialList(uint32 friend_guid, bool ignore)
Definition: SocialMgr.cpp:52
#define sLog
Log class singleton.
Definition: Log.h:187
void UpdatePvP(bool state, bool override=false)
Definition: Player.cpp:18356
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:779
ACE_INT32 int32
Definition: Define.h:67
unsigned long escape_string(char *to, const char *from, unsigned long length)
Definition: Database.cpp:212
void HandlePlayerLogoutOpcode(WorldPacket &recvPacket)
void clearResurrectRequestData()
Definition: Player.h:1746
bool IsDungeon() const
Definition: Map.h:427
void Initialize(uint16 opcode, size_t newres=200)
Definition: WorldPacket.h:37
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
void HandleCompleteCinema(WorldPacket &recvPacket)
virtual void SendSysMessage(const char *str)
Definition: Chat.cpp:787
uint32 GetAccountId() const
Definition: WorldSession.h:100
bool IsGameMaster() const
Definition: Player.h:1009
UNORDERED_MAP< uint64, T * > MapType
#define GUID_HIPART(x)
Definition: ObjectGuid.h:82
Player * GetPlayer() const
Definition: WorldSession.h:104
uint32 GetGUIDLow() const
Definition: Object.h:160
void SpawnCorpseBones()
Definition: Player.cpp:4380
void SetDifficulty(DungeonDifficulty difficulty)
Definition: Group.cpp:1499
LocaleConstant GetSessionDbcLocale() const
Definition: WorldSession.h:233
DungeonDifficulty GetDifficulty()
Definition: Player.h:1884
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Definition: Util.cpp:294
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:985
DungeonDifficulty
void apply(T *val)
Definition: ByteConverter.h:41
#define sObjectMgr
Definition: ObjectMgr.h:1285
void wstrToLower(std::wstring &str)
Definition: Util.h:314
void SendPacket(WorldPacket const *packet)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
uint32 const * GetTalentTabPages(uint32 cls)
Definition: DBCStores.cpp:766
uint8 GetHighestPvPRankIndex()
Definition: Player.cpp:18272
void HandleSetFriendNoteOpcode(WorldPacket &recvPacket)
void HandleStandStateChangeOpcode(WorldPacket &recvPacket)
uint32 m_timeSyncServer
Definition: Player.h:2956
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.h:762
bool HasFriend(uint32 friend_guid)
Definition: SocialMgr.cpp:154
void HandleRequestPetInfoOpcode(WorldPacket &recv_data)
bool HasSpell(uint32 spell) const override
Definition: Player.cpp:3813
virtual void sGossipSelectCode(Player *, uint32, uint32, char const *)
Definition: UnitAI.h:113
CorpseType GetType() const
Definition: Corpse.h:79
void LogoutPlayer(bool Save)
void UpdateZone(uint32 newZone)
Definition: Player.cpp:6338
void HandleNextCinematicCamera(WorldPacket &recvPacket)
uint32 target_mapId
Definition: ObjectMgr.h:344
time_t endTimer
Definition: Player.h:225
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
uint32 GossipOptionSender(unsigned int Selection)
Definition: GossipDef.cpp:122
void HandleTimeSyncResp(WorldPacket &recv_data)
size_t wpos() const
Definition: ByteBuffer.h:264
uint32 GetTotalPlayedTime()
Definition: Player.h:1056
#define INSPECT_DISTANCE
Definition: Object.h:37
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:225
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
Definition: Player.cpp:1556
void HandleAddFriendOpcode(WorldPacket &recvPacket)
CinematicMgr * GetCinematicMgr() const
Definition: Player.h:1255
ACE_UINT8 uint8
Definition: Define.h:73
void ResetInstances(uint8 method)
Definition: Player.cpp:16976
uint32 GossipOptionAction(unsigned int Selection)
Definition: GossipDef.cpp:127
#define UI64FMTD
Definition: Common.h:149
PlayerSocial * GetSocial()
Definition: Player.h:985
void HandleFarSightOpcode(WorldPacket &recv_data)
std::string GetCppString() const
Definition: Field.h:52
const bool & IsInWorld() const
Definition: Object.h:129
bool IsLeader(const uint64 &guid) const
Definition: Group.h:251
void HandleAcceptGrantLevel(WorldPacket &recv_data)
void ToggleFlag(uint16 index, uint32 flag)
Definition: Object.h:291
Unit * GetCharm() const
Definition: Unit.cpp:7615
uint32 GuidHigh2TypeId(uint32 guid_hi)
Definition: Object.cpp:43
void HandleWorldTeleportOpcode(WorldPacket &recv_data)
time_t const & GetGhostTime() const
Definition: Corpse.h:71
void PetSpellInitialize()
Definition: Player.cpp:17319
bool IsVisibleGloballyFor(Player *pl) const
Definition: Player.cpp:18711
static uint32 TeamForRace(uint8 race)
Definition: Player.cpp:5885
FriendsResult
Definition: SocialMgr.h:81
#define IS_CREATURE_GUID(Guid)
Definition: ObjectGuid.h:66
void PSendSysMessage(const char *format,...) ATTR_PRINTF(2
Definition: Chat.cpp:855
bool GossipOptionCoded(unsigned int Selection)
Definition: GossipDef.cpp:132
void HandleMoveRootAck(WorldPacket &recvPacket)
DatabaseType LoginDatabase
Accessor to the realm/login database.
Definition: Main.cpp:55
void DoLootRelease(uint64 lguid)
size_t size() const
Definition: ByteBuffer.h:336
static void HandleAddIgnoreOpcodeCallBack(QueryResult_AutoPtr result, uint32 accountId)
void HandleBugOpcode(WorldPacket &recvPacket)
bool IsAlive() const
Definition: Unit.h:1433
float GetDistance(const WorldObject *obj) const
Definition: Object.h:706
uint32 TalentTab
Definition: DBCStructure.h:931
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition: Object.cpp:878
void SetDifficulty(DungeonDifficulty dungeon_difficulty)
Definition: Player.h:1880
void put(size_t pos, T value)
Definition: ByteBuffer.h:79
#define MAKE_NEW_GUID(l, e, h)
Definition: ObjectGuid.h:80
void HandleChooseTitleOpcode(WorldPacket &recv_data)
CreatureAI * AI() const
Definition: Creature.h:548
static Player * FindPlayer(uint64, bool force=false)
void HandleResurrectResponseOpcode(WorldPacket &recvPacket)
void HandleRealmStateRequestOpcode(WorldPacket &recv_data)
PvPInfo pvpInfo
Definition: Player.h:1773
void RemovePet(Pet *pet, PetSaveMode mode, bool returnreagent=false)
Definition: Player.cpp:17122
void BuildPlayerRepop()
Definition: Player.cpp:4147
void HandleRepopRequestOpcode(WorldPacket &recvPacket)
Definition: MiscHandler.cpp:45
size_t size() const
Definition: ObjectGuid.h:314
PackedGuid const & GetPackGUID() const
Definition: Object.h:172
#define DEBUG_LOG(...)
Definition: Log.h:194
void SetFFAPvP(bool state)
Definition: Player.cpp:17079
void ResurrectPlayer(float restore_percent, bool applySickness=false)
Definition: Player.cpp:4209
bool AsyncPQuery(Class *object, void(Class::*method)(QueryResult_AutoPtr), const char *format,...) ATTR_PRINTF(4
Definition: DatabaseImpl.h:128
void SetVisible(FactionTemplateEntry const *factionTemplateEntry)
void HandleZoneUpdateOpcode(WorldPacket &recvPacket)
void HandleMoveTimeSkippedOpcode(WorldPacket &recv_data)
Corpse * GetCorpse() const
Definition: Player.cpp:4386
bool PExecute(const char *format,...) ATTR_PRINTF(2
Definition: Database.cpp:441
const char * GetOregonString(int32 entry) const
Definition: Map.h:266
#define sAccountMgr
Definition: AccountMgr.h:60
uint32 GetTalentInspectBitPosInTab(uint32 talentId)
Definition: DBCStores.cpp:748
#define IS_GAMEOBJECT_GUID(Guid)
Definition: ObjectGuid.h:73
#define sSocialMgr
Definition: SocialMgr.h:166
void hexlike() const
Definition: ByteBuffer.h:451
void HandleGrantLevel(WorldPacket &recv_data)
uint32 parent
Definition: Map.h:233
const char * GetName() const
Definition: Object.h:692
ReputationMgr & GetReputationMgr()
Definition: Player.h:2091
uint32 GetLatency() const
Definition: WorldSession.h:243
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1006
ACE_UINT64 uint64
Definition: Define.h:70
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition: Object.h:323
void HandleSetActionButtonOpcode(WorldPacket &recvPacket)
void KillPlayer()
Definition: Player.cpp:4280
void HandleInspectOpcode(WorldPacket &recvPacket)
float GetGrantableLevels() const
Definition: Player.h:1284
void HandleInspectHonorStatsOpcode(WorldPacket &recvPacket)
uint32 RankID[5]
Definition: DBCStructure.h:934
void HandleDelFriendOpcode(WorldPacket &recvPacket)
void HandleDelIgnoreOpcode(WorldPacket &recvPacket)
float target_Orientation
Definition: ObjectMgr.h:348
void HandleSetSelectionOpcode(WorldPacket &recvPacket)
void HandlePlayedTime(WorldPacket &recvPacket)
Player * _player
Definition: WorldSession.h:729
ACE_Refcounted_Auto_Ptr< QueryResult, ACE_Null_Mutex > QueryResult_AutoPtr
Definition: QueryResult.h:113
void SetSelection(const uint64 &guid)
Definition: Player.h:1571
uint32 realmID
Id of the realm.
Definition: Main.cpp:57
float target_X
Definition: ObjectMgr.h:345
void HandleFeatherFallAck(WorldPacket &recv_data)
void HandleResetInstancesOpcode(WorldPacket &recv_data)
void HandleLogoutRequestOpcode(WorldPacket &recvPacket)
void SendReferFriendError(ReferFriendError err, const char *name=0)
Definition: Player.cpp:11621
void GiveLevel(uint32 level, bool ignoreRAF=false)
Definition: Player.cpp:2508
uint8 getClass() const
Definition: Unit.h:1039
bool Satisfy(AccessRequirement const *, uint32 target_map, bool report=false)
Definition: Player.cpp:16034
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:7279
uint32 GetTeam() const
Definition: Player.h:2075
Creature * GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
Definition: Player.cpp:2191
bool IsMounted() const
Definition: Unit.h:1173
void OnGossipSelect(WorldObject *pSource, uint32 gossipListId, uint32 menuId)
Definition: Player.cpp:12367
void HandleWhoisOpcode(WorldPacket &recv_data)
void BeginCinematic()
uint32 access_id
Definition: ObjectMgr.h:343
void AreaExploredOrEventHappens(uint32 questId)
Definition: Player.cpp:13731
#define sScriptMgr
Definition: Group.h:526
static Unit * GetUnit(WorldObject const &, uint64 guid)
float target_Y
Definition: ObjectMgr.h:346
EnterState
Definition: Map.h:399
uint32 GetTalentTabInspectBitSize(uint32 talentTabId)
Definition: DBCStores.cpp:757
WorldSession * GetSession() const
Definition: Player.h:1959
#define sWorld
Definition: World.h:860
uint64 readPackGUID()
Definition: ByteBuffer.h:312
void HandleAddIgnoreOpcode(WorldPacket &recvPacket)
void SetFriendNote(uint32 friend_guid, std::string note)
Definition: SocialMgr.cpp:106
void SetRestFlag(RestFlag restFlag, uint32 triggerId=0)
Definition: Player.cpp:20802
void HandleSetActionBar(WorldPacket &recv_data)
DatabaseType CharacterDatabase
Accessor to the character database.
Definition: Main.cpp:54
void uint32 GetSecurity() const
Definition: WorldSession.h:96
void RemoveFromSocialList(uint32 friend_guid, bool ignore)
Definition: SocialMgr.cpp:86
ACE_UINT16 uint16
Definition: Define.h:72
bool isInFlight() const
Definition: Unit.h:1308
void HandleWhoOpcode(WorldPacket &recvPacket)
#define CORPSE_RECLAIM_RADIUS
Definition: Corpse.h:35
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.h:299
size_t rpos() const
Definition: ByteBuffer.h:253
void SetGrantableLevels(float amount)
Definition: Player.h:1288
ACE_UINT32 uint32
Definition: Define.h:71
void HandleDismountOpcode(WorldPacket &recv_data)
void HandleReportSpamOpcode(WorldPacket &recv_data)
Pet * GetPet() const
Definition: Player.cpp:17104
GameObject * GetGameObject(uint64 guid)
Definition: Map.cpp:2638
void SetSeer(WorldObject *target)
Definition: Player.h:2393
Definition: Unit.h:884
uint32 GetCorpseReclaimDelay(bool pvp) const
Definition: Player.cpp:20053
uint32 getLevel() const
Definition: Unit.h:1029
void ResetInstances(uint8 method, Player *SendMsgTo)
Definition: Group.cpp:1527
Definition: Player.h:922
uint32 m_timeSyncCounter
Definition: Player.h:2953
DeathState getDeathState()
Definition: Unit.h:1445
float target_Z
Definition: ObjectMgr.h:347
#define MAX_LEVEL
Definition: DBCEnums.h:28
void HandleSetTaxiBenchmarkOpcode(WorldPacket &recv_data)
#define STRONG_MAX_LEVEL
Definition: DBCEnums.h:32
WorldObject * GetViewpoint() const
Definition: Player.cpp:20446
Definition: Group.h:154
void HandleFriendListOpcode(WorldPacket &recvPacket)
const uint64 & GetGUID() const
Definition: Object.h:156
void UpdateVisibilityForPlayer()
Definition: Player.cpp:18884