Core/Log: Implement log masks for debug log level, to allow selective debug output. Update your worldserver.conf.

This commit is contained in:
Machiavelli
2011-02-20 20:16:34 +01:00
parent 45db1591a4
commit e07e20ffca
99 changed files with 1046 additions and 1092 deletions
@@ -58,7 +58,7 @@ void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
{
sLog->outDebug("bg_av HandleKillUnit %i",unit->GetEntry());
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i",unit->GetEntry());
if (GetStatus() != STATUS_IN_PROGRESS)
return;
uint32 entry = unit->GetEntry();
@@ -139,7 +139,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
return;//maybe we should log this, cause this must be a cheater or a big bug
uint8 team = GetTeamIndexByTeamId(player->GetTeam());
//TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor
sLog->outDebug("BG_AV Quest %i completed",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed",questid);
switch(questid)
{
case AV_QUEST_A_SCRAPS1:
@@ -149,7 +149,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][0]+=20;
if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25,50,75 turn ins
{
sLog->outDebug("BG_AV Quest %i completed starting with unit upgrading..",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..",questid);
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
{
@@ -164,21 +164,21 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][1]++;
RewardReputationToTeam(team,1,player->GetTeam());
if (m_Team_QuestStatus[team][1] == 30)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
break;
case AV_QUEST_A_COMMANDER2:
case AV_QUEST_H_COMMANDER2:
m_Team_QuestStatus[team][2]++;
RewardReputationToTeam(team,1,player->GetTeam());
if (m_Team_QuestStatus[team][2] == 60)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
break;
case AV_QUEST_A_COMMANDER3:
case AV_QUEST_H_COMMANDER3:
m_Team_QuestStatus[team][3]++;
RewardReputationToTeam(team,1,player->GetTeam());
if (m_Team_QuestStatus[team][1] == 120)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
break;
case AV_QUEST_A_BOSS1:
case AV_QUEST_H_BOSS1:
@@ -187,16 +187,16 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
case AV_QUEST_H_BOSS2:
m_Team_QuestStatus[team][4]++;
if (m_Team_QuestStatus[team][4] >= 200)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
break;
case AV_QUEST_A_NEAR_MINE:
case AV_QUEST_H_NEAR_MINE:
m_Team_QuestStatus[team][5]++;
if (m_Team_QuestStatus[team][5] == 28)
{
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
if (m_Team_QuestStatus[team][6] == 7)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
}
break;
case AV_QUEST_A_OTHER_MINE:
@@ -204,9 +204,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][6]++;
if (m_Team_QuestStatus[team][6] == 7)
{
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
if (m_Team_QuestStatus[team][5] == 20)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
}
break;
case AV_QUEST_A_RIDER_HIDE:
@@ -214,9 +214,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][7]++;
if (m_Team_QuestStatus[team][7] == 25)
{
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
if (m_Team_QuestStatus[team][8] == 25)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
}
break;
case AV_QUEST_A_RIDER_TAME:
@@ -224,13 +224,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
m_Team_QuestStatus[team][8]++;
if (m_Team_QuestStatus[team][8] == 25)
{
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid);
if (m_Team_QuestStatus[team][7] == 25)
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
}
break;
default:
sLog->outDebug("BG_AV Quest %i completed but is not interesting at all",questid);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all",questid);
return; //was no interesting quest at all
break;
}
@@ -409,7 +409,7 @@ void BattlegroundAV::StartingEventCloseDoors()
void BattlegroundAV::StartingEventOpenDoors()
{
sLog->outDebug("BG_AV: start spawning mine stuff");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff");
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++)
SpawnBGObject(i,RESPAWN_IMMEDIATELY);
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++)
@@ -519,7 +519,7 @@ void BattlegroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
//Source->Unmount();
break;
default:
sLog->outDebug("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
// Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -572,7 +572,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
{
uint32 object = GetObjectThroughNode(node);
sLog->outDebug("bg_av: player destroyed point node %i object %i",node,object);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i",node,object);
//despawn banner
SpawnBGObject(object, RESPAWN_ONE_DAY);
@@ -645,7 +645,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
if (!initial)
{
sLog->outDebug("bg_av depopulating mine %i (0=north,1=south)",mine);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north,1=south)",mine);
if (mine == AV_SOUTH_MINE)
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
if (m_BgCreatures[i])
@@ -656,7 +656,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
}
SendMineWorldStates(mine);
sLog->outDebug("bg_av populating mine %i (0=north,1=south)",mine);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north,1=south)",mine);
uint16 miner;
//also neutral team exists.. after a big time, the neutral team tries to conquer the mine
if (mine == AV_NORTH_MINE)
@@ -678,7 +678,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
else
miner = AV_NPC_S_MINE_N_1;
//vermin
sLog->outDebug("spawning vermin");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "spawning vermin");
if (team == ALLIANCE)
cinfo = AV_NPC_S_MINE_A_3;
else if (team == HORDE)
@@ -795,7 +795,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
{
sLog->outDebug("bg_AV getnodethroughobject %i",object);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i",object);
if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER)
return BG_AV_Nodes(object);
if (object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT)
@@ -817,7 +817,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
{ //this function is the counterpart to GetNodeThroughObject()
sLog->outDebug("bg_AV GetObjectThroughNode %i",node);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i",node);
if (m_Nodes[node].Owner == ALLIANCE)
{
if (m_Nodes[node].State == POINT_ASSAULTED)
@@ -860,7 +860,7 @@ void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target
if (GetStatus() != STATUS_IN_PROGRESS)
return;
int32 object = GetObjectType(target_obj->GetGUID());
sLog->outDebug("BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object);
if (object < 0)
return;
switch(target_obj->GetEntry())
@@ -899,7 +899,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
EventPlayerAssaultsPoint(player,object);
return;
}
sLog->outDebug("player defends point object: %i node: %i",object,node);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i",object,node);
if (m_Nodes[node].PrevOwner != team)
{
sLog->outError("BG_AV: player defends point which doesn't belong to his team %i",node);
@@ -961,7 +961,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
BG_AV_Nodes node = GetNodeThroughObject(object);
uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner
uint32 team = player->GetTeam();
sLog->outDebug("bg_av: player assaults point object %i node %i",object,node);
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i",object,node);
if (owner == team || team == m_Nodes[node].TotalOwner)
return; //surely a gm used this object
@@ -1314,7 +1314,7 @@ bool BattlegroundAV::SetupBattleground()
}
uint16 i;
sLog->outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ...");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Alterac Valley: entering state STATUS_WAIT_JOIN ...");
// Initial Nodes
for (i = 0; i < BG_AV_OBJECT_MAX; i++)
SpawnBGObject(i, RESPAWN_ONE_DAY);
@@ -1345,22 +1345,22 @@ bool BattlegroundAV::SetupBattleground()
SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE,RESPAWN_IMMEDIATELY);
//creatures
sLog->outDebug("BG_AV start poputlating nodes");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes");
for (BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
{
if (m_Nodes[i].Owner)
PopulateNode(i);
}
//all creatures which don't get despawned through the script are static
sLog->outDebug("BG_AV: start spawning static creatures");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures");
for (i=0; i < AV_STATICCPLACE_MAX; i++)
AddAVCreature(0,i+AV_CPLACE_MAX);
//mainspiritguides:
sLog->outDebug("BG_AV: start spawning spiritguides creatures");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures");
AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE);
AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE);
//spawn the marshals (those who get deleted, if a tower gets destroyed)
sLog->outDebug("BG_AV: start spawning marshal creatures");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures");
for (i=AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++)
AddAVCreature(i,AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH));
AddAVCreature(AV_NPC_HERALD,AV_CPLACE_HERALD);
@@ -217,12 +217,12 @@ void BattlegroundWS::RespawnFlag(uint32 Team, bool captured)
{
if (Team == ALLIANCE)
{
sLog->outDebug("Respawn Alliance flag");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Respawn Alliance flag");
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
}
else
{
sLog->outDebug("Respawn Horde flag");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Respawn Horde flag");
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
}
@@ -699,7 +699,7 @@ bool BattlegroundWS::SetupBattleground()
return false;
}
sLog->outDebug("BatteGroundWS: BG objects and spirit guides spawned");
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BatteGroundWS: BG objects and spirit guides spawned");
return true;
}