Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -16,25 +16,29 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#include "ArenaTeam.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "Common.h"
|
||||
#include "Creature.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "Group.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Player.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recvData)
|
||||
{
|
||||
@@ -42,7 +46,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recvData)
|
||||
recvData >> guid;
|
||||
TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from %s", guid.ToString().c_str());
|
||||
|
||||
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
|
||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BATTLEMASTER);
|
||||
if (!unit)
|
||||
return;
|
||||
|
||||
@@ -77,7 +81,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
uint32 instanceId;
|
||||
uint8 asGroup;
|
||||
bool isPremade = false;
|
||||
Group* grp = NULL;
|
||||
Group* grp = nullptr;
|
||||
ObjectGuid guid;
|
||||
|
||||
recvData >> instanceId; // Instance Id
|
||||
@@ -109,7 +113,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId_, NULL))
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId_, nullptr))
|
||||
{
|
||||
ChatHandler(this).PSendSysMessage(LANG_BG_DISABLED);
|
||||
return;
|
||||
@@ -127,7 +131,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
|
||||
// get bg instance or bg template if instance not found
|
||||
Battleground* bg = NULL;
|
||||
Battleground* bg = nullptr;
|
||||
if (instanceId)
|
||||
bg = sBattlegroundMgr->GetBattlegroundThroughClientInstance(instanceId, bgTypeId);
|
||||
|
||||
@@ -150,7 +154,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_LFG_CANT_USE_BATTLEGROUND);
|
||||
GetPlayer()->GetSession()->SendPacket(&data);
|
||||
GetPlayer()->SendDirectMessage(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -159,7 +163,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
_player->SendDirectMessage(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,7 +172,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
// player is already in random queue
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_IN_RANDOM_BG);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
_player->SendDirectMessage(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -177,7 +181,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
// player is already in queue, can't start random queue
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_IN_NON_RANDOM_BG);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
_player->SendDirectMessage(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -191,7 +195,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_BATTLEGROUND_TOO_MANY_QUEUES);
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
_player->SendDirectMessage(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,7 +204,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0);
|
||||
GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, nullptr, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0);
|
||||
|
||||
uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId);
|
||||
@@ -229,7 +233,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam());
|
||||
|
||||
BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
GroupQueueInfo* ginfo = NULL;
|
||||
GroupQueueInfo* ginfo = nullptr;
|
||||
uint32 avgTime = 0;
|
||||
|
||||
if (!err)
|
||||
@@ -239,7 +243,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
@@ -249,7 +253,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
member->SendDirectMessage(&data);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -261,7 +265,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
|
||||
WorldPacket data; // send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, ginfo->ArenaType);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
member->SendDirectMessage(&data);
|
||||
TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",
|
||||
bgQueueTypeId, bgTypeId, member->GetGUID().GetCounter(), member->GetName().c_str());
|
||||
}
|
||||
@@ -281,8 +285,8 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvDa
|
||||
|
||||
uint32 acount = 0;
|
||||
uint32 hcount = 0;
|
||||
Player* aplr = NULL;
|
||||
Player* hplr = NULL;
|
||||
Player* aplr = nullptr;
|
||||
Player* hplr = nullptr;
|
||||
|
||||
if (ObjectGuid guid = bg->GetFlagPickerGUID(TEAM_ALLIANCE))
|
||||
{
|
||||
@@ -508,7 +512,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
//send bg command result to show nice message
|
||||
WorldPacket data2;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data2, bg, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS);
|
||||
_player->GetSession()->SendPacket(&data2);
|
||||
_player->SendDirectMessage(&data2);
|
||||
action = 0;
|
||||
TC_LOG_DEBUG("bg.battleground", "Player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName().c_str(), _player->GetGUID().GetCounter());
|
||||
}
|
||||
@@ -548,7 +552,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
|
||||
}
|
||||
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_IN_PROGRESS, _player->GetBattlegroundQueueJoinTime(bgTypeId), bg->GetElapsedTime(), bg->GetArenaType());
|
||||
_player->GetSession()->SendPacket(&data);
|
||||
_player->SendDirectMessage(&data);
|
||||
|
||||
// remove battleground queue status from BGmgr
|
||||
bgQueue.RemovePlayer(_player->GetGUID(), false);
|
||||
@@ -624,7 +628,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/)
|
||||
|
||||
WorldPacket data;
|
||||
// we must update all queues here
|
||||
Battleground* bg = NULL;
|
||||
Battleground* bg = nullptr;
|
||||
for (uint8 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
|
||||
{
|
||||
BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(i);
|
||||
@@ -707,7 +711,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, BATTLEGROUND_AA, NULL))
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, BATTLEGROUND_AA, nullptr))
|
||||
{
|
||||
ChatHandler(this).PSendSysMessage(LANG_ARENA_DISABLED);
|
||||
return;
|
||||
@@ -748,7 +752,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
||||
BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
|
||||
|
||||
uint32 avgTime = 0;
|
||||
GroupQueueInfo* ginfo = NULL;
|
||||
GroupQueueInfo* ginfo = nullptr;
|
||||
|
||||
err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, arenatype, arenatype, true, arenaslot);
|
||||
if (!err)
|
||||
@@ -759,7 +763,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
||||
avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId());
|
||||
}
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
@@ -769,7 +773,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
||||
{
|
||||
WorldPacket data;
|
||||
sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
member->SendDirectMessage(&data);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -781,7 +785,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
||||
|
||||
WorldPacket data; // send status packet (in queue)
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype);
|
||||
member->GetSession()->SendPacket(&data);
|
||||
member->SendDirectMessage(&data);
|
||||
|
||||
TC_LOG_DEBUG("bg.battleground", "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUID().GetCounter(), member->GetName().c_str());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user