OregonCore  revision 3611e8a-git
Your Favourite TBC server
WorldSession.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 "WorldSocket.h" // must be first to make ACE happy with ACE includes in it
19 #include "Common.h"
20 #include "Database/DatabaseEnv.h"
21 #include "Log.h"
22 #include "Opcodes.h"
23 #include "WorldPacket.h"
24 #include "WorldSession.h"
25 #include "Player.h"
26 #include "ObjectMgr.h"
27 #include "Group.h"
28 #include "Guild.h"
29 #include "World.h"
30 #include "BattlegroundMgr.h"
31 #include "OutdoorPvPMgr.h"
32 #include "Chat.h"
33 #include "SocialMgr.h"
34 #include "ScriptMgr.h"
35 #include "WardenWin.h"
36 #include "WardenMac.h"
37 
38 // WorldSession constructor
39 WorldSession::WorldSession(uint32 id, WorldSocket* sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
40  LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time), m_timeOutTime(0),
41  _player(NULL), m_Socket(sock), _security(sec), _accountId(id), m_expansion(expansion), m_Warden(NULL),
42  m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false),
43  m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(sObjectMgr.GetIndexForLocale(locale)),
44  _logoutTime(0), m_latency(0), m_clientTimeDelay(0)
45 {
46  if (sock)
47  {
48  m_Address = sock->GetRemoteAddress();
49  sock->AddReference();
51  LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId());
52  }
53 }
54 
55 // WorldSession destructor
57 {
58  // unload player if not unloaded
59  if (_player)
60  LogoutPlayer(true);
61 
62  // If have unclosed socket, close it
63  if (m_Socket)
64  {
67  m_Socket = NULL;
68  }
69 
70  if (m_Warden)
71  delete m_Warden;
72 
73  // empty incoming packet queue
74  WorldPacket* packet;
75  while (_recvQueue.next(packet))
76  delete packet;
77 
78  LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId());
79  CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = %u;", GetAccountId());
80 }
81 
82 void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
83 {
84  sLog.outError("Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt crash server?), skipped",
85  GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size);
86 }
87 
88 // Get the player name
89 char const* WorldSession::GetPlayerName() const
90 {
91  return GetPlayer() ? GetPlayer()->GetName() : "<none>";
92 }
93 
94 // Send a packet to the client
96 {
97  if (!m_Socket)
98  return;
99 
100  #ifdef OREGON_DEBUG
101 
102  // Code for network use statistic
103  static uint64 sendPacketCount = 0;
104  static uint64 sendPacketBytes = 0;
105 
106  static time_t firstTime = time(NULL);
107  static time_t lastTime = firstTime; // next 60 secs start time
108 
109  static uint64 sendLastPacketCount = 0;
110  static uint64 sendLastPacketBytes = 0;
111 
112  time_t cur_time = time(NULL);
113 
114  if ((cur_time - lastTime) < 60)
115  {
116  sendPacketCount += 1;
117  sendPacketBytes += packet->size();
118 
119  sendLastPacketCount += 1;
120  sendLastPacketBytes += packet->size();
121  }
122  else
123  {
124  uint64 minTime = uint64(cur_time - lastTime);
125  uint64 fullTime = uint64(lastTime - firstTime);
126  sLog.outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount) / fullTime, float(sendPacketBytes) / fullTime, uint32(fullTime));
127  sLog.outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount) / minTime, float(sendLastPacketBytes) / minTime);
128 
129  lastTime = cur_time;
130  sendLastPacketCount = 1;
131  sendLastPacketBytes = packet->wpos(); // wpos is real written size
132  }
133 
134  #endif // !OREGON_DEBUG
135 
136  if (m_Socket->SendPacket(*packet) == -1)
138 }
139 
140 // Add an incoming packet to the queue
142 {
143  _recvQueue.add(new_packet);
144 }
145 
146 // Logging helper for unexpected opcodes
147 void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* reason)
148 {
149  sLog.outError("SESSION: received unexpected opcode %s (0x%.4X) %s",
150  LookupOpcodeName(packet->GetOpcode()),
151  packet->GetOpcode(),
152  reason);
153 }
154 
155 // Logging helper for unexpected opcodes
157 {
158  sLog.outError("SESSION: opcode %s (0x%.4X) has unprocessed tail data (read stop at %lu from %lu)",
159  LookupOpcodeName(packet->GetOpcode()),
160  packet->GetOpcode(),
161  packet->rpos(), packet->wpos());
162  sLog.outError("Dumping packet causing error:");
163  packet->hexlike();
164 }
165 
166 #if COMPILER == COMPILER_GNU
167 #pragma GCC diagnostic ignored "-Wuninitialized"
168 #endif
169 
170 // Update the WorldSession (triggered by World update)
172 {
174  UpdateTimeOutTime(diff);
175 
178  if (IsConnectionIdle())
180 
181  // Retrieve packets from the receive queue and call the appropriate handlers
182  // not proccess packets if socket already closed
183  WorldPacket* packet;
184  uint64 now = getMSTime64();
185  uint32 packetsThisCycle = 0;
186  while (m_Socket && !m_Socket->IsClosed() && ++packetsThisCycle <= 20 && _recvQueue.next(packet))
187  {
188  /*#if 1
189  sLog.outError("MOEP: %s (0x%.4X)",
190  LookupOpcodeName(packet->GetOpcode()),
191  packet->GetOpcode());
192  #endif*/
193 
194  if (packet->GetOpcode() >= NUM_MSG_TYPES)
195  {
196  sLog.outError("SESSION: received invalid opcode %s (0x%.4X)",
197  LookupOpcodeName(packet->GetOpcode()),
198  packet->GetOpcode());
199  }
200  else
201  {
202  OpcodeHandler const& opHandle = opcodeTable[packet->GetOpcode()];
203  unsigned long opStatus = opHandle.status;
204 
205  if (opStatus & STATUS_PROTECTED)
206  {
207  ProtectedOpcodeMap::iterator op = _protectedOpcodes.find(packet->GetOpcode());
208  if (op == _protectedOpcodes.end())
209  {
210  ProtectedOpcodeStatus status;
211  status.lastUsed = now;
212  status.timesUsed = 1;
213 
214  _protectedOpcodes.insert(std::pair<uint32, ProtectedOpcodeStatus>(packet->GetOpcode(), status));
215  }
216  else
217  {
218  ProtectedOpcodeProperties const& prop = sWorld.GetProtectedOpcodeProperties(packet->GetOpcode());
219  if (++op->second.timesUsed > prop.threshold)
220  {
221  if (getMSTimeDiff64(now, op->second.lastUsed) <= prop.interval)
222  {
223  switch (prop.penalty)
224  {
225  case OPCODE_PENALTY_SKIP:
226  continue;
227  case OPCODE_PENALTY_KICK:
228  KickPlayer();
229  }
230  }
231  else
232  op->second.timesUsed = 1;
233  }
234 
235  op->second.lastUsed = now;
236  }
237 
238  opStatus &= ~STATUS_PROTECTED;
239  }
240 
241  try
242  {
243  switch (opStatus)
244  {
245  case STATUS_LOGGEDIN:
246  if (!_player)
247  {
248  // skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets
250  LogUnexpectedOpcode(packet, "the player has not logged in yet");
251  }
252  else if (_player->IsInWorld())
253  ExecuteOpcode(opHandle, packet);
254 
255  // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
256  break;
258  if (!_player)
259  LogUnexpectedOpcode(packet, "the player has not logged in yet");
260  else if (_player->IsInWorld())
261  LogUnexpectedOpcode(packet, "the player is still in world");
262  else
263  ExecuteOpcode(opHandle, packet);
264  break;
265  case STATUS_AUTHED:
266  // prevent cheating with skip queue wait
267  if (m_inQueue)
268  {
269  LogUnexpectedOpcode(packet, "the player not pass queue yet");
270  break;
271  }
272 
273  m_playerRecentlyLogout = false;
274 
275  ExecuteOpcode(opHandle, packet);
276  break;
277  case STATUS_NEVER:
278  sLog.outError("SESSION: received not allowed opcode %s (0x%.4X)",
279  LookupOpcodeName(packet->GetOpcode()),
280  packet->GetOpcode());
281  break;
282  }
283  }
284  catch (ByteBufferException&)
285  {
286  sLog.outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
287  packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
288  if (sLog.IsOutDebug())
289  {
290  sLog.outDebug("Dumping error causing packet:");
291  packet->hexlike();
292  }
293  }
294  }
295 
296  delete packet;
297  }
298 
299  if (m_Socket && !m_Socket->IsClosed() && m_Warden)
300  m_Warden->Update();
301 
302  // If necessary, log the player out (normal logout)
303  if (ShouldLogOut(time(0)) && !m_playerLoading)
304  LogoutPlayer(true);
305 
306  // Cleanup socket pointer if need (disconnect)
307  if (m_Socket && m_Socket->IsClosed())
308  {
310  m_Socket = NULL;
311  return false;
312  }
313 
314  return true;
315 }
316 
317 #if COMPILER == COMPILER_GNU
318 #pragma GCC diagnostic warning "-Wuninitialized"
319 #endif
320 
321 // Log the player out
323 {
324  // finish pending transfers before starting the logout
325  while (_player && _player->IsBeingTeleportedFar())
327 
328  m_playerLogout = true;
329  m_playerSave = Save;
330 
331  if (_player)
332  {
333  //Hook for OnLogout Event
334  sScriptMgr.OnLogout(_player);
335 
336  if (uint64 lguid = GetPlayer()->GetLootGUID())
337  DoLootRelease(lguid);
338 
339  // If the player just died before logging out, make him appear as a ghost
340  if (_player->GetDeathTimer())
341  {
345  }
346  else if (!_player->getAttackers().empty())
347  {
348  _player->CombatStop();
351 
352  // build set of player who attack _player or who have pet attacking of _player
353  std::set<Player*> aset;
354  for (Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)
355  {
356  Unit* owner = (*itr)->GetOwner(); // including player controlled case
357  if (owner)
358  {
359  if (owner->GetTypeId() == TYPEID_PLAYER)
360  aset.insert(owner->ToPlayer());
361  }
362  else if ((*itr)->GetTypeId() == TYPEID_PLAYER)
363  aset.insert((*itr)->ToPlayer());
364  }
365 
366  _player->SetPvPDeath(!aset.empty());
367  _player->KillPlayer();
370 
371  // give honor to all attackers from set like group case
372  for (std::set<Player*>::const_iterator itr = aset.begin(); itr != aset.end(); ++itr)
373  (*itr)->RewardHonor(_player, aset.size());
374 
375  // give bg rewards and update counters like kill by first from attackers
376  // this can't be called for all attackers.
377  if (!aset.empty())
378  if (Battleground* bg = _player->GetBattleground())
379  bg->HandleKillPlayer(_player, *aset.begin());
380  }
382  {
383  // this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION
385  //_player->SetDeathPvP(*); set at SPELL_AURA_SPIRIT_OF_REDEMPTION apply time
386  _player->KillPlayer();
389  }
390  //drop a flag if player is carrying it
391  if (Battleground* bg = _player->GetBattleground())
392  bg->EventPlayerLoggedOut(_player);
393 
394  // Teleport to home if the player is in an invalid instance
396  {
398  //this is a bad place to call for far teleport because we need player to be in world for successful logout
399  //maybe we should implement delayed far teleport logout?
400  }
401 
402  // FG: finish pending transfers after starting the logout
403  // this should fix players beeing able to logout and login back with full hp at death position
404  while (_player->IsBeingTeleportedFar())
406 
407  sOutdoorPvPMgr.HandlePlayerLeaveZone(_player, _player->GetZoneId());
408 
409  for (int i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
410  {
411  if (int32 bgTypeId = _player->GetBattlegroundQueueId(i))
412  {
414  sBattlegroundMgr.m_BattlegroundQueues[ bgTypeId ].RemovePlayer(_player->GetGUID(), true);
415  }
416  }
417 
418  // If the player is in a guild, update the guild roster and broadcast a logout message to other guild members
419  if (Guild* guild = sObjectMgr.GetGuildById(_player->GetGuildId()))
420  {
421  guild->LoadPlayerStatsByGuid(_player->GetGUID());
422  guild->UpdateLogoutTime(_player->GetGUID());
423 
424  guild->BroadcastEvent(GE_SIGNED_OFF, _player->GetGUID(), _player->GetName());
425  }
426 
427  // Remove pet
428  _player->RemovePet(NULL, PET_SAVE_AS_CURRENT, true);
429 
430  // empty buyback items and save the player in the database
431  // some save parts only correctly work in case player present in map/player_lists (pets, etc)
432  if (Save)
433  {
434  uint32 eslot;
435  for (int j = BUYBACK_SLOT_START; j < BUYBACK_SLOT_END; ++j)
436  {
437  eslot = j - BUYBACK_SLOT_START;
441  }
442  _player->SaveToDB();
443  }
444 
445  // Leave all channels before player delete...
447 
448  // If the player is in a group (or invited), remove him. If the group if then only 1 person, disband the group.
450 
451  // Broadcast a logout message to the player's friends
452  sSocialMgr.SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
453  sSocialMgr.RemovePlayerSocial (_player->GetGUIDLow ());
454 
455  // Remove the player from the world
456  // the player may not be in the world when logging out
457  // e.g if he got disconnected during a transfer to another map
458  // calls to GetMap in this case may cause crashes
460  Map* _map = _player->GetMap();
461  _map->RemovePlayerFromMap(_player, true);
462  _player = NULL; // deleted in Remove call
463 
464  // Send the 'logout complete' packet to the client
466  SendPacket(&data);
467 
468  // Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline
469  //No SQL injection as AccountId is uint32
470  CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'",
471  GetAccountId());
472  sLog.outDebug("SESSION: Sent SMSG_LOGOUT_COMPLETE Message");
473  }
474 
475  m_playerLogout = false;
476  m_playerSave = false;
477  m_playerRecentlyLogout = true;
478  LogoutRequest(0);
479 }
480 
481 // Kick a player out of the World
483 {
484  if (m_Socket && !m_Socket->IsClosed())
486 }
487 
488 // Cancel channeling handler
489 
490 void WorldSession::SendAreaTriggerMessage(const char* Text, ...)
491 {
492  va_list ap;
493  char szStr [1024];
494  szStr[0] = '\0';
495 
496  va_start(ap, Text);
497  vsnprintf(szStr, 1024, Text, ap);
498  va_end(ap);
499 
500  uint32 length = strlen(szStr) + 1;
501  WorldPacket data(SMSG_AREA_TRIGGER_MESSAGE, 4 + length);
502  data << length;
503  data << szStr;
504  SendPacket(&data);
505 }
506 
507 void WorldSession::SendNotification(const char* format, ...)
508 {
509  if (format)
510  {
511  va_list ap;
512  char szStr [1024];
513  szStr[0] = '\0';
514  va_start(ap, format);
515  vsnprintf(szStr, 1024, format, ap);
516  va_end(ap);
517 
518  WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr) + 1));
519  data << szStr;
520  SendPacket(&data);
521  }
522 }
523 
525 {
526  char const* format = GetOregonString(string_id);
527  if (format)
528  {
529  va_list ap;
530  char szStr [1024];
531  szStr[0] = '\0';
532  va_start(ap, string_id);
533  vsnprintf(szStr, 1024, format, ap);
534  va_end(ap);
535 
536  WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr) + 1));
537  data << szStr;
538  SendPacket(&data);
539  }
540 }
541 
542 const char* WorldSession::GetOregonString(int32 entry) const
543 {
544  return sObjectMgr.GetOregonString(entry, GetSessionDbLocaleIndex());
545 }
546 
548 {
549  sLog.outError("SESSION: received unhandled opcode %s (0x%.4X)",
550  LookupOpcodeName(recvPacket.GetOpcode()),
551  recvPacket.GetOpcode());
552 }
553 
555 {
556  sLog.outError("SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead",
557  LookupOpcodeName(recvPacket.GetOpcode()),
558  recvPacket.GetOpcode());
559 }
560 
562 {
563  sLog.outError("SESSION: received server-side opcode %s (0x%.4X)",
564  LookupOpcodeName(recvPacket.GetOpcode()),
565  recvPacket.GetOpcode());
566 }
567 
569 {
570  sLog.outError("SESSION: received deprecated opcode %s (0x%.4X)",
571  LookupOpcodeName(recvPacket.GetOpcode()),
572  recvPacket.GetOpcode());
573 }
574 
576 {
577  if (position == 0)
578  {
579  WorldPacket packet(SMSG_AUTH_RESPONSE, 1);
580  packet << uint8(AUTH_OK);
581  SendPacket(&packet);
582  }
583  else
584  {
585  WorldPacket packet(SMSG_AUTH_RESPONSE, 5);
586  packet << uint8(AUTH_WAIT_QUEUE);
587  packet << uint32(position);
588  SendPacket(&packet);
589  }
590 }
591 
592 
593 void WorldSession::InitWarden(BigNumber* K, std::string os)
594 {
595  if (os == "Win") // Windows
596  m_Warden = (WardenBase*)new WardenWin();
597  else // MacOS
598  m_Warden = (WardenBase*)new WardenMac();
599 
600  m_Warden->Init(this, K);
601 }
603 {
604  // need prevent do internal far teleports in handlers because some handlers do lot steps
605  // or call code that can do far teleports in some conditions unexpectedly for generic way work code
606  if (_player)
608 
609  (this->*opHandle.handler)(*packet);
610 
611  if (_player)
612  {
613  // can be not set in fact for login opcode, but this not create porblems.
615 
616  //we should execute delayed teleports only for alive(!) players
617  //because we don't want player's ghost teleported from graveyard
620  }
621 
622  if (packet->rpos() < packet->wpos())
623  LogUnprocessedTail(packet);
624 }
625 
Kick the player.
Definition: World.h:443
long AddReference(void)
void SendNotification(const char *format,...) ATTR_PRINTF(2
Player authenticated.
Definition: Opcodes.h:1100
uint16 GetOpcode() const
Definition: WorldPacket.h:44
void RepopAtGraveyard()
Definition: Player.cpp:4606
void(WorldSession::* handler)(WorldPacket &recvPacket)
Definition: Opcodes.h:1113
bool IsBeingTeleportedFar() const
Definition: Player.h:2058
virtual void RemovePlayerFromMap(Player *, bool)
Definition: Map.cpp:672
Battleground * GetBattleground() const
Definition: Player.cpp:19386
void SaveToDB()
Definition: Player.cpp:16219
Using this opcode is time protected.
Definition: Opcodes.h:1104
OpcodeHandler opcodeTable[NUM_MSG_TYPES]
Definition: Opcodes.cpp:22
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:79
ACE_Based::LockedQueue< WorldPacket *, ACE_Thread_Mutex > _recvQueue
Definition: WorldSession.h:760
Map * GetMap() const
Definition: Object.h:829
void LogoutRequest(time_t requestTime)
Definition: WorldSession.h:141
Player transferring to another map.
Definition: Opcodes.h:1102
void QueuePacket(WorldPacket *new_packet)
void setOnlineOfflineState(bool pIsOnline)
void SetPvPDeath(bool on)
Definition: Player.h:1037
bool IsHasDelayedTeleport() const
Definition: Player.h:2932
uint32 GetDeathTimer() const
Definition: Player.h:2130
void SendAuthWaitQue(uint32 position)
std::string const & GetRemoteAddress()
Definition: WorldSession.h:113
#define PLAYER_MAX_BATTLEGROUND_QUEUES
bool m_playerLogout
Definition: WorldSession.h:742
uint32 GetZoneId() const
Definition: Object.cpp:1176
void RemoveSpellsCausingAura(AuraType auraType)
Definition: Unit.cpp:648
Opcode not accepted from client (deprecated or server side only)
Definition: Opcodes.h:1103
WorldSession(uint32 id, WorldSocket *sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale)
void SizeError(WorldPacket const &packet, uint32 size) const
#define sLog
Log class singleton.
Definition: Log.h:187
int SendPacket(const WorldPacket &pct)
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:779
ACE_INT32 int32
Definition: Define.h:67
bool next(T &result)
Definition: LockedQueue.h:68
NULL Dbg ErrDB Arena Chat Char Map MMap false
Definition: Log.cpp:556
#define SIZEFMTD
Definition: Common.h:155
void ResetTimeOutTime()
Definition: WorldSession.h:265
uint32 GetAccountId() const
Definition: WorldSession.h:100
bool IsGameMaster() const
Definition: Player.h:1009
Player * GetPlayer() const
Definition: WorldSession.h:104
uint32 GetGUIDLow() const
Definition: Object.h:160
unsigned long status
Definition: Opcodes.h:1112
#define sObjectMgr
Definition: ObjectMgr.h:1285
void SendPacket(WorldPacket const *packet)
bool TeleportToHomebind(uint32 options=0)
Definition: Player.h:2462
uint32 threshold
Sets the maximum count one protected packet per Interval can be processed per session.
Definition: World.h:449
Player * ToPlayer()
Definition: Object.h:386
void Update()
Definition: WardenBase.cpp:123
void LogoutPlayer(bool Save)
void CleanupsBeforeDelete() override
Definition: Player.cpp:483
void CleanupChannels()
Definition: Player.cpp:4660
size_t wpos() const
Definition: ByteBuffer.h:264
uint8 GetTypeId() const
Definition: Object.h:204
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
Definition: Player.cpp:1556
WorldLocation m_teleport_dest
Definition: Player.h:2959
uint32 GetBattlegroundQueueId(uint32 index) const
Definition: Player.h:2230
ACE_UINT8 uint8
Definition: Define.h:73
#define UI64FMTD
Definition: Common.h:149
AttackerSet const & getAttackers() const
Definition: Unit.h:980
uint32 m_teleport_options
Definition: Player.h:2960
const bool & IsInWorld() const
Definition: Object.h:129
HostileRefManager & getHostileRefManager()
Definition: Unit.h:1842
void Handle_EarlyProccess(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
void Handle_Deprecated(WorldPacket &recvPacket)
OpcodePenalty penalty
What should happen if the threshold per interval is passed.
Definition: World.h:451
void LogUnexpectedOpcode(WorldPacket *packet, const char *reason)
void RemovePet(Pet *pet, PetSaveMode mode, bool returnreagent=false)
Definition: Player.cpp:17122
void BuildPlayerRepop()
Definition: Player.cpp:4147
WorldSocket * m_Socket
Definition: WorldSession.h:730
void CombatStop(bool cast=false)
Definition: Unit.cpp:7442
const char * LookupOpcodeName(uint16 id)
Definition: Opcodes.h:1119
bool m_InstanceValid
Definition: Player.h:2555
void Handle_ServerSide(WorldPacket &recvPacket)
void SetCanDelayTeleport(bool setting)
Definition: Player.h:2928
bool PExecute(const char *format,...) ATTR_PRINTF(2
Definition: Database.cpp:441
const char * GetOregonString(int32 entry) const
Definition: Map.h:266
char const * GetPlayerName() const
void add(const T &item)
Definition: LockedQueue.h:55
virtual void Init(WorldSession *pClient, BigNumber *K)
Definition: WardenBase.cpp:41
#define sSocialMgr
Definition: SocialMgr.h:166
void SetUInt64Value(uint16 index, const uint64 &value)
Definition: Object.cpp:798
void hexlike() const
Definition: ByteBuffer.h:451
uint32 GetGuildId()
Definition: Player.h:1837
void HandleMoveWorldportAckOpcode()
bool m_playerRecentlyLogout
Definition: WorldSession.h:743
void UpdateTimeOutTime(uint32 diff)
Definition: WorldSession.h:258
Protected Opcode.
Definition: World.h:447
const char * GetName() const
Definition: Object.h:692
ACE_UINT64 uint64
Definition: Define.h:70
void KillPlayer()
Definition: Player.cpp:4280
std::string m_Address
Definition: WorldSession.h:731
uint64 getMSTime64()
Definition: Timer.h:37
bool IsClosed(void) const
void InitWarden(BigNumber *K, std::string os)
#define NUM_MSG_TYPES
Definition: Opcodes.h:1095
Player * _player
Definition: WorldSession.h:729
int GetSessionDbLocaleIndex() const
Definition: WorldSession.h:237
uint32 interval
Interval for threshold, in milliseconds.&#39;.
Definition: World.h:450
Unit * GetOwner() const
Definition: Unit.cpp:7549
bool Update(uint32 diff)
ProtectedOpcodeMap _protectedOpcodes
Definition: WorldSession.h:758
#define sBattlegroundMgr
void ExecuteOpcode(OpcodeHandler const &opHandle, WorldPacket *packet)
void SendAreaTriggerMessage(const char *Text,...) ATTR_PRINTF(2
void LogUnprocessedTail(WorldPacket *packet)
void CloseSocket(void)
#define sScriptMgr
Definition: Group.h:526
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:783
Skip the packet without processing.
Definition: World.h:442
LocaleConstant
Definition: Common.h:211
#define sWorld
Definition: World.h:860
DatabaseType CharacterDatabase
Accessor to the character database.
Definition: Main.cpp:54
Player in game.
Definition: Opcodes.h:1101
size_t rpos() const
Definition: ByteBuffer.h:253
ACE_UINT32 uint32
Definition: Define.h:71
const std::string & GetRemoteAddress(void) const
uint64 getMSTimeDiff64(uint64 t1, uint64 t2)
Definition: Timer.h:87
Definition: Guild.h:265
Definition: Unit.h:884
void UninviteFromGroup()
Definition: Player.cpp:2397
bool m_playerLoading
Definition: WorldSession.h:741
void RemoveBattlegroundQueueId(uint32 val)
Definition: Player.h:2277
bool ShouldLogOut(time_t currTime) const
Definition: WorldSession.h:147
void Handle_NULL(WorldPacket &recvPacket)
long RemoveReference(void)
void RemoveAllAurasOnDeath()
Definition: Unit.cpp:4547
bool IsConnectionIdle() const
Definition: WorldSession.h:269
#define vsnprintf
Definition: Common.h:131
WardenBase * m_Warden
Definition: WorldSession.h:738
const uint64 & GetGUID() const
Definition: Object.h:156