OregonCore  revision 3611e8a-git
Your Favourite TBC server
MovementHandler.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 "WorldPacket.h"
20 #include "WorldSession.h"
21 #include "Opcodes.h"
22 #include "Log.h"
23 #include "Corpse.h"
24 #include "Player.h"
25 #include "MapManager.h"
26 #include "Transports.h"
27 #include "Battleground.h"
29 #include "InstanceSaveMgr.h"
30 
31 #define MOVEMENT_PACKET_TIME_DELAY 0
32 
34 {
35  DEBUG_LOG("WORLD: got MSG_MOVE_WORLDPORT_ACK.");
37 }
38 
40 {
41  // ignore unexpected far teleports
42  if (!GetPlayer()->IsBeingTeleportedFar())
43  return;
44 
45  // get the teleport destination
46  WorldLocation const& loc = GetPlayer()->GetTeleportDest();
47 
48  // possible errors in the coordinate validity check
50  {
51  sLog.outError("WorldSession::HandleMoveWorldportAckOpcode: player %s (%d) was teleported far to a not valid location. (map:%u, x:%f, y:%f, "
52  "z:%f) We port him to his homebind instead..", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ());
53  // stop teleportation else we would try this again and again in LogoutPlayer...
55  // and teleport the player to a valid place
57  return;
58  }
59 
60  // get the destination map entry, not the current one, this will fix homebind and reset greeting
61  MapEntry const* mEntry = sMapStore.LookupEntry(loc.GetMapId());
62  InstanceTemplate const* mInstance = sObjectMgr.GetInstanceTemplate(loc.GetMapId());
63 
64  // reset instance validity, except if going to an instance inside an instance
65  if (GetPlayer()->m_InstanceValid == false && !mInstance)
66  GetPlayer()->m_InstanceValid = true;
67 
69 
70  Map* oldMap = GetPlayer()->GetMap();
71  ASSERT(oldMap);
72  if (GetPlayer()->IsInWorld())
73  {
74  sLog.outError("Crash alert! Player is still in world when teleported from map %u! to new map %u", oldMap->GetId(), loc.GetMapId());
75  oldMap->RemovePlayerFromMap(GetPlayer(), false);
76  }
77 
78  // relocate the player to the teleport destination
79  Map* newMap = MapManager::Instance().CreateMap(loc.GetMapId(), GetPlayer(), 0);
80  // the CannotEnter checks are done in TeleporTo but conditions may change
81  // while the player is in transit, for example the map may get full
82  if (!newMap || newMap->CannotEnter(GetPlayer()))
83  {
84  sLog.outError("Map %d could not be created for player %d, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUIDLow());
86  return;
87  }
88  else
89  GetPlayer()->Relocate(&loc);
90 
91  GetPlayer()->ResetMap();
92  GetPlayer()->SetMap(newMap);
93 
94  // check this before Map::AddPlayerToMap(player), because that will create the instance save!
95  bool reset_notify = (GetPlayer()->GetBoundInstance(GetPlayer()->GetMapId(), GetPlayer()->GetDifficulty()) == NULL);
96 
98  if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer()))
99  {
100  sLog.outError("WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.GetMapId());
101  GetPlayer()->ResetMap();
102  GetPlayer()->SetMap(oldMap);
104  return;
105  }
106 
107  // battleground state prepare (in case join to BG), at relogin/tele player not invited
108  // only add to bg group and object, if the player was invited (else he entered through command)
109  if (GetPlayer()->InBattleground())
110  {
111  // cleanup setting if outdated
112  if (!mEntry->IsBattlegroundOrArena())
113  {
114  // We're not in BG
115  GetPlayer()->SetBattlegroundId(0); // We're not in BG.
116  // reset destination bg team
117  GetPlayer()->SetBGTeam(0);
118  }
119  // join to bg case
120  else if (Battleground* bg = GetPlayer()->GetBattleground())
121  {
122  if (GetPlayer()->IsInvitedForBattlegroundInstance(GetPlayer()->GetBattlegroundId()))
123  bg->AddPlayer(GetPlayer());
124  }
125  }
126 
128 
129  // flight fast teleport case
130  if (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE)
131  {
132  if (!GetPlayer()->InBattleground())
133  {
134  // short preparations to continue flight
136  flight->Initialize(*GetPlayer());
137  return;
138  }
139 
140  // battleground state prepare, stop flight
143  }
144 
145  // resurrect character at enter into instance where his corpse exist after add to map
146  Corpse* corpse = GetPlayer()->GetCorpse();
147  if (corpse && corpse->GetType() != CORPSE_BONES && corpse->GetMapId() == GetPlayer()->GetMapId())
148  {
149  if (mEntry->IsDungeon())
150  {
151  GetPlayer()->ResurrectPlayer(0.5f, false);
153  }
154  }
155 
156  bool allowMount = !mEntry->IsDungeon() || mEntry->IsBattlegroundOrArena();
157  if (mInstance)
158  {
159  if (reset_notify)
160  {
161  // check if this instance has a reset time and send it to player if so
162  if (uint32 timeReset = sInstanceSaveMgr.GetResetTimeFor(mEntry->MapID))
163  {
164  uint32 timeleft = timeReset - time(NULL);
165  GetPlayer()->SendInstanceResetWarning(mEntry->MapID, timeleft); // greeting at the entrance of the resort raid instance
166 
167  }
168  }
169 
170  // check if instance is valid
171  if (!GetPlayer()->CheckInstanceValidity(false))
172  GetPlayer()->m_InstanceValid = false;
173 
174  // instance mounting is handled in InstanceTemplate
175  allowMount = mInstance->allowMount;
176  }
177 
178  // mount allow check
179  if (!allowMount)
181 
182  // honorless target
183  if (GetPlayer()->pvpInfo.inHostileArea)
184  GetPlayer()->CastSpell(GetPlayer(), 2479, true);
185 
186  // allow waterwalking for ghost players at map change
187  if (GetPlayer()->GetCorpse())
188  GetPlayer()->SetWaterWalking(true);
189 
190  // resummon pet
191  if (GetPlayer()->m_temporaryUnsummonedPetNumber)
192  {
193  Pet* NewPet = new Pet(GetPlayer());
194  if (!NewPet->LoadPetFromDB(GetPlayer(), 0, GetPlayer()->m_temporaryUnsummonedPetNumber, true))
195  delete NewPet;
196 
198  }
199 
200  //lets process all delayed operations on successful teleport
202 }
203 
205 {
206  uint64 guid;
207  uint32 flags, time;
208 
209  recv_data >> guid;
210  recv_data >> flags >> time;
211  DEBUG_LOG("Guid " UI64FMTD, guid);
212  DEBUG_LOG("Flags %u, time %u", flags, time / IN_MILLISECONDS);
213 
214  Unit* mover = _player->m_mover;
215  Player* plMover = mover->GetTypeId() == TYPEID_PLAYER ? mover->ToPlayer() : NULL;
216 
217  if (!plMover || !plMover->IsBeingTeleportedNear())
218  return;
219 
220  if (guid != plMover->GetGUID())
221  return;
222 
223  plMover->SetSemaphoreTeleportNear(false);
224 
225  uint32 old_zone = plMover->GetZoneId();
226 
227  WorldLocation const& dest = plMover->GetTeleportDest();
228 
229  plMover->SetPosition(dest, true);
230 
231  uint32 newzone = plMover->GetZoneId();
232 
233  plMover->UpdateZone(newzone);
234 
235  // new zone
236  if (old_zone != newzone)
237  {
238  // honorless target
239  if (plMover->pvpInfo.inHostileArea)
240  plMover->CastSpell(plMover, 2479, true);
241  }
242 
243  // resummon pet
244  if (plMover->m_temporaryUnsummonedPetNumber)
245  {
246  Pet* NewPet = new Pet(plMover);
247  if (!NewPet->LoadPetFromDB(plMover, 0, plMover->m_temporaryUnsummonedPetNumber, true))
248  delete NewPet;
249 
250  plMover->m_temporaryUnsummonedPetNumber = 0;
251  }
252 
253  //lets process all delayed operations on successful teleport
254  plMover->ProcessDelayedOperations();
255 }
256 
258 {
259  Unit* mover = _player->m_mover;
260 
261  ASSERT(mover != NULL); // there must always be a mover
262 
263  Player* plMover = mover->GetTypeId() == TYPEID_PLAYER ? mover->ToPlayer() : NULL;
264 
265  // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck
266  if (plMover && plMover->IsBeingTeleported())
267  {
268  recv_data.rpos(recv_data.wpos()); // prevent warnings spam
269  return;
270  }
271 
272  //get opcode
273  uint16 opcode = recv_data.GetOpcode();
274 
275  /* extract packet */
276  MovementInfo movementInfo;
277  recv_data >> movementInfo;
278  /*----------------*/
279 
280  /*if (recv_data.size() != recv_data.rpos())
281  {
282  sLog.outError("MovementHandler: player %s (guid %d, account %u) sent a packet (opcode %u) that is %u bytes larger than it should be. Kicked as cheater.", _player->GetName(), _player->GetGUIDLow(), _player->GetSession()->GetAccountId(), opcode, recv_data.size() - recv_data.rpos());
283  KickPlayer();
284  return;
285  }*/
286 
287  if (!Oregon::IsValidMapCoord(movementInfo.GetPos()->GetPositionX(), movementInfo.GetPos()->GetPositionY(), movementInfo.GetPos()->GetPositionZ(), movementInfo.GetPos()->GetOrientation()))
288  return;
289 
290  //Save movement flags
291  mover->SetUnitMovementFlags(movementInfo.GetMovementFlags());
292 
293  if (mover->IsSitState() && movementInfo.GetMovementFlags() & (MOVEMENTFLAG_MOVING | MOVEMENTFLAG_TURNING))
295 
296  /* handle special cases */
297  if (movementInfo.HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
298  {
299  // transports size limited
300  // (also received at zeppelin/lift leave by some reason with t_* as absolute in continent coordinates, can be safely skipped)
301  if (movementInfo.GetTransportPos()->GetPositionX() > 50 || movementInfo.GetTransportPos()->GetPositionY() > 50 || movementInfo.GetTransportPos()->GetPositionZ() > 50)
302  return;
303 
304  if (!Oregon::IsValidMapCoord(movementInfo.GetPos()->GetPositionX() + movementInfo.GetTransportPos()->GetPositionX(), movementInfo.GetPos()->GetPositionY() + movementInfo.GetTransportPos()->GetPositionY(),
305  movementInfo.GetPos()->GetPositionZ() + movementInfo.GetTransportPos()->GetPositionZ(), movementInfo.GetPos()->GetOrientation() + movementInfo.GetTransportPos()->GetOrientation()))
306  return;
307 
308  // if we boarded a transport, add us to it
309  if (plMover && !plMover->m_transport)
310  {
311  // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list
312  for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter)
313  {
314  if ((*iter)->GetGUID() == movementInfo.t_guid)
315  {
316  // unmount before boarding
318 
319  plMover->m_transport = (*iter);
320  (*iter)->AddPassenger(plMover);
321  break;
322  }
323  }
324  }
325  }
326  else if (plMover && plMover->m_transport) // if we were on a transport, leave
327  {
328  plMover->m_transport->RemovePassenger(plMover);
329  plMover->m_transport = NULL;
330  movementInfo.ClearTransportData();
331  }
332 
333  // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map).
334  if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight())
335  plMover->HandleFallDamage(movementInfo);
336 
337  if (plMover && (movementInfo.HasMovementFlag(MOVEMENTFLAG_SWIMMING) != plMover->IsInWater()))
338  {
339  // now client not include swimming flag in case jumping under water
340  plMover->SetInWater(!plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.GetPos()->GetPositionX(), movementInfo.GetPos()->GetPositionY(), movementInfo.GetPos()->GetPositionZ()));
341  }
342 
343  uint32 mstime = getMSTime();
344  if (m_clientTimeDelay == 0)
345  m_clientTimeDelay = mstime - movementInfo.time;
346 
347  /* process position-change */
348  recv_data.put<uint32>(5, movementInfo.time + m_clientTimeDelay + MOVEMENT_PACKET_TIME_DELAY); // offset flags(4) + unk(1)
349  WorldPacket data(opcode, mover->GetPackGUID().size() + recv_data.size());
350  data << mover->GetPackGUID();
351  data.append(recv_data.contents(), recv_data.size());
352  if (mover->isCharmed() && mover->GetCharmer())
353  mover->GetCharmer()->SendMessageToSet(&data, false);
354  else
355  mover->SendMessageToSet(&data, false);
356 
357  mover->m_movementInfo = movementInfo;
358  mover->SetPosition(movementInfo.pos);
359 
360  if (plMover) // nothing is charmed, or player charmed
361  {
362  if (opcode == MSG_MOVE_FALL_LAND || plMover->m_lastFallTime > movementInfo.GetFallTime() || plMover->m_lastFallZ < movementInfo.GetPos()->GetPositionZ())
363  plMover->SetFallInformation(movementInfo.GetFallTime(), movementInfo.GetPos()->GetPositionZ());
364 
365  // we should add the check only for class hunter
366  if (plMover->isMovingOrTurning())
368 
369  if (movementInfo.GetPos()->GetPositionZ() < -500.0f)
370  plMover->HandleFallUnderMap();
371  }
372 }
373 
375 {
376  DEBUG_LOG("WORLD: Recvd CMSG_SPEED_CHANGE_ACK");
377  /* extract packet */
378  ObjectGuid guid;
379  MovementInfo movementInfo;
380  float newspeed;
381 
382  recv_data >> guid;
383  recv_data >> Unused<uint32>(); // counter or moveEvent
384  recv_data >> movementInfo;
385  recv_data >> newspeed;
386 
387  // now can skip not our packet
388  if (GetPlayer()->GetGUID() != guid.GetRawValue())
389  return;
390  /*----------------*/
391 
392  // Save movement flags
393  GetPlayer()->SetUnitMovementFlags(movementInfo.GetMovementFlags());
394 
395  // client ACK send one packet for mounted/run case and need skip all except last from its
396  // in other cases anti-cheat check can be fail in false case
397 
398  // UnitMoveType move_type;
399  UnitMoveType force_move_type;
400 
401  //static char const* move_type_name[MAX_MOVE_TYPE] = {"Walk", "Run", "RunBack", "Swim", "SwimBack", "TurnRate", "Flight", "FlightBack"};
402 
403  uint16 opcode = recv_data.GetOpcode();
404  switch (opcode)
405  {
406  case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: /*move_type = MOVE_WALK; */
407  force_move_type = MOVE_WALK;
408  break;
409  case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: /*move_type = MOVE_RUN; */
410  force_move_type = MOVE_RUN;
411  break;
412  case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: /*move_type = MOVE_RUN_BACK; */
413  force_move_type = MOVE_RUN_BACK;
414  break;
415  case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK: /*move_type = MOVE_SWIM; */
416  force_move_type = MOVE_SWIM;
417  break;
418  case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: /*move_type = MOVE_SWIM_BACK; */
419  force_move_type = MOVE_SWIM_BACK;
420  break;
421  case CMSG_FORCE_TURN_RATE_CHANGE_ACK: /*move_type = MOVE_TURN_RATE; */
422  force_move_type = MOVE_TURN_RATE;
423  break;
424  case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK: /*move_type = MOVE_FLIGHT; */
425  force_move_type = MOVE_FLIGHT;
426  break;
427  case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: /*move_type = MOVE_FLIGHT_BACK;*/
428  force_move_type = MOVE_FLIGHT_BACK;
429  break;
430  default:
431  sLog.outError("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
432  return;
433  }
434 
435  // skip all forced speed changes except last and unexpected
436  // in run/mounted case used one ACK and it must be skipped.m_forced_speed_changes[MOVE_RUN] store both.
437  if (GetPlayer()->m_forced_speed_changes[force_move_type] > 0)
438  {
439  --GetPlayer()->m_forced_speed_changes[force_move_type];
440  if (GetPlayer()->m_forced_speed_changes[force_move_type] > 0)
441  return;
442  }
443 }
444 
446 {
447  DEBUG_LOG("WORLD: Recvd CMSG_SET_ACTIVE_MOVER");
448 
449  uint64 guid;
450  recv_data >> guid;
451 
452  if (GetPlayer()->IsInWorld())
453  {
454  if (Unit* mover = ObjectAccessor::GetUnit(*GetPlayer(), guid))
455  GetPlayer()->SetMover(mover);
456  }
457  else
458  {
459  sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID());
461  }
462 }
463 
465 {
466  DEBUG_LOG("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER");
467  recv_data.hexlike();
468 
469  uint64 old_mover_guid;
470  MovementInfo mi;
471 
472  recv_data >> old_mover_guid;
473  recv_data >> mi;
474 
475  if (!old_mover_guid)
476  return;
477 
478  GetPlayer()->m_movementInfo = mi;
479 }
480 
482 {
483  DEBUG_LOG("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM");
484 
486  data << uint64(GetPlayer()->GetGUID());
487 
488  GetPlayer()->SendMessageToSet(&data, false);
489 }
490 
492 {
493  // Currently not used but maybe use later for recheck final player position
494  // (must be at call same as into "recv_data >> x >> y >> z >> orientation;"
495  DEBUG_LOG("CMSG_MOVE_KNOCK_BACK_ACK");
496 
497  MovementInfo movementInfo;
498  uint64 guid;
499 
500  recv_data >> guid; // guid
501  recv_data >> Unused<uint32>(); // Always set to 0
502  recv_data >> movementInfo;
503 
504  if (GetPlayer()->GetGUID() != guid)
505  return;
506 
507  _player->m_movementInfo = movementInfo;
508 
509  // Calculate timestamp
510  uint32 move_time, mstime;
511  mstime = getMSTime();
512  if(m_clientTimeDelay == 0)
513  m_clientTimeDelay = mstime - movementInfo.time;
514  move_time = (movementInfo.time - (mstime - m_clientTimeDelay)) + mstime;
515  movementInfo.time = move_time;
516 
517  // Save movement flags
518  GetPlayer()->SetUnitMovementFlags(movementInfo.GetMovementFlags());
519 
520  // Send packet
521  WorldPacket data(MSG_MOVE_KNOCK_BACK, uint16(recv_data.size() + 4));
522  data.appendPackGUID(guid);
523 
524  /* Includes data shown below (but in different order) */
525  movementInfo.Write(data);
526 
527  /* This is sent in addition to the rest of the movement data (yes, angle+velocity are sent twice) */
528  data << movementInfo.j_sinAngle;
529  data << movementInfo.j_cosAngle;
530  data << movementInfo.j_xyspeed;
531  data << movementInfo.j_velocity;
532 
533  /* Do we really need to send the data to everyone? Seemed to work better */
534  _player->SendMessageToSet(&data, false);
535 }
536 
538 {
539  // fly mode on/off
540  DEBUG_LOG("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK");
541  //recv_data.hexlike();
542 
543  MovementInfo movementInfo;
544 
545  recv_data.read_skip<uint64>(); // guid
546  recv_data.read_skip<uint32>(); // unk
547  recv_data >> movementInfo;
548  recv_data.read_skip<uint32>(); // unk2
549 
550  GetPlayer()->SetUnitMovementFlags(movementInfo.GetMovementFlags());
551 }
552 
554 {
555  DEBUG_LOG("CMSG_MOVE_HOVER_ACK");
556 
557  MovementInfo movementInfo;
558 
559  recv_data >> Unused<uint64>(); // guid
560  recv_data >> Unused<uint32>(); // unk
561  recv_data >> movementInfo;
562  recv_data >> Unused<uint32>(); // unk2
563 }
564 
566 {
567  DEBUG_LOG("CMSG_MOVE_WATER_WALK_ACK");
568 
569  MovementInfo movementInfo;
570 
571  recv_data >> Unused<uint64>(); // guid
572  recv_data >> Unused<uint32>(); // unk
573  recv_data >> movementInfo;
574  recv_data >> Unused<uint32>(); // unk2
575 }
576 
578 {
579  if (!GetPlayer()->IsAlive() || GetPlayer()->IsInCombat())
580  return;
581 
582  uint64 summoner_guid;
583  bool agree;
584  recv_data >> summoner_guid;
585  recv_data >> agree;
586 
587  GetPlayer()->SummonIfPossible(agree);
588 }
589 
Unit * GetCharmer() const
Definition: Unit.cpp:7557
UnitMoveType
Definition: Unit.h:458
void SendInstanceResetWarning(uint32 mapid, uint32 time)
Definition: Player.cpp:19130
uint16 GetOpcode() const
Definition: WorldPacket.h:44
void ResetMap() override
Definition: Player.cpp:20658
void SummonIfPossible(bool agree)
Definition: Player.cpp:19541
void SetInWater(bool apply)
Definition: Player.cpp:2272
Definition: Corpse.h:48
const uint8 * contents() const
Definition: ByteBuffer.h:331
void read_skip()
Definition: ByteBuffer.h:276
void HandleMoveTeleportAck(WorldPacket &recvPacket)
virtual void RemovePlayerFromMap(Player *, bool)
Definition: Map.cpp:672
void SetStandState(uint8 state)
Definition: Unit.cpp:11872
void HandleMoveNotActiveMoverOpcode(WorldPacket &recv_data)
uint32 MapID
Definition: DBCStructure.h:514
Map * GetMap() const
Definition: Object.h:829
bool IsSitState() const
Definition: Unit.cpp:11857
#define MOVEMENT_PACKET_TIME_DELAY
void ProcessDelayedOperations()
Definition: Player.cpp:1842
MovementInfo m_movementInfo
Definition: Object.h:915
void SetBGTeam(uint32 team)
Definition: Player.h:2312
void HandleMountSpecialAnimOpcode(WorldPacket &recvdata)
bool IsInWater() const override
Definition: Player.h:964
MotionMaster * GetMotionMaster()
Definition: Unit.h:2001
uint32 GetZoneId() const
Definition: Object.cpp:1176
void RemoveSpellsCausingAura(AuraType auraType)
Definition: Unit.cpp:648
uint32 getMSTime()
Definition: Timer.h:32
void HandleForceSpeedChangeAck(WorldPacket &recv_data)
void HandleMoveWaterWalkAck(WorldPacket &recvPacket)
#define sLog
Log class singleton.
Definition: Log.h:187
void HandleSummonResponseOpcode(WorldPacket &recv_data)
void HandleMoveHoverAck(WorldPacket &recv_data)
void SendInitialPacketsBeforeAddToMap()
Definition: Player.cpp:18984
uint32 m_clientTimeDelay
Definition: WorldSession.h:749
bool IsValidMapCoord(float c)
Definition: GridDefines.h:192
bool SetWaterWalking(bool enable, bool packetOnly=false) override
Definition: Player.cpp:20785
Player * GetPlayer() const
Definition: WorldSession.h:104
uint32 GetGUIDLow() const
Definition: Object.h:160
void SpawnCorpseBones()
Definition: Player.cpp:4380
void HandleFallDamage(MovementInfo &movementInfo)
Definition: Player.cpp:20315
void HandleSetActiveMoverOpcode(WorldPacket &recv_data)
bool SetPosition(float x, float y, float z, float orientation, bool teleport=false) override
Definition: Player.cpp:5707
#define sObjectMgr
Definition: ObjectMgr.h:1285
void HandleMoveKnockBackAck(WorldPacket &recvPacket)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
_Ty top() const
Definition: MotionMaster.h:132
bool TeleportToHomebind(uint32 options=0)
Definition: Player.h:2462
virtual void SendMessageToSet(WorldPacket *data, bool self)
Definition: Object.h:777
Transport * m_transport
Definition: Player.h:2876
Player * ToPlayer()
Definition: Object.h:386
void SendInitialPacketsAfterAddToMap()
Definition: Player.cpp:19032
bool IsBeingTeleported() const
Definition: Player.h:2050
CorpseType GetType() const
Definition: Corpse.h:79
void UpdateZone(uint32 newZone)
Definition: Player.cpp:6338
uint32 GetId(void) const
Definition: Map.h:333
size_t wpos() const
Definition: ByteBuffer.h:264
uint8 GetTypeId() const
Definition: Object.h:204
#define UI64FMTD
Definition: Common.h:149
void Relocate(float x, float y)
Definition: Position.h:65
void SetMover(Unit *target)
Definition: Player.h:2387
void SetSemaphoreTeleportFar(bool semphsetting)
Definition: Player.h:2066
void HandleMovementOpcodes(WorldPacket &recvPacket)
size_t size() const
Definition: ByteBuffer.h:336
float GetPositionY() const
Definition: Position.h:98
bool IsBeingTeleportedNear() const
Definition: Player.h:2054
void put(size_t pos, T value)
Definition: ByteBuffer.h:79
void CastSpell(Unit *Victim, uint32 spellId, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
Definition: Unit.cpp:1174
void HandleMoveFlyModeChangeAckOpcode(WorldPacket &recv_data)
bool allowMount
Definition: Map.h:242
float GetPositionZ() const
Definition: Position.h:99
PvPInfo pvpInfo
Definition: Player.h:1773
bool AddPassenger(Player *passenger)
Definition: Transports.cpp:451
void SetUnitMovementFlags(uint32 f)
Definition: Unit.h:2016
size_t size() const
Definition: ObjectGuid.h:314
PackedGuid const & GetPackGUID() const
Definition: Object.h:172
#define DEBUG_LOG(...)
Definition: Log.h:194
bool m_InstanceValid
Definition: Player.h:2555
void ResurrectPlayer(float restore_percent, bool applySickness=false)
Definition: Player.cpp:4209
bool IsDungeon() const
Definition: DBCStructure.h:550
void HandleFallUnderMap()
Definition: Player.cpp:20364
InstancePlayerBind * GetBoundInstance(uint32 mapid, uint8 difficulty)
Definition: Player.cpp:15838
uint32 GetMapId() const
Definition: Object.h:585
bool IsUnderWater(float x, float y, float z) const
Definition: Map.cpp:1851
Corpse * GetCorpse() const
Definition: Player.cpp:4386
uint8 m_forced_speed_changes[MAX_MOVE_TYPE]
Definition: Player.h:2487
Definition: Map.h:266
void CleanupAfterTaxiFlight()
Definition: Player.cpp:17893
void hexlike() const
Definition: ByteBuffer.h:451
#define sInstanceSaveMgr
void HandleMoveWorldportAckOpcode()
void SetBattlegroundId(uint32 val)
Definition: Player.h:2253
void appendPackGUID(uint64 guid)
Definition: ByteBuffer.h:402
ACE_UINT64 uint64
Definition: Define.h:70
Definition: Unit.h:461
Map * CreateMap(uint32 mapId, const WorldObject *obj, uint32 loginInstanceId=0)
Definition: MapManager.cpp:125
Map const * GetBaseMap() const
Definition: Object.cpp:1981
Player * _player
Definition: WorldSession.h:729
bool IsBattlegroundOrArena() const
Definition: DBCStructure.h:570
virtual bool SetPosition(float x, float y, float z, float orientation, bool teleport=false)
Definition: Unit.cpp:12467
bool LoadPetFromDB(Player *owner, uint32 petentry=0, uint32 petnumber=0, bool current=false)
Definition: Pet.cpp:131
static bool IsValidMapCoord(uint32 mapid, float x, float y)
Definition: MapManager.h:87
void SetMap(Map *map) override
Definition: Player.cpp:20670
#define ASSERT
Definition: Errors.h:33
void SetSemaphoreTeleportNear(bool semphsetting)
Definition: Player.h:2062
void SetFallInformation(uint32 time, float z)
Definition: Player.h:2364
static Unit * GetUnit(WorldObject const &, uint64 guid)
bool RemovePassenger(Player *passenger)
Definition: Transports.cpp:461
void SendMessageToSet(WorldPacket *data, bool self) override
Definition: Player.h:1996
TransportSet m_Transports
Definition: MapManager.h:127
ACE_UINT16 uint16
Definition: Define.h:72
bool inHostileArea
Definition: Player.h:222
bool isInFlight() const
Definition: Unit.h:1308
bool isCharmed() const
Definition: Unit.h:1543
size_t rpos() const
Definition: ByteBuffer.h:253
virtual EnterState CannotEnter(Player *)
Definition: Map.h:414
ACE_UINT32 uint32
Definition: Define.h:71
float GetPositionX() const
Definition: Position.h:97
Unit * m_mover
Definition: Player.h:2362
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:158
WorldLocation & GetTeleportDest()
Definition: Player.h:2046
Definition: Unit.h:884
Definition: Player.h:922
float m_lastFallZ
Definition: Player.h:2361
uint32 m_temporaryUnsummonedPetNumber
Definition: Player.h:2972
bool isMovingOrTurning() const
Definition: Player.h:2372
Definition: Pet.h:146
uint32 m_lastFallTime
Definition: Player.h:2360
const uint64 & GetGUID() const
Definition: Object.h:156