mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
chore(Core/Logging): replace most server loggers (#5726)
* chore(Core/Logging): replace most server loggers Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -307,9 +307,7 @@ inline void Battleground::_CheckSafePositions(uint32 diff)
|
||||
GetTeamStartLoc(itr->second->GetBgTeamId(), x, y, z, o);
|
||||
if (pos.GetExactDistSq(x, y, z) > maxDist)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("bg.battleground", "BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", itr->second->GetName().c_str(), GetMapId());
|
||||
#endif
|
||||
itr->second->TeleportTo(GetMapId(), x, y, z, o);
|
||||
}
|
||||
}
|
||||
@@ -442,7 +440,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
||||
|
||||
if (!FindBgMap())
|
||||
{
|
||||
LOG_ERROR("server", "Battleground::_ProcessJoin: map (map id: %u, instance id: %u) is not created!", m_MapId, m_InstanceID);
|
||||
LOG_ERROR("bg.battleground", "Battleground::_ProcessJoin: map (map id: %u, instance id: %u) is not created!", m_MapId, m_InstanceID);
|
||||
EndNow();
|
||||
return;
|
||||
}
|
||||
@@ -1169,7 +1167,7 @@ void Battleground::Init()
|
||||
|
||||
if (m_BgInvitedPlayers[TEAM_ALLIANCE] > 0 || m_BgInvitedPlayers[TEAM_HORDE] > 0)
|
||||
{
|
||||
LOG_ERROR("server", "Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!", m_BgInvitedPlayers[TEAM_ALLIANCE], m_BgInvitedPlayers[TEAM_HORDE], m_MapId, m_InstanceID);
|
||||
LOG_ERROR("bg.battleground", "Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!", m_BgInvitedPlayers[TEAM_ALLIANCE], m_BgInvitedPlayers[TEAM_HORDE], m_MapId, m_InstanceID);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
@@ -1268,9 +1266,7 @@ void Battleground::AddPlayer(Player* player)
|
||||
sScriptMgr->OnBattlegroundAddPlayer(this, player);
|
||||
|
||||
// Log
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "BATTLEGROUND: Player %s joined the battle.", player->GetName().c_str());
|
||||
#endif
|
||||
LOG_DEBUG("bg.battleground", "BATTLEGROUND: Player %s joined the battle.", player->GetName().c_str());
|
||||
}
|
||||
|
||||
// this method adds player to his team's bg group, or sets his correct group if player is already in bg group
|
||||
@@ -1447,7 +1443,7 @@ void Battleground::UpdatePlayerScore(Player* player, uint32 type, uint32 value,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!",
|
||||
type, m_MapId, m_InstanceID);
|
||||
break;
|
||||
}
|
||||
@@ -1517,7 +1513,7 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
LOG_ERROR("server", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
delete go;
|
||||
return false;
|
||||
@@ -1568,7 +1564,7 @@ void Battleground::DoorClose(uint32 type)
|
||||
}
|
||||
}
|
||||
else
|
||||
LOG_ERROR("server", "Battleground::DoorClose: door gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::DoorClose: door gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
type, BgObjects[type].ToString().c_str(), m_MapId, m_InstanceID);
|
||||
}
|
||||
|
||||
@@ -1580,7 +1576,7 @@ void Battleground::DoorOpen(uint32 type)
|
||||
obj->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
else
|
||||
LOG_ERROR("server", "Battleground::DoorOpen: door gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::DoorOpen: door gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
type, BgObjects[type].ToString().c_str(), m_MapId, m_InstanceID);
|
||||
}
|
||||
|
||||
@@ -1588,7 +1584,7 @@ GameObject* Battleground::GetBGObject(uint32 type)
|
||||
{
|
||||
GameObject* obj = GetBgMap()->GetGameObject(BgObjects[type]);
|
||||
if (!obj)
|
||||
LOG_ERROR("server", "Battleground::GetBGObject: gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::GetBGObject: gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
type, BgObjects[type].ToString().c_str(), m_MapId, m_InstanceID);
|
||||
return obj;
|
||||
}
|
||||
@@ -1597,7 +1593,7 @@ Creature* Battleground::GetBGCreature(uint32 type)
|
||||
{
|
||||
Creature* creature = GetBgMap()->GetCreature(BgCreatures[type]);
|
||||
if (!creature)
|
||||
LOG_ERROR("server", "Battleground::GetBGCreature: creature (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::GetBGCreature: creature (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
type, BgCreatures[type].ToString().c_str(), m_MapId, m_InstanceID);
|
||||
return creature;
|
||||
}
|
||||
@@ -1642,7 +1638,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, PHASEMASK_NORMAL, entry, 0, x, y, z, o))
|
||||
{
|
||||
LOG_ERROR("server", "Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
delete creature;
|
||||
return nullptr;
|
||||
@@ -1653,7 +1649,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
||||
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
|
||||
if (!cinfo)
|
||||
{
|
||||
LOG_ERROR("server", "Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
delete creature;
|
||||
return nullptr;
|
||||
@@ -1692,7 +1688,7 @@ bool Battleground::DelCreature(uint32 type)
|
||||
return true;
|
||||
}
|
||||
|
||||
LOG_ERROR("server", "Battleground::DelCreature: creature (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::DelCreature: creature (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
type, BgCreatures[type].ToString().c_str(), m_MapId, m_InstanceID);
|
||||
|
||||
BgCreatures[type].Clear();
|
||||
@@ -1712,7 +1708,7 @@ bool Battleground::DelObject(uint32 type)
|
||||
return true;
|
||||
}
|
||||
|
||||
LOG_ERROR("server", "Battleground::DelObject: gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::DelObject: gameobject (type: %u, %s) not found for BG (map: %u, instance id: %u)!",
|
||||
type, BgObjects[type].ToString().c_str(), m_MapId, m_InstanceID);
|
||||
|
||||
BgObjects[type].Clear();
|
||||
@@ -1737,7 +1733,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
|
||||
//creature->CastSpell(creature, SPELL_SPIRIT_HEAL_CHANNEL, true);
|
||||
return true;
|
||||
}
|
||||
LOG_ERROR("server", "Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
LOG_ERROR("bg.battleground", "Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
type, entry, m_MapId, m_InstanceID);
|
||||
EndNow();
|
||||
return false;
|
||||
@@ -1926,7 +1922,7 @@ int32 Battleground::GetObjectType(ObjectGuid guid)
|
||||
if (BgObjects[i] == guid)
|
||||
return i;
|
||||
|
||||
LOG_ERROR("server", "Battleground::GetObjectType: player used gameobject (%s) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
|
||||
LOG_ERROR("bg.battleground", "Battleground::GetObjectType: player used gameobject (%s) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
|
||||
guid.ToString().c_str(), m_MapId, m_InstanceID);
|
||||
|
||||
return -1;
|
||||
@@ -1983,7 +1979,7 @@ uint32 Battleground::GetTeamScore(TeamId teamId) const
|
||||
if (teamId == TEAM_ALLIANCE || teamId == TEAM_HORDE)
|
||||
return m_TeamScores[teamId];
|
||||
|
||||
LOG_ERROR("server", "GetTeamScore with wrong Team %u for BG %u", teamId, GetBgTypeID());
|
||||
LOG_ERROR("bg.battleground", "GetTeamScore with wrong Team %u for BG %u", teamId, GetBgTypeID());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user