aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-08-07 13:44:22 -0500
committerSubv <s.v.h21@hotmail.com>2012-08-07 13:44:22 -0500
commitd82266bc0ef31df82dc67c1023d6208df6ac247b (patch)
treea0c5970a82e568ca54a25809555b7abad52e1bc1 /src/server/game
parent224cf663e2af8b355b4bdca4069080636321b0ba (diff)
parentf8cd39b2ed1056f409c2690ac8bb661fbcb68e18 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/authserver/Server/AuthSocket.cpp src/server/game/Achievements/AchievementMgr.cpp src/server/game/Chat/Chat.h src/server/game/Chat/Commands/Level1.cpp src/server/game/Chat/Commands/Level2.cpp src/server/game/Chat/Commands/Level3.cpp src/server/game/DataStores/DBCStores.cpp src/server/game/DataStores/DBCStructure.h src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Object/Updates/UpdateData.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Guilds/Guild.cpp src/server/game/Guilds/GuildMgr.cpp src/server/game/Handlers/AuctionHouseHandler.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/ChatHandler.cpp src/server/game/Handlers/GroupHandler.cpp src/server/game/Handlers/ItemHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Handlers/MovementHandler.cpp src/server/game/Handlers/PetHandler.cpp src/server/game/Handlers/QuestHandler.cpp src/server/game/Handlers/VehicleHandler.cpp src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/game/Spells/SpellEffects.cpp src/server/game/Spells/SpellMgr.cpp src/server/game/World/World.cpp src/server/scripts/Commands/cs_debug.cpp src/server/scripts/Commands/cs_modify.cpp src/server/scripts/Commands/cs_reload.cpp src/server/scripts/Kalimdor/azuremyst_isle.cpp src/server/shared/Logging/Log.cpp src/server/shared/Logging/Log.h src/server/worldserver/worldserver.conf.dist
Diffstat (limited to 'src/server/game')
-rwxr-xr-xsrc/server/game/AI/CoreAI/CombatAI.cpp4
-rwxr-xr-xsrc/server/game/AI/CoreAI/PassiveAI.h1
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.cpp5
-rwxr-xr-xsrc/server/game/AI/CoreAI/UnitAI.cpp2
-rwxr-xr-xsrc/server/game/AI/CreatureAI.cpp4
-rwxr-xr-xsrc/server/game/AI/CreatureAIRegistry.cpp1
-rwxr-xr-xsrc/server/game/AI/CreatureAISelector.cpp1
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.cpp61
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAI.h1
-rwxr-xr-xsrc/server/game/AI/EventAI/CreatureEventAIMgr.cpp250
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp14
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp38
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h1
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp22
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp26
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp40
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h6
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp112
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h30
-rw-r--r--[-rwxr-xr-x]src/server/game/Achievements/AchievementMgr.cpp133
-rwxr-xr-xsrc/server/game/Addons/AddonMgr.cpp8
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp43
-rwxr-xr-xsrc/server/game/Battlegrounds/ArenaTeam.cpp22
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.cpp10
-rwxr-xr-xsrc/server/game/Battlegrounds/Battleground.cpp48
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp44
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundQueue.cpp14
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAB.cpp10
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAV.cpp50
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundBE.cpp6
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundEY.cpp24
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundIC.cpp20
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundNA.cpp6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRL.cpp6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundRV.cpp6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundSA.cpp6
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundWS.cpp14
-rw-r--r--src/server/game/CMakeLists.txt1
-rw-r--r--src/server/game/Calendar/CalendarMgr.cpp18
-rwxr-xr-xsrc/server/game/Chat/Channels/Channel.cpp6
-rwxr-xr-xsrc/server/game/Chat/Channels/ChannelMgr.h1
-rwxr-xr-xsrc/server/game/Chat/Chat.cpp142
-rw-r--r--[-rwxr-xr-x]src/server/game/Chat/Chat.h109
-rwxr-xr-xsrc/server/game/Chat/Commands/Level0.cpp129
-rwxr-xr-xsrc/server/game/Chat/Commands/Level1.cpp633
-rwxr-xr-xsrc/server/game/Chat/Commands/Level2.cpp681
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp1764
-rwxr-xr-xsrc/server/game/Combat/HostileRefManager.h1
-rwxr-xr-xsrc/server/game/Combat/ThreatManager.cpp1
-rwxr-xr-xsrc/server/game/Combat/UnitEvents.h2
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp294
-rwxr-xr-xsrc/server/game/Conditions/DisableMgr.cpp62
-rw-r--r--src/server/game/DataStores/DB2Stores.cpp12
-rw-r--r--[-rwxr-xr-x]src/server/game/DataStores/DBCStores.cpp13
-rw-r--r--[-rwxr-xr-x]src/server/game/DataStores/DBCStructure.h6
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp28
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp3
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.h2
-rwxr-xr-xsrc/server/game/Entities/Corpse/Corpse.cpp6
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp44
-rwxr-xr-xsrc/server/game/Entities/Creature/CreatureGroups.cpp12
-rwxr-xr-xsrc/server/game/Entities/Creature/GossipDef.cpp2
-rwxr-xr-xsrc/server/game/Entities/Creature/TemporarySummon.cpp4
-rwxr-xr-xsrc/server/game/Entities/DynamicObject/DynamicObject.cpp2
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp22
-rwxr-xr-xsrc/server/game/Entities/Item/Container/Bag.cpp2
-rwxr-xr-xsrc/server/game/Entities/Item/Item.cpp12
-rwxr-xr-xsrc/server/game/Entities/Item/ItemEnchantmentMgr.cpp10
-rw-r--r--[-rwxr-xr-x]src/server/game/Entities/Object/Object.cpp66
-rw-r--r--[-rwxr-xr-x]src/server/game/Entities/Object/Updates/UpdateData.cpp0
-rwxr-xr-xsrc/server/game/Entities/Pet/Pet.cpp22
-rw-r--r--[-rwxr-xr-x]src/server/game/Entities/Player/Player.cpp336
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h7
-rwxr-xr-xsrc/server/game/Entities/Transport/Transport.cpp46
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp219
-rwxr-xr-xsrc/server/game/Events/GameEventMgr.cpp244
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.cpp2
-rwxr-xr-xsrc/server/game/Globals/ObjectAccessor.h4
-rw-r--r--[-rwxr-xr-x]src/server/game/Globals/ObjectMgr.cpp1291
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.h8
-rwxr-xr-xsrc/server/game/Grids/GridStates.h2
-rwxr-xr-xsrc/server/game/Grids/ObjectGridLoader.cpp2
-rwxr-xr-xsrc/server/game/Groups/Group.cpp8
-rw-r--r--src/server/game/Groups/GroupMgr.cpp38
-rw-r--r--[-rwxr-xr-x]src/server/game/Guilds/Guild.cpp50
-rw-r--r--src/server/game/Guilds/GuildMgr.cpp88
-rwxr-xr-xsrc/server/game/Handlers/AddonHandler.cpp2
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/AuctionHouseHandler.cpp14
-rwxr-xr-xsrc/server/game/Handlers/BattleGroundHandler.cpp16
-rwxr-xr-xsrc/server/game/Handlers/CalendarHandler.cpp8
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp71
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/ChatHandler.cpp14
-rwxr-xr-xsrc/server/game/Handlers/CombatHandler.cpp2
-rwxr-xr-xsrc/server/game/Handlers/DuelHandler.cpp4
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/GroupHandler.cpp14
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/ItemHandler.cpp10
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/MailHandler.cpp6
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/MiscHandler.cpp40
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/MovementHandler.cpp26
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/PetHandler.cpp46
-rwxr-xr-xsrc/server/game/Handlers/PetitionsHandler.cpp4
-rwxr-xr-xsrc/server/game/Handlers/QueryHandler.cpp2
-rw-r--r--[-rwxr-xr-x]src/server/game/Handlers/QuestHandler.cpp14
-rwxr-xr-xsrc/server/game/Handlers/SpellHandler.cpp16
-rwxr-xr-xsrc/server/game/Handlers/TradeHandler.cpp12
-rw-r--r--src/server/game/Handlers/VehicleHandler.cpp20
-rwxr-xr-xsrc/server/game/Instances/InstanceSaveMgr.cpp16
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.cpp10
-rwxr-xr-xsrc/server/game/Instances/InstanceScript.h11
-rwxr-xr-xsrc/server/game/Loot/LootMgr.cpp124
-rwxr-xr-xsrc/server/game/Mails/Mail.cpp2
-rwxr-xr-xsrc/server/game/Mails/Mail.h5
-rwxr-xr-xsrc/server/game/Maps/Map.cpp92
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.cpp4
-rwxr-xr-xsrc/server/game/Maps/MapManager.cpp4
-rwxr-xr-xsrc/server/game/Miscellaneous/Formulas.h2
-rwxr-xr-xsrc/server/game/Miscellaneous/Language.h5
-rwxr-xr-xsrc/server/game/Movement/MotionMaster.cpp74
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp6
-rw-r--r--src/server/game/Movement/Spline/MoveSpline.cpp6
-rwxr-xr-xsrc/server/game/Movement/Waypoints/WaypointManager.cpp8
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvP.cpp4
-rwxr-xr-xsrc/server/game/OutdoorPvP/OutdoorPvPMgr.cpp16
-rwxr-xr-xsrc/server/game/Pools/PoolMgr.cpp85
-rwxr-xr-xsrc/server/game/Reputation/ReputationMgr.cpp4
-rwxr-xr-xsrc/server/game/Scripting/MapScripts.cpp102
-rwxr-xr-xsrc/server/game/Scripting/ScriptLoader.cpp4
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.cpp39
-rwxr-xr-xsrc/server/game/Scripting/ScriptMgr.h2
-rwxr-xr-xsrc/server/game/Scripting/ScriptSystem.cpp60
-rw-r--r--src/server/game/Scripting/ScriptSystem.h1
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp4
-rw-r--r--src/server/game/Server/Protocol/PacketLog.cpp62
-rw-r--r--src/server/game/Server/Protocol/PacketLog.h50
-rw-r--r--src/server/game/Server/WorldPacket.cpp12
-rw-r--r--[-rwxr-xr-x]src/server/game/Server/WorldSession.cpp68
-rw-r--r--[-rwxr-xr-x]src/server/game/Server/WorldSocket.cpp130
-rw-r--r--src/server/game/Server/WorldSocketAcceptor.h4
-rwxr-xr-xsrc/server/game/Server/WorldSocketMgr.cpp18
-rwxr-xr-xsrc/server/game/Skills/SkillDiscovery.cpp20
-rwxr-xr-xsrc/server/game/Skills/SkillExtraItems.cpp16
-rw-r--r--[-rwxr-xr-x]src/server/game/Spells/Auras/SpellAuraEffects.cpp46
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp50
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp51
-rw-r--r--[-rwxr-xr-x]src/server/game/Spells/SpellEffects.cpp91
-rw-r--r--src/server/game/Spells/SpellInfo.cpp13
-rw-r--r--[-rwxr-xr-x]src/server/game/Spells/SpellMgr.cpp293
-rwxr-xr-xsrc/server/game/Spells/SpellScript.cpp86
-rwxr-xr-xsrc/server/game/Texts/CreatureTextMgr.cpp26
-rwxr-xr-xsrc/server/game/Tickets/TicketMgr.cpp12
-rw-r--r--src/server/game/Tools/CharacterDatabaseCleaner.cpp8
-rw-r--r--src/server/game/Tools/PlayerDump.cpp8
-rw-r--r--src/server/game/Warden/Warden.cpp2
-rw-r--r--src/server/game/Warden/WardenCheckMgr.cpp28
-rw-r--r--src/server/game/Warden/WardenMac.cpp2
-rw-r--r--src/server/game/Warden/WardenWin.cpp8
-rwxr-xr-xsrc/server/game/Weather/Weather.cpp6
-rwxr-xr-xsrc/server/game/Weather/WeatherMgr.cpp14
-rw-r--r--[-rwxr-xr-x]src/server/game/World/World.cpp492
160 files changed, 3331 insertions, 6868 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 86f2c6a28b7..7d7a27fce13 100755
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -182,7 +182,7 @@ void CasterAI::UpdateAI(const uint32 diff)
ArcherAI::ArcherAI(Creature* c) : CreatureAI(c)
{
if (!me->m_spells[0])
- sLog->outError("ArcherAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "ArcherAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(me->m_spells[0]);
m_minRange = spellInfo ? spellInfo->GetMinRange(false) : 0;
@@ -231,7 +231,7 @@ void ArcherAI::UpdateAI(const uint32 /*diff*/)
TurretAI::TurretAI(Creature* c) : CreatureAI(c)
{
if (!me->m_spells[0])
- sLog->outError("TurretAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "TurretAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry());
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(me->m_spells[0]);
m_minRange = spellInfo ? spellInfo->GetMinRange(false) : 0;
diff --git a/src/server/game/AI/CoreAI/PassiveAI.h b/src/server/game/AI/CoreAI/PassiveAI.h
index d7bf8656f23..b4fd579d693 100755
--- a/src/server/game/AI/CoreAI/PassiveAI.h
+++ b/src/server/game/AI/CoreAI/PassiveAI.h
@@ -20,7 +20,6 @@
#define TRINITY_PASSIVEAI_H
#include "CreatureAI.h"
-//#include "CreatureAIImpl.h"
class PassiveAI : public CreatureAI
{
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 97ae0581a18..99cf1cda4fc 100755
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -61,7 +61,7 @@ void PetAI::_stopAttack()
{
if (!me->isAlive())
{
- sLog->outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow());
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->CombatStop();
@@ -100,7 +100,7 @@ void PetAI::UpdateAI(const uint32 diff)
if (_needToStop())
{
- sLog->outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Pet AI stopped attacking [guid=%u]", me->GetGUIDLow());
_stopAttack();
return;
}
@@ -430,7 +430,6 @@ void PetAI::HandleReturnMovement()
}
}
}
-
}
void PetAI::DoAttack(Unit* target, bool chase)
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp
index bf50909eeee..e159c1a7d9b 100755
--- a/src/server/game/AI/CoreAI/UnitAI.cpp
+++ b/src/server/game/AI/CoreAI/UnitAI.cpp
@@ -130,7 +130,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
void UnitAI::DoCast(uint32 spellId)
{
Unit* target = NULL;
- //sLog->outError("aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target);
+ //sLog->outError(LOG_FILTER_GENERAL, "aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target);
switch (AISpellInfo[spellId].target)
{
default:
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 9c236cbd039..17cef3ec1a1 100755
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -54,7 +54,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
Map* map = creature->GetMap();
if (!map->IsDungeon()) //use IsDungeon instead of Instanceable, in case battlegrounds will be instantiated
{
- sLog->outError("DoZoneInCombat call for map that isn't an instance (creature entry = %d)", creature->GetTypeId() == TYPEID_UNIT ? creature->ToCreature()->GetEntry() : 0);
+ sLog->outError(LOG_FILTER_GENERAL, "DoZoneInCombat call for map that isn't an instance (creature entry = %d)", creature->GetTypeId() == TYPEID_UNIT ? creature->ToCreature()->GetEntry() : 0);
return;
}
@@ -77,7 +77,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
if (!creature->HasReactState(REACT_PASSIVE) && !creature->getVictim())
{
- sLog->outError("DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
return;
}
diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp
index e4cb62c56de..e5c689da339 100755
--- a/src/server/game/AI/CreatureAIRegistry.cpp
+++ b/src/server/game/AI/CreatureAIRegistry.cpp
@@ -30,7 +30,6 @@
#include "CreatureAIFactory.h"
#include "SmartAI.h"
-//#include "CreatureAIImpl.h"
namespace AIRegistry
{
void Initialize()
diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp
index 1a0c6652e74..2d69f1e0243 100755
--- a/src/server/game/AI/CreatureAISelector.cpp
+++ b/src/server/game/AI/CreatureAISelector.cpp
@@ -125,7 +125,6 @@ namespace FactorySelector
}*/
return (mv_factory == NULL ? NULL : mv_factory->Create(creature));
-
}
GameObjectAI* SelectGameObjectAI(GameObject* go)
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index 9745b7185d9..82abfc0454c 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -40,7 +40,7 @@ bool CreatureEventAIHolder::UpdateRepeatTimer(Creature* creature, uint32 repeatM
Time = urand(repeatMin, repeatMax);
else
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", creature->GetEntry(), Event.event_id, Event.event_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", creature->GetEntry(), Event.event_id, Event.event_type);
Enabled = false;
return false;
}
@@ -64,7 +64,6 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
std::vector<CreatureEventAI_Event>::const_iterator i;
for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i)
{
-
//Debug check
#ifndef TRINITY_DEBUG
if ((*i).event_flags & EFLAG_DEBUG_ONLY)
@@ -83,10 +82,10 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
}
//EventMap had events but they were not added because they must be for instance
if (m_CreatureEventAIList.empty())
- sLog->outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", me->GetEntry());
}
else
- sLog->outError("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", me->GetEntry());
m_bEmptyList = m_CreatureEventAIList.empty();
m_Phase = 0;
@@ -319,7 +318,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& holder, Unit* actionIn
break;
}
default:
- sLog->outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), holder.Event.event_id, holder.Event.event_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), holder.Event.event_id, holder.Event.event_type);
break;
}
@@ -492,10 +491,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
caster->CastSpell(target, action.cast.spellId, (action.cast.castFlags & CAST_TRIGGERED));
}
-
}
else
- sLog->outErrorDb("CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", eventId, me->GetEntry(), action.cast.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", eventId, me->GetEntry(), action.cast.spellId);
}
break;
}
@@ -511,7 +509,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
creature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
if (!creature)
- sLog->outErrorDb("CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, eventId, me->GetEntry());
else if (action.summon.target != TARGET_T_SELF && target)
creature->AI()->AttackStart(target);
break;
@@ -607,12 +605,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
int32 new_phase = int32(m_Phase)+action.set_inc_phase.step;
if (new_phase < 0)
{
- sLog->outErrorDb("CreatureEventAI: Event %d decrease m_Phase under 0. CreatureEntry = %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d decrease m_Phase under 0. CreatureEntry = %d", eventId, me->GetEntry());
m_Phase = 0;
}
else if (new_phase >= MAX_PHASE)
{
- sLog->outErrorDb("CreatureEventAI: Event %d incremented m_Phase above %u. m_Phase mask cannot be used with phases past %u. CreatureEntry = %d", eventId, MAX_PHASE-1, MAX_PHASE-1, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d incremented m_Phase above %u. m_Phase mask cannot be used with phases past %u. CreatureEntry = %d", eventId, MAX_PHASE-1, MAX_PHASE-1, me->GetEntry());
m_Phase = MAX_PHASE-1;
}
else
@@ -663,7 +661,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
if (action.random_phase_range.phaseMin <= action.random_phase_range.phaseMax)
m_Phase = urand(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
else
- sLog->outErrorDb("CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", eventId, me->GetEntry());
break;
case ACTION_T_SUMMON_ID:
{
@@ -672,7 +670,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr->GetCreatureEventAISummonMap().find(action.summon_id.spawnId);
if (i == sEventAIMgr->GetCreatureEventAISummonMap().end())
{
- sLog->outErrorDb("CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, eventId, me->GetEntry());
return;
}
@@ -683,7 +681,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
creature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0);
if (!creature)
- sLog->outErrorDb("CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, eventId, me->GetEntry());
else if (action.summon_id.target != TARGET_T_SELF && target)
creature->AI()->AttackStart(target);
@@ -703,10 +701,10 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
break;
case ACTION_T_SET_INST_DATA:
{
- InstanceScript* instance = (InstanceScript*)me->GetInstanceScript();
+ InstanceScript* instance = me->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", eventId, me->GetEntry());
return;
}
@@ -718,14 +716,14 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
Unit* target = GetTargetByType(action.set_inst_data64.target, actionInvoker);
if (!target)
{
- sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", eventId, me->GetEntry());
return;
}
- InstanceScript* instance = (InstanceScript*)me->GetInstanceScript();
+ InstanceScript* instance = me->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", eventId, me->GetEntry());
return;
}
@@ -735,8 +733,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_UPDATE_TEMPLATE:
if (me->GetEntry() == action.update_template.creatureId)
{
-
- sLog->outErrorDb("CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", eventId, me->GetEntry());
return;
}
@@ -745,8 +742,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
case ACTION_T_DIE:
if (me->isDead())
{
-
- sLog->outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", eventId, me->GetEntry());
return;
}
me->Kill(me);
@@ -798,7 +794,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
object = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2);
if (!object)
{
- sLog->outErrorDb("TSCR: EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, eventId, me->GetEntry());
+ sLog->outError(LOG_FILTER_TSCR, "EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, eventId, me->GetEntry());
}
break;
}
@@ -843,6 +839,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
break;
}
+ default:
+ break;
}
}
@@ -1048,7 +1046,6 @@ void CreatureEventAI::MoveInLineOfSight(Unit* who)
void CreatureEventAI::SpellHit(Unit* unit, const SpellInfo* spell)
{
-
if (m_bEmptyList)
return;
@@ -1111,6 +1108,8 @@ void CreatureEventAI::UpdateAI(const uint32 diff)
if (me->IsInRange(me->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist))
ProcessEvent(*i);
break;
+ default:
+ break;
}
}
@@ -1230,13 +1229,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
{
if (!source)
{
- sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.", textEntry);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i, invalid Source pointer.", textEntry);
return;
}
if (textEntry >= 0)
{
- sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
return;
}
@@ -1244,7 +1243,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
if (i == sEventAIMgr->GetCreatureEventAITextMap().end())
{
- sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry);
return;
}
@@ -1255,7 +1254,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
if (sSoundEntriesStore.LookupEntry((*i).second.SoundId))
source->PlayDirectSound((*i).second.SoundId);
else
- sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId);
}
if ((*i).second.Emote)
@@ -1265,7 +1264,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
((Unit*)source)->HandleEmoteCommand((*i).second.Emote);
}
else
- sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", textEntry, source->GetTypeId());
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", textEntry, source->GetTypeId());
}
switch ((*i).second.Type)
@@ -1286,13 +1285,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t
{
if (target && target->GetTypeId() == TYPEID_PLAYER)
source->MonsterWhisper(textEntry, target->GetGUID());
- else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
+ else sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
}break;
case CHAT_TYPE_BOSS_WHISPER:
{
if (target && target->GetTypeId() == TYPEID_PLAYER)
source->MonsterWhisper(textEntry, target->GetGUID(), true);
- else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
+ else sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry);
}break;
case CHAT_TYPE_ZONE_YELL:
source->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0);
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h
index 3d2bcf888c8..b9e1ae32be4 100755
--- a/src/server/game/AI/EventAI/CreatureEventAI.h
+++ b/src/server/game/AI/EventAI/CreatureEventAI.h
@@ -589,7 +589,6 @@ struct CreatureEventAIHolder
class CreatureEventAI : public CreatureAI
{
-
public:
explicit CreatureEventAI(Creature* c);
~CreatureEventAI()
diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
index d95074d9052..af25ba6af1d 100755
--- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp
@@ -38,13 +38,13 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
// Load EventAI Text
sObjectMgr->LoadTrinityStrings("creature_ai_texts", MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
- // Gather Additional data from EventAI Texts 0 1 2 3 4
+ // Gather Additional data from EventAI Texts 0 1 2 3 4
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
if (!result)
{
- sLog->outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty.");
+
return;
}
@@ -64,33 +64,33 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
// range negative
if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID)
{
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)", i, MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)", i, MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID);
continue;
}
// range negative (must not happen, loaded from same table)
if (!sObjectMgr->GetTrinityStringLocale(i))
{
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found", i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` not found", i);
continue;
}
if (temp.SoundId)
{
if (!sSoundEntriesStore.LookupEntry(temp.SoundId))
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.", i, temp.SoundId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.", i, temp.SoundId);
}
if (!GetLanguageDescByID(temp.Language))
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.", i, temp.Language);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.", i, temp.Language);
if (temp.Type > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.", i, temp.Type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.", i, temp.Type);
if (temp.Emote)
{
if (!sEmotesStore.LookupEntry(temp.Emote))
- sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.", i, temp.Emote);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.", i, temp.Emote);
}
m_CreatureEventAI_TextMap[i] = temp;
@@ -98,11 +98,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
-// -------------------
void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
{
uint32 oldMSTime = getMSTime();
@@ -115,8 +114,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
if (!result)
{
- sLog->outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty.");
+
return;
}
@@ -137,7 +136,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
if (!Trinity::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation))
{
- sLog->outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation);
continue;
}
@@ -147,11 +146,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
-// -------------------
void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
uint32 oldMSTime = getMSTime();
@@ -169,8 +167,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (!result)
{
- sLog->outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty.");
+
return;
}
@@ -191,7 +189,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
//Report any errors in event
if (e_type >= EVENT_T_END)
{
- sLog->outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type);
continue;
}
temp.event_type = EventAI_Type(e_type);
@@ -208,21 +206,21 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
//Creature does not exist in database
if (!cInfo)
{
- sLog->outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, creature_id);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, creature_id);
continue;
}
// Only on the first script
if (cInfo->AIName != "EventAI" && m_CreatureEventAI_Event_Map[creature_id].empty())
- sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id);
+ sLog->outError(LOG_FILTER_SQL, "Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id);
//No chance of this event occuring
if (temp.event_chance == 0)
- sLog->outErrorDb("CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i);
//Chance above 100, force it to be 100
else if (temp.event_chance > 100)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i);
temp.event_chance = 100;
}
@@ -232,23 +230,23 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
case EVENT_T_TIMER:
case EVENT_T_TIMER_OOC:
if (temp.timer.initialMax < temp.timer.initialMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i);
if (temp.timer.repeatMax < temp.timer.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_HP:
case EVENT_T_MANA:
case EVENT_T_TARGET_HP:
case EVENT_T_TARGET_MANA:
if (temp.percent_range.percentMax > 100)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i);
if (temp.percent_range.percentMax <= temp.percent_range.percentMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i);
if (temp.event_flags & EFLAG_REPEATABLE && !temp.percent_range.repeatMin && !temp.percent_range.repeatMax)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i);
temp.event_flags &= ~EFLAG_REPEATABLE;
}
break;
@@ -258,29 +256,29 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.spell_hit.spellId);
if (!spell)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
continue;
}
if ((temp.spell_hit.schoolMask & spell->SchoolMask) != spell->SchoolMask)
- sLog->outErrorDb("CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.spell_hit.schoolMask, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.spell_hit.schoolMask, i);
}
if (!temp.spell_hit.schoolMask)
- sLog->outErrorDb("CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.spell_hit.schoolMask, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.spell_hit.schoolMask, i);
if (temp.spell_hit.repeatMax < temp.spell_hit.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_RANGE:
if (temp.range.maxDist < temp.range.minDist)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (MaxDist < MinDist). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (MaxDist < MinDist). Event will never repeat.", temp.creature_id, i);
if (temp.range.repeatMax < temp.range.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_OOC_LOS:
if (temp.ooc_los.repeatMax < temp.ooc_los.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_SPAWNED:
switch (temp.spawned.condition)
@@ -289,55 +287,55 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
case SPAWNED_EVENT_MAP:
if (!sMapStore.LookupEntry(temp.spawned.conditionValue1))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'map specific' but with not existed map (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'map specific' but with not existed map (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
break;
case SPAWNED_EVENT_ZONE:
if (!GetAreaEntryByAreaID(temp.spawned.conditionValue1))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'area specific' but with not existed area (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'area specific' but with not existed area (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
default:
- sLog->outErrorDb("CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition);
break;
}
break;
case EVENT_T_FRIENDLY_HP:
if (temp.friendly_hp.repeatMax < temp.friendly_hp.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_FRIENDLY_IS_CC:
if (temp.friendly_is_cc.repeatMax < temp.friendly_is_cc.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_FRIENDLY_MISSING_BUFF:
{
SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.spell_hit.spellId);
if (!spell)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
continue;
}
if (temp.friendly_buff.repeatMax < temp.friendly_buff.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
}
case EVENT_T_KILL:
if (temp.kill.repeatMax < temp.kill.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_TARGET_CASTING:
if (temp.target_casting.repeatMax < temp.target_casting.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_SUMMONED_UNIT:
if (!sObjectMgr->GetCreatureTemplate(temp.summon_unit.creatureId))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with not existed creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.summon_unit.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with not existed creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.summon_unit.creatureId);
if (temp.summon_unit.repeatMax < temp.summon_unit.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_QUEST_ACCEPT:
case EVENT_T_QUEST_COMPLETE:
if (!sObjectMgr->GetQuestTemplate(temp.quest.questId))
- sLog->outErrorDb("CreatureEventAI: Creature %u are using event(%u) with not existed qyest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId);
- sLog->outErrorDb("CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with not existed qyest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i);
continue;
case EVENT_T_AGGRO:
@@ -347,7 +345,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (temp.event_flags & EFLAG_REPEATABLE)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i);
temp.event_flags &= ~EFLAG_REPEATABLE;
}
@@ -358,7 +356,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (!sEmotesTextStore.LookupEntry(temp.receive_emote.emoteId))
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.", temp.creature_id, i, temp.receive_emote.emoteId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.", temp.creature_id, i, temp.receive_emote.emoteId);
continue;
}
if (temp.receive_emote.condition)
@@ -369,14 +367,14 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
cond.ConditionValue2 = temp.receive_emote.conditionValue2;
if (!sConditionMgr->isConditionTypeValid(&cond))
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.", temp.creature_id, i, temp.receive_emote.condition);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.", temp.creature_id, i, temp.receive_emote.condition);
continue;
}
}
if (!(temp.event_flags & EFLAG_REPEATABLE))
{
- sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: EFLAG_REPEATABLE not set. Event must always be repeatable. Flag applied.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: EFLAG_REPEATABLE not set. Event must always be repeatable. Flag applied.", temp.creature_id, i);
temp.event_flags |= EFLAG_REPEATABLE;
}
@@ -389,16 +387,16 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.buffed.spellId);
if (!spell)
{
- sLog->outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i);
continue;
}
if (temp.buffed.repeatMax < temp.buffed.repeatMin)
- sLog->outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
}
default:
- sLog->outErrorDb("CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i);
break;
}
@@ -407,7 +405,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
uint16 action_type = fields[10+(j*4)].GetUInt8();
if (action_type >= ACTION_T_END)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type);
temp.action[j].type = ACTION_T_NONE;
continue;
}
@@ -429,30 +427,30 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (action.text.TextId1 < 0)
{
if (m_CreatureEventAI_TextMap.find(action.text.TextId1) == m_CreatureEventAI_TextMap.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1);
}
if (action.text.TextId2 < 0)
{
if (m_CreatureEventAI_TextMap.find(action.text.TextId2) == m_CreatureEventAI_TextMap.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1);
if (!action.text.TextId1)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1);
}
if (action.text.TextId3 < 0)
{
if (m_CreatureEventAI_TextMap.find(action.text.TextId3) == m_CreatureEventAI_TextMap.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1);
if (!action.text.TextId1 || !action.text.TextId2)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1);
}
break;
}
case ACTION_T_SET_FACTION:
if (action.set_faction.factionId !=0 && !sFactionStore.LookupEntry(action.set_faction.factionId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent FactionId %u.", i, j+1, action.set_faction.factionId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent FactionId %u.", i, j+1, action.set_faction.factionId);
action.set_faction.factionId = 0;
}
break;
@@ -461,7 +459,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.morph.creatureId && !sObjectMgr->GetCreatureTemplate(action.morph.creatureId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId);
action.morph.creatureId = 0;
}
@@ -469,12 +467,12 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.morph.creatureId)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId, action.morph.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId, action.morph.creatureId);
action.morph.modelId = 0;
}
else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant ModelId %u.", i, j+1, action.morph.modelId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant ModelId %u.", i, j+1, action.morph.modelId);
action.morph.modelId = 0;
}
}
@@ -482,33 +480,33 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
case ACTION_T_SOUND:
if (!sSoundEntriesStore.LookupEntry(action.sound.soundId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant SoundID %u.", i, j+1, action.sound.soundId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant SoundID %u.", i, j+1, action.sound.soundId);
break;
case ACTION_T_EMOTE:
if (!sEmotesStore.LookupEntry(action.emote.emoteId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.emote.emoteId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.emote.emoteId);
break;
case ACTION_T_RANDOM_SOUND:
if (!sSoundEntriesStore.LookupEntry(action.random_sound.soundId1))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId1);
if (action.random_sound.soundId2 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId2))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId2);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId2);
if (action.random_sound.soundId3 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId3))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId3);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId3);
break;
case ACTION_T_RANDOM_EMOTE:
if (!sEmotesStore.LookupEntry(action.random_emote.emoteId1))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId1);
if (action.random_emote.emoteId2 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId2))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId2);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId2);
if (action.random_emote.emoteId3 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId3))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId3);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId3);
break;
case ACTION_T_CAST:
{
const SpellInfo* spell = sSpellMgr->GetSpellInfo(action.cast.spellId);
if (!spell)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast.spellId);
/* FIXME: temp.raw.param3 not have event tipes with recovery time in it....
else
{
@@ -516,7 +514,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
//output as debug for now, also because there's no general rule all spells have RecoveryTime
if (temp.event_param3 < spell->RecoveryTime)
- sLog->outDebug("CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1, action.cast.spellId, spell->RecoveryTime, temp.event_param3);
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1, action.cast.spellId, spell->RecoveryTime, temp.event_param3);
}
}
*/
@@ -526,143 +524,143 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
action.cast.castFlags |= CAST_TRIGGERED;
if (action.cast.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
}
case ACTION_T_SUMMON:
if (!sObjectMgr->GetCreatureTemplate(action.summon.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatureId);
if (action.summon.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_THREAT_SINGLE_PCT:
if (std::abs(action.threat_single_pct.percent) > 100)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_single_pct.percent);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_single_pct.percent);
if (action.threat_single_pct.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_THREAT_ALL_PCT:
if (std::abs(action.threat_all_pct.percent) > 100)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent);
break;
case ACTION_T_QUEST_EVENT:
if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event.questId))
{
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId);
}
else
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event.questId);
if (action.quest_event.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_CAST_EVENT:
if (!sObjectMgr->GetCreatureTemplate(action.cast_event.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event.creatureId);
if (!sSpellMgr->GetSpellInfo(action.cast_event.spellId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event.spellId);
if (action.cast_event.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_UNIT_FIELD:
if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1);
if (action.set_unit_field.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_UNIT_FLAG:
case ACTION_T_REMOVE_UNIT_FLAG:
if (action.unit_flag.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_PHASE:
if (action.set_phase.phase >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
break;
case ACTION_T_INC_PHASE:
if (action.set_inc_phase.step == 0)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
else if (std::abs(action.set_inc_phase.step) > MAX_PHASE-1)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step);
break;
case ACTION_T_QUEST_EVENT_ALL:
if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event_all.questId))
{
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId);
}
else
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event_all.questId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event_all.questId);
break;
case ACTION_T_CAST_EVENT_ALL:
if (!sObjectMgr->GetCreatureTemplate(action.cast_event_all.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event_all.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event_all.creatureId);
if (!sSpellMgr->GetSpellInfo(action.cast_event_all.spellId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event_all.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event_all.spellId);
break;
case ACTION_T_REMOVEAURASFROMSPELL:
if (!sSpellMgr->GetSpellInfo(action.remove_aura.spellId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.remove_aura.spellId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.remove_aura.spellId);
if (action.remove_aura.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3
if (action.random_phase.phase1 >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase.phase2 >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase.phase3 >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
break;
case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax
if (action.random_phase_range.phaseMin >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase_range.phaseMin >= MAX_PHASE)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1);
if (action.random_phase_range.phaseMin >= action.random_phase_range.phaseMax)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j+1);
std::swap(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax);
// equal case processed at call
}
break;
case ACTION_T_SUMMON_ID:
if (!sObjectMgr->GetCreatureTemplate(action.summon_id.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.summon_id.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.summon_id.creatureId);
if (action.summon_id.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
if (m_CreatureEventAI_Summon_Map.find(action.summon_id.spawnId) == m_CreatureEventAI_Summon_Map.end())
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId);
break;
case ACTION_T_KILLED_MONSTER:
if (!sObjectMgr->GetCreatureTemplate(action.killed_monster.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.killed_monster.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.killed_monster.creatureId);
if (action.killed_monster.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_SET_INST_DATA:
if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
if (action.set_inst_data.value > 4/*SPECIAL*/)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1);
break;
case ACTION_T_SET_INST_DATA64:
if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1);
if (action.set_inst_data64.target >= TARGET_T_END)
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1);
break;
case ACTION_T_UPDATE_TEMPLATE:
if (!sObjectMgr->GetCreatureTemplate(action.update_template.creatureId))
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.update_template.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.update_template.creatureId);
break;
case ACTION_T_SET_SHEATH:
if (action.set_sheath.sheath >= MAX_SHEATH_STATE)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j+1, action.set_sheath.sheath);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j+1, action.set_sheath.sheath);
action.set_sheath.sheath = SHEATH_STATE_UNARMED;
}
break;
@@ -671,7 +669,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.invincibility_hp_level.hp_level > 100)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level);
action.invincibility_hp_level.hp_level = 100;
}
}
@@ -681,7 +679,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.mount.creatureId && !sObjectMgr->GetCreatureTemplate(action.mount.creatureId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId);
action.morph.creatureId = 0;
}
@@ -689,12 +687,12 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
{
if (action.mount.creatureId)
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.mount.modelId, action.mount.creatureId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.mount.modelId, action.mount.creatureId);
action.mount.modelId = 0;
}
else if (!sCreatureDisplayInfoStore.LookupEntry(action.mount.modelId))
{
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId);
action.mount.modelId = 0;
}
}
@@ -714,7 +712,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
case ACTION_T_RANDOM_SAY:
case ACTION_T_RANDOM_YELL:
case ACTION_T_RANDOM_TEXTEMOTE:
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
break;
case ACTION_T_MOVE_RANDOM_POINT:
@@ -728,7 +726,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
break;
default:
- sLog->outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, action.type);
+ sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, action.type);
break;
}
}
@@ -740,6 +738,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index 55ce2451709..1611ae2b85d 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -5,9 +5,13 @@
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
-#include "ScriptPCH.h"
+#include "ScriptedCreature.h"
#include "Item.h"
#include "Spell.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
+#include "Cell.h"
+#include "CellImpl.h"
#include "ObjectMgr.h"
#include "TemporarySummon.h"
@@ -153,7 +157,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
if (!sSoundEntriesStore.LookupEntry(soundId))
{
- sLog->outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", soundId, source->GetTypeId(), source->GetGUIDLow());
+ sLog->outError(LOG_FILTER_TSCR, "Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", soundId, source->GetTypeId(), source->GetGUIDLow());
return;
}
@@ -246,7 +250,7 @@ void ScriptedAI::DoResetThreat()
{
if (!me->CanHaveThreatList() || me->getThreatManager().isThreatListEmpty())
{
- sLog->outError("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry());
+ sLog->outError(LOG_FILTER_TSCR, "DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry());
return;
}
@@ -295,7 +299,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o
if (Player* player = unit->ToPlayer())
player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
else
- sLog->outError("TSCR: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
+ sLog->outError(LOG_FILTER_TSCR, "Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o);
}
void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
@@ -427,7 +431,7 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(uint32 const diff)
return false;
break;
default: // For most of creatures that certain area is their home area.
- sLog->outDetail("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition. Using the default one.", me->GetEntry());
+ sLog->outInfo(LOG_FILTER_GENERAL, "TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition. Using the default one.", me->GetEntry());
uint32 homeAreaId = me->GetMap()->GetAreaId(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ());
if (me->GetAreaId() == homeAreaId)
return false;
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index c7751fc7383..003c9ac9d1c 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -9,7 +9,7 @@ SDComment:
SDCategory: Npc
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
#include "Group.h"
@@ -175,7 +175,7 @@ void npc_escortAI::EnterEvadeMode()
{
AddEscortState(STATE_ESCORT_RETURNING);
ReturnToLastPoint();
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI has left combat and is now returning to last point");
}
else
{
@@ -216,7 +216,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
{
if (DespawnAtEnd)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI reached end of waypoints");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI reached end of waypoints");
if (m_bCanReturnToStart)
{
@@ -227,7 +227,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
m_uiWPWaitTimer = 0;
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ);
return;
}
@@ -243,7 +243,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
}
else
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI reached end of waypoints with Despawn off");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI reached end of waypoints with Despawn off");
return;
}
@@ -252,7 +252,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
if (!HasEscortState(STATE_ESCORT_PAUSED))
{
me->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z);
WaypointStart(CurrentWP->id);
@@ -270,7 +270,7 @@ void npc_escortAI::UpdateAI(uint32 const diff)
{
if (DespawnAtFar && !IsPlayerOrGroupInRange())
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI failed because player/group was to far away or not found");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI failed because player/group was to far away or not found");
if (m_bCanInstantRespawn)
{
@@ -308,7 +308,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
//Combat start position reached, continue waypoint movement
if (pointId == POINT_LAST_POINT)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI has returned to original position before combat");
me->SetWalk(!m_bIsRunning);
RemoveEscortState(STATE_ESCORT_RETURNING);
@@ -318,7 +318,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
}
else if (pointId == POINT_HOME)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI has returned to original home location and will continue from beginning of waypoint list.");
CurrentWP = WaypointList.begin();
m_uiWPWaitTimer = 1;
@@ -328,11 +328,11 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
//Make sure that we are still on the right waypoint
if (CurrentWP->id != pointId)
{
- sLog->outError("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", pointId, CurrentWP->id, me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", pointId, CurrentWP->id, me->GetEntry());
return;
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI Waypoint %u reached", CurrentWP->id);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI Waypoint %u reached", CurrentWP->id);
//Call WP function
WaypointReached(CurrentWP->id);
@@ -401,14 +401,14 @@ void npc_escortAI::SetRun(bool on)
if (!m_bIsRunning)
me->SetWalk(false);
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
me->SetWalk(true);
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI attempt to set walk mode, but is already walking.");
}
m_bIsRunning = on;
@@ -419,13 +419,13 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
{
if (me->getVictim())
{
- sLog->outError("TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry());
return;
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
- sLog->outError("TSCR: EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry());
+ sLog->outError(LOG_FILTER_TSCR, "EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry());
return;
}
@@ -438,7 +438,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
if (WaypointList.empty())
{
- sLog->outErrorDb("TSCR: EscortAI (script: %s, creature entry: %u) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).",
+ sLog->outError(LOG_FILTER_SQL, "TSCR: EscortAI (script: %s, creature entry: %u) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).",
me->GetScriptName().c_str(), me->GetEntry(), quest ? quest->GetQuestId() : 0);
return;
}
@@ -454,13 +454,13 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
m_bCanReturnToStart = canLoopPath;
if (m_bCanReturnToStart && m_bCanInstantRespawn)
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveIdle();
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
}
//disable npcflags
@@ -471,7 +471,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
+ sLog->outDebug(LOG_FILTER_TSCR, "EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
CurrentWP = WaypointList.begin();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index 7a7fab014dc..4b4f3656a8d 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -123,4 +123,3 @@ struct npc_escortAI : public ScriptedAI
bool HasImmuneToNPCFlags;
};
#endif
-
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index 987af82e496..1e83c203553 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -9,7 +9,7 @@ SDComment: This AI is under development
SDCategory: Npc
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptedCreature.h"
#include "ScriptedFollowerAI.h"
#include "Group.h"
@@ -165,7 +165,7 @@ void FollowerAI::EnterEvadeMode()
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI left combat, returning to CombatStartPosition.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI left combat, returning to CombatStartPosition.");
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
{
@@ -191,7 +191,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
{
if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is set completed, despawns.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI is set completed, despawns.");
me->DespawnOrUnsummon();
return;
}
@@ -202,7 +202,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
{
if (HasFollowState(STATE_FOLLOW_RETURNING))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is returning to leader.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI is returning to leader.");
RemoveFollowState(STATE_FOLLOW_RETURNING);
me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
@@ -231,7 +231,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff)
if (bIsMaxRangeExceeded)
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI failed because player/group was to far away or not found");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI failed because player/group was to far away or not found");
me->DespawnOrUnsummon();
return;
}
@@ -274,13 +274,13 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
{
if (me->getVictim())
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI attempt to StartFollow while in combat.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI attempt to StartFollow while in combat.");
return;
}
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
{
- sLog->outError("TSCR: FollowerAI attempt to StartFollow while already following.");
+ sLog->outError(LOG_FILTER_TSCR, "FollowerAI attempt to StartFollow while already following.");
return;
}
@@ -296,7 +296,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
{
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
}
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
@@ -305,7 +305,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName(), m_uiLeaderGUID);
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName(), m_uiLeaderGUID);
}
Player* FollowerAI::GetLeaderForFollower()
@@ -324,7 +324,7 @@ Player* FollowerAI::GetLeaderForFollower()
if (member && member->isAlive() && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE))
{
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader changed and returned new leader.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI GetLeader changed and returned new leader.");
m_uiLeaderGUID = member->GetGUID();
return member;
}
@@ -333,7 +333,7 @@ Player* FollowerAI::GetLeaderForFollower()
}
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader can not find suitable leader.");
+ sLog->outDebug(LOG_FILTER_TSCR, "FollowerAI GetLeader can not find suitable leader.");
return NULL;
}
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 96fc43e0572..0b8236908a0 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -27,9 +27,8 @@
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "Group.h"
-
#include "SmartAI.h"
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
SmartAI::SmartAI(Creature* c) : CreatureAI(c)
{
@@ -108,7 +107,7 @@ WayPoint* SmartAI::GetNextWayPoint()
mLastWP = (*itr).second;
if (mLastWP->id != mCurrentWPID)
{
- sLog->outError("SmartAI::GetNextWayPoint: Got not expected waypoint id %u, expected %u", mLastWP->id, mCurrentWPID);
+ sLog->outError(LOG_FILTER_GENERAL, "SmartAI::GetNextWayPoint: Got not expected waypoint id %u, expected %u", mLastWP->id, mCurrentWPID);
}
return (*itr).second;
}
@@ -119,7 +118,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/)
{
if (me->isInCombat())// no wp movement in combat
{
- sLog->outError("SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry());
return;
}
if (HasEscortState(SMART_ESCORT_ESCORTING))
@@ -135,8 +134,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/)
SetRun(run);
- WayPoint* wp = GetNextWayPoint();
- if (wp)
+ if (WayPoint* wp = GetNextWayPoint())
{
me->GetPosition(&mLastOOCPos);
me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
@@ -164,7 +162,7 @@ void SmartAI::PausePath(uint32 delay, bool forced)
return;
if (HasEscortState(SMART_ESCORT_PAUSED))
{
- sLog->outError("SmartAI::StartPath: Creature entry %u wanted to pause waypoint movement while already paused, ignoring.", me->GetEntry());
+ sLog->outError(LOG_FILTER_GENERAL, "SmartAI::StartPath: Creature entry %u wanted to pause waypoint movement while already paused, ignoring.", me->GetEntry());
return;
}
mForcedPaused = forced;
@@ -302,7 +300,6 @@ void SmartAI::UpdatePath(const uint32 diff)
mWPPauseTimer = 0;
} else {
mWPPauseTimer -= diff;
-
}
}
if (HasEscortState(SMART_ESCORT_RETURNING))
@@ -324,15 +321,12 @@ void SmartAI::UpdatePath(const uint32 diff)
if (mCurrentWPID == GetWPCount())
{
EndPath();
- } else {
- WayPoint* wp = GetNextWayPoint();
- if (wp)
- {
- SetRun(mRun);
- me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
- }
}
-
+ else if (WayPoint* wp = GetNextWayPoint())
+ {
+ SetRun(mRun);
+ me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z);
+ }
}
}
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 103cde80f43..6e5a34e8c33 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -910,7 +910,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
InstanceScript* instance = obj->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
break;
}
@@ -931,7 +931,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
InstanceScript* instance = obj->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid);
break;
}
@@ -1438,7 +1438,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(e.action.equip.entry);
if (!einfo)
{
- sLog->outErrorDb("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry);
return;
}
npc->SetCurrentEquipmentId(e.action.equip.entry);
@@ -1563,7 +1563,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (e.GetTargetType() == SMART_TARGET_NONE)
{
- sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
break;
}
@@ -1687,7 +1687,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
uint32 id = temp[urand(0, count)];
if (e.GetTargetType() == SMART_TARGET_NONE)
{
- sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
break;
}
@@ -1717,7 +1717,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
uint32 id = urand(e.action.randTimedActionList.entry1, e.action.randTimedActionList.entry2);
if (e.GetTargetType() == SMART_TARGET_NONE)
{
- sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
break;
}
@@ -1782,7 +1782,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
- (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.setunitByte.byte1);
+ (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, e.action.setunitByte.type, e.action.setunitByte.byte1);
delete targets;
break;
@@ -1795,7 +1795,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsUnit(*itr))
- (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.delunitByte.byte1);
+ (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, e.action.delunitByte.type, e.action.delunitByte.byte1);
delete targets;
break;
@@ -1909,14 +1909,14 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI()))
ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list
else
- sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping");
}
else if (IsGameObject(*itr))
{
if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI()))
ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list
else
- sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping");
}
}
@@ -1950,7 +1950,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
}
default:
- sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;
}
@@ -1960,7 +1960,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK)
ProcessEvent(linked, unit, var0, var1, bvar, spell, gob);
else
- sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link);
}
}
@@ -1970,7 +1970,7 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e)
return;
if (mTemplate)
{
- sLog->outErrorDb("SmartScript::InstallTemplate: Entry %d SourceType %u AI Template can not be set more then once, skipped.", e.entryOrGuid, e.GetScriptType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::InstallTemplate: Entry %d SourceType %u AI Template can not be set more then once, skipped.", e.entryOrGuid, e.GetScriptType());
return;
}
mTemplate = (SMARTAI_TEMPLATE)e.action.installTtemplate.id;
@@ -2227,7 +2227,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
{
if (!trigger && !GetBaseObject())
{
- sLog->outErrorDb("SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry");
+ sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry");
break;
}
@@ -2250,7 +2250,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
{
if (!trigger && !GetBaseObject())
{
- sLog->outErrorDb("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry");
+ sLog->outError(LOG_FILTER_SQL, "SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry");
break;
}
@@ -2787,7 +2787,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
break;
}
default:
- sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
break;
}
}
@@ -2984,9 +2984,9 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
mEvents.push_back((*i));//NOTE: 'world(0)' events still get processed in ANY instance mode
}
if (mEvents.empty() && obj)
- sLog->outErrorDb("SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry());
if (mEvents.empty() && at)
- sLog->outErrorDb("SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id);
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id);
}
void SmartScript::GetScript()
@@ -3030,7 +3030,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at)
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is GameObject %u", go->GetEntry());
break;
default:
- sLog->outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!");
+ sLog->outError(LOG_FILTER_GENERAL, "SmartScript::OnInitialize: Unhandled TypeID !WARNING!");
return;
}
} else if (at)
@@ -3041,7 +3041,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at)
}
else
{
- sLog->outError("SmartScript::OnInitialize: !WARNING! Initialized objects are NULL.");
+ sLog->outError(LOG_FILTER_GENERAL, "SmartScript::OnInitialize: !WARNING! Initialized objects are NULL.");
return;
}
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index 03d533e69e5..2a0eceb574a 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -117,7 +117,7 @@ class SmartScript
smart = false;
if (!smart)
- sLog->outErrorDb("SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetEntry() : (me ? me->GetEntry() : 0));
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetEntry() : (me ? me->GetEntry() : 0));
return smart;
}
@@ -131,7 +131,7 @@ class SmartScript
if (!go || go->GetAIName() != "SmartGameObjectAI")
smart = false;
if (!smart)
- sLog->outErrorDb("SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetEntry() : (go ? go->GetEntry() : 0));
+ sLog->outError(LOG_FILTER_SQL, "SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetEntry() : (go ? go->GetEntry() : 0));
return smart;
}
@@ -254,7 +254,6 @@ class SmartScript
mStoredEvents.erase(i);
return;
}
-
}
}
}
@@ -268,7 +267,6 @@ class SmartScript
{
return (*i);
}
-
}
}
SmartScriptHolder s;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index de766d2a7e1..7a997609b5d 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -50,8 +50,8 @@ void SmartWaypointMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
+
return;
}
@@ -78,7 +78,7 @@ void SmartWaypointMgr::LoadFromDB()
}
if (last_id != id)
- sLog->outErrorDb("SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id);
+ sLog->outError(LOG_FILTER_SQL, "SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id);
last_id++;
(*waypoint_map[entry])[id] = new WayPoint(id, x, y, z);
@@ -88,8 +88,8 @@ void SmartWaypointMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u SmartAI waypoint paths (total %u waypoints) in %u ms", count, total, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u SmartAI waypoint paths (total %u waypoints) in %u ms", count, total, GetMSTimeDiffToNow(oldMSTime));
+
}
SmartWaypointMgr::~SmartWaypointMgr()
@@ -117,8 +117,8 @@ void SmartAIMgr::LoadSmartAIFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty.");
+
return;
}
@@ -134,7 +134,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt8();
if (source_type >= SMART_SCRIPT_TYPE_MAX)
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type));
continue;
}
if (temp.entryOrGuid >= 0)
@@ -145,7 +145,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sObjectMgr->GetCreatureTemplate((uint32)temp.entryOrGuid))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
break;
@@ -154,7 +154,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sObjectMgr->GetGameObjectTemplate((uint32)temp.entryOrGuid))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
break;
@@ -163,7 +163,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sAreaTriggerStore.LookupEntry((uint32)temp.entryOrGuid))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
}
break;
@@ -171,7 +171,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
case SMART_SCRIPT_TYPE_TIMED_ACTIONLIST:
break;//nothing to check, really
default:
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type %u", (uint32)source_type);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type %u", (uint32)source_type);
continue;
}
}
@@ -179,7 +179,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
if (!sObjectMgr->GetCreatureData(uint32(abs(temp.entryOrGuid))))
{
- sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid)));
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid)));
continue;
}
}
@@ -234,8 +234,8 @@ void SmartAIMgr::LoadSmartAIFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
@@ -249,7 +249,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
{
if (e.target.unitDistance.creature && !sObjectMgr->GetCreatureTemplate(e.target.unitDistance.creature))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
return false;
}
break;
@@ -259,7 +259,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
{
if (e.target.goDistance.entry && !sObjectMgr->GetGameObjectTemplate(e.target.goDistance.entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.goDistance.entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.goDistance.entry);
return false;
}
break;
@@ -281,7 +281,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
{
if (e.target.playerDistance.dist == 0)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u has maxDist 0 as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has maxDist 0 as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
break;
@@ -305,7 +305,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
case SMART_TARGET_STORED:
break;
default:
- sLog->outErrorDb("SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled target_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
return true;
@@ -315,28 +315,28 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.event.type >= SMART_EVENT_END)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetEventType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetEventType());
return false;
}
// in SMART_SCRIPT_TYPE_TIMED_ACTIONLIST all event types are overriden by core
if (e.GetScriptType() != SMART_SCRIPT_TYPE_TIMED_ACTIONLIST && !(SmartAIEventMask[e.event.type][1] & SmartAITypeMask[e.GetScriptType()][1]))
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d, event type %u can not be used for Script type %u", e.entryOrGuid, e.GetEventType(), e.GetScriptType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d, event type %u can not be used for Script type %u", e.entryOrGuid, e.GetEventType(), e.GetScriptType());
return false;
}
if (e.action.type <= 0 || e.action.type >= SMART_ACTION_END)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
return false;
}
if (e.event.event_phase_mask > SMART_EVENT_PHASE_ALL)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
return false;
}
if (e.event.event_flags > SMART_EVENT_FLAGS_ALL)
{
- sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event flags (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event flags (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags);
return false;
}
if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST)
@@ -377,12 +377,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.event.spellHit.spell);
if (!spellInfo)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
return false;
}
if (e.event.spellHit.school && (e.event.spellHit.school & spellInfo->SchoolMask) != spellInfo->SchoolMask)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses Spell entry %u with invalid school mask, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses Spell entry %u with invalid school mask, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
return false;
}
}
@@ -397,12 +397,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_RESPAWN:
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.map);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.map);
return false;
}
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_AREA && !GetAreaEntryByAreaID(e.event.respawn.area))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Area entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.area);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Area entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.area);
return false;
}
break;
@@ -484,7 +484,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.event.movementInform.type > NULL_MOTION_TYPE)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
return false;
}
break;
@@ -508,7 +508,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.link && e.link == e.event_id)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
return false;
}
break;
@@ -540,7 +540,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.event.doAction.eventId > EVENT_CHARGE)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId);
return false;
}
break;
@@ -580,7 +580,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_ON_SPELLCLICK:
break;
default:
- sLog->outErrorDb("SmartAIMgr: Not handled event_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled event_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
}
@@ -590,7 +590,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SET_FACTION:
if (e.action.faction.factionID && !sFactionTemplateStore.LookupEntry(e.action.faction.factionID))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Faction %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.faction.factionID);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Faction %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.faction.factionID);
return false;
}
break;
@@ -600,7 +600,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.action.morphOrMount.creature > 0 && !sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
return false;
}
@@ -608,12 +608,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.action.morphOrMount.creature)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u has ModelID set with also set CreatureId, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has ModelID set with also set CreatureId, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
else if (!sCreatureDisplayInfoStore.LookupEntry(e.action.morphOrMount.model))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Model id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.model);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Model id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.model);
return false;
}
}
@@ -624,7 +624,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
if (e.action.sound.range > TEXT_RANGE_WORLD)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Text Range %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.sound.range);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Text Range %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.sound.range);
return false;
}
break;
@@ -642,7 +642,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (!sTaxiPathStore.LookupEntry(e.action.taxi.id))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Taxi path ID %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Taxi path ID %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
return false;
}
break;
@@ -678,13 +678,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
return false;
}
}
else
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
return false;
}
break;
@@ -695,24 +695,22 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (!IsSpellValid(e, e.action.castCreatureOrGO.spell))
return false;
break;
-
-
case SMART_ACTION_SET_EVENT_PHASE:
if (e.action.setEventPhase.phase >= SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set phase %u. Phase mask cannot be used past phase %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setEventPhase.phase, SMART_EVENT_PHASE_MAX-1);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set phase %u. Phase mask cannot be used past phase %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setEventPhase.phase, SMART_EVENT_PHASE_MAX-1);
return false;
}
break;
case SMART_ACTION_INC_EVENT_PHASE:
if (!e.action.incEventPhase.inc && !e.action.incEventPhase.dec)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u is incrementing phase by 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u is incrementing phase by 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
else if (e.action.incEventPhase.inc > SMART_EVENT_PHASE_MAX || e.action.incEventPhase.dec > SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to increment phase by too large value, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to increment phase by too large value, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
break;
@@ -736,7 +734,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
e.action.randomPhase.phase5 >= SMART_EVENT_PHASE_MAX ||
e.action.randomPhase.phase6 >= SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
}
@@ -746,7 +744,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (e.action.randomPhaseRange.phaseMin >= SMART_EVENT_PHASE_MAX ||
e.action.randomPhaseRange.phaseMax >= SMART_EVENT_PHASE_MAX)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax))
@@ -758,7 +756,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
if (e.action.summonCreature.type < TEMPSUMMON_TIMED_OR_DEAD_DESPAWN || e.action.summonCreature.type > TEMPSUMMON_MANUAL_DESPAWN)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
return false;
}
break;
@@ -773,7 +771,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SET_SHEATH:
if (e.action.setSheath.sheath && e.action.setSheath.sheath >= MAX_SHEATH_STATE)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect Sheath state %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setSheath.sheath);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect Sheath state %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setSheath.sheath);
return false;
}
break;
@@ -781,7 +779,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (e.action.react.state > REACT_AGGRESSIVE)
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.react.state);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.react.state);
return false;
}
break;
@@ -801,14 +799,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_TELEPORT:
if (!sMapStore.LookupEntry(e.action.teleport.mapID))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.teleport.mapID);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Map entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.teleport.mapID);
return false;
}
break;
case SMART_ACTION_INSTALL_AI_TEMPLATE:
if (e.action.installTtemplate.id >= SMARTAI_TEMPLATE_END)
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent AI template id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.installTtemplate.id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses non-existent AI template id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.installTtemplate.id);
return false;
}
break;
@@ -820,14 +818,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
{
if (!sSmartWaypointMgr->GetPath(e.action.wpStart.pathID))
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
return false;
}
if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest))
return false;
if (e.action.wpStart.reactState > REACT_AGGRESSIVE)
{
- sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
return false;
}
break;
@@ -908,7 +906,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SEND_TARGET_TO_TARGET:
break;
default:
- sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
return false;
}
@@ -926,7 +924,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
CreatureData const* data = sObjectMgr->GetCreatureData(entry);
if (!data)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Creature guid %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Creature guid %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
else
@@ -936,7 +934,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder const& e, uint32 id)
error = true;
if (error)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Text id %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.source_type, e.GetActionType(), id);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u using non-existent Text id %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.source_type, e.GetActionType(), id);
return false;
}
return true;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 155f27d0fe7..2a81339a930 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -535,7 +535,6 @@ struct SmartAction
struct
{
-
uint32 emote1;
uint32 emote2;
uint32 emote3;
@@ -828,11 +827,13 @@ struct SmartAction
struct
{
uint32 byte1;
+ uint32 type;
} setunitByte;
struct
{
uint32 byte1;
+ uint32 type;
} delunitByte;
struct
@@ -1244,7 +1245,6 @@ struct SmartScriptHolder
bool active;
bool runOnce;
bool enableTimed;
-
};
typedef UNORDERED_MAP<uint32, WayPoint*> WPPath;
@@ -1311,7 +1311,7 @@ class SmartAIMgr
{
if (target < SMART_TARGET_NONE || target >= SMART_TARGET_END)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Target type %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), target);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Target type %d, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), target);
return false;
}
return true;
@@ -1321,7 +1321,7 @@ class SmartAIMgr
{
if (max < min)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses min/max params wrong (%u/%u), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), min, max);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses min/max params wrong (%u/%u), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), min, max);
return false;
}
return true;
@@ -1331,7 +1331,7 @@ class SmartAIMgr
{
if (pct < -100 || pct > 100)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invalid Percent set (%d), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), pct);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has invalid Percent set (%d), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), pct);
return false;
}
return true;
@@ -1341,7 +1341,7 @@ class SmartAIMgr
{
if (!data)
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u Parameter can not be NULL, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u Parameter can not be NULL, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
return true;
@@ -1351,7 +1351,7 @@ class SmartAIMgr
{
if (!sObjectMgr->GetCreatureTemplate(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1361,7 +1361,7 @@ class SmartAIMgr
{
if (!sObjectMgr->GetQuestTemplate(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Quest entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1371,7 +1371,7 @@ class SmartAIMgr
{
if (!sObjectMgr->GetGameObjectTemplate(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent GameObject entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1381,7 +1381,7 @@ class SmartAIMgr
{
if (!sSpellMgr->GetSpellInfo(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1391,7 +1391,7 @@ class SmartAIMgr
{
if (!sItemStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Item entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Item entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1401,7 +1401,7 @@ class SmartAIMgr
{
if (!sEmotesTextStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Text Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Text Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1411,7 +1411,7 @@ class SmartAIMgr
{
if (!sEmotesStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Emote entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1421,7 +1421,7 @@ class SmartAIMgr
{
if (!sAreaTriggerStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent AreaTrigger entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent AreaTrigger entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
@@ -1431,7 +1431,7 @@ class SmartAIMgr
{
if (!sSoundEntriesStore.LookupEntry(entry))
{
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Sound entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
+ sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Sound entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
return false;
}
return true;
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index a0e3b923406..68467fe4423 100755..100644
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -76,7 +76,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
{
if (dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE)
{
- sLog->outErrorDb("Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID, dataType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID, dataType);
return false;
}
@@ -108,7 +108,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
default:
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
{
- sLog->outErrorDb("Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType);
return false;
}
break;
@@ -123,7 +123,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE:
if (!creature.id || !sObjectMgr->GetCreatureTemplate(creature.id))
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, creature.id);
return false;
}
@@ -131,19 +131,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE:
if (!classRace.class_id && !classRace.race_id)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
@@ -151,7 +151,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH:
if (health.percent < 1 || health.percent > 100)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, health.percent);
return false;
}
@@ -162,19 +162,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(aura.spell_id);
if (!spellEntry)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id);
return false;
}
if (aura.effect_idx >= 3)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx);
return false;
}
if (!spellEntry->Effects[aura.effect_idx].ApplyAuraName)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.",
criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx);
return false;
}
@@ -183,7 +183,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL:
if (level.minlevel > STRONG_MAX_LEVEL)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, level.minlevel);
return false;
}
@@ -191,7 +191,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER:
if (gender.gender > GENDER_NONE)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, gender.gender);
return false;
}
@@ -199,7 +199,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT:
if (!ScriptId)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have ScriptName set, ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have ScriptName set, ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
@@ -207,7 +207,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
if (map_players.maxcount <= 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, map_players.maxcount);
return false;
}
@@ -215,7 +215,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM:
if (team.team != ALLIANCE && team.team != HORDE)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, team.team);
return false;
}
@@ -223,7 +223,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK:
if (drunk.state >= MAX_DRUNKEN)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, drunk.state);
return false;
}
@@ -231,7 +231,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY:
if (!sHolidaysStore.LookupEntry(holiday.id))
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, holiday.id);
return false;
}
@@ -241,7 +241,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM:
if (equipped_item.item_quality >= MAX_ITEM_QUALITY)
{
- sLog->outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, equipped_item.item_quality);
return false;
}
@@ -249,25 +249,25 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE:
if (!classRace.class_id && !classRace.race_id)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.",
criteria->ID, criteria->requiredType, dataType);
return false;
}
if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.class_id);
return false;
}
if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.",
criteria->ID, criteria->requiredType, dataType, classRace.race_id);
return false;
}
return true;
default:
- sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType);
return false;
}
}
@@ -342,14 +342,14 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
Map* map = source->GetMap();
if (!map->IsDungeon())
{
- sLog->outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u",
+ sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u",
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
return false;
}
InstanceScript* instance = ((InstanceMap*)map)->GetInstanceScript();
if (!instance)
{
- sLog->outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
+ sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script",
ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId());
return false;
}
@@ -734,7 +734,7 @@ void AchievementMgr<Player>::LoadFromDB(PreparedQueryResult achievementResult, P
if (!criteria)
{
// we will remove not existed criteria for all characters
- sLog->outError("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id);
+ sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
stmt->setUInt16(0, uint16(id));
@@ -795,7 +795,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr
if (!criteria)
{
// we will remove not existed criteria for all guilds
- sLog->outError("Non-existing achievement criteria %u data removed from table `guild_achievement_progress`.", id);
+ sLog->outError(LOG_FILTER_GENERAL, "Non-existing achievement criteria %u data removed from table `guild_achievement_progress`.", id);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA);
stmt->setUInt16(0, uint16(id));
@@ -2239,7 +2239,7 @@ void AchievementMgr<T>::RemoveTimedAchievement(AchievementCriteriaTimedTypes typ
template<class T>
void AchievementMgr<T>::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer)
{
- sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID);
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u)", achievement->ID);
// disable for gamemasters with GM-mode enabled
if (_owner->isGameMaster())
@@ -2318,7 +2318,7 @@ void AchievementMgr<T>::CompletedAchievement(AchievementEntry const* achievement
template<>
void AchievementMgr<Guild>::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer)
{
- sLog->outDetail("AchievementMgr<Guild>::CompletedAchievement(%u)", achievement->ID);
+ sLog->outInfo(LOG_FILTER_GENERAL, "AchievementMgr<Guild>::CompletedAchievement(%u)", achievement->ID);
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID))
return;
@@ -2800,8 +2800,8 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
if (sAchievementCriteriaStore.GetNumRows() == 0)
{
- sLog->outErrorDb(">> Loaded 0 achievement criteria.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 achievement criteria.");
+
return;
}
@@ -2826,8 +2826,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
m_AchievementCriteriasByTimedType[criteria->timedCriteriaStartType].push_back(criteria);
}
- sLog->outString(">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime));
}
void AchievementGlobalMgr::LoadAchievementReferenceList()
@@ -2836,8 +2835,8 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
if (sAchievementStore.GetNumRows() == 0)
{
- sLog->outString(">> Loaded 0 achievement references.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 achievement references.");
+
return;
}
@@ -2857,8 +2856,8 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
if (AchievementEntry const* achievement = sAchievementStore.LookupEntry(4539))
const_cast<AchievementEntry*>(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar)
- sLog->outString(">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void AchievementGlobalMgr::LoadAchievementCriteriaData()
@@ -2871,8 +2870,8 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (!result)
{
- sLog->outString(">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty.");
+
return;
}
@@ -2887,7 +2886,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (!criteria)
{
- sLog->outErrorDb("Table `achievement_criteria_data` has data for non-existing criteria (Entry: %u), ignore.", criteria_id);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has data for non-existing criteria (Entry: %u), ignore.", criteria_id);
continue;
}
@@ -2897,7 +2896,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (strcmp(scriptName, "")) // not empty
{
if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT)
- sLog->outErrorDb("Table `achievement_criteria_data` has ScriptName set for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has ScriptName set for non-scripted data type (Entry: %u, type %u), useless data.", criteria_id, dataType);
else
scriptId = sObjectMgr->GetScriptId(scriptName);
}
@@ -3000,11 +2999,11 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
}
if (!GetCriteriaDataSet(criteria) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, NULL))
- sLog->outErrorDb("Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement);
}
- sLog->outString(">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void AchievementGlobalMgr::LoadCompletedAchievements()
@@ -3015,8 +3014,8 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
if (!result)
{
- sLog->outString(">> Loaded 0 completed achievements. DB table `character_achievement` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 completed achievements. DB table `character_achievement` is empty.");
+
return;
}
@@ -3029,7 +3028,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
if (!achievement)
{
// Remove non existent achievements from all characters
- sLog->outError("Non-existing achievement %u data removed from table `character_achievement`.", achievementId);
+ sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Non-existing achievement %u data removed from table `character_achievement`.", achievementId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEVMENT);
@@ -3043,8 +3042,8 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
m_allCompletedAchievements.insert(achievementId);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void AchievementGlobalMgr::LoadRewards()
@@ -3058,8 +3057,8 @@ void AchievementGlobalMgr::LoadRewards()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
+
return;
}
@@ -3072,7 +3071,7 @@ void AchievementGlobalMgr::LoadRewards()
const AchievementEntry* pAchievement = sAchievementStore.LookupEntry(entry);
if (!pAchievement)
{
- sLog->outErrorDb("Table `achievement_reward` has wrong achievement (Entry: %u), ignore", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` has wrong achievement (Entry: %u), ignore", entry);
continue;
}
@@ -3087,19 +3086,19 @@ void AchievementGlobalMgr::LoadRewards()
// must be title or mail at least
if (!reward.titleId[0] && !reward.titleId[1] && !reward.sender)
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) not have title or item reward data, ignore.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) not have title or item reward data, ignore.", entry);
continue;
}
if (pAchievement->requiredFaction == ACHIEVEMENT_FACTION_ANY && ((reward.titleId[0] == 0) != (reward.titleId[1] == 0)))
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]);
if (reward.titleId[0])
{
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[0]);
if (!titleEntry)
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]);
reward.titleId[0] = 0;
}
}
@@ -3109,7 +3108,7 @@ void AchievementGlobalMgr::LoadRewards()
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(reward.titleId[1]);
if (!titleEntry)
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_H`, set to 0", entry, reward.titleId[1]);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_H`, set to 0", entry, reward.titleId[1]);
reward.titleId[1] = 0;
}
}
@@ -3119,27 +3118,27 @@ void AchievementGlobalMgr::LoadRewards()
{
if (!sObjectMgr->GetCreatureTemplate(reward.sender))
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender);
reward.sender = 0;
}
}
else
{
if (reward.itemId)
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) does not have sender data but has item reward, item will not be rewarded.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) does not have sender data but has item reward, item will not be rewarded.", entry);
if (!reward.subject.empty())
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) does not have sender data but has mail subject.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) does not have sender data but has mail subject.", entry);
if (!reward.text.empty())
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) does not have sender data but has mail text.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) does not have sender data but has mail text.", entry);
}
if (reward.itemId)
{
if (!sObjectMgr->GetItemTemplate(reward.itemId))
{
- sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId);
+ sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId);
reward.itemId = 0;
}
}
@@ -3150,8 +3149,8 @@ void AchievementGlobalMgr::LoadRewards()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void AchievementGlobalMgr::LoadRewardLocales()
@@ -3166,8 +3165,8 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (!result)
{
- sLog->outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty");
+
return;
}
@@ -3179,7 +3178,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (m_achievementRewards.find(entry) == m_achievementRewards.end())
{
- sLog->outErrorDb("Table `locales_achievement_reward` (Entry: %u) has locale strings for non-existing achievement reward.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `locales_achievement_reward` (Entry: %u) has locale strings for non-existing achievement reward.", entry);
continue;
}
@@ -3193,6 +3192,6 @@ void AchievementGlobalMgr::LoadRewardLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp
index 528e682e8d4..6af87827917 100755
--- a/src/server/game/Addons/AddonMgr.cpp
+++ b/src/server/game/Addons/AddonMgr.cpp
@@ -43,8 +43,8 @@ void LoadFromDB()
QueryResult result = CharacterDatabase.Query("SELECT name, crc FROM addons");
if (!result)
{
- sLog->outString(">> Loaded 0 known addons. DB table `addons` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 known addons. DB table `addons` is empty!");
+
return;
}
@@ -63,8 +63,8 @@ void LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u known addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u known addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SaveAddon(AddonInfo const& addon)
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index b28ed3d06fb..c134f4e277e 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -263,8 +263,8 @@ void AuctionHouseMgr::LoadAuctionItems()
if (!result)
{
- sLog->outString(">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!");
+
return;
}
@@ -272,7 +272,6 @@ void AuctionHouseMgr::LoadAuctionItems()
do
{
-
Field* fields = result->Fetch();
uint32 item_guid = fields[11].GetUInt32();
@@ -281,7 +280,7 @@ void AuctionHouseMgr::LoadAuctionItems()
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item_template);
if (!proto)
{
- sLog->outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template);
continue;
}
@@ -297,8 +296,8 @@ void AuctionHouseMgr::LoadAuctionItems()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void AuctionHouseMgr::LoadAuctions()
@@ -310,8 +309,8 @@ void AuctionHouseMgr::LoadAuctions()
if (!result)
{
- sLog->outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
+
return;
}
@@ -336,8 +335,8 @@ void AuctionHouseMgr::LoadAuctions()
CharacterDatabase.CommitTransaction(trans);
- sLog->outString(">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void AuctionHouseMgr::AddAItem(Item* it)
@@ -605,7 +604,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
Item* item = sAuctionMgr->GetAItem(item_guidlow);
if (!item)
{
- sLog->outError("AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow);
return false;
}
data << uint32(Id);
@@ -688,14 +687,14 @@ bool AuctionEntry::LoadFromDB(Field* fields)
CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer);
if (!auctioneerData)
{
- sLog->outError("Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
return false;
}
CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id);
if (!auctioneerInfo)
{
- sLog->outError("Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
return false;
}
@@ -703,7 +702,7 @@ bool AuctionEntry::LoadFromDB(Field* fields)
auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(factionTemplateId);
if (!auctionHouseEntry)
{
- sLog->outError("Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
return false;
}
@@ -711,7 +710,7 @@ bool AuctionEntry::LoadFromDB(Field* fields)
// and item_template in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems)
if (!sAuctionMgr->GetAItem(item_guidlow))
{
- sLog->outError("Auction %u has not a existing item : %u", Id, item_guidlow);
+ sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing item : %u", Id, item_guidlow);
return false;
}
return true;
@@ -735,8 +734,8 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup()
if (!expAuctions)
{
- sLog->outString(">> No expired auctions to delete");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> No expired auctions to delete");
+
return;
}
@@ -783,8 +782,8 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup()
} while (expAuctions->NextRow());
- sLog->outString(">> Deleted %u expired auctions in %u ms", expirecount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Deleted %u expired auctions in %u ms", expirecount, GetMSTimeDiffToNow(oldMSTime));
+
}
@@ -810,14 +809,14 @@ bool AuctionEntry::LoadFromFieldList(Field* fields)
CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(auctioneer);
if (!auctioneerData)
{
- sLog->outError("AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer);
return false;
}
CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id);
if (!auctioneerInfo)
{
- sLog->outError("AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::LoadFromFieldList() - Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id);
return false;
}
@@ -826,7 +825,7 @@ bool AuctionEntry::LoadFromFieldList(Field* fields)
if (!auctionHouseEntry)
{
- sLog->outError("AuctionEntry::LoadFromFieldList() - Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
+ sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::LoadFromFieldList() - Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId);
return false;
}
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index 89151b6395c..b9ddabcf254 100755
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -87,7 +87,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string teamName, uin
// Add captain as member
AddMember(CaptainGuid);
- sLog->outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid);
+ sLog->outInfo(LOG_FILTER_ARENAS, "New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid);
return true;
}
@@ -125,7 +125,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
// Check if player is already in a similar arena team
if ((player && player->GetArenaTeamId(GetSlot())) || Player::GetArenaTeamIdFromDB(playerGuid, GetType()) != 0)
{
- sLog->outError("Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());
+ sLog->outDebug(LOG_FILTER_ARENAS, "Arena: Player %s (guid: %u) already has an arena team of type %u", playerName.c_str(), GUID_LOPART(playerGuid), GetType());
return false;
}
@@ -184,7 +184,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid)
player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
}
- sLog->outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId());
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId());
return true;
}
@@ -250,8 +250,8 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
// Delete member if character information is missing
if (newMember.Name.empty())
{
- sLog->outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));
- this->DelMember(newMember.Guid, true);
+ sLog->outError(LOG_FILTER_SQL, "ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newMember.Guid));
+ DelMember(newMember.Guid, true);
continue;
}
@@ -267,7 +267,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
if (Empty() || !captainPresentInTeam)
{
// Arena team is empty or captain is not in team, delete from db
- sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);
+ sLog->outDebug(LOG_FILTER_ARENAS, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId);
return false;
}
@@ -297,7 +297,7 @@ void ArenaTeam::SetCaptain(uint64 guid)
newCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
char const* oldCaptainName = oldCaptain ? oldCaptain->GetName() : "";
uint32 oldCaptainLowGuid = oldCaptain ? oldCaptain->GetGUIDLow() : 0;
- sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].",
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].",
oldCaptainName, oldCaptainLowGuid, newCaptain->GetName(), newCaptain->GetGUIDLow(), GetId(), GetType());
}
}
@@ -321,7 +321,7 @@ void ArenaTeam::DelMember(uint64 guid, bool cleanDb)
// delete all info regarding this team
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
- sLog->outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
// Only used for single member deletion, for arena team disband we use a single query for more efficiency
@@ -346,7 +346,7 @@ void ArenaTeam::Disband(WorldSession* session)
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
if (Player* player = session->GetPlayer())
- sLog->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
+ sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
// Update database
@@ -507,7 +507,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun
data << str1 << str2 << str3;
break;
default:
- sLog->outError("Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount);
+ sLog->outError(LOG_FILTER_ARENAS, "Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount);
return;
}
@@ -529,7 +529,7 @@ uint8 ArenaTeam::GetSlotByType(uint32 type)
default:
break;
}
- sLog->outError("FATAL: Unknown arena team type %u for some arena team", type);
+ sLog->outError(LOG_FILTER_ARENAS, "FATAL: Unknown arena team type %u for some arena team", type);
return 0xFF;
}
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
index 1b666859749..416b54a5713 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
@@ -81,7 +81,7 @@ uint32 ArenaTeamMgr::GenerateArenaTeamId()
{
if (NextArenaTeamId >= 0xFFFFFFFE)
{
- sLog->outError("Arena team ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Arena team ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return NextArenaTeamId++;
@@ -101,8 +101,8 @@ void ArenaTeamMgr::LoadArenaTeams()
if (!result)
{
- sLog->outString(">> Loaded 0 arena teams. DB table `arena_team` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded 0 arena teams. DB table `arena_team` is empty!");
+
return;
}
@@ -132,8 +132,8 @@ void ArenaTeamMgr::LoadArenaTeams()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ArenaTeamMgr::DistributeArenaPoints()
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 4444f1860e4..6b9cdad9272 100755
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -442,7 +442,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
if (!FindBgMap())
{
- sLog->outError("Battleground::_ProcessJoin: map (map id: %u, instance id: %u) is not created!", m_MapId, m_InstanceID);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::_ProcessJoin: map (map id: %u, instance id: %u) is not created!", m_MapId, m_InstanceID);
EndNow();
return;
}
@@ -552,7 +552,7 @@ inline void Battleground::_ProcessJoin(uint32 diff)
if (dist >= maxDist)
{
- sLog->outError("BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", plr->GetName(), GetMapId());
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", plr->GetName(), GetMapId());
plr->TeleportTo(GetMapId(), x, y, z, o);
}
}
@@ -590,7 +590,7 @@ inline Player* Battleground::_GetPlayer(uint64 guid, bool offlineRemove, const c
{
player = ObjectAccessor::FindPlayer(guid);
if (!player)
- sLog->outError("Battleground::%s: player (GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::%s: player (GUID: %u) not found for BG (map: %u, instance id: %u)!",
context, GUID_LOPART(guid), m_MapId, m_InstanceID);
}
return player;
@@ -773,17 +773,17 @@ void Battleground::EndBattleground(uint32 winner)
winner_matchmaker_rating = GetArenaMatchmakerRating(winner);
winner_matchmaker_change = winner_arena_team->WonAgainst(winner_matchmaker_rating, loser_matchmaker_rating, winner_change);
loser_matchmaker_change = loser_arena_team->LostAgainst(loser_matchmaker_rating, winner_matchmaker_rating, loser_change);
- sLog->outArena("match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", m_ArenaType, winner_team_rating, winner_change, winner_matchmaker_rating,
+ sLog->outDebug(LOG_FILTER_BATTLEGROUND, "match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", m_ArenaType, winner_team_rating, winner_change, winner_matchmaker_rating,
winner_matchmaker_change, loser_team_rating, loser_change, loser_matchmaker_rating, loser_matchmaker_change);
SetArenaMatchmakerRating(winner, winner_matchmaker_rating + winner_matchmaker_change);
SetArenaMatchmakerRating(GetOtherTeam(winner), loser_matchmaker_rating + loser_matchmaker_change);
SetArenaTeamRatingChangeForTeam(winner, winner_change);
SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
- sLog->outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change);
+ sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change);
if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
- sLog->outArena("Statistics match Type: %u for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", m_ArenaType, player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows);
+ sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Statistics match Type: %u for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", m_ArenaType, player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows);
}
// Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes
else
@@ -1072,7 +1072,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
if (Transport)
player->TeleportToBGEntryPoint();
- sLog->outDetail("BATTLEGROUND: Removed player %s from Battleground.", player->GetName());
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Removed player %s from Battleground.", player->GetName());
}
//battleground object will be deleted next Battleground::Update() call
@@ -1092,7 +1092,7 @@ void Battleground::Reset()
m_Events = 0;
if (m_InvitedAlliance > 0 || m_InvitedHorde > 0)
- sLog->outError("Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!",
m_InvitedAlliance, m_InvitedHorde, m_MapId, m_InstanceID);
m_InvitedAlliance = 0;
@@ -1120,7 +1120,7 @@ void Battleground::StartBattleground()
// and it doesn't matter if we call StartBattleground() more times, because m_Battlegrounds is a map and instance id never changes
sBattlegroundMgr->AddBattleground(GetInstanceID(), GetTypeID(), this);
if (m_IsRated)
- sLog->outArena("Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]);
+ sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]);
}
void Battleground::AddPlayer(Player* player)
@@ -1211,7 +1211,7 @@ void Battleground::AddPlayer(Player* player)
AddOrSetPlayerToCorrectBgGroup(player, team);
// Log
- sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", player->GetName());
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Player %s joined the battle.", player->GetName());
}
// this method adds player to his team's bg group, or sets his correct group if player is already in bg group
@@ -1409,7 +1409,7 @@ void Battleground::UpdatePlayerScore(Player* Source, uint32 type, uint32 value,
itr->second->HealingDone += value;
break;
default:
- sLog->outError("Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!",
type, m_MapId, m_InstanceID);
break;
}
@@ -1458,9 +1458,9 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, GetBgMap(),
PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
{
- sLog->outErrorDb("Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_SQL, "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
- sLog->outError("Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete go;
return false;
@@ -1511,7 +1511,7 @@ void Battleground::DoorClose(uint32 type)
}
}
else
- sLog->outError("Battleground::DoorClose: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DoorClose: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
}
@@ -1523,7 +1523,7 @@ void Battleground::DoorOpen(uint32 type)
obj->SetGoState(GO_STATE_ACTIVE);
}
else
- sLog->outError("Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
}
@@ -1531,7 +1531,7 @@ GameObject* Battleground::GetBGObject(uint32 type)
{
GameObject* obj = GetBgMap()->GetGameObject(BgObjects[type]);
if (!obj)
- sLog->outError("Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
return obj;
}
@@ -1540,7 +1540,7 @@ Creature* Battleground::GetBGCreature(uint32 type)
{
Creature* creature = GetBgMap()->GetCreature(BgCreatures[type]);
if (!creature)
- sLog->outError("Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgCreatures[type]), m_MapId, m_InstanceID);
return creature;
}
@@ -1573,7 +1573,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
Creature* creature = new Creature;
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
{
- sLog->outError("Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete creature;
return NULL;
@@ -1584,7 +1584,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry);
if (!cinfo)
{
- sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_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 NULL;
@@ -1619,7 +1619,7 @@ bool Battleground::DelCreature(uint32 type)
return true;
}
- sLog->outError("Battleground::DelCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DelCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgCreatures[type]), m_MapId, m_InstanceID);
BgCreatures[type] = 0;
return false;
@@ -1637,7 +1637,7 @@ bool Battleground::DelObject(uint32 type)
BgObjects[type] = 0;
return true;
}
- sLog->outError("Battleground::DelObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::DelObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
type, GUID_LOPART(BgObjects[type]), m_MapId, m_InstanceID);
BgObjects[type] = 0;
return false;
@@ -1664,7 +1664,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
//creature->CastSpell(creature, SPELL_SPIRIT_HEAL_CHANNEL, true);
return true;
}
- sLog->outError("Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_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;
@@ -1765,7 +1765,7 @@ void Battleground::HandleTriggerBuff(uint64 go_guid)
index--;
if (index < 0)
{
- sLog->outError("Battleground::HandleTriggerBuff: cannot find buff gameobject (GUID: %u, entry: %u, type: %u) in internal data for BG (map: %u, instance id: %u)!",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::HandleTriggerBuff: cannot find buff gameobject (GUID: %u, entry: %u, type: %u) in internal data for BG (map: %u, instance id: %u)!",
GUID_LOPART(go_guid), obj->GetEntry(), obj->GetGoType(), m_MapId, m_InstanceID);
return;
}
@@ -1889,7 +1889,7 @@ int32 Battleground::GetObjectType(uint64 guid)
for (uint32 i = 0; i < BgObjects.size(); ++i)
if (BgObjects[i] == guid)
return i;
- sLog->outError("Battleground::GetObjectType: player used gameobject (GUID: %u) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground::GetObjectType: player used gameobject (GUID: %u) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
GUID_LOPART(guid), m_MapId, m_InstanceID);
return -1;
}
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 8205c30dd1e..f9fb27f54bc 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -226,7 +226,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket* data, Battlegro
*data << uint8(uiFrame);
break;
default:
- sLog->outError("Unknown BG status!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Unknown BG status!");
break;
}
}
@@ -281,7 +281,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
itr2 = itr++;
if (!bg->IsPlayerInBattleground(itr2->first))
{
- sLog->outError("Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
continue;
}
@@ -391,7 +391,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
// should never happen
if (++scoreCount >= bg->GetMaxPlayers() && itr != bg->GetPlayerScoresEnd())
{
- sLog->outError("Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers());
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers());
break;
}
}
@@ -508,7 +508,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId
if (!bg_template)
{
- sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
return NULL;
}
bool isRandom = false;
@@ -550,7 +550,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId
bg_template = GetBattlegroundTemplate(bgTypeId);
if (!bg_template)
{
- sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
return NULL;
}
}
@@ -683,8 +683,8 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 battlegrounds. DB table `battleground_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 battlegrounds. DB table `battleground_template` is empty.");
+
return;
}
@@ -702,7 +702,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
if (!bl)
{
- sLog->outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
continue;
}
@@ -717,14 +717,14 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
// check values from DB
if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam)
{
- sLog->outErrorDb("Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)",
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)",
data.bgTypeId, data.MinPlayersPerTeam, data.MaxPlayersPerTeam);
continue;
}
if (data.LevelMin == 0 || data.LevelMax == 0 || data.LevelMin > data.LevelMax)
{
- sLog->outErrorDb("Table `battleground_template` for id %u has bad values for LevelMin (%u) and LevelMax(%u)",
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u has bad values for LevelMin (%u) and LevelMax(%u)",
data.bgTypeId, data.LevelMin, data.LevelMax);
continue;
}
@@ -746,7 +746,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
}
else
{
- sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", data.bgTypeId, startId);
continue;
}
@@ -767,7 +767,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
}
else
{
- sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
+ sLog->outError(LOG_FILTER_SQL, "Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", data.bgTypeId, startId);
continue;
}
@@ -793,8 +793,8 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void BattlegroundMgr::InitAutomaticArenaPointDistribution()
@@ -891,12 +891,12 @@ void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, Batt
team = player->GetTeam();
bg->GetTeamStartLoc(team, x, y, z, O);
- sLog->outDetail("BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", player->GetName(), mapid, x, y, z, O);
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", player->GetName(), mapid, x, y, z, O);
player->TeleportTo(mapid, x, y, z, O);
}
else
{
- sLog->outError("player %u is trying to port to non-existent bg instance %u", player->GetGUIDLow(), instanceId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "player %u is trying to port to non-existent bg instance %u", player->GetGUIDLow(), instanceId);
}
}
@@ -1078,8 +1078,8 @@ void BattlegroundMgr::LoadBattleMastersEntry()
if (!result)
{
- sLog->outString(">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
+
return;
}
@@ -1095,7 +1095,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
uint32 bgTypeId = fields[1].GetUInt32();
if (!sBattlemasterListStore.LookupEntry(bgTypeId))
{
- sLog->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId);
+ sLog->outError(LOG_FILTER_SQL, "Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId);
continue;
}
@@ -1103,8 +1103,8 @@ void BattlegroundMgr::LoadBattleMastersEntry()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId)
@@ -1138,4 +1138,4 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday)
bool BattlegroundMgr::IsBGWeekend(BattlegroundTypeId bgTypeId)
{
return IsHolidayActive(BGTypeToWeekendHolidayId(bgTypeId));
-} \ No newline at end of file
+}
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 6f4264c0faf..85d41977d13 100755
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -294,7 +294,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
itr = m_QueuedPlayers.find(guid);
if (itr == m_QueuedPlayers.end())
{
- sLog->outError("BattlegroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid));
return;
}
@@ -328,7 +328,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount)
//player can't be in queue without group, but just in case
if (bracket_id == -1)
{
- sLog->outError("BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
return;
}
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id);
@@ -780,14 +780,14 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
if (!bg_template)
{
- sLog->outError("Battleground: Update: bg template not found for %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: Update: bg template not found for %u", bgTypeId);
return;
}
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(), bracket_id);
if (!bracketEntry)
{
- sLog->outError("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
return;
}
@@ -838,7 +838,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false);
if (!bg2)
{
- sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
return;
}
//invite those selection pools
@@ -864,7 +864,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false);
if (!bg2)
{
- sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
return;
}
@@ -962,7 +962,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTyp
Battleground* arena = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, true);
if (!arena)
{
- sLog->outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
return;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
index 86f3d5c54cb..fa36f0b02aa 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -238,7 +238,7 @@ void BattlegroundAB::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 4021: // Unk2
//break;
default:
- //sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ //sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
//Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -356,7 +356,7 @@ void BattlegroundAB::_SendNodeUpdate(uint8 node)
void BattlegroundAB::_NodeOccupied(uint8 node, Team team)
{
if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team))
- sLog->outError("Failed to spawn spirit guide! point: %u, team: %u, ", node, team);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Failed to spawn spirit guide! point: %u, team: %u, ", node, team);
uint8 capturedNodes = 0;
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
@@ -561,7 +561,7 @@ bool BattlegroundAB::SetupBattleground()
|| !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i, BG_AB_OBJECTID_AURA_C, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
)
{
- sLog->outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAB: Failed to spawn some object Battleground not created!");
return false;
}
}
@@ -569,7 +569,7 @@ bool BattlegroundAB::SetupBattleground()
|| !AddObject(BG_AB_OBJECT_GATE_H, BG_AB_OBJECTID_GATE_H, BG_AB_DoorPositions[1][0], BG_AB_DoorPositions[1][1], BG_AB_DoorPositions[1][2], BG_AB_DoorPositions[1][3], BG_AB_DoorPositions[1][4], BG_AB_DoorPositions[1][5], BG_AB_DoorPositions[1][6], BG_AB_DoorPositions[1][7], RESPAWN_IMMEDIATELY)
)
{
- sLog->outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAB: Failed to spawn door object Battleground not created!");
return false;
}
//buffs
@@ -579,7 +579,7 @@ bool BattlegroundAB::SetupBattleground()
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
)
- sLog->outErrorDb("BatteGroundAB: Failed to spawn buff object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAB: Failed to spawn buff object!");
}
return true;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index 715564d3252..37072866238 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -93,7 +93,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
{
if (!m_CaptainAlive[0])
{
- sLog->outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
return;
}
m_CaptainAlive[0]=false;
@@ -112,7 +112,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
{
if (!m_CaptainAlive[1])
{
- sLog->outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
return;
}
m_CaptainAlive[1]=false;
@@ -480,7 +480,7 @@ void BattlegroundAV::RemovePlayer(Player* player, uint64 /*guid*/, uint32 /*team
{
if (!player)
{
- sLog->outError("bg_AV no player at remove");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "bg_AV no player at remove");
return;
}
//TODO search more buffs
@@ -588,7 +588,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
if (BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp])
DelCreature(AV_CPLACE_A_MARSHAL_SOUTH + tmp);
else
- sLog->outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_AV: playerdestroyedpoint: marshal %i doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp);
//spawn destroyed aura
for (uint8 i=0; i <= 9; i++)
SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10), RESPAWN_IMMEDIATELY);
@@ -753,7 +753,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
if (BgCreatures[node])
DelCreature(node);
if (!AddSpiritGuide(node, BG_AV_CreaturePos[node][0], BG_AV_CreaturePos[node][1], BG_AV_CreaturePos[node][2], BG_AV_CreaturePos[node][3], owner))
- sLog->outError("AV: couldn't spawn spiritguide at node %i", node);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "AV: couldn't spawn spiritguide at node %i", node);
}
for (uint8 i=0; i<4; i++)
@@ -811,7 +811,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
return BG_AV_Nodes(object - 29);
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE)
return BG_AV_NODES_SNOWFALL_GRAVE;
- sLog->outError("BattlegroundAV: ERROR! GetPlace got a wrong object :(");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundAV: ERROR! GetPlace got a wrong object :(");
ASSERT(false);
return BG_AV_Nodes(0);
}
@@ -849,7 +849,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
}
else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
- sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
ASSERT(false);
return 0;
}
@@ -903,7 +903,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
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);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_AV: player defends point which doesn't belong to his team %i", node);
return;
}
@@ -1124,7 +1124,7 @@ uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used
if (state == POINT_ASSAULTED)
return 3;
}
- sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i", state, team);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_AV: should update a strange worldstate state:%i team:%i", state, team);
return 5; //this will crash the game, but i want to know if something is wrong here
}
@@ -1203,7 +1203,7 @@ bool BattlegroundAV::SetupBattleground()
// horde gates
|| !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0], BG_AV_DoorPositons[1][1], BG_AV_DoorPositons[1][2], BG_AV_DoorPositons[1][3], 0, 0, sin(BG_AV_DoorPositons[1][3]/2), cos(BG_AV_DoorPositons[1][3]/2), RESPAWN_IMMEDIATELY))
{
- sLog->outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundAV: Failed to spawn some object Battleground not created!1");
return false;
}
@@ -1221,7 +1221,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!2");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!2");
return false;
}
}
@@ -1236,7 +1236,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_A, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PH, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!3");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!3");
return false;
}
}
@@ -1249,7 +1249,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PA, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_H, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!4");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!4");
return false;
}
}
@@ -1257,7 +1257,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
return false;
}
}
@@ -1271,7 +1271,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_SMOKE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
return false;
}
}
@@ -1279,7 +1279,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
return false;
}
}
@@ -1289,7 +1289,7 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i, BG_AV_OBJECTID_MINE_N, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
return false;
}
}
@@ -1297,14 +1297,14 @@ bool BattlegroundAV::SetupBattleground()
{
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i);
return false;
}
}
if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N, BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3], 0, 0, sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!8");
return false;
}
for (uint8 i = 0; i < 4; i++)
@@ -1314,7 +1314,7 @@ bool BattlegroundAV::SetupBattleground()
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H, BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH, BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY))
{
- sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
return false;
}
}
@@ -1402,7 +1402,7 @@ const char* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
case BG_AV_NODES_FROSTWOLF_WTOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_FROST_W);
case BG_AV_NODES_FROSTWOLF_HUT: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
default:
- sLog->outError("tried to get name for node %u", node);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "tried to get name for node %u", node);
break;
}
@@ -1413,22 +1413,22 @@ void BattlegroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
{
if (m_Nodes[node].TotalOwner == team)
{
- sLog->outCrash("Assaulting team is TotalOwner of node");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Assaulting team is TotalOwner of node");
ASSERT (false);
}
if (m_Nodes[node].Owner == team)
{
- sLog->outCrash("Assaulting team is owner of node");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Assaulting team is owner of node");
ASSERT (false);
}
if (m_Nodes[node].State == POINT_DESTROYED)
{
- sLog->outCrash("Destroyed node is being assaulted");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Destroyed node is being assaulted");
ASSERT (false);
}
if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwner) //only assault an assaulted node if no totalowner exists
{
- sLog->outCrash("Assault on an not assaulted node with total owner");
+ sLog->outFatal(LOG_FILTER_BATTLEGROUND, "Assault on an not assaulted node with total owner");
ASSERT (false);
}
//the timer gets another time, if the previous owner was 0 == Neutral
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
index c7eddbb67a9..78cf6b9863f 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp
@@ -89,7 +89,7 @@ void BattlegroundBE::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killer player not found");
return;
}
@@ -122,7 +122,7 @@ void BattlegroundBE::HandleAreaTrigger(Player* Source, uint32 Trigger)
//buff_guid = BgObjects[BG_BE_OBJECT_BUFF_2];
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -154,7 +154,7 @@ bool BattlegroundBE::SetupBattleground()
|| !AddObject(BG_BE_OBJECT_BUFF_1, BG_BE_OBJECT_TYPE_BUFF_1, 6249.042f, 275.3239f, 11.22033f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|| !AddObject(BG_BE_OBJECT_BUFF_2, BG_BE_OBJECT_TYPE_BUFF_2, 6228.26f, 249.566f, 11.21812f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
{
- sLog->outErrorDb("BatteGroundBE: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundBE: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
index ccc6a2305b4..20eba2a7f67 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp
@@ -171,7 +171,7 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("BattlegroundDS: Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundDS: Killer player not found");
return;
}
@@ -200,7 +200,7 @@ void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger)
setPipeKnockBackCount(0);
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -240,7 +240,7 @@ bool BattlegroundDS::SetupBattleground()
|| !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_1, 0, 1369.977f, 817.2882f, 16.08718f, 3.106686f, RESPAWN_IMMEDIATELY)
|| !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_2, 0, 1212.833f, 765.3871f, 16.09484f, 0.0f, RESPAWN_IMMEDIATELY))
{
- sLog->outErrorDb("BatteGroundDS: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundDS: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index 2b02caaf5a2..35ea94ba607 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -153,7 +153,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint()
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
if (!player)
{
- sLog->outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
++j;
continue;
}
@@ -193,7 +193,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
Player* player = ObjectAccessor::FindPlayer(m_PlayersNearPoint[i][j]);
if (!player)
{
- sLog->outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
@@ -411,7 +411,7 @@ void BattlegroundEY::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 5866:
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -474,7 +474,7 @@ bool BattlegroundEY::SetupBattleground()
|| !AddObject(BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER, BG_OBJECT_HU_TOWER_CAP_EY_ENTRY, 2282.121582f, 1760.006958f, 1189.707153f, 1.919862f, 0, 0, 0.819152f, 0.573576f, RESPAWN_ONE_DAY)
)
{
- sLog->outErrorDb("BatteGroundEY: Failed to spawn some object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundEY: Failed to spawn some object Battleground not created!");
return false;
}
@@ -484,28 +484,28 @@ bool BattlegroundEY::SetupBattleground()
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]);
if (!at)
{
- sLog->outError("BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
continue;
}
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
)
- sLog->outError("BattlegroundEY: Cannot spawn buff");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Cannot spawn buff");
}
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
- sLog->outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE);
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
{
- sLog->outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
return false;
}
@@ -570,7 +570,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
if (obj)
obj->Delete();
else
- sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u", GUID_LOPART(GetDroppedFlagGUID()));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Unknown dropped flag guid: %u", GUID_LOPART(GetDroppedFlagGUID()));
SetDroppedFlagGUID(0);
}
@@ -742,7 +742,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* Source, uint32 Point)
WorldSafeLocsEntry const* sg = NULL;
sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId);
if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
- sLog->outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
Point, Team, m_CapturingPointTypes[Point].GraveYardId);
// SpawnBGCreature(Point, RESPAWN_IMMEDIATELY);
@@ -894,7 +894,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
if (!entry)
{
- sLog->outError("BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
return NULL;
}
@@ -911,7 +911,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player)
{
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
if (!entry)
- sLog->outError("BattlegroundEY: Not found graveyard: %u", m_CapturingPointTypes[i].GraveYardId);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundEY: Not found graveyard: %u", m_CapturingPointTypes[i].GraveYardId);
else
{
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
index 47ea9915ac7..76e328b46ac 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
@@ -275,7 +275,7 @@ void BattlegroundIC::StartingEventOpenDoors()
BG_IC_Teleporters[i].x, BG_IC_Teleporters[i].y,
BG_IC_Teleporters[i].z, BG_IC_Teleporters[i].o,
0, 0, 0, 0, RESPAWN_ONE_DAY))
- sLog->outError("Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry);
}
}
@@ -372,7 +372,7 @@ bool BattlegroundIC::SetupBattleground()
BG_IC_ObjSpawnlocs[i].z, BG_IC_ObjSpawnlocs[i].o,
0, 0, 0, 0, RESPAWN_ONE_DAY))
{
- sLog->outError("Isle of Conquest: There was an error spawning gameobject %u", BG_IC_ObjSpawnlocs[i].entry);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning gameobject %u", BG_IC_ObjSpawnlocs[i].entry);
return false;
}
}
@@ -384,7 +384,7 @@ bool BattlegroundIC::SetupBattleground()
BG_IC_NpcSpawnlocs[i].z, BG_IC_NpcSpawnlocs[i].o,
RESPAWN_ONE_DAY))
{
- sLog->outError("Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[i].entry);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[i].entry);
return false;
}
}
@@ -394,7 +394,7 @@ bool BattlegroundIC::SetupBattleground()
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+3, BG_IC_SpiritGuidePos[7][0], BG_IC_SpiritGuidePos[7][1], BG_IC_SpiritGuidePos[7][2], BG_IC_SpiritGuidePos[7][3], ALLIANCE)
|| !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+4, BG_IC_SpiritGuidePos[8][0], BG_IC_SpiritGuidePos[8][1], BG_IC_SpiritGuidePos[8][2], BG_IC_SpiritGuidePos[8][3], HORDE))
{
- sLog->outError("Isle of Conquest: Failed to spawn initial spirit guide!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: Failed to spawn initial spirit guide!");
return false;
}
@@ -403,7 +403,7 @@ bool BattlegroundIC::SetupBattleground()
if (!gunshipAlliance || !gunshipHorde)
{
- sLog->outError("Isle of Conquest: There was an error creating gunships!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: There was an error creating gunships!");
return false;
}
@@ -615,7 +615,7 @@ uint32 BattlegroundIC::GetNextBanner(ICNodePoint* nodePoint, uint32 team, bool r
return nodePoint->last_entry;
// we should never be here...
- sLog->outError("Isle Of Conquest: Unexpected return in GetNextBanner function");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle Of Conquest: Unexpected return in GetNextBanner function");
return 0;
}
@@ -639,7 +639,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
BG_IC_SpiritGuidePos[nodePoint->nodeType][0], BG_IC_SpiritGuidePos[nodePoint->nodeType][1],
BG_IC_SpiritGuidePos[nodePoint->nodeType][2], BG_IC_SpiritGuidePos[nodePoint->nodeType][3],
(nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE)))
- sLog->outError("Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", nodePoint->nodeType, nodePoint->faction);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", nodePoint->nodeType, nodePoint->faction);
}
switch (nodePoint->gameobject_type)
@@ -658,7 +658,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
0, 0, 0, 0, RESPAWN_ONE_DAY);
}
- //sLog->outError("BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
+ //sLog->outError(LOG_FILTER_BATTLEGROUND, "BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction);
(nodePoint->faction == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->BuildStartMovePacket(GetBgMap());
(nodePoint->faction == TEAM_ALLIANCE ? gunshipHorde : gunshipAlliance)->BuildStopMovePacket(GetBgMap());
@@ -908,7 +908,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period)
if (!goinfo)
{
- sLog->outErrorDb("Transport ID: %u will not be loaded, gameobject_template missing", goEntry);
+ sLog->outError(LOG_FILTER_SQL, "Transport ID: %u will not be loaded, gameobject_template missing", goEntry);
delete t;
return NULL;
}
@@ -918,7 +918,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period)
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
- sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
+ sLog->outError(LOG_FILTER_SQL, "Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
delete t;
return NULL;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
index 0974c96a991..f39b1ba5540 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp
@@ -86,7 +86,7 @@ void BattlegroundNA::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("BattlegroundNA: Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundNA: Killer player not found");
return;
}
@@ -115,7 +115,7 @@ void BattlegroundNA::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 4537: // buff trigger?
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -147,7 +147,7 @@ bool BattlegroundNA::SetupBattleground()
|| !AddObject(BG_NA_OBJECT_BUFF_1, BG_NA_OBJECT_TYPE_BUFF_1, 4009.189941f, 2895.250000f, 13.052700f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|| !AddObject(BG_NA_OBJECT_BUFF_2, BG_NA_OBJECT_TYPE_BUFF_2, 4103.330078f, 2946.350098f, 13.051300f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
{
- sLog->outErrorDb("BatteGroundNA: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundNA: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
index 6a626217a4e..7fa9980a77c 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp
@@ -86,7 +86,7 @@ void BattlegroundRL::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "Killer player not found");
return;
}
@@ -116,7 +116,7 @@ void BattlegroundRL::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 4697: // buff trigger?
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -146,7 +146,7 @@ bool BattlegroundRL::SetupBattleground()
|| !AddObject(BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_TYPE_BUFF_1, 1328.719971f, 1632.719971f, 36.730400f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|| !AddObject(BG_RL_OBJECT_BUFF_2, BG_RL_OBJECT_TYPE_BUFF_2, 1243.300049f, 1699.170044f, 34.872601f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
{
- sLog->outErrorDb("BatteGroundRL: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundRL: Failed to spawn some object!");
return false;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
index 2b8f5925265..769df5445c7 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp
@@ -130,7 +130,7 @@ void BattlegroundRV::HandleKillPlayer(Player* player, Player* killer)
if (!killer)
{
- sLog->outError("BattlegroundRV: Killer player not found");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundRV: Killer player not found");
return;
}
@@ -162,7 +162,7 @@ void BattlegroundRV::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 5474:
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -214,7 +214,7 @@ bool BattlegroundRV::SetupBattleground()
)
{
- sLog->outErrorDb("BatteGroundRV: Failed to spawn some object!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundRV: Failed to spawn some object!");
return false;
}
return true;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index bda1bdfa8d3..f7f4df61be6 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -162,7 +162,7 @@ bool BattlegroundSA::ResetObjs()
if (!sg)
{
- sLog->outError("SOTA: Can't find GY entry %u", BG_SA_GYEntries[i]);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "SOTA: Can't find GY entry %u", BG_SA_GYEntries[i]);
return false;
}
@@ -175,7 +175,7 @@ bool BattlegroundSA::ResetObjs()
{
GraveyardStatus[i] = ((Attackers == TEAM_HORDE)? TEAM_ALLIANCE : TEAM_HORDE);
if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((Attackers == TEAM_HORDE)? ALLIANCE : HORDE)))
- sLog->outError("SOTA: couldn't spawn GY: %u", i);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "SOTA: couldn't spawn GY: %u", i);
}
}
@@ -725,7 +725,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]);
if (!sg)
{
- sLog->outError("BattlegroundSA::CaptureGraveyard: non-existant GY entry: %u", BG_SA_GYEntries[i]);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundSA::CaptureGraveyard: non-existant GY entry: %u", BG_SA_GYEntries[i]);
return;
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
index 0c583ddde3f..c09285fd7ad 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -251,7 +251,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
if (GameObject* obj = GetBgMap()->GetGameObject(GetDroppedFlagGUID(team)))
obj->Delete();
else
- sLog->outError("unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team)));
SetDroppedFlagGUID(0, team);
_bothFlagsKept = false;
@@ -557,7 +557,7 @@ void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
{
if (!player)
{
- sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundWS: Removing offline player who has the FLAG!!");
this->SetAllianceFlagPicker(0);
this->RespawnFlag(ALLIANCE, false);
}
@@ -568,7 +568,7 @@ void BattlegroundWS::RemovePlayer(Player* player, uint64 guid, uint32 /*team*/)
{
if (!player)
{
- sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!");
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "BattlegroundWS: Removing offline player who has the FLAG!!");
this->SetHordeFlagPicker(0);
this->RespawnFlag(HORDE, false);
}
@@ -637,7 +637,7 @@ void BattlegroundWS::HandleAreaTrigger(Player* Source, uint32 Trigger)
case 4629: // unk4
break;
default:
- sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
+ sLog->outError(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
break;
}
@@ -672,21 +672,21 @@ bool BattlegroundWS::SetupBattleground()
|| !AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY)
)
{
- sLog->outErrorDb("BatteGroundWS: Failed to spawn some object Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundWS: Failed to spawn some object Battleground not created!");
return false;
}
WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
{
- sLog->outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
return false;
}
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
{
- sLog->outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
+ sLog->outError(LOG_FILTER_SQL, "BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
return false;
}
diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt
index 8b81a48c33b..a83e77e6632 100644
--- a/src/server/game/CMakeLists.txt
+++ b/src/server/game/CMakeLists.txt
@@ -141,7 +141,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/Calendar
${CMAKE_CURRENT_SOURCE_DIR}/Chat
${CMAKE_CURRENT_SOURCE_DIR}/Chat/Channels
- ${CMAKE_CURRENT_SOURCE_DIR}/Chat/Commands
${CMAKE_CURRENT_SOURCE_DIR}/Combat
${CMAKE_CURRENT_SOURCE_DIR}/Conditions
${CMAKE_CURRENT_SOURCE_DIR}/DataStores
diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp
index 62bc0ab3205..80de42c0ce2 100644
--- a/src/server/game/Calendar/CalendarMgr.cpp
+++ b/src/server/game/Calendar/CalendarMgr.cpp
@@ -99,7 +99,7 @@ CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId)
if (itr != _invites.end())
return &(itr->second);
- sLog->outError("CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId);
return NULL;
}
@@ -109,7 +109,7 @@ CalendarEvent* CalendarMgr::GetEvent(uint64 eventId)
if (itr != _events.end())
return &(itr->second);
- sLog->outError("CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId);
return NULL;
}
@@ -149,7 +149,7 @@ void CalendarMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u calendar events", count);
+ sLog->outInfo(LOG_FILTER_CALENDAR, ">> Loaded %u calendar events", count);
count = 0;
// 0 1 2 3 4 5 6 7
@@ -176,7 +176,7 @@ void CalendarMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u calendar Invites", count);
+ sLog->outInfo(LOG_FILTER_CALENDAR, ">> Loaded %u calendar Invites", count);
*/
}
@@ -442,7 +442,7 @@ bool CalendarMgr::AddEvent(CalendarEvent const& newEvent)
uint64 eventId = newEvent.GetEventId();
if (_events.find(eventId) != _events.end())
{
- sLog->outError("CalendarMgr::AddEvent: Event [" UI64FMTD "] exists", eventId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::AddEvent: Event [" UI64FMTD "] exists", eventId);
return false;
}
@@ -455,7 +455,7 @@ bool CalendarMgr::RemoveEvent(uint64 eventId)
CalendarEventMap::iterator itr = _events.find(eventId);
if (itr == _events.end())
{
- sLog->outError("CalendarMgr::RemoveEvent: Event [" UI64FMTD "] does not exist", eventId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::RemoveEvent: Event [" UI64FMTD "] does not exist", eventId);
return false;
}
@@ -494,13 +494,13 @@ bool CalendarMgr::AddInvite(CalendarInvite const& newInvite)
uint64 inviteId = newInvite.GetInviteId();
if (!inviteId)
{
- sLog->outError("CalendarMgr::AddInvite: Cant add Invite 0");
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::AddInvite: Cant add Invite 0");
return false;
}
if (_invites.find(inviteId) != _invites.end())
{
- sLog->outError("CalendarMgr::AddInvite: Invite [" UI64FMTD "] exists", inviteId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::AddInvite: Invite [" UI64FMTD "] exists", inviteId);
return false;
}
@@ -516,7 +516,7 @@ uint64 CalendarMgr::RemoveInvite(uint64 inviteId)
CalendarInviteMap::iterator itr = _invites.find(inviteId);
if (itr == _invites.end())
{
- sLog->outError("CalendarMgr::RemoveInvite: Invite [" UI64FMTD "] does not exist", inviteId);
+ sLog->outError(LOG_FILTER_CALENDAR, "CalendarMgr::RemoveInvite: Invite [" UI64FMTD "] does not exist", inviteId);
return 0;
}
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 0e89601e987..c3845f16826 100755
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -36,13 +36,13 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
m_flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
- if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
+ if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
m_flags |= CHANNEL_FLAG_TRADE;
- if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
+ if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
m_flags |= CHANNEL_FLAG_CITY;
- if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
+ if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
m_flags |= CHANNEL_FLAG_LFG;
else // for all other channels
m_flags |= CHANNEL_FLAG_NOT_LFG;
diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h
index ac030ffb73f..887e53f49a5 100755
--- a/src/server/game/Chat/Channels/ChannelMgr.h
+++ b/src/server/game/Chat/Channels/ChannelMgr.h
@@ -49,4 +49,3 @@ class HordeChannelMgr : public ChannelMgr {};
ChannelMgr* channelMgr(uint32 team);
#endif
-
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index b95b5f41921..b8d4234b2a0 100755
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -38,13 +38,6 @@
bool ChatHandler::load_command_table = true;
-// wrapper for old-style handlers
-template<bool (ChatHandler::*F)(const char*)>
-bool OldHandler(ChatHandler* chatHandler, const char* args)
-{
- return (chatHandler->*F)(args);
-}
-
// get number of commands in table
static size_t getCommandTableSize(const ChatCommand* commands)
{
@@ -67,124 +60,6 @@ static size_t appendCommandTable(ChatCommand* target, const ChatCommand* source)
ChatCommand* ChatHandler::getCommandTable()
{
- static ChatCommand channelSetCommandTable[] =
- {
- { "ownership", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleChannelSetOwnership>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand channelCommandTable[] =
- {
- { "set", SEC_ADMINISTRATOR, true, NULL, "", channelSetCommandTable },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand groupCommandTable[] =
- {
- { "leader", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupLeaderCommand>, "", NULL },
- { "disband", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupDisbandCommand>, "", NULL },
- { "remove", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupRemoveCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand petCommandTable[] =
- {
- { "create", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCreatePetCommand>, "", NULL },
- { "learn", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandlePetLearnCommand>, "", NULL },
- { "unlearn", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandlePetUnlearnCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand pdumpCommandTable[] =
- {
- { "load", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandlePDumpLoadCommand>, "", NULL },
- { "write", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandlePDumpWriteCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand sendCommandTable[] =
- {
- { "items", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendItemsCommand>, "", NULL },
- { "mail", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleSendMailCommand>, "", NULL },
- { "message", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendMessageCommand>, "", NULL },
- { "money", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleSendMoneyCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand commandTable[] =
- {
- { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
- { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable },
-
- { "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable },
-
- { "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable },
-
- { "aura", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleAuraCommand>, "", NULL },
- { "unaura", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnAuraCommand>, "", NULL },
- { "nameannounce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleNameAnnounceCommand>, "", NULL },
- { "gmnameannounce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMNameAnnounceCommand>, "", NULL },
- { "announce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleAnnounceCommand>, "", NULL },
- { "gmannounce", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMAnnounceCommand>, "", NULL },
- { "notify", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleNotifyCommand>, "", NULL },
- { "gmnotify", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleGMNotifyCommand>, "", NULL },
- { "appear", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleAppearCommand>, "", NULL },
- { "summon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleSummonCommand>, "", NULL },
- { "groupsummon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGroupSummonCommand>, "", NULL },
- { "commands", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleCommandsCommand>, "", NULL },
- { "die", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDieCommand>, "", NULL },
- { "revive", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleReviveCommand>, "", NULL },
- { "dismount", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleDismountCommand>, "", NULL },
- { "guid", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleGUIDCommand>, "", NULL },
- { "help", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleHelpCommand>, "", NULL },
- { "itemmove", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleItemMoveCommand>, "", NULL },
- { "cooldown", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCooldownCommand>, "", NULL },
- { "unlearn", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnLearnCommand>, "", NULL },
- { "distance", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGetDistanceCommand>, "", NULL },
- { "recall", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleRecallCommand>, "", NULL },
- { "save", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleSaveCommand>, "", NULL },
- { "saveall", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleSaveAllCommand>, "", NULL },
- { "kick", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleKickPlayerCommand>, "", NULL },
- { "start", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleStartCommand>, "", NULL },
- { "taxicheat", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleTaxiCheatCommand>, "", NULL },
- { "linkgrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLinkGraveCommand>, "", NULL },
- { "neargrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleNearGraveCommand>, "", NULL },
- { "explorecheat", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleExploreCheatCommand>, "", NULL },
- { "levelup", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLevelUpCommand>, "", NULL },
- { "showarea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleShowAreaCommand>, "", NULL },
- { "hidearea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleHideAreaCommand>, "", NULL },
- { "additem", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleAddItemCommand>, "", NULL },
- { "additemset", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleAddItemSetCommand>, "", NULL },
- { "bank", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleBankCommand>, "", NULL },
- { "wchange", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleChangeWeather>, "", NULL },
- { "maxskill", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleMaxSkillCommand>, "", NULL },
- { "setskill", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleSetSkillCommand>, "", NULL },
- { "whispers", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleWhispersCommand>, "", NULL },
- { "pinfo", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandlePInfoCommand>, "", NULL },
- { "respawn", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleRespawnCommand>, "", NULL },
- { "send", SEC_MODERATOR, true, NULL, "", sendCommandTable },
- { "mute", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleMuteCommand>, "", NULL },
- { "unmute", SEC_MODERATOR, true, OldHandler<&ChatHandler::HandleUnmuteCommand>, "", NULL },
- { "movegens", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleMovegensCommand>, "", NULL },
- { "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL },
- { "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL },
- { "combatstop", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL },
- { "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL },
- { "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL },
- { "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL },
-
- { "freeze", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleFreezeCommand>, "", NULL },
- { "unfreeze", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleUnFreezeCommand>, "", NULL },
- { "listfreeze", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleListFreezeCommand>, "", NULL },
-
- { "possess", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandlePossessCommand>, "", NULL },
- { "unpossess", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnPossessCommand>, "", NULL },
- { "bindsight", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleBindSightCommand>, "", NULL },
- { "unbindsight", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleUnbindSightCommand>, "", NULL },
- { "playall", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandlePlayAllCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
// cache for commands, needed because some commands are loaded dynamically through ScriptMgr
// cache is never freed and will show as a memory leak in diagnostic tools
// can't use vector as vector storage is implementation-dependent, eg, there can be alignment gaps between elements
@@ -196,25 +71,23 @@ ChatCommand* ChatHandler::getCommandTable()
{
// count total number of top-level commands
- size_t total = getCommandTableSize(commandTable);
+ size_t total = 0;
std::vector<ChatCommand*> const& dynamic = sScriptMgr->GetChatCommands();
for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it)
total += getCommandTableSize(*it);
total += 1; // ending zero
// cache top-level commands
+ size_t added = 0;
commandTableCache = (ChatCommand*)malloc(sizeof(ChatCommand) * total);
memset(commandTableCache, 0, sizeof(ChatCommand) * total);
ACE_ASSERT(commandTableCache);
- size_t added = appendCommandTable(commandTableCache, commandTable);
for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it)
added += appendCommandTable(commandTableCache + added, *it);
}
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS);
-
PreparedQueryResult result = WorldDatabase.Query(stmt);
-
if (result)
{
do
@@ -224,7 +97,8 @@ ChatCommand* ChatHandler::getCommandTable()
SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt8(), fields[2].GetString(), name);
- } while (result->NextRow());
+ }
+ while (result->NextRow());
}
}
@@ -527,12 +401,12 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, const char* text,
// expected subcommand by full name DB content
else if (*text)
{
- sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
return false;
}
if (table[i].SecurityLevel != security)
- sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
table[i].SecurityLevel = security;
table[i].Help = help;
@@ -543,9 +417,9 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, const char* text,
if (!cmd.empty())
{
if (table == getCommandTable())
- sLog->outErrorDb("Table `command` have not existed command '%s', skip.", cmd.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Table `command` have not existed command '%s', skip.", cmd.c_str());
else
- sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
}
return false;
diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h
index 84a2b601472..c0560ee0e27 100755..100644
--- a/src/server/game/Chat/Chat.h
+++ b/src/server/game/Chat/Chat.h
@@ -124,120 +124,13 @@ class ChatHandler
static bool LoadCommandTable() { return load_command_table; }
static void SetLoadCommandTable(bool val) { load_command_table = val; }
- // cs_character
- void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel);
-
+ bool ShowHelpForCommand(ChatCommand* table, const char* cmd);
protected:
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
static bool SetDataForCommandInTable(ChatCommand* table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand);
bool ExecuteCommandInTable(ChatCommand* table, const char* text, const std::string& fullcmd);
- bool ShowHelpForCommand(ChatCommand* table, const char* cmd);
bool ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd);
- bool HandleNameAnnounceCommand(const char* args);
- bool HandleGMNameAnnounceCommand(const char* args);
- bool HandleGMAnnounceCommand(const char* args);
- bool HandleGMNotifyCommand(const char* args);
-
- bool HandleChannelSetOwnership(const char *args);
-
- bool HandlePossessCommand(const char* args);
- bool HandleUnPossessCommand(const char* args);
- bool HandleBindSightCommand(const char* args);
- bool HandleUnbindSightCommand(const char* args);
-
- bool HandlePDumpLoadCommand(const char *args);
- bool HandlePDumpWriteCommand(const char *args);
-
- bool HandleSendItemsCommand(const char* args);
- bool HandleSendMailCommand(const char* args);
- bool HandleSendMessageCommand(const char * args);
- bool HandleSendMoneyCommand(const char* args);
-
- bool HandleHelpCommand(const char* args);
- bool HandleCommandsCommand(const char* args);
- bool HandleStartCommand(const char* args);
- bool HandleDismountCommand(const char* args);
- bool HandleSaveCommand(const char* args);
-
- bool HandleSummonCommand(const char* args);
- bool HandleAppearCommand(const char* args);
- bool HandleGroupSummonCommand(const char* args);
- bool HandleRecallCommand(const char* args);
- bool HandleAnnounceCommand(const char* args);
- bool HandleNotifyCommand(const char* args);
- bool HandleTaxiCheatCommand(const char* args);
- bool HandleWhispersCommand(const char* args);
-
- bool HandleGUIDCommand(const char* args);
- bool HandleItemMoveCommand(const char* args);
- bool HandleDeMorphCommand(const char* args);
- bool HandlePInfoCommand(const char* args);
- bool HandleMuteCommand(const char* args);
- bool HandleUnmuteCommand(const char* args);
- bool HandleMovegensCommand(const char* args);
- bool HandleFreezeCommand(const char *args);
- bool HandleUnFreezeCommand(const char *args);
- bool HandleListFreezeCommand(const char* args);
-
- bool HandleCooldownCommand(const char* args);
- bool HandleUnLearnCommand(const char* args);
- bool HandleGetDistanceCommand(const char* args);
- bool HandleDieCommand(const char* args);
- bool HandleDamageCommand(const char *args);
- bool HandleReviveCommand(const char* args);
- bool HandleAuraCommand(const char* args);
- bool HandleUnAuraCommand(const char* args);
- bool HandleLinkGraveCommand(const char* args);
- bool HandleNearGraveCommand(const char* args);
- bool HandleActivateObjectCommand(const char* args);
- bool HandleSpawnTransportCommand(const char* args);
- bool HandleExploreCheatCommand(const char* args);
- bool HandleWaterwalkCommand(const char* args);
- bool HandleLevelUpCommand(const char* args);
- bool HandleShowAreaCommand(const char* args);
- bool HandleHideAreaCommand(const char* args);
- bool HandleAddItemCommand(const char* args);
- bool HandleAddItemSetCommand(const char* args);
- bool HandlePetUnlearnCommand(const char* args);
- bool HandlePetLearnCommand(const char* args);
- bool HandleCreatePetCommand(const char* args);
-
- bool HandleGroupLeaderCommand(const char* args);
- bool HandleGroupDisbandCommand(const char* args);
- bool HandleGroupRemoveCommand(const char* args);
-
- bool HandleBankCommand(const char* args);
- bool HandleChangeWeather(const char* args);
- bool HandleKickPlayerCommand(const char * args);
-
- bool HandleMaxSkillCommand(const char* args);
- bool HandleSetSkillCommand(const char* args);
- bool HandleRespawnCommand(const char* args);
- bool HandleComeToMeCommand(const char *args);
- bool HandleCombatStopCommand(const char *args);
-
- /*bool HandleCharDeleteCommand(const char *args);
- bool HandleSendMessageCommand(const char * args);*/
-
- bool HandleFlushArenaPointsCommand(const char *args);
- bool HandlePlayAllCommand(const char* args);
- bool HandleRepairitemsCommand(const char* args);
-
- bool HandleTempGameObjectCommand(const char* args);
-
- //! Development Commands
-
- /*bool HandleQuestAdd(const char * args);
- bool HandleQuestRemove(const char * args);
- bool HandleQuestComplete(const char * args);*/
-
- //bool HandleSet32Bit(const char* args);
- bool HandleSaveAllCommand(const char* args);
-
- // Utility methods for commands
- void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id);
-
private:
WorldSession* m_session; // != NULL for chat command call and NULL for CLI command
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
deleted file mode 100755
index b05ba9b4194..00000000000
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "World.h"
-#include "Player.h"
-#include "Chat.h"
-#include "ObjectAccessor.h"
-#include "Language.h"
-#include "AccountMgr.h"
-#include "SystemConfig.h"
-#include "revision.h"
-#include "Util.h"
-
-bool ChatHandler::HandleHelpCommand(const char* args)
-{
- char* cmd = strtok((char*)args, " ");
- if (!cmd)
- {
- ShowHelpForCommand(getCommandTable(), "help");
- ShowHelpForCommand(getCommandTable(), "");
- }
- else
- {
- if (!ShowHelpForCommand(getCommandTable(), cmd))
- SendSysMessage(LANG_NO_HELP_CMD);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleCommandsCommand(const char* /*args*/)
-{
- ShowHelpForCommand(getCommandTable(), "");
- return true;
-}
-
-bool ChatHandler::HandleStartCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- if (player->isInFlight())
- {
- SendSysMessage(LANG_YOU_IN_FLIGHT);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->isInCombat())
- {
- SendSysMessage(LANG_YOU_IN_COMBAT);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
- {
- // if player is dead and stuck, send ghost to graveyard
- player->RepopAtGraveyard();
- return true;
- }
-
- // cast spell Stuck
- player->CastSpell(player, 7355, false);
- return true;
-}
-
-bool ChatHandler::HandleDismountCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- //If player is not mounted, so go out :)
- if (!player->IsMounted())
- {
- SendSysMessage(LANG_CHAR_NON_MOUNTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->isInFlight())
- {
- SendSysMessage(LANG_YOU_IN_FLIGHT);
- SetSentErrorMessage(true);
- return false;
- }
-
- player->Dismount();
- player->RemoveAurasByType(SPELL_AURA_MOUNTED);
- return true;
-}
-
-bool ChatHandler::HandleSaveCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- // save GM account without delay and output message
- if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
- {
- if (Player* target = getSelectedPlayer())
- target->SaveToDB();
- else
- player->SaveToDB();
- SendSysMessage(LANG_PLAYER_SAVED);
- return true;
- }
-
- // save if the player has last been saved over 20 seconds ago
- uint32 save_interval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
- if (save_interval == 0 || (save_interval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20 * IN_MILLISECONDS))
- player->SaveToDB();
-
- return true;
-}
-
diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp
deleted file mode 100755
index 0e5b17bbc06..00000000000
--- a/src/server/game/Chat/Commands/Level1.cpp
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "TicketMgr.h"
-#include "Player.h"
-#include "AccountMgr.h"
-#include "Opcodes.h"
-#include "Chat.h"
-#include "Log.h"
-#include "MapManager.h"
-#include "ObjectAccessor.h"
-#include "Language.h"
-#include "CellImpl.h"
-#include "InstanceSaveMgr.h"
-#include "Util.h"
-#include "Group.h"
-
-#ifdef _DEBUG_VMAPS
-#include "VMapFactory.h"
-#endif
-
-bool ChatHandler::HandleNameAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string name("Console");
- if (WorldSession* session = GetSession())
- name = session->GetPlayer()->GetName();
-
- sWorld->SendWorldText(LANG_ANNOUNCE_COLOR, name.c_str(), args);
- return true;
-}
-
-bool ChatHandler::HandleGMNameAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string name("Console");
- if (WorldSession* session = GetSession())
- name = session->GetPlayer()->GetName();
-
- sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, name.c_str(), args);
- return true;
-}
-
-// global announce
-bool ChatHandler::HandleAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- char buff[2048];
- sprintf(buff, GetTrinityString(LANG_SYSTEMMESSAGE), args);
- sWorld->SendServerMessage(SERVER_MSG_STRING, buff);
- return true;
-}
-
-// announce to logged in GMs
-bool ChatHandler::HandleGMAnnounceCommand(const char* args)
-{
- if (!*args)
- return false;
-
- sWorld->SendGMText(LANG_GM_BROADCAST, args);
- return true;
-}
-
-//notification player at the screen
-bool ChatHandler::HandleNotifyCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string str = GetTrinityString(LANG_GLOBAL_NOTIFY);
- str += args;
-
- WorldPacket data(SMSG_NOTIFICATION, 2 + str.length());
- data.WriteBits(str.length(), 13);
- data.FlushBits();
- data.append(str.c_str(), str.length());
- sWorld->SendGlobalMessage(&data);
-
- return true;
-}
-
-//notification GM at the screen
-bool ChatHandler::HandleGMNotifyCommand(const char* args)
-{
- if (!*args)
- return false;
-
- std::string str = GetTrinityString(LANG_GM_NOTIFY);
- str += args;
-
- WorldPacket data(SMSG_NOTIFICATION, 2 + str.length());
- data.WriteBits(str.length(), 13);
- data.FlushBits();
- data.append(str.c_str(), str.length());
- sWorld->SendGlobalGMMessage(&data);
-
- return true;
-}
-
-//Summon Player
-bool ChatHandler::HandleSummonCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- Player* _player = m_session->GetPlayer();
- if (target == _player || target_guid == _player->GetGUID())
- {
- PSendSysMessage(LANG_CANT_TELEPORT_SELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target)
- {
- std::string nameLink = playerLink(target_name);
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- if (target->IsBeingTeleported())
- {
- PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- Map* map = m_session->GetPlayer()->GetMap();
-
- if (map->IsBattlegroundOrArena())
- {
- // only allow if gm mode is on
- if (!_player->isGameMaster())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- // if both players are in different bgs
- else if (target->GetBattlegroundId() && m_session->GetPlayer()->GetBattlegroundId() != target->GetBattlegroundId())
- target->LeaveBattleground(false); // Note: should be changed so target gets no Deserter debuff
-
- // all's well, set bg id
- // when porting out from the bg, it will be reset to 0
- target->SetBattlegroundId(m_session->GetPlayer()->GetBattlegroundId(), m_session->GetPlayer()->GetBattlegroundTypeId());
- // remember current position as entry point for return at bg end teleportation
- if (!target->GetMap()->IsBattlegroundOrArena())
- target->SetBattlegroundEntryPoint();
- }
- else if (map->IsDungeon())
- {
- Map* cMap = target->GetMap();
-
- if (cMap->Instanceable() && cMap->GetInstanceId() != map->GetInstanceId())
- target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true);
-
- // we are in instance, and can summon only player in our group with us as lead
- if (!m_session->GetPlayer()->GetGroup() || !target->GetGroup() ||
- (target->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()) ||
- (m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()))
- // the last check is a bit excessive, but let it be, just in case
- {
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
- if (needReportToTarget(target))
- ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str());
-
- // stop flight if need
- if (target->isInFlight())
- {
- target->GetMotionMaster()->MovementExpired();
- target->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- target->SaveRecallPosition();
-
- // before GM
- float x, y, z;
- m_session->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
- target->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
- target->SetPhaseMask(m_session->GetPlayer()->GetPhaseMask(), true);
- }
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, target_guid))
- return false;
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), GetTrinityString(LANG_OFFLINE));
-
- // in point where GM stay
- Player::SavePositionInDB(m_session->GetPlayer()->GetMapId(),
- m_session->GetPlayer()->GetPositionX(),
- m_session->GetPlayer()->GetPositionY(),
- m_session->GetPlayer()->GetPositionZ(),
- m_session->GetPlayer()->GetOrientation(),
- m_session->GetPlayer()->GetZoneId(),
- target_guid);
- }
-
- return true;
-}
-
-//Teleport to Player
-bool ChatHandler::HandleAppearCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- Player* _player = m_session->GetPlayer();
- if (target == _player || target_guid == _player->GetGUID())
- {
- SendSysMessage(LANG_CANT_TELEPORT_SELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target)
- {
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- std::string chrNameLink = playerLink(target_name);
-
- Map* cMap = target->GetMap();
- if (cMap->IsBattlegroundOrArena())
- {
- // only allow if gm mode is on
- if (!_player->isGameMaster())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- // if both players are in different bgs
- else if (_player->GetBattlegroundId() && _player->GetBattlegroundId() != target->GetBattlegroundId())
- _player->LeaveBattleground(false); // Note: should be changed so _player gets no Deserter debuff
-
- // all's well, set bg id
- // when porting out from the bg, it will be reset to 0
- _player->SetBattlegroundId(target->GetBattlegroundId(), target->GetBattlegroundTypeId());
- // remember current position as entry point for return at bg end teleportation
- if (!_player->GetMap()->IsBattlegroundOrArena())
- _player->SetBattlegroundEntryPoint();
- }
- else if (cMap->IsDungeon())
- {
- // we have to go to instance, and can go to player only if:
- // 1) we are in his group (either as leader or as member)
- // 2) we are not bound to any group and have GM mode on
- if (_player->GetGroup())
- {
- // we are in group, we can go only if we are in the player group
- if (_player->GetGroup() != target->GetGroup())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
- else
- {
- // we are not in group, let's verify our GM mode
- if (!_player->isGameMaster())
- {
- PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- // if the player or the player's group is bound to another instance
- // the player will not be bound to another one
- InstancePlayerBind* pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(cMap->IsRaid()));
- if (!pBind)
- {
- Group* group = _player->GetGroup();
- // if no bind exists, create a solo bind
- InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
- if (!gBind)
- if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId()))
- _player->BindToInstance(save, !save->CanReset());
- }
-
- if (cMap->IsRaid())
- _player->SetRaidDifficulty(target->GetRaidDifficulty());
- else
- _player->SetDungeonDifficulty(target->GetDungeonDifficulty());
- }
-
- PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
-
- // stop flight if need
- if (_player->isInFlight())
- {
- _player->GetMotionMaster()->MovementExpired();
- _player->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- _player->SaveRecallPosition();
-
- // to point to see at target with same orientation
- float x, y, z;
- target->GetContactPoint(_player, x, y, z);
-
- _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
- _player->SetPhaseMask(target->GetPhaseMask(), true);
- }
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, target_guid))
- return false;
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
-
- // to point where player stay (if loaded)
- float x, y, z, o;
- uint32 map;
- bool in_flight;
- if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, target_guid))
- return false;
-
- // stop flight if need
- if (_player->isInFlight())
- {
- _player->GetMotionMaster()->MovementExpired();
- _player->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- _player->SaveRecallPosition();
-
- _player->TeleportTo(map, x, y, z, _player->GetOrientation());
- }
-
- return true;
-}
-
-// Teleport player to last position
-bool ChatHandler::HandleRecallCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- if (target->IsBeingTeleported())
- {
- PSendSysMessage(LANG_IS_TELEPORTED, GetNameLink(target).c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- // stop flight if need
- if (target->isInFlight())
- {
- target->GetMotionMaster()->MovementExpired();
- target->CleanupAfterTaxiFlight();
- }
-
- target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO);
- return true;
-}
-
-//Enable On\OFF all taxi paths
-bool ChatHandler::HandleTaxiCheatCommand(const char* args)
-{
- if (!*args)
- {
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string argstr = (char*)args;
-
- Player* chr = getSelectedPlayer();
-
- if (!chr)
- chr = m_session->GetPlayer();
- else if (HasLowerSecurity(chr, 0)) // check online security
- return false;
-
- if (argstr == "on")
- {
- chr->SetTaxiCheater(true);
- PSendSysMessage(LANG_YOU_GIVE_TAXIS, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, GetNameLink().c_str());
- return true;
- }
-
- if (argstr == "off")
- {
- chr->SetTaxiCheater(false);
- PSendSysMessage(LANG_YOU_REMOVE_TAXIS, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, GetNameLink().c_str());
-
- return true;
- }
-
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
-}
-
-//Enable\Dissable accept whispers (for GM)
-bool ChatHandler::HandleWhispersCommand(const char* args)
-{
- if (!*args)
- {
- PSendSysMessage(LANG_COMMAND_WHISPERACCEPTING, m_session->GetPlayer()->isAcceptWhispers() ? GetTrinityString(LANG_ON) : GetTrinityString(LANG_OFF));
- return true;
- }
-
- std::string argstr = (char*)args;
- // whisper on
- if (argstr == "on")
- {
- m_session->GetPlayer()->SetAcceptWhispers(true);
- SendSysMessage(LANG_COMMAND_WHISPERON);
- return true;
- }
-
- // whisper off
- if (argstr == "off")
- {
- // Remove all players from the Gamemaster's whisper whitelist
- m_session->GetPlayer()->ClearWhisperWhiteList();
- m_session->GetPlayer()->SetAcceptWhispers(false);
- SendSysMessage(LANG_COMMAND_WHISPEROFF);
- return true;
- }
-
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
-}
-
-//Save all players in the world
-bool ChatHandler::HandleSaveAllCommand(const char* /*args*/)
-{
- sObjectAccessor->SaveAllPlayers();
- SendSysMessage(LANG_PLAYERS_SAVED);
- return true;
-}
-
-//Send mail by command
-bool ChatHandler::HandleSendMailCommand(const char* args)
-{
- // format: name "subject text" "mail text"
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- char* tail1 = strtok(NULL, "");
- if (!tail1)
- return false;
-
- char* msgSubject = extractQuotedArg(tail1);
- if (!msgSubject)
- return false;
-
- char* tail2 = strtok(NULL, "");
- if (!tail2)
- return false;
-
- char* msgText = extractQuotedArg(tail2);
- if (!msgText)
- return false;
-
- // msgSubject, msgText isn't NUL after prev. check
- std::string subject = msgSubject;
- std::string text = msgText;
-
- // from console show not existed sender
- MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
-
- //- TODO: Fix poor design
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
- MailDraft(subject, text)
- .SendMailTo(trans, MailReceiver(target, GUID_LOPART(target_guid)), sender);
-
- CharacterDatabase.CommitTransaction(trans);
-
- std::string nameLink = playerLink(target_name);
- PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
- return true;
-}
-
-//Summon group of player
-bool ChatHandler::HandleGroupSummonCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- Group* grp = target->GetGroup();
-
- std::string nameLink = GetNameLink(target);
-
- if (!grp)
- {
- PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- Map* gmMap = m_session->GetPlayer()->GetMap();
- bool to_instance = gmMap->Instanceable();
-
- // we are in instance, and can summon only player in our group with us as lead
- if (to_instance && (
- !m_session->GetPlayer()->GetGroup() || (grp->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()) ||
- (m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID())))
- // the last check is a bit excessive, but let it be, just in case
- {
- SendSysMessage(LANG_CANNOT_SUMMON_TO_INST);
- SetSentErrorMessage(true);
- return false;
- }
-
- for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
- {
- Player* player = itr->getSource();
-
- if (!player || player == m_session->GetPlayer() || !player->GetSession())
- continue;
-
- // check online security
- if (HasLowerSecurity(player, 0))
- return false;
-
- std::string plNameLink = GetNameLink(player);
-
- if (player->IsBeingTeleported() == true)
- {
- PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- if (to_instance)
- {
- Map* plMap = player->GetMap();
-
- if (plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId())
- {
- // cannot summon from instance to instance
- PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
- if (needReportToTarget(player))
- ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
-
- // stop flight if need
- if (player->isInFlight())
- {
- player->GetMotionMaster()->MovementExpired();
- player->CleanupAfterTaxiFlight();
- }
- // save only in non-flight case
- else
- player->SaveRecallPosition();
-
- // before GM
- float x, y, z;
- m_session->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize());
- player->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation());
- }
-
- return true;
-}
diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp
deleted file mode 100755
index 752ba6bc3ca..00000000000
--- a/src/server/game/Chat/Commands/Level2.cpp
+++ /dev/null
@@ -1,681 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "DBCStores.h"
-#include "ObjectMgr.h"
-#include "Player.h"
-#include "Item.h"
-#include "GameObject.h"
-#include "Opcodes.h"
-#include "Chat.h"
-#include "MapManager.h"
-#include "Language.h"
-#include "World.h"
-#include "GameEventMgr.h"
-#include "SpellMgr.h"
-#include "PoolMgr.h"
-#include "AccountMgr.h"
-#include "WaypointManager.h"
-#include "Util.h"
-#include <cctype>
-#include <iostream>
-#include <fstream>
-#include <map>
-#include "OutdoorPvPMgr.h"
-#include "Transport.h"
-#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
-#include "CreatureGroups.h"
-#include "ace/INET_Addr.h"
-
-//mute player for some times
-bool ChatHandler::HandleMuteCommand(const char* args)
-{
- char* nameStr;
- char* delayStr;
- extractOptFirstArg((char*)args, &nameStr, &delayStr);
- if (!delayStr)
- return false;
-
- char *mutereason = strtok(NULL, "\r");
- std::string mutereasonstr = "No reason";
- if (mutereason != NULL)
- mutereasonstr = mutereason;
-
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
- return false;
-
- uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
-
- // find only player from same account if any
- if (!target)
- if (WorldSession* session = sWorld->FindSession(accountId))
- target = session->GetPlayer();
-
- uint32 notspeaktime = (uint32) atoi(delayStr);
-
- // must have strong lesser security level
- if (HasLowerSecurity (target, target_guid, true))
- return false;
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
-
- if (target)
- {
- // Target is online, mute will be in effect right away.
- int64 muteTime = time(NULL) + notspeaktime * MINUTE;
- target->GetSession()->m_muteTime = muteTime;
-
- stmt->setInt64(0, muteTime);
-
- ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str());
- }
- else
- {
- // Target is offline, mute will be in effect starting from the next login.
- int32 muteTime = -int32(notspeaktime * MINUTE);
-
- stmt->setInt64(0, muteTime);
- }
-
- stmt->setUInt32(1, accountId);
-
- LoginDatabase.Execute(stmt);
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notspeaktime, mutereasonstr.c_str());
-
- return true;
-}
-
-//unmute player
-bool ChatHandler::HandleUnmuteCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
-
- // find only player from same account if any
- if (!target)
- if (WorldSession* session = sWorld->FindSession(accountId))
- target = session->GetPlayer();
-
- // must have strong lesser security level
- if (HasLowerSecurity (target, target_guid, true))
- return false;
-
- if (target)
- {
- if (target->CanSpeak())
- {
- SendSysMessage(LANG_CHAT_ALREADY_ENABLED);
- SetSentErrorMessage(true);
- return false;
- }
-
- target->GetSession()->m_muteTime = 0;
- }
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
-
- stmt->setInt64(0, 0);
- stmt->setUInt32(1, accountId);
-
- LoginDatabase.Execute(stmt);
-
- if (target)
- ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str());
- return true;
-}
-
-bool ChatHandler::HandleGUIDCommand(const char* /*args*/)
-{
- uint64 guid = m_session->GetPlayer()->GetSelection();
-
- if (guid == 0)
- {
- SendSysMessage(LANG_NO_SELECTION);
- SetSentErrorMessage(true);
- return false;
- }
-
- PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
- return true;
-}
-
- //move item to other slot
-bool ChatHandler::HandleItemMoveCommand(const char* args)
-{
- if (!*args)
- return false;
-
- char* pParam1 = strtok((char*)args, " ");
- if (!pParam1)
- return false;
-
- char* pParam2 = strtok(NULL, " ");
- if (!pParam2)
- return false;
-
- uint8 srcslot = (uint8)atoi(pParam1);
- uint8 dstslot = (uint8)atoi(pParam2);
-
- if (srcslot == dstslot)
- return true;
-
- if (!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcslot, true))
- return false;
-
- if (!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, dstslot, false))
- return false;
-
- uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcslot);
- uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstslot);
-
- m_session->GetPlayer()->SwapItem(src, dst);
-
- return true;
-}
-
-//kick player
-bool ChatHandler::HandleKickPlayerCommand(const char *args)
-{
- Player* target = NULL;
- std::string playerName;
- if (!extractPlayerTarget((char*)args, &target, NULL, &playerName))
- return false;
-
- if (m_session && target == m_session->GetPlayer())
- {
- SendSysMessage(LANG_COMMAND_KICKSELF);
- SetSentErrorMessage(true);
- return false;
- }
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
- sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
- else
- PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
-
- target->GetSession()->KickPlayer();
- return true;
-}
-
-//show info of player
-bool ChatHandler::HandlePInfoCommand(const char* args)
-{
- Player* target;
- uint64 target_guid;
- std::string target_name;
-
- uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
-
- if (sObjectMgr->GetPlayerNameByGUID(parseGUID, target_name))
- {
- target = sObjectMgr->GetPlayerByLowGUID(parseGUID);
- target_guid = parseGUID;
- }
- else if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
- return false;
-
- uint32 accId = 0;
- uint64 money = 0;
- uint32 total_player_time = 0;
- uint8 level = 0;
- uint32 latency = 0;
- uint8 race;
- uint8 Class;
- int64 muteTime = 0;
- int64 banTime = -1;
- uint32 mapId;
- uint32 areaId;
- uint32 phase = 0;
-
- // get additional information from Player object
- if (target)
- {
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- accId = target->GetSession()->GetAccountId();
- money = target->GetMoney();
- total_player_time = target->GetTotalPlayedTime();
- level = target->getLevel();
- latency = target->GetSession()->GetLatency();
- race = target->getRace();
- Class = target->getClass();
- muteTime = target->GetSession()->m_muteTime;
- mapId = target->GetMapId();
- areaId = target->GetAreaId();
- phase = target->GetPhaseMask();
- }
- // get additional information from DB
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, target_guid))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO);
- stmt->setUInt32(0, GUID_LOPART(target_guid));
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (!result)
- return false;
-
- Field* fields = result->Fetch();
- total_player_time = fields[0].GetUInt32();
- level = fields[1].GetUInt8();
- money = fields[2].GetUInt64();
- accId = fields[3].GetUInt32();
- race = fields[4].GetUInt8();
- Class = fields[5].GetUInt8();
- mapId = fields[6].GetUInt16();
- areaId = fields[7].GetUInt16();
- }
-
- std::string username = GetTrinityString(LANG_ERROR);
- std::string email = GetTrinityString(LANG_ERROR);
- std::string last_ip = GetTrinityString(LANG_ERROR);
- uint32 security = 0;
- std::string last_login = GetTrinityString(LANG_ERROR);
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
- stmt->setInt32(0, int32(realmID));
- stmt->setUInt32(1, accId);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
-
- if (result)
- {
- Field* fields = result->Fetch();
- username = fields[0].GetString();
- security = fields[1].GetUInt8();
- email = fields[2].GetString();
- muteTime = fields[5].GetUInt64();
-
- if (email.empty())
- email = "-";
-
- if (!m_session || m_session->GetSecurity() >= AccountTypes(security))
- {
- last_ip = fields[3].GetString();
- last_login = fields[4].GetString();
-
- uint32 ip = inet_addr(last_ip.c_str());
-#if TRINITY_ENDIAN == BIGENDIAN
- EndianConvertReverse(ip);
-#endif
-
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY);
-
- stmt->setUInt32(0, ip);
-
- PreparedQueryResult result2 = WorldDatabase.Query(stmt);
-
- if (result2)
- {
- Field* fields2 = result2->Fetch();
- last_ip.append(" (");
- last_ip.append(fields2[0].GetString());
- last_ip.append(")");
- }
- }
- else
- {
- last_ip = "-";
- last_login = "-";
- }
- }
-
- std::string nameLink = playerLink(target_name);
-
- PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(target_guid), username.c_str(), accId, email.c_str(), security, last_ip.c_str(), last_login.c_str(), latency);
-
- std::string bannedby = "unknown";
- std::string banreason = "";
-
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
- stmt->setUInt32(0, accId);
- PreparedQueryResult result2 = LoginDatabase.Query(stmt);
- if (!result2)
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS);
- stmt->setUInt32(0, GUID_LOPART(target_guid));
- result2 = CharacterDatabase.Query(stmt);
- }
-
- if (result2)
- {
- Field* fields = result2->Fetch();
- banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32());
- bannedby = fields[2].GetString();
- banreason = fields[3].GetString();
- }
-
- if (muteTime > 0)
- PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str());
-
- if (banTime >= 0)
- PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str());
-
- std::string race_s, Class_s;
- switch (race)
- {
- case RACE_HUMAN: race_s = "Human"; break;
- case RACE_ORC: race_s = "Orc"; break;
- case RACE_DWARF: race_s = "Dwarf"; break;
- case RACE_NIGHTELF: race_s = "Night Elf"; break;
- case RACE_UNDEAD_PLAYER: race_s = "Undead"; break;
- case RACE_TAUREN: race_s = "Tauren"; break;
- case RACE_GNOME: race_s = "Gnome"; break;
- case RACE_TROLL: race_s = "Troll"; break;
- case RACE_BLOODELF: race_s = "Blood Elf"; break;
- case RACE_DRAENEI: race_s = "Draenei"; break;
- case RACE_GOBLIN: race_s = "Goblin"; break;
- case RACE_WORGEN: race_s = "Worgen"; break;
- }
- switch (Class)
- {
- case CLASS_WARRIOR: Class_s = "Warrior"; break;
- case CLASS_PALADIN: Class_s = "Paladin"; break;
- case CLASS_HUNTER: Class_s = "Hunter"; break;
- case CLASS_ROGUE: Class_s = "Rogue"; break;
- case CLASS_PRIEST: Class_s = "Priest"; break;
- case CLASS_DEATH_KNIGHT: Class_s = "Death Knight"; break;
- case CLASS_SHAMAN: Class_s = "Shaman"; break;
- case CLASS_MAGE: Class_s = "Mage"; break;
- case CLASS_WARLOCK: Class_s = "Warlock"; break;
- case CLASS_DRUID: Class_s = "Druid"; break;
- }
-
- std::string timeStr = secsToTimeString(total_player_time, true, true);
- uint64 gold = money / GOLD;
- uint64 silv = (money % GOLD) / SILVER;
- uint64 copp = (money % GOLD) % SILVER;
- PSendSysMessage(LANG_PINFO_LEVEL, race_s.c_str(), Class_s.c_str(), timeStr.c_str(), level, gold, silv, copp);
-
- // Add map, zone, subzone and phase to output
- int locale = GetSessionDbcLocale();
- std::string areaName = "<unknown>";
- std::string zoneName = "";
-
- MapEntry const* map = sMapStore.LookupEntry(mapId);
-
- AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
- if (area)
- {
- areaName = area->area_name[locale];
-
- AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
-
- if (zone)
- zoneName = zone->area_name[locale];
- }
-
- if (target)
- {
- if (!zoneName.empty())
- PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase);
- else
- PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "<unknown>", phase);
- }
- else
- PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str());
-
- return true;
-}
-
-bool ChatHandler::HandleCombatStopCommand(const char* args)
-{
- Player* target = NULL;
-
- if (args && strlen(args) > 0)
- {
- target = sObjectAccessor->FindPlayerByName(args);
- if (!target)
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- if (!target)
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- target->CombatStop();
- target->getHostileRefManager().deleteReferences();
- return true;
-}
-
-
-bool ChatHandler::HandleRepairitemsCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- // Repair items
- target->DurabilityRepairAll(false, 0, false);
-
- PSendSysMessage(LANG_YOU_REPAIR_ITEMS, GetNameLink(target).c_str());
- if (needReportToTarget(target))
- ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetNameLink().c_str());
- return true;
-}
-
-bool ChatHandler::HandleWaterwalkCommand(const char* args)
-{
- if (!*args)
- return false;
-
- Player* player = getSelectedPlayer();
-
- if (!player)
- {
- PSendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- // check online security
- if (HasLowerSecurity(player, 0))
- return false;
-
- if (strncmp(args, "on", 3) == 0)
- player->SendMovementSetWaterWalking(true); // ON
- else if (strncmp(args, "off", 4) == 0)
- player->SendMovementSetWaterWalking(false); // OFF
- else
- {
- SendSysMessage(LANG_USE_BOL);
- return false;
- }
-
- PSendSysMessage(LANG_YOU_SET_WATERWALK, args, GetNameLink(player).c_str());
- if (needReportToTarget(player))
- ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetNameLink().c_str());
- return true;
-}
-
-bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
- Creature* creatureTarget = getSelectedCreature();
-
- if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
- {
- PSendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry());
- // Creatures with family 0 crashes the server
- if (cInfo->family == 0)
- {
- PSendSysMessage("This creature cannot be tamed. (family id: 0).");
- SetSentErrorMessage(true);
- return false;
- }
-
- if (player->GetPetGUID())
- {
- PSendSysMessage("You already have a pet");
- SetSentErrorMessage(true);
- return false;
- }
-
- // Everything looks OK, create new pet
- Pet* pet = new Pet(player, HUNTER_PET);
- if (!pet->CreateBaseAtCreature(creatureTarget))
- {
- delete pet;
- PSendSysMessage("Error 1");
- return false;
- }
-
- creatureTarget->setDeathState(JUST_DIED);
- creatureTarget->RemoveCorpse();
- creatureTarget->SetHealth(0); // just for nice GM-mode view
-
- pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID());
- pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction());
-
- if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
- {
- sLog->outError("InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
- PSendSysMessage("Error 2");
- delete pet;
- return false;
- }
-
- // prepare visual effect for levelup
- pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
-
- pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
- // this enables pet details window (Shift+P)
- pet->InitPetCreateSpells();
- pet->SetFullHealth();
-
- pet->GetMap()->AddToMap(pet->ToCreature());
-
- // visual effect for levelup
- pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel());
-
- player->SetMinion(pet, true);
- pet->SavePetToDB(PET_SAVE_AS_CURRENT);
- player->PetSpellInitialize();
-
- return true;
-}
-
-bool ChatHandler::HandlePetLearnCommand(const char* args)
-{
- if (!*args)
- return false;
-
- Player* player = m_session->GetPlayer();
- Pet* pet = player->GetPet();
-
- if (!pet)
- {
- PSendSysMessage("You have no pet");
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 spellId = extractSpellIdFromLink((char*)args);
-
- if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
- return false;
-
- // Check if pet already has it
- if (pet->HasSpell(spellId))
- {
- PSendSysMessage("Pet already has spell: %u", spellId);
- SetSentErrorMessage(true);
- return false;
- }
-
- // Check if spell is valid
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
- if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
- SetSentErrorMessage(true);
- return false;
- }
-
- pet->learnSpell(spellId);
-
- PSendSysMessage("Pet has learned spell %u", spellId);
- return true;
-}
-
-bool ChatHandler::HandlePetUnlearnCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* player = m_session->GetPlayer();
- Pet* pet = player->GetPet();
-
- if (!pet)
- {
- PSendSysMessage("You have no pet");
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 spellId = extractSpellIdFromLink((char*)args);
-
- if (pet->HasSpell(spellId))
- pet->removeSpell(spellId, false);
- else
- PSendSysMessage("Pet doesn't have that spell");
-
- return true;
-}
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
deleted file mode 100755
index 355789b565e..00000000000
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ /dev/null
@@ -1,1764 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Common.h"
-#include "DatabaseEnv.h"
-#include "WorldPacket.h"
-#include "WorldSession.h"
-#include "World.h"
-#include "ObjectMgr.h"
-#include "ArenaTeamMgr.h"
-#include "GuildMgr.h"
-#include "AuctionHouseMgr.h"
-#include "AccountMgr.h"
-#include "PlayerDump.h"
-#include "SpellMgr.h"
-#include "Player.h"
-#include "Opcodes.h"
-#include "GameObject.h"
-#include "Chat.h"
-#include "Log.h"
-#include "Guild.h"
-#include "ObjectAccessor.h"
-#include "MapManager.h"
-#include "Language.h"
-#include "GridNotifiersImpl.h"
-#include "CellImpl.h"
-#include "Weather.h"
-#include "PointMovementGenerator.h"
-#include "TargetedMovementGenerator.h"
-#include "SkillDiscovery.h"
-#include "SkillExtraItems.h"
-#include "SystemConfig.h"
-#include "Config.h"
-#include "Util.h"
-#include "ItemEnchantmentMgr.h"
-#include "BattlegroundMgr.h"
-#include "InstanceSaveMgr.h"
-#include "InstanceScript.h"
-#include "CreatureEventAIMgr.h"
-#include "SpellAuraEffects.h"
-#include "DBCEnums.h"
-#include "ConditionMgr.h"
-#include "DisableMgr.h"
-#include "Transport.h"
-#include "WeatherMgr.h"
-#include "ScriptMgr.h"
-#include "CreatureTextMgr.h"
-#include "SmartAI.h"
-#include "Group.h"
-#include "ChannelMgr.h"
-#include <stdlib.h>
-
-bool ChatHandler::HandleMaxSkillCommand(const char* /*args*/)
-{
- Player* SelectedPlayer = getSelectedPlayer();
- if (!SelectedPlayer)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- // each skills that have max skill value dependent from level seted to current level max skill value
- SelectedPlayer->UpdateSkillsToMaxSkillsForLevel();
- return true;
-}
-
-bool ChatHandler::HandleSetSkillCommand(const char *args)
-{
- // number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r
- char* skill_p = extractKeyFromLink((char*)args, "Hskill");
- if (!skill_p)
- return false;
-
- char *level_p = strtok (NULL, " ");
- if (!level_p)
- return false;
-
- char *max_p = strtok (NULL, " ");
-
- int32 skill = atoi(skill_p);
- if (skill <= 0)
- {
- PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
- SetSentErrorMessage(true);
- return false;
- }
-
- int32 level = atol(level_p);
-
- Player* target = getSelectedPlayer();
- if (!target)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- SkillLineEntry const* sl = sSkillLineStore.LookupEntry(skill);
- if (!sl)
- {
- PSendSysMessage(LANG_INVALID_SKILL_ID, skill);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string tNameLink = GetNameLink(target);
-
- if (!target->GetSkillValue(skill))
- {
- PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, sl->name[GetSessionDbcLocale()]);
- SetSentErrorMessage(true);
- return false;
- }
-
- int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill);
-
- if (level <= 0 || level > max || max <= 0)
- return false;
-
- target->SetSkill(skill, target->GetSkillStep(skill), level, max);
- PSendSysMessage(LANG_SET_SKILL, skill, sl->name[GetSessionDbcLocale()], tNameLink.c_str(), level, max);
-
- return true;
-}
-
-bool ChatHandler::HandleUnLearnCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
- uint32 spell_id = extractSpellIdFromLink((char*)args);
- if (!spell_id)
- return false;
-
- char const* allStr = strtok(NULL, " ");
- bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false;
-
- Player* target = getSelectedPlayer();
- if (!target)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (allRanks)
- spell_id = sSpellMgr->GetFirstSpellInChain (spell_id);
-
- if (target->HasSpell(spell_id))
- target->removeSpell(spell_id, false, !allRanks);
- else
- SendSysMessage(LANG_FORGET_SPELL);
-
- if (GetTalentSpellCost(spell_id))
- target->SendTalentsInfoData(false);
-
- return true;
-}
-
-bool ChatHandler::HandleCooldownCommand(const char *args)
-{
- Player* target = getSelectedPlayer();
- if (!target)
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string tNameLink = GetNameLink(target);
-
- if (!*args)
- {
- target->RemoveAllSpellCooldown();
- PSendSysMessage(LANG_REMOVEALL_COOLDOWN, tNameLink.c_str());
- }
- else
- {
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell_id = extractSpellIdFromLink((char*)args);
- if (!spell_id)
- return false;
-
- if (!sSpellMgr->GetSpellInfo(spell_id))
- {
- PSendSysMessage(LANG_UNKNOWN_SPELL, target == m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- target->RemoveSpellCooldown(spell_id, true);
- PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target == m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str());
- }
- return true;
-}
-
-bool ChatHandler::HandleAddItemCommand(const char *args)
-{
- if (!*args)
- return false;
-
- uint32 itemId = 0;
-
- if (args[0] == '[') // [name] manual form
- {
- char* citemName = strtok((char*)args, "]");
-
- if (citemName && citemName[0])
- {
- std::string itemName = citemName+1;
- WorldDatabase.EscapeString(itemName);
-
- PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME);
- stmt->setString(0, itemName);
- PreparedQueryResult result = WorldDatabase.Query(stmt);
-
- if (!result)
- {
- PSendSysMessage(LANG_COMMAND_COULDNOTFIND, citemName+1);
- SetSentErrorMessage(true);
- return false;
- }
- itemId = result->Fetch()->GetUInt16();
- }
- else
- return false;
- }
- else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r
- {
- char* cId = extractKeyFromLink((char*)args, "Hitem");
- if (!cId)
- return false;
- itemId = atol(cId);
- }
-
- char* ccount = strtok(NULL, " ");
-
- int32 count = 1;
-
- if (ccount)
- count = strtol(ccount, NULL, 10);
-
- if (count == 0)
- count = 1;
-
- Player* player = m_session->GetPlayer();
- Player* plTarget = getSelectedPlayer();
- if (!plTarget)
- plTarget = player;
-
- sLog->outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
-
- ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemId);
- if (!pProto)
- {
- PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId);
- SetSentErrorMessage(true);
- return false;
- }
-
- //Subtract
- if (count < 0)
- {
- plTarget->DestroyItemCount(itemId, -count, true, false);
- PSendSysMessage(LANG_REMOVEITEM, itemId, -count, GetNameLink(plTarget).c_str());
- return true;
- }
-
- //Adding items
- uint32 noSpaceForCount = 0;
-
- // check space and find places
- ItemPosCountVec dest;
- InventoryResult msg = plTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount);
- if (msg != EQUIP_ERR_OK) // convert to possible store amount
- count -= noSpaceForCount;
-
- if (count == 0 || dest.empty()) // can't add any
- {
- PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
- SetSentErrorMessage(true);
- return false;
- }
-
- Item* item = plTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
-
- // remove binding (let GM give it to another player later)
- if (player == plTarget)
- for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
- if (Item* item1 = player->GetItemByPos(itr->pos))
- item1->SetBinding(false);
-
- if (count > 0 && item)
- {
- player->SendNewItem(item, count, false, true);
- if (player != plTarget)
- plTarget->SendNewItem(item, count, true, false);
- }
-
- if (noSpaceForCount > 0)
- PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount);
-
- return true;
-}
-
-bool ChatHandler::HandleAddItemSetCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* cId = extractKeyFromLink((char*)args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r
- if (!cId)
- return false;
-
- uint32 itemsetId = atol(cId);
-
- // prevent generation all items with itemset field value '0'
- if (itemsetId == 0)
- {
- PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemsetId);
- SetSentErrorMessage(true);
- return false;
- }
-
- Player* player = m_session->GetPlayer();
- Player* playerTarget = getSelectedPlayer();
- if (!playerTarget)
- playerTarget = player;
-
- sLog->outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId);
-
- bool found = false;
- ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore();
- for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr)
- {
- if (itr->second.ItemSet == itemsetId)
- {
- found = true;
- ItemPosCountVec dest;
- InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itr->second.ItemId, 1);
- if (msg == EQUIP_ERR_OK)
- {
- Item* item = playerTarget->StoreNewItem(dest, itr->second.ItemId, true);
-
- // remove binding (let GM give it to another player later)
- if (player == playerTarget)
- item->SetBinding(false);
-
- player->SendNewItem(item, 1, false, true);
- if (player != playerTarget)
- playerTarget->SendNewItem(item, 1, true, false);
- }
- else
- {
- player->SendEquipError(msg, NULL, NULL, itr->second.ItemId);
- PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itr->second.ItemId, 1);
- }
- }
- }
-
- if (!found)
- {
- PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemsetId);
-
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandleGetDistanceCommand(const char *args)
-{
- WorldObject* obj = NULL;
-
- if (*args)
- {
- uint64 guid = extractGuidFromLink((char*)args);
- if (guid)
- obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
-
- if (!obj)
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
- }
- else
- {
- obj = getSelectedUnit();
-
- if (!obj)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- PSendSysMessage(LANG_DISTANCE, m_session->GetPlayer()->GetDistance(obj), m_session->GetPlayer()->GetDistance2d(obj), m_session->GetPlayer()->GetExactDist(obj), m_session->GetPlayer()->GetExactDist2d(obj));
- return true;
-}
-
-bool ChatHandler::HandleDieCommand(const char* /*args*/)
-{
- Unit* target = getSelectedUnit();
-
- if (!target || !m_session->GetPlayer()->GetSelection())
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if (HasLowerSecurity((Player*)target, 0, false))
- return false;
- }
-
- if (target->isAlive())
- {
- if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE))
- m_session->GetPlayer()->Kill(target);
- else
- m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleDamageCommand(const char * args)
-{
- if (!*args)
- return false;
-
- Unit* target = getSelectedUnit();
-
- if (!target || !m_session->GetPlayer()->GetSelection())
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if (HasLowerSecurity((Player*)target, 0, false))
- return false;
- }
-
- if (!target->isAlive())
- return true;
-
- char* damageStr = strtok((char*)args, " ");
- if (!damageStr)
- return false;
-
- int32 damage_int = atoi((char*)damageStr);
- if (damage_int <= 0)
- return true;
-
- uint32 damage = damage_int;
-
- char* schoolStr = strtok((char*)NULL, " ");
-
- // flat melee damage without resistence/etc reduction
- if (!schoolStr)
- {
- m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- if (target != m_session->GetPlayer())
- m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0);
- return true;
- }
-
- uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL;
- if (school >= MAX_SPELL_SCHOOL)
- return false;
-
- SpellSchoolMask schoolmask = SpellSchoolMask(1 << school);
-
- if (Unit::IsDamageReducedByArmor(schoolmask))
- damage = m_session->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK);
-
- char* spellStr = strtok((char*)NULL, " ");
-
- // melee damage by specific school
- if (!spellStr)
- {
- uint32 absorb = 0;
- uint32 resist = 0;
-
- m_session->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
-
- if (damage <= absorb + resist)
- return true;
-
- damage -= absorb + resist;
-
- m_session->GetPlayer()->DealDamageMods(target, damage, &absorb);
- m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
- m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
- return true;
- }
-
- // non-melee damage
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spellid = extractSpellIdFromLink((char*)args);
- if (!spellid || !sSpellMgr->GetSpellInfo(spellid))
- return false;
-
- m_session->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage);
- return true;
-}
-
-bool ChatHandler::HandleReviveCommand(const char *args)
-{
- Player* target;
- uint64 target_guid;
- if (!extractPlayerTarget((char*)args, &target, &target_guid))
- return false;
-
- if (target)
- {
- target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f);
- target->SpawnCorpseBones();
- target->SaveToDB();
- }
- else
- // will resurrected at login without corpse
- sObjectAccessor->ConvertCorpseForPlayer(target_guid);
-
- return true;
-}
-
-bool ChatHandler::HandleAuraCommand(const char *args)
-{
- Unit* target = getSelectedUnit();
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spellID = extractSpellIdFromLink((char*)args);
-
- if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID))
- Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target);
-
- return true;
-}
-
-bool ChatHandler::HandleUnAuraCommand(const char *args)
-{
- Unit* target = getSelectedUnit();
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- std::string argstr = args;
- if (argstr == "all")
- {
- target->RemoveAllAuras();
- return true;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spellID = extractSpellIdFromLink((char*)args);
- if (!spellID)
- return false;
-
- target->RemoveAurasDueToSpell(spellID);
-
- return true;
-}
-
-bool ChatHandler::HandleLinkGraveCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* px = strtok((char*)args, " ");
- if (!px)
- return false;
-
- uint32 g_id = (uint32)atoi(px);
-
- uint32 g_team;
-
- char* px2 = strtok(NULL, " ");
-
- if (!px2)
- g_team = 0;
- else if (strncmp(px2, "horde", 6) == 0)
- g_team = HORDE;
- else if (strncmp(px2, "alliance", 9) == 0)
- g_team = ALLIANCE;
- else
- return false;
-
- WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id);
-
- if (!graveyard)
- {
- PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, g_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- Player* player = m_session->GetPlayer();
-
- uint32 zoneId = player->GetZoneId();
-
- AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
- if (!areaEntry || areaEntry->zone !=0)
- {
- PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, g_id, zoneId);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (sObjectMgr->AddGraveYardLink(g_id, zoneId, g_team))
- PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id, zoneId);
- else
- PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id, zoneId);
-
- return true;
-}
-
-bool ChatHandler::HandleNearGraveCommand(const char *args)
-{
- uint32 g_team;
-
- size_t argslen = strlen(args);
-
- if (!*args)
- g_team = 0;
- else if (strncmp((char*)args, "horde", argslen) == 0)
- g_team = HORDE;
- else if (strncmp((char*)args, "alliance", argslen) == 0)
- g_team = ALLIANCE;
- else
- return false;
-
- Player* player = m_session->GetPlayer();
- uint32 zone_id = player->GetZoneId();
-
- WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard(
- player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), g_team);
-
- if (graveyard)
- {
- uint32 g_id = graveyard->ID;
-
- GraveYardData const* data = sObjectMgr->FindGraveYardData(g_id, zone_id);
- if (!data)
- {
- PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, g_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- g_team = data->team;
-
- std::string team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM);
-
- if (g_team == 0)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
- else if (g_team == HORDE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
- else if (g_team == ALLIANCE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
-
- PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id, team_name.c_str(), zone_id);
- }
- else
- {
- std::string team_name;
-
- if (g_team == 0)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY);
- else if (g_team == HORDE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE);
- else if (g_team == ALLIANCE)
- team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE);
-
- if (g_team == ~uint32(0))
- PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id);
- else
- PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str());
- }
-
- return true;
-}
-
-bool ChatHandler::HandleExploreCheatCommand(const char *args)
-{
- if (!*args)
- return false;
-
- int flag = atoi((char*)args);
-
- Player* chr = getSelectedPlayer();
- if (chr == NULL)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (flag != 0)
- {
- PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, GetNameLink().c_str());
- }
- else
- {
- PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, GetNameLink(chr).c_str());
- if (needReportToTarget(chr))
- ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, GetNameLink().c_str());
- }
-
- for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
- {
- if (flag != 0)
- m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
- else
- m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0);
- }
-
- return true;
-}
-
-void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel)
-{
- if (player)
- {
- player->GiveLevel(newLevel);
- player->InitTalentForLevel();
- player->SetUInt32Value(PLAYER_XP, 0);
-
- if (needReportToTarget(player))
- {
- if (oldLevel == newLevel)
- ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, GetNameLink().c_str());
- else if (oldLevel < newLevel)
- ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP, GetNameLink().c_str(), newLevel);
- else // if (oldlevel > newlevel)
- ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, GetNameLink().c_str(), newLevel);
- }
- }
- else
- {
- // Update level and reset XP, everything else will be updated at login
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_LEVEL);
-
- stmt->setUInt8(0, uint8(newLevel));
- stmt->setUInt32(1, GUID_LOPART(playerGuid));
-
- CharacterDatabase.Execute(stmt);
- }
-}
-
-bool ChatHandler::HandleLevelUpCommand(const char *args)
-{
- char* nameStr;
- char* levelStr;
- extractOptFirstArg((char*)args, &nameStr, &levelStr);
-
- // exception opt second arg: .character level $name
- if (levelStr && isalpha(levelStr[0]))
- {
- nameStr = levelStr;
- levelStr = NULL; // current level will used
- }
-
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
- return false;
-
- int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid);
- int32 addlevel = levelStr ? atoi(levelStr) : 1;
- int32 newlevel = oldlevel + addlevel;
-
- if (newlevel < 1)
- newlevel = 1;
-
- if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level
- newlevel = STRONG_MAX_LEVEL;
-
- HandleCharacterLevel(target, target_guid, oldlevel, newlevel);
-
- if (!m_session || m_session->GetPlayer() != target) // including chr == NULL
- {
- std::string nameLink = playerLink(target_name);
- PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
- }
-
- return true;
-}
-
-bool ChatHandler::HandleShowAreaCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* chr = getSelectedPlayer();
- if (chr == NULL)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- int area = GetAreaFlagByAreaID(atoi((char*)args));
- int offset = area / 32;
- uint32 val = (uint32)(1 << (area % 32));
-
- if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
- {
- SendSysMessage(LANG_BAD_VALUE);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 currFields = chr->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
- chr->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields | val));
-
- SendSysMessage(LANG_EXPLORE_AREA);
- return true;
-}
-
-bool ChatHandler::HandleHideAreaCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* chr = getSelectedPlayer();
- if (chr == NULL)
- {
- SendSysMessage(LANG_NO_CHAR_SELECTED);
- SetSentErrorMessage(true);
- return false;
- }
-
- int area = GetAreaFlagByAreaID(atoi((char*)args));
- int offset = area / 32;
- uint32 val = (uint32)(1 << (area % 32));
-
- if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
- {
- SendSysMessage(LANG_BAD_VALUE);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 currFields = chr->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
- chr->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields ^ val));
-
- SendSysMessage(LANG_UNEXPLORE_AREA);
- return true;
-}
-
-bool ChatHandler::HandleBankCommand(const char* /*args*/)
-{
- m_session->SendShowBank(m_session->GetPlayer()->GetGUID());
-
- return true;
-}
-
-bool ChatHandler::HandleChangeWeather(const char *args)
-{
- if (!*args)
- return false;
-
- //Weather is OFF
- if (!sWorld->getBoolConfig(CONFIG_WEATHER))
- {
- SendSysMessage(LANG_WEATHER_DISABLED);
- SetSentErrorMessage(true);
- return false;
- }
-
- // *Change the weather of a cell
- char* px = strtok((char*)args, " ");
- char* py = strtok(NULL, " ");
-
- if (!px || !py)
- return false;
-
- uint32 type = (uint32)atoi(px); //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
- float grade = (float)atof(py); //0 to 1, sending -1 is instand good weather
-
- Player* player = m_session->GetPlayer();
- uint32 zoneid = player->GetZoneId();
-
- Weather* wth = WeatherMgr::FindWeather(zoneid);
-
- if (!wth)
- wth = WeatherMgr::AddWeather(zoneid);
- if (!wth)
- {
- SendSysMessage(LANG_NO_WEATHER);
- SetSentErrorMessage(true);
- return false;
- }
-
- wth->SetWeather(WeatherType(type), grade);
-
- return true;
-}
-
-bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- // accept only explicitly selected target (not implicitly self targeting case)
- Unit* target = getSelectedUnit();
- if (player->GetSelection() && target)
- {
- if (target->GetTypeId() != TYPEID_UNIT || target->isPet())
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (target->isDead())
- target->ToCreature()->Respawn();
- return true;
- }
-
- CellCoord p(Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()));
- Cell cell(p);
- cell.SetNoCreate();
-
- Trinity::RespawnDo u_do;
- Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(player, u_do);
-
- TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
- cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange());
-
- return true;
-}
-
-bool ChatHandler::HandlePDumpLoadCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char * file = strtok((char*)args, " ");
- if (!file)
- return false;
-
- char * account = strtok(NULL, " ");
- if (!account)
- return false;
-
- std::string account_name = account;
- if (!AccountMgr::normalizeString(account_name))
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 account_id = AccountMgr::GetId(account_name);
- if (!account_id)
- {
- account_id = atoi(account); // use original string
- if (!account_id)
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- if (!AccountMgr::GetName(account_id, account_name))
- {
- PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- char* guid_str = NULL;
- char* name_str = strtok(NULL, " ");
-
- std::string name;
- if (name_str)
- {
- name = name_str;
- // normalize the name if specified and check if it exists
- if (!normalizePlayerName(name))
- {
- PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (ObjectMgr::CheckPlayerName(name, true) != CHAR_NAME_SUCCESS)
- {
- PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
- SetSentErrorMessage(true);
- return false;
- }
-
- guid_str = strtok(NULL, " ");
- }
-
- uint32 guid = 0;
-
- if (guid_str)
- {
- guid = atoi(guid_str);
- if (!guid)
- {
- PSendSysMessage(LANG_INVALID_CHARACTER_GUID);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (sObjectMgr->GetPlayerAccountIdByGUID(guid))
- {
- PSendSysMessage(LANG_CHARACTER_GUID_IN_USE, guid);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- switch (PlayerDumpReader().LoadDump(file, account_id, name, guid))
- {
- case DUMP_SUCCESS:
- PSendSysMessage(LANG_COMMAND_IMPORT_SUCCESS);
- break;
- case DUMP_FILE_OPEN_ERROR:
- PSendSysMessage(LANG_FILE_OPEN_FAIL, file);
- SetSentErrorMessage(true);
- return false;
- case DUMP_FILE_BROKEN:
- PSendSysMessage(LANG_DUMP_BROKEN, file);
- SetSentErrorMessage(true);
- return false;
- case DUMP_TOO_MANY_CHARS:
- PSendSysMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, account_name.c_str(), account_id);
- SetSentErrorMessage(true);
- return false;
- default:
- PSendSysMessage(LANG_COMMAND_IMPORT_FAILED);
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandlePDumpWriteCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* file = strtok((char*)args, " ");
- char* p2 = strtok(NULL, " ");
-
- if (!file || !p2)
- return false;
-
- uint64 guid;
- // character name can't start from number
- if (isNumeric(p2))
- guid = MAKE_NEW_GUID(atoi(p2), 0, HIGHGUID_PLAYER);
- else
- {
- std::string name = extractPlayerNameFromLink(p2);
- if (name.empty())
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- guid = sObjectMgr->GetPlayerGUIDByName(name);
- }
-
- if (!sObjectMgr->GetPlayerAccountIdByGUID(guid))
- {
- PSendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- switch (PlayerDumpWriter().WriteDump(file, uint32(guid)))
- {
- case DUMP_SUCCESS:
- PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS);
- break;
- case DUMP_FILE_OPEN_ERROR:
- PSendSysMessage(LANG_FILE_OPEN_FAIL, file);
- SetSentErrorMessage(true);
- return false;
- case DUMP_CHARACTER_DELETED:
- PSendSysMessage(LANG_COMMAND_EXPORT_DELETED_CHAR);
- SetSentErrorMessage(true);
- return false;
- default:
- PSendSysMessage(LANG_COMMAND_EXPORT_FAILED);
- SetSentErrorMessage(true);
- return false;
- }
-
- return true;
-}
-
-bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow());
-
- MotionMaster* mm = unit->GetMotionMaster();
- float x,y,z;
- mm->GetDestination(x,y,z);
-
- for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
- {
- MovementGenerator* mg = mm->GetMotionSlot(i);
- if (!mg)
- {
- SendSysMessage("Empty");
- continue;
- }
- switch (mg->GetMovementGeneratorType())
- {
- case IDLE_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_IDLE); break;
- case RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_RANDOM); break;
- case WAYPOINT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_WAYPOINT); break;
- case ANIMAL_RANDOM_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM); break;
- case CONFUSED_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_CONFUSED); break;
- case CHASE_MOTION_TYPE:
- {
- Unit* target = NULL;
- if (unit->GetTypeId() == TYPEID_PLAYER)
- target = static_cast<ChaseMovementGenerator<Player> const*>(mg)->GetTarget();
- else
- target = static_cast<ChaseMovementGenerator<Creature> const*>(mg)->GetTarget();
-
- if (!target)
- SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
- else if (target->GetTypeId() == TYPEID_PLAYER)
- PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow());
- else
- PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow());
- break;
- }
- case FOLLOW_MOTION_TYPE:
- {
- Unit* target = NULL;
- if (unit->GetTypeId() == TYPEID_PLAYER)
- target = static_cast<FollowMovementGenerator<Player> const*>(mg)->GetTarget();
- else
- target = static_cast<FollowMovementGenerator<Creature> const*>(mg)->GetTarget();
-
- if (!target)
- SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
- else if (target->GetTypeId() == TYPEID_PLAYER)
- PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow());
- else
- PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow());
- break;
- }
- case HOME_MOTION_TYPE:
- {
- if (unit->GetTypeId() == TYPEID_UNIT)
- PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
- else
- SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
- break;
- }
- case FLIGHT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FLIGHT); break;
- case POINT_MOTION_TYPE:
- {
- PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
- break;
- }
- case FLEEING_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FEAR); break;
- case DISTRACT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_DISTRACT); break;
- case EFFECT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_EFFECT); break;
- default:
- PSendSysMessage(LANG_MOVEGENS_UNKNOWN, mg->GetMovementGeneratorType());
- break;
- }
- }
- return true;
-}
-
-/*
-ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator
-Without this function 3rd party scripting library will get linking errors (unresolved external)
-when attempting to use the PointMovementGenerator
-*/
-bool ChatHandler::HandleComeToMeCommand(const char *args)
-{
- char* newFlagStr = strtok((char*)args, " ");
-
- if (!newFlagStr)
- return false;
-
- Creature* caster = getSelectedCreature();
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- Player* player = m_session->GetPlayer();
-
- caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
- return true;
-}
-
-//Send items by mail
-bool ChatHandler::HandleSendItemsCommand(const char *args)
-{
- // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
- Player* receiver;
- uint64 receiver_guid;
- std::string receiver_name;
- if (!extractPlayerTarget((char*)args, &receiver, &receiver_guid, &receiver_name))
- return false;
-
- char* tail1 = strtok(NULL, "");
- if (!tail1)
- return false;
-
- char* msgSubject = extractQuotedArg(tail1);
- if (!msgSubject)
- return false;
-
- char* tail2 = strtok(NULL, "");
- if (!tail2)
- return false;
-
- char* msgText = extractQuotedArg(tail2);
- if (!msgText)
- return false;
-
- // msgSubject, msgText isn't NUL after prev. check
- std::string subject = msgSubject;
- std::string text = msgText;
-
- // extract items
- typedef std::pair<uint32, uint32> ItemPair;
- typedef std::list< ItemPair > ItemPairs;
- ItemPairs items;
-
- // get all tail string
- char* tail = strtok(NULL, "");
-
- // get from tail next item str
- while (char* itemStr = strtok(tail, " "))
- {
- // and get new tail
- tail = strtok(NULL, "");
-
- // parse item str
- char* itemIdStr = strtok(itemStr, ":");
- char* itemCountStr = strtok(NULL, " ");
-
- uint32 item_id = atoi(itemIdStr);
- if (!item_id)
- return false;
-
- ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(item_id);
- if (!item_proto)
- {
- PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, item_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1;
- if (item_count < 1 || (item_proto->MaxCount > 0 && item_count > uint32(item_proto->MaxCount)))
- {
- PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count, item_id);
- SetSentErrorMessage(true);
- return false;
- }
-
- while (item_count > item_proto->GetMaxStackSize())
- {
- items.push_back(ItemPair(item_id, item_proto->GetMaxStackSize()));
- item_count -= item_proto->GetMaxStackSize();
- }
-
- items.push_back(ItemPair(item_id, item_count));
-
- if (items.size() > MAX_MAIL_ITEMS)
- {
- PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS);
- SetSentErrorMessage(true);
- return false;
- }
- }
-
- // from console show not existed sender
- MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
-
- // fill mail
- MailDraft draft(subject, text);
-
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
-
- for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr)
- {
- if (Item* item = Item::CreateItem(itr->first, itr->second, m_session ? m_session->GetPlayer() : 0))
- {
- item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted
- draft.AddItem(item);
- }
- }
-
- draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiver_guid)), sender);
- CharacterDatabase.CommitTransaction(trans);
-
- std::string nameLink = playerLink(receiver_name);
- PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
- return true;
-}
-
-///Send money by mail
-bool ChatHandler::HandleSendMoneyCommand(const char *args)
-{
- /// format: name "subject text" "mail text" money
-
- Player* receiver;
- uint64 receiver_guid;
- std::string receiver_name;
- if (!extractPlayerTarget((char*)args, &receiver, &receiver_guid, &receiver_name))
- return false;
-
- char* tail1 = strtok(NULL, "");
- if (!tail1)
- return false;
-
- char* msgSubject = extractQuotedArg(tail1);
- if (!msgSubject)
- return false;
-
- char* tail2 = strtok(NULL, "");
- if (!tail2)
- return false;
-
- char* msgText = extractQuotedArg(tail2);
- if (!msgText)
- return false;
-
- char* money_str = strtok(NULL, "");
- int64 money = money_str ? atoll(money_str) : 0;
- if (money <= 0)
- return false;
-
- // msgSubject, msgText isn't NUL after prev. check
- std::string subject = msgSubject;
- std::string text = msgText;
-
- // from console show not existed sender
- MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
-
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
-
- MailDraft(subject, text)
- .AddMoney(money)
- .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiver_guid)), sender);
-
- CharacterDatabase.CommitTransaction(trans);
-
- std::string nameLink = playerLink(receiver_name);
- PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str());
- return true;
-}
-
-/// Send a message to a player in game
-bool ChatHandler::HandleSendMessageCommand(const char *args)
-{
- ///- Find the player
- Player* rPlayer;
- if (!extractPlayerTarget((char*)args, &rPlayer))
- return false;
-
- char* msg_str = strtok(NULL, "");
- if (!msg_str)
- return false;
-
- ///- Check that he is not logging out.
- if (rPlayer->GetSession()->isLogingOut())
- {
- SendSysMessage(LANG_PLAYER_NOT_FOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- ///- Send the message
- //Use SendAreaTriggerMessage for fastest delivery.
- rPlayer->GetSession()->SendAreaTriggerMessage("%s", msg_str);
- rPlayer->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r");
-
- //Confirmation message
- std::string nameLink = GetNameLink(rPlayer);
- PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msg_str);
- return true;
-}
-
-bool ChatHandler::HandleFlushArenaPointsCommand(const char * /*args*/)
-{
- sArenaTeamMgr->DistributeArenaPoints();
- return true;
-}
-
-bool ChatHandler::HandleChannelSetOwnership(const char *args)
-{
- if (!*args)
- return false;
- char *channel = strtok((char*)args, " ");
- char *argstr = strtok(NULL, "");
-
- if (!channel || !argstr)
- return false;
-
- Player* player = m_session->GetPlayer();
- Channel* chn = NULL;
-
- if (ChannelMgr* cMgr = channelMgr(player->GetTeam()))
- chn = cMgr->GetChannel(channel, player);
-
- if (strcmp(argstr, "on") == 0)
- {
- if (chn)
- chn->SetOwnership(true);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
- stmt->setUInt8 (0, 1);
- stmt->setString(1, channel);
- CharacterDatabase.Execute(stmt);
- PSendSysMessage(LANG_CHANNEL_ENABLE_OWNERSHIP, channel);
- }
- else if (strcmp(argstr, "off") == 0)
- {
- if (chn)
- chn->SetOwnership(false);
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP);
- stmt->setUInt8 (0, 0);
- stmt->setString(1, channel);
- CharacterDatabase.Execute(stmt);
- PSendSysMessage(LANG_CHANNEL_DISABLE_OWNERSHIP, channel);
- }
- else
- return false;
-
- return true;
-}
-
-bool ChatHandler::HandlePlayAllCommand(const char *args)
-{
- if (!*args)
- return false;
-
- uint32 soundId = atoi((char*)args);
-
- if (!sSoundEntriesStore.LookupEntry(soundId))
- {
- PSendSysMessage(LANG_SOUND_NOT_EXIST, soundId);
- SetSentErrorMessage(true);
- return false;
- }
-
- WorldPacket data(SMSG_PLAY_SOUND, 4);
- data << uint32(soundId) << m_session->GetPlayer()->GetGUID();
- sWorld->SendGlobalMessage(&data);
-
- PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId);
- return true;
-}
-
-bool ChatHandler::HandleFreezeCommand(const char *args)
-{
- std::string name;
- Player* player;
- char *TargetName = strtok((char*)args, " "); //get entered name
- if (!TargetName) //if no name entered use target
- {
- player = getSelectedPlayer();
- if (player) //prevent crash with creature as target
- {
- name = player->GetName();
- normalizePlayerName(name);
- }
- }
- else // if name entered
- {
- name = TargetName;
- normalizePlayerName(name);
- player = sObjectAccessor->FindPlayerByName(name.c_str());
- }
-
- if (!player)
- {
- SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
- return true;
- }
-
- if (player == m_session->GetPlayer())
- {
- SendSysMessage(LANG_COMMAND_FREEZE_ERROR);
- return true;
- }
-
- //effect
- if (player && player != m_session->GetPlayer())
- {
- PSendSysMessage(LANG_COMMAND_FREEZE, name.c_str());
-
- //stop combat + make player unattackable + duel stop + stop some spells
- player->setFaction(35);
- player->CombatStop();
- if (player->IsNonMeleeSpellCasted(true))
- player->InterruptNonMeleeSpells(true);
- player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- //if player class = hunter || warlock remove pet if alive
- if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
- {
- if (Pet* pet = player->GetPet())
- {
- pet->SavePetToDB(PET_SAVE_AS_CURRENT);
- // not let dismiss dead pet
- if (pet && pet->isAlive())
- player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT);
- }
- }
-
- //m_session->GetPlayer()->CastSpell(player, spellID, false);
- if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(9454))
- Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player);
-
- //save player
- player->SaveToDB();
- }
- return true;
-}
-
-bool ChatHandler::HandleUnFreezeCommand(const char *args)
-{
- std::string name;
- Player* player;
- char* targetName = strtok((char*)args, " "); // Get entered name
-
- if (targetName)
- {
- name = targetName;
- normalizePlayerName(name);
- player = sObjectAccessor->FindPlayerByName(name.c_str());
- }
- else // If no name was entered - use target
- {
- player = getSelectedPlayer();
- if (player)
- name = player->GetName();
- }
-
- if (player)
- {
- PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
-
- // Reset player faction + allow combat + allow duels
- player->setFactionForRace(player->getRace());
- player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
-
- // Remove Freeze spell (allowing movement and spells)
- player->RemoveAurasDueToSpell(9454);
-
- // Save player
- player->SaveToDB();
- }
- else
- {
- if (targetName)
- {
- // Check for offline players
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME);
- stmt->setString(0, name);
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (!result)
- {
- SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
- return true;
- }
-
- // If player found: delete his freeze aura
- Field* fields = result->Fetch();
- uint32 lowGuid = fields[0].GetUInt32();
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
- stmt->setUInt32(0, lowGuid);
- CharacterDatabase.Execute(stmt);
-
- PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
- return true;
- }
- else
- {
- SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
- return true;
- }
- }
-
- return true;
-}
-
-bool ChatHandler::HandleListFreezeCommand(const char * /*args*/)
-{
- // Get names from DB
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN);
-
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (!result)
- {
- SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS);
- return true;
- }
- //Header of the names
- PSendSysMessage(LANG_COMMAND_LIST_FREEZE);
-
- //Output of the results
- do
- {
- Field* fields = result->Fetch();
- std::string fplayers = fields[0].GetString();
- PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, fplayers.c_str());
- } while (result->NextRow());
-
- return true;
-}
-
-bool ChatHandler::HandleGroupLeaderCommand(const char *args)
-{
- Player* player = NULL;
- Group* group = NULL;
- uint64 guid = 0;
- char* cname = strtok((char*)args, " ");
-
- if (GetPlayerGroupAndGUIDByName(cname, player, group, guid))
- if (group && group->GetLeaderGUID() != guid)
- {
- group->ChangeLeader(guid);
- group->SendUpdate();
- }
-
- return true;
-}
-
-bool ChatHandler::HandleGroupDisbandCommand(const char *args)
-{
- Player* player = NULL;
- Group* group = NULL;
- uint64 guid = 0;
- char* cname = strtok((char*)args, " ");
-
- if (GetPlayerGroupAndGUIDByName(cname, player, group, guid))
- if (group)
- group->Disband();
-
- return true;
-}
-
-bool ChatHandler::HandleGroupRemoveCommand(const char *args)
-{
- Player* player = NULL;
- Group* group = NULL;
- uint64 guid = 0;
- char* cname = strtok((char*)args, " ");
-
- if (GetPlayerGroupAndGUIDByName(cname, player, group, guid, true))
- if (group)
- group->RemoveMember(guid);
-
- return true;
-}
-
-bool ChatHandler::HandlePossessCommand(const char * /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- return false;
-
- m_session->GetPlayer()->CastSpell(unit, 530, true);
- return true;
-}
-
-bool ChatHandler::HandleUnPossessCommand(const char * /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- unit = m_session->GetPlayer();
-
- unit->RemoveCharmAuras();
-
- return true;
-}
-
-bool ChatHandler::HandleBindSightCommand(const char * /*args*/)
-{
- Unit* unit = getSelectedUnit();
- if (!unit)
- return false;
-
- m_session->GetPlayer()->CastSpell(unit, 6277, true);
- return true;
-}
-
-bool ChatHandler::HandleUnbindSightCommand(const char * /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- if (player->isPossessing())
- return false;
-
- player->StopCastingBindSight();
- return true;
-}
diff --git a/src/server/game/Combat/HostileRefManager.h b/src/server/game/Combat/HostileRefManager.h
index 8a49d230161..b8991d8faf8 100755
--- a/src/server/game/Combat/HostileRefManager.h
+++ b/src/server/game/Combat/HostileRefManager.h
@@ -71,4 +71,3 @@ class HostileRefManager : public RefManager<Unit, ThreatManager>
};
//=================================================
#endif
-
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 0c43c9ece0e..87853a53b6c 100755
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -194,7 +194,6 @@ void HostileReference::updateOnlineStatus()
}
else
accessible = true;
-
}
setAccessibleState(accessible);
setOnlineOfflineState(online);
diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h
index 39c79b8273a..de60491de89 100755
--- a/src/server/game/Combat/UnitEvents.h
+++ b/src/server/game/Combat/UnitEvents.h
@@ -77,7 +77,6 @@ class UnitBaseEvent
bool matchesTypeMask(uint32 pMask) const { return iType & pMask; }
void setType(uint32 pType) { iType = pType; }
-
};
//==============================================================
@@ -134,4 +133,3 @@ class ThreatManagerEvent : public ThreatRefStatusChangeEvent
//==============================================================
#endif
-
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 9f534ab697d..67ba643dd97 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -16,7 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#include "Player.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
@@ -686,7 +685,7 @@ void ConditionMgr::LoadConditions(bool isReload)
//must clear all custom handled cases (groupped types) before reload
if (isReload)
{
- sLog->outString("Reseting Loot Conditions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Reseting Loot Conditions...");
LootTemplates_Creature.ResetConditions();
LootTemplates_Fishing.ResetConditions();
LootTemplates_Gameobject.ResetConditions();
@@ -700,10 +699,10 @@ void ConditionMgr::LoadConditions(bool isReload)
LootTemplates_Prospecting.ResetConditions();
LootTemplates_Spell.ResetConditions();
- sLog->outString("Re-Loading `gossip_menu` Table for Conditions!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `gossip_menu` Table for Conditions!");
sObjectMgr->LoadGossipMenu();
- sLog->outString("Re-Loading `gossip_menu_option` Table for Conditions!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading `gossip_menu_option` Table for Conditions!");
sObjectMgr->LoadGossipMenuItems();
sSpellMgr->UnloadSpellInfoImplicitTargetConditionLists();
}
@@ -713,8 +712,8 @@ void ConditionMgr::LoadConditions(bool isReload)
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 conditions. DB table `conditions` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 conditions. DB table `conditions` is empty!");
+
return;
}
@@ -722,7 +721,6 @@ void ConditionMgr::LoadConditions(bool isReload)
do
{
-
Field* fields = result->Fetch();
Condition* cond = new Condition();
@@ -750,7 +748,7 @@ void ConditionMgr::LoadConditions(bool isReload)
{
if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skip
{
- sLog->outErrorDb("Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId);
+ sLog->outError(LOG_FILTER_SQL, "Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId);
delete cond;
continue;
}
@@ -761,19 +759,19 @@ void ConditionMgr::LoadConditions(bool isReload)
rowType = "reference";
//check for useless data
if (cond->ConditionTarget)
- sLog->outErrorDb("Condition %s %i has useless data in ConditionTarget (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionTarget);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in ConditionTarget (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionTarget);
if (cond->ConditionValue1)
- sLog->outErrorDb("Condition %s %i has useless data in value1 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in value1 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue1);
if (cond->ConditionValue2)
- sLog->outErrorDb("Condition %s %i has useless data in value2 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in value2 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Condition %s %i has useless data in value3 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in value3 (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionValue3);
if (cond->NegativeCondition)
- sLog->outErrorDb("Condition %s %i has useless data in NegativeCondition (%u)!", rowType, iSourceTypeOrReferenceId, cond->NegativeCondition);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in NegativeCondition (%u)!", rowType, iSourceTypeOrReferenceId, cond->NegativeCondition);
if (cond->SourceGroup && iSourceTypeOrReferenceId < 0)
- sLog->outErrorDb("Condition %s %i has useless data in SourceGroup (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in SourceGroup (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceGroup);
if (cond->SourceEntry && iSourceTypeOrReferenceId < 0)
- sLog->outErrorDb("Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceEntry);
}
else if (!isConditionTypeValid(cond))//doesn't have reference, validate ConditionType
{
@@ -804,13 +802,13 @@ void ConditionMgr::LoadConditions(bool isReload)
//Grouping is only allowed for some types (loot templates, gossip menus, gossip items)
if (cond->SourceGroup && !CanHaveSourceGroupSet(cond->SourceType))
{
- sLog->outErrorDb("Condition type %u has not allowed value of SourceGroup = %u!", uint32(cond->SourceType), cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "Condition type %u has not allowed value of SourceGroup = %u!", uint32(cond->SourceType), cond->SourceGroup);
delete cond;
continue;
}
if (cond->SourceId && !CanHaveSourceIdSet(cond->SourceType))
{
- sLog->outErrorDb("Condition type %u has not allowed value of SourceId = %u!", uint32(cond->SourceType), cond->SourceId);
+ sLog->outError(LOG_FILTER_SQL, "Condition type %u has not allowed value of SourceId = %u!", uint32(cond->SourceType), cond->SourceId);
delete cond;
continue;
}
@@ -896,7 +894,7 @@ void ConditionMgr::LoadConditions(bool isReload)
if (!valid)
{
- sLog->outErrorDb("Not handled grouped condition, SourceGroup %u", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "Not handled grouped condition, SourceGroup %u", cond->SourceGroup);
delete cond;
}
else
@@ -928,22 +926,22 @@ void ConditionMgr::LoadConditions(bool isReload)
}
while (result->NextRow());
- sLog->outString(">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot)
{
if (!loot)
{
- sLog->outErrorDb("ConditionMgr: LootTemplate %u not found", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "ConditionMgr: LootTemplate %u not found", cond->SourceGroup);
return false;
}
if (loot->addConditionItem(cond))
return true;
- sLog->outErrorDb("ConditionMgr: Item %u not found in LootTemplate %u", cond->SourceEntry, cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "ConditionMgr: Item %u not found in LootTemplate %u", cond->SourceEntry, cond->SourceGroup);
return false;
}
@@ -963,7 +961,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond)
}
}
- sLog->outErrorDb("addToGossipMenus: GossipMenu %u not found", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "addToGossipMenus: GossipMenu %u not found", cond->SourceGroup);
return false;
}
@@ -982,7 +980,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond)
}
}
- sLog->outErrorDb("addToGossipMenuItems: GossipMenuId %u Item %u not found", cond->SourceGroup, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "addToGossipMenuItems: GossipMenuId %u Item %u not found", cond->SourceGroup, cond->SourceEntry);
return false;
}
@@ -1037,7 +1035,7 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
// we have overlapping masks in db
if (conditionEffMask != *itr)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - "
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - "
"effect masks are overlapping (all SourceGroup values having given bit set must be equal) - ignoring.", cond->SourceEntry, cond->SourceGroup);
return false;
}
@@ -1062,7 +1060,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (cond->SourceType == CONDITION_SOURCE_TYPE_NONE || cond->SourceType >= CONDITION_SOURCE_TYPE_MAX)
{
- sLog->outErrorDb("Invalid ConditionSourceType %u in `condition` table, ignoring.", uint32(cond->SourceType));
+ sLog->outError(LOG_FILTER_SQL, "Invalid ConditionSourceType %u in `condition` table, ignoring.", uint32(cond->SourceType));
return false;
}
@@ -1072,7 +1070,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Creature.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1080,7 +1078,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1089,7 +1087,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Disenchant.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1097,7 +1095,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1106,7 +1104,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Fishing.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1114,7 +1112,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1123,7 +1121,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Gameobject.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1131,7 +1129,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1140,7 +1138,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Item.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1148,7 +1146,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1157,7 +1155,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Mail.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1165,7 +1163,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1174,7 +1172,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Milling.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1182,7 +1180,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1191,7 +1189,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Pickpocketing.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1199,7 +1197,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1208,7 +1206,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Prospecting.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1216,7 +1214,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1225,7 +1223,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Reference.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1233,7 +1231,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1242,7 +1240,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Skinning.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1250,7 +1248,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1259,7 +1257,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!LootTemplates_Spell.HaveLootFor(cond->SourceGroup))
{
- sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceGroup %u in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->SourceGroup);
return false;
}
@@ -1267,7 +1265,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
break;
@@ -1277,13 +1275,13 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(cond->SourceEntry);
if (!spellInfo)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
if ((cond->SourceGroup > MAX_EFFECT_MASK) || !cond->SourceGroup)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set , ignoring.", cond->SourceEntry, cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set , ignoring.", cond->SourceEntry, cond->SourceGroup);
return false;
}
@@ -1314,7 +1312,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
break;
}
- sLog->outErrorDb("SourceEntry %u SourceGroup %u in `condition` table - spell %u does not have implicit targets of types: _AREA_, _CONE_, _NEARBY_ for effect %u, SourceGroup needs correction, ignoring.", cond->SourceEntry, origGroup, cond->SourceEntry, uint32(i));
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u SourceGroup %u in `condition` table - spell %u does not have implicit targets of types: _AREA_, _CONE_, _NEARBY_ for effect %u, SourceGroup needs correction, ignoring.", cond->SourceEntry, origGroup, cond->SourceEntry, uint32(i));
cond->SourceGroup &= ~(1<<i);
}
// all effects were removed, no need to add the condition at all
@@ -1326,7 +1324,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
{
if (!sObjectMgr->GetCreatureTemplate(cond->SourceEntry))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceEntry);
return false;
}
break;
@@ -1336,7 +1334,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->SourceEntry);
if (!spellProto)
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
break;
@@ -1344,40 +1342,40 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
case CONDITION_SOURCE_TYPE_QUEST_ACCEPT:
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
{
- sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->SourceEntry);
return false;
}
break;
case CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK:
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
{
- sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->SourceEntry);
return false;
}
break;
case CONDITION_SOURCE_TYPE_VEHICLE_SPELL:
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
return false;
}
if (!sSpellMgr->GetSpellInfo(cond->SourceEntry))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
break;
case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT:
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->SourceGroup);
return false;
}
if (!sSpellMgr->GetSpellInfo(cond->SourceEntry))
{
- sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->SourceEntry);
return false;
}
break;
@@ -1395,13 +1393,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (cond->ConditionType == CONDITION_NONE || cond->ConditionType >= CONDITION_MAX)
{
- sLog->outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->ConditionType), cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->ConditionType), cond->SourceEntry);
return false;
}
if (cond->ConditionTarget >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, has incorrect ConditionTarget set, ignoring.", cond->SourceType, cond->SourceEntry);
+ sLog->outError(LOG_FILTER_SQL, "SourceType %u, SourceEntry %u in `condition` table, has incorrect ConditionTarget set, ignoring.", cond->SourceType, cond->SourceEntry);
return false;
}
@@ -1411,17 +1409,17 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
{
- sLog->outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Aura condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 > EFFECT_2)
{
- sLog->outErrorDb("Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Aura condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Aura condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ITEM:
@@ -1429,13 +1427,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->ConditionValue1);
if (!proto)
{
- sLog->outErrorDb("Item condition has non existing item (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Item condition has non existing item (%u), skipped", cond->ConditionValue1);
return false;
}
if (!cond->ConditionValue2)
{
- sLog->outErrorDb("Item condition has 0 set for item count in value2 (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Item condition has 0 set for item count in value2 (%u), skipped", cond->ConditionValue2);
return false;
}
break;
@@ -1445,14 +1443,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->ConditionValue1);
if (!proto)
{
- sLog->outErrorDb("ItemEquipped condition has non existing item (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ItemEquipped condition has non existing item (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("ItemEquipped condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ItemEquipped condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("ItemEquipped condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ItemEquipped condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ZONEID:
@@ -1460,20 +1458,20 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(cond->ConditionValue1);
if (!areaEntry)
{
- sLog->outErrorDb("ZoneID condition has non existing area (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition has non existing area (%u), skipped", cond->ConditionValue1);
return false;
}
if (areaEntry->zone != 0)
{
- sLog->outErrorDb("ZoneID condition requires to be in area (%u) which is a subzone but zone expected, skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition requires to be in area (%u) which is a subzone but zone expected, skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("ZoneID condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("ZoneID condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ZoneID condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_REPUTATION_RANK:
@@ -1481,25 +1479,25 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
FactionEntry const* factionEntry = sFactionStore.LookupEntry(cond->ConditionValue1);
if (!factionEntry)
{
- sLog->outErrorDb("Reputation condition has non existing faction (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Reputation condition has non existing faction (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Reputation condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Reputation condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_TEAM:
{
if (cond->ConditionValue1 != ALLIANCE && cond->ConditionValue1 != HORDE)
{
- sLog->outErrorDb("Team condition specifies unknown team (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Team condition specifies unknown team (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Team condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Team condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Team condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Team condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_SKILL:
@@ -1507,17 +1505,17 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(cond->ConditionValue1);
if (!pSkill)
{
- sLog->outErrorDb("Skill condition specifies non-existing skill (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Skill condition specifies non-existing skill (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 < 1 || cond->ConditionValue2 > sWorld->GetConfigMaxSkillValue())
{
- sLog->outErrorDb("Skill condition specifies invalid skill value (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Skill condition specifies invalid skill value (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Skill condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Skill condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_QUESTREWARDED:
@@ -1527,14 +1525,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (!sObjectMgr->GetQuestTemplate(cond->ConditionValue1))
{
- sLog->outErrorDb("Quest condition specifies non-existing quest (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Quest condition specifies non-existing quest (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 > 1)
- sLog->outErrorDb("Quest condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Quest condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Quest condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Quest condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ACTIVE_EVENT:
@@ -1542,14 +1540,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
if (cond->ConditionValue1 >=events.size() || !events[cond->ConditionValue1].isValid())
{
- sLog->outErrorDb("ActiveEvent condition has non existing event id (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ActiveEvent condition has non existing event id (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("ActiveEvent condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ActiveEvent condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("ActiveEvent condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ActiveEvent condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_ACHIEVEMENT:
@@ -1557,42 +1555,42 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1);
if (!achievement)
{
- sLog->outErrorDb("Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Achivement condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Achivement condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Achivement condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Achivement condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_CLASS:
{
if (!(cond->ConditionValue1 & CLASSMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Class condition has non existing classmask (%u), skipped", cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE);
+ sLog->outError(LOG_FILTER_SQL, "Class condition has non existing classmask (%u), skipped", cond->ConditionValue1 & ~CLASSMASK_ALL_PLAYABLE);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Class condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Class condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Class condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Class condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_RACE:
{
if (!(cond->ConditionValue1 & RACEMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Race condition has non existing racemask (%u), skipped", cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
+ sLog->outError(LOG_FILTER_SQL, "Race condition has non existing racemask (%u), skipped", cond->ConditionValue1 & ~RACEMASK_ALL_PLAYABLE);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Race condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Race condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Race condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Race condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_MAPID:
@@ -1600,77 +1598,77 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
MapEntry const* me = sMapStore.LookupEntry(cond->ConditionValue1);
if (!me)
{
- sLog->outErrorDb("Map condition has non existing map (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Map condition has non existing map (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Map condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Map condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Map condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Map condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_SPELL:
{
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
{
- sLog->outErrorDb("Spell condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Spell condition has non existing spell (Id: %d), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("Spell condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Spell condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Spell condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Spell condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_LEVEL:
{
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("Level condition has invalid option (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Level condition has invalid option (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("Level condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Level condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_DRUNKENSTATE:
{
if (cond->ConditionValue1 > DRUNKEN_SMASHED)
{
- sLog->outErrorDb("DrunkState condition has invalid state (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "DrunkState condition has invalid state (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2)
{
- sLog->outErrorDb("DrunkState condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "DrunkState condition has useless data in value2 (%u)!", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("DrunkState condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "DrunkState condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_NEAR_CREATURE:
{
if (!sObjectMgr->GetCreatureTemplate(cond->ConditionValue1))
{
- sLog->outErrorDb("NearCreature condition has non existing creature template entry (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "NearCreature condition has non existing creature template entry (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("NearCreature condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "NearCreature condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_NEAR_GAMEOBJECT:
{
if (!sObjectMgr->GetGameObjectTemplate(cond->ConditionValue1))
{
- sLog->outErrorDb("NearGameObject condition has non existing gameobject template entry (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "NearGameObject condition has non existing gameobject template entry (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("NearGameObject condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "NearGameObject condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_OBJECT_ENTRY:
@@ -1680,79 +1678,79 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
case TYPEID_UNIT:
if (cond->ConditionValue2 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue2))
{
- sLog->outErrorDb("ObjectEntry condition has non existing creature template entry (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has non existing creature template entry (%u), skipped", cond->ConditionValue2);
return false;
}
break;
case TYPEID_GAMEOBJECT:
if (cond->ConditionValue2 && !sObjectMgr->GetGameObjectTemplate(cond->ConditionValue2))
{
- sLog->outErrorDb("ObjectEntry condition has non existing game object template entry (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has non existing game object template entry (%u), skipped", cond->ConditionValue2);
return false;
}
break;
case TYPEID_PLAYER:
case TYPEID_CORPSE:
if (cond->ConditionValue2)
- sLog->outErrorDb("ObjectEntry condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has useless data in value2 (%u)!", cond->ConditionValue2);
break;
default:
- sLog->outErrorDb("ObjectEntry condition has wrong typeid set (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has wrong typeid set (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("ObjectEntry condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "ObjectEntry condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_TYPE_MASK:
{
if (!cond->ConditionValue1 || (cond->ConditionValue1 & ~(TYPEMASK_UNIT | TYPEMASK_PLAYER | TYPEMASK_GAMEOBJECT | TYPEMASK_CORPSE)))
{
- sLog->outErrorDb("TypeMask condition has invalid typemask set (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "TypeMask condition has invalid typemask set (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue2)
- sLog->outErrorDb("TypeMask condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "TypeMask condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("TypeMask condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "TypeMask condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_RELATION_TO:
{
if (cond->ConditionValue1 >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("RelationTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
- sLog->outErrorDb("RelationTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 >= RELATION_MAX)
{
- sLog->outErrorDb("RelationTo condition has invalid ConditionValue2(RelationType) (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has invalid ConditionValue2(RelationType) (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("RelationTo condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "RelationTo condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_REACTION_TO:
{
if (cond->ConditionValue1 >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("ReactionTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ReactionTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
- sLog->outErrorDb("ReactionTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "ReactionTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
return false;
}
if (!cond->ConditionValue2)
{
- sLog->outErrorDb("mConditionValue2 condition has invalid ConditionValue2(rankMask) (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "mConditionValue2 condition has invalid ConditionValue2(rankMask) (%u), skipped", cond->ConditionValue2);
return false;
}
break;
@@ -1761,17 +1759,17 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (cond->ConditionValue1 >= cond->GetMaxAvailableConditionTargets())
{
- sLog->outErrorDb("DistanceTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "DistanceTo condition has invalid ConditionValue1(ConditionTarget selection) (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
- sLog->outErrorDb("DistanceTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "DistanceTo condition has ConditionValue1(ConditionTarget selection) set to self (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("DistanceTo condition has invalid ComparisionType (%u), skipped", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "DistanceTo condition has invalid ComparisionType (%u), skipped", cond->ConditionValue3);
return false;
}
break;
@@ -1779,38 +1777,38 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
case CONDITION_ALIVE:
{
if (cond->ConditionValue1)
- sLog->outErrorDb("Alive condition has useless data in value1 (%u)!", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Alive condition has useless data in value1 (%u)!", cond->ConditionValue1);
if (cond->ConditionValue2)
- sLog->outErrorDb("Alive condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Alive condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Alive condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Alive condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_HP_VAL:
{
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("HpVal condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "HpVal condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("HpVal condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "HpVal condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_HP_PCT:
{
if (cond->ConditionValue1 > 100)
{
- sLog->outErrorDb("HpPct condition has too big percent value (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "HpPct condition has too big percent value (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
- sLog->outErrorDb("HpPct condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "HpPct condition has invalid ComparisionType (%u), skipped", cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("HpPct condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "HpPct condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_AREAID:
@@ -1820,19 +1818,19 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
{
if (!sWorld->getWorldState(cond->ConditionValue1))
{
- sLog->outErrorDb("World state condition has non existing world state in value1 (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "World state condition has non existing world state in value1 (%u), skipped", cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3)
- sLog->outErrorDb("World state condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "World state condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_PHASEMASK:
{
if (cond->ConditionValue2)
- sLog->outErrorDb("Phasemask condition has useless data in value2 (%u)!", cond->ConditionValue2);
+ sLog->outError(LOG_FILTER_SQL, "Phasemask condition has useless data in value2 (%u)!", cond->ConditionValue2);
if (cond->ConditionValue3)
- sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3);
+ sLog->outError(LOG_FILTER_SQL, "Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3);
break;
}
case CONDITION_TITLE:
@@ -1840,22 +1838,22 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(cond->ConditionValue1);
if (!titleEntry)
{
- sLog->outErrorDb("Title condition has non existing title in value1 (%u), skipped", cond->ConditionValue1);
+ sLog->outError(LOG_FILTER_SQL, "Title condition has non existing title in value1 (%u), skipped", cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_UNUSED_19:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
+ sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
return false;
case CONDITION_UNUSED_20:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_20 in `conditions` table - ignoring");
+ sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_20 in `conditions` table - ignoring");
return false;
case CONDITION_UNUSED_21:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_21 in `conditions` table - ignoring");
+ sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_21 in `conditions` table - ignoring");
return false;
case CONDITION_UNUSED_24:
- sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring");
+ sLog->outError(LOG_FILTER_SQL, "Found ConditionTypeOrReference = CONDITION_UNUSED_24 in `conditions` table - ignoring");
return false;
default:
break;
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp
index d7a769d3f5c..6215cf5bb75 100755
--- a/src/server/game/Conditions/DisableMgr.cpp
+++ b/src/server/game/Conditions/DisableMgr.cpp
@@ -59,8 +59,8 @@ void LoadDisables()
if (!result)
{
- sLog->outString(">> Loaded 0 disables. DB table `disables` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 disables. DB table `disables` is empty!");
+
return;
}
@@ -71,7 +71,7 @@ void LoadDisables()
DisableType type = DisableType(fields[0].GetUInt32());
if (type >= MAX_DISABLE_TYPES)
{
- sLog->outErrorDb("Invalid type %u specified in `disables` table, skipped.", type);
+ sLog->outError(LOG_FILTER_SQL, "Invalid type %u specified in `disables` table, skipped.", type);
continue;
}
@@ -88,13 +88,13 @@ void LoadDisables()
case DISABLE_TYPE_SPELL:
if (!(sSpellMgr->GetSpellInfo(entry) || flags & SPELL_DISABLE_DEPRECATED_SPELL))
{
- sLog->outErrorDb("Spell entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
if (!flags || flags > MAX_SPELL_DISABLE_TYPE)
{
- sLog->outErrorDb("Disable flags for spell %u are invalid, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags for spell %u are invalid, skipped.", entry);
continue;
}
@@ -121,7 +121,7 @@ void LoadDisables()
MapEntry const* mapEntry = sMapStore.LookupEntry(entry);
if (!mapEntry)
{
- sLog->outErrorDb("Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
bool isFlagInvalid = false;
@@ -142,12 +142,12 @@ void LoadDisables()
break;
case MAP_BATTLEGROUND:
case MAP_ARENA:
- sLog->outErrorDb("Battleground map %u specified to be disabled in map case, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Battleground map %u specified to be disabled in map case, skipped.", entry);
continue;
}
if (isFlagInvalid)
{
- sLog->outErrorDb("Disable flags for map %u are invalid, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags for map %u are invalid, skipped.", entry);
continue;
}
break;
@@ -155,64 +155,64 @@ void LoadDisables()
case DISABLE_TYPE_BATTLEGROUND:
if (!sBattlemasterListStore.LookupEntry(entry))
{
- sLog->outErrorDb("Battleground entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Battleground entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
if (flags)
- sLog->outErrorDb("Disable flags specified for battleground %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for battleground %u, useless data.", entry);
break;
case DISABLE_TYPE_OUTDOORPVP:
if (entry > MAX_OUTDOORPVP_TYPES)
{
- sLog->outErrorDb("OutdoorPvPTypes value %u from `disables` is invalid, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "OutdoorPvPTypes value %u from `disables` is invalid, skipped.", entry);
continue;
}
if (flags)
- sLog->outErrorDb("Disable flags specified for outdoor PvP %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for outdoor PvP %u, useless data.", entry);
break;
case DISABLE_TYPE_ACHIEVEMENT_CRITERIA:
if (!sAchievementCriteriaStore.LookupEntry(entry))
{
- sLog->outErrorDb("Achievement Criteria entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Achievement Criteria entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
if (flags)
- sLog->outErrorDb("Disable flags specified for Achievement Criteria %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for Achievement Criteria %u, useless data.", entry);
break;
case DISABLE_TYPE_VMAP:
{
MapEntry const* mapEntry = sMapStore.LookupEntry(entry);
if (!mapEntry)
{
- sLog->outErrorDb("Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry);
continue;
}
switch (mapEntry->map_type)
{
case MAP_COMMON:
if (flags & VMAP_DISABLE_AREAFLAG)
- sLog->outString("Areaflag disabled for world map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Areaflag disabled for world map %u.", entry);
if (flags & VMAP_DISABLE_LIQUIDSTATUS)
- sLog->outString("Liquid status disabled for world map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Liquid status disabled for world map %u.", entry);
break;
case MAP_INSTANCE:
case MAP_RAID:
if (flags & VMAP_DISABLE_HEIGHT)
- sLog->outString("Height disabled for instance map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Height disabled for instance map %u.", entry);
if (flags & VMAP_DISABLE_LOS)
- sLog->outString("LoS disabled for instance map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "LoS disabled for instance map %u.", entry);
break;
case MAP_BATTLEGROUND:
if (flags & VMAP_DISABLE_HEIGHT)
- sLog->outString("Height disabled for battleground map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Height disabled for battleground map %u.", entry);
if (flags & VMAP_DISABLE_LOS)
- sLog->outString("LoS disabled for battleground map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "LoS disabled for battleground map %u.", entry);
break;
case MAP_ARENA:
if (flags & VMAP_DISABLE_HEIGHT)
- sLog->outString("Height disabled for arena map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Height disabled for arena map %u.", entry);
if (flags & VMAP_DISABLE_LOS)
- sLog->outString("LoS disabled for arena map %u.", entry);
+ sLog->outInfo(LOG_FILTER_GENERAL, "LoS disabled for arena map %u.", entry);
break;
default:
break;
@@ -228,8 +228,8 @@ void LoadDisables()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime));
+
}
void CheckQuestDisables()
@@ -239,8 +239,8 @@ void CheckQuestDisables()
uint32 count = m_DisableMap[DISABLE_TYPE_QUEST].size();
if (!count)
{
- sLog->outString(">> Checked 0 quest disables.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Checked 0 quest disables.");
+
return;
}
@@ -250,17 +250,17 @@ void CheckQuestDisables()
const uint32 entry = itr->first;
if (!sObjectMgr->GetQuestTemplate(entry))
{
- sLog->outErrorDb("Quest entry %u from `disables` doesn't exist, skipped.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Quest entry %u from `disables` doesn't exist, skipped.", entry);
m_DisableMap[DISABLE_TYPE_QUEST].erase(itr++);
continue;
}
if (itr->second.flags)
- sLog->outErrorDb("Disable flags specified for quest %u, useless data.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Disable flags specified for quest %u, useless data.", entry);
++itr;
}
- sLog->outString(">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags)
diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp
index edc97d6b517..2e1c25ced39 100644
--- a/src/server/game/DataStores/DB2Stores.cpp
+++ b/src/server/game/DataStores/DB2Stores.cpp
@@ -34,7 +34,7 @@ uint32 DB2FilesCount = 0;
static bool LoadDB2_assert_print(uint32 fsize,uint32 rsize, const std::string& filename)
{
- sLog->outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
+ sLog->outError(LOG_FILTER_GENERAL, "Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
// ASSERT must fail after function call
return false;
@@ -87,7 +87,7 @@ void LoadDB2Stores(const std::string& dataPath)
// error checks
if (bad_db2_files.size() >= DB2FilesCount)
{
- sLog->outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str());
exit(1);
}
else if (!bad_db2_files.empty())
@@ -96,7 +96,7 @@ void LoadDB2Stores(const std::string& dataPath)
for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i)
str += *i + "\n";
- sLog->outError("\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount,str.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount,str.c_str());
exit(1);
}
@@ -104,11 +104,9 @@ void LoadDB2Stores(const std::string& dataPath)
if (!sItemStore.LookupEntry(83086) || // last item added in 4.3.4 (15595)
!sItemExtendedCostStore.LookupEntry(3872) ) // last item extended cost added in 4.3.4 (15595)
{
- sLog->outString();
- sLog->outError("Please extract correct db2 files from client 4.3.4 15595.");
+ sLog->outError(LOG_FILTER_GENERAL, "Please extract correct db2 files from client 4.3.4 15595.");
exit(1);
}
- sLog->outString(">> Initialized %d DB2 data stores.", DB2FilesCount);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Initialized %d DB2 data stores.", DB2FilesCount);
}
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 8c2ba721319..e2fce5491a9 100755..100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -252,7 +252,7 @@ uint32 DBCFileCount = 0;
static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename)
{
- sLog->outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
+ sLog->outError(LOG_FILTER_GENERAL, "Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize);
// ASSERT must fail after function call
return false;
@@ -570,7 +570,7 @@ void LoadDBCStores(const std::string& dataPath)
if (spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x]))
{
if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values
- sLog->outErrorDb("spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
+ sLog->outError(LOG_FILTER_SQL, "spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x);
newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0
}
else
@@ -727,7 +727,7 @@ void LoadDBCStores(const std::string& dataPath)
// error checks
if (bad_dbc_files.size() >= DBCFileCount)
{
- sLog->outError("Incorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc", DBCFileCount, dataPath.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Incorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc", DBCFileCount, dataPath.c_str());
exit(1);
}
else if (!bad_dbc_files.empty())
@@ -736,7 +736,7 @@ void LoadDBCStores(const std::string& dataPath)
for (StoreProblemList::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
str += *i + "\n";
- sLog->outError("Some required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFileCount, str.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Some required *.dbc files (%u from %d) not found or not compatible:\n%s", (uint32)bad_dbc_files.size(), DBCFileCount, str.c_str());
exit(1);
}
@@ -747,12 +747,11 @@ void LoadDBCStores(const std::string& dataPath)
!sMapStore.LookupEntry(980) || // last map added in 4.3.4 (15595)
!sSpellStore.LookupEntry(121820) ) // last spell added in 4.3.4 (15595)
{
- sLog->outError("You have _outdated_ DBC files. Please extract correct versions from current using client.");
+ sLog->outError(LOG_FILTER_GENERAL, "You have _outdated_ DBC files. Please extract correct versions from current using client.");
exit(1);
}
- sLog->outString(">> Initialized %d DBC data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Initialized %d DBC data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
}
const std::string* GetRandomCharacterName(uint8 race, uint8 gender)
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index 5e841a2f78b..38cc9fe29e7 100755..100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1129,7 +1129,7 @@ struct GtOCTBaseMPByClassEntry
/* no used
struct HolidayDescriptionsEntry
{
- uint32 ID; // 0, this is NOT holiday id
+ uint32 ID; // 0, m_holidayDescriptionID
//char* name // 1 m_name_lang
};
*/
@@ -1137,7 +1137,7 @@ struct HolidayDescriptionsEntry
/* no used
struct HolidayNamesEntry
{
- uint32 ID; // 0, this is NOT holiday id
+ uint32 ID; // 0, m_holidayNameID
//char* name // 1 m_name_lang
};
*/
@@ -1335,7 +1335,7 @@ struct ItemSetEntry
struct LFGDungeonEntry
{
uint32 ID; // 0
- //char* name[16]; // 1-17 Name lang
+ //char* name; // 1
uint32 minlevel; // 2
uint32 maxlevel; // 3
uint32 reclevel; // 4
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index b3e5f2a3eab..18ba5926b07 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -135,8 +135,8 @@ void LFGMgr::LoadRewards()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!");
+
return;
}
@@ -157,25 +157,25 @@ void LFGMgr::LoadRewards()
if (!sLFGDungeonStore.LookupEntry(dungeonId))
{
- sLog->outErrorDb("Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
continue;
}
if (!maxLevel || maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
- sLog->outErrorDb("Level %u specified for dungeon %u in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "Level %u specified for dungeon %u in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
}
if (firstQuestId && !sObjectMgr->GetQuestTemplate(firstQuestId))
{
- sLog->outErrorDb("First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
firstQuestId = 0;
}
if (otherQuestId && !sObjectMgr->GetQuestTemplate(otherQuestId))
{
- sLog->outErrorDb("Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
+ sLog->outError(LOG_FILTER_SQL, "Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
otherQuestId = 0;
}
@@ -183,8 +183,8 @@ void LFGMgr::LoadRewards()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_LFG, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void LFGMgr::Update(uint32 diff)
@@ -310,7 +310,7 @@ void LFGMgr::Update(uint32 diff)
LfgQueueInfo* queue = itQueue->second;
if (!queue)
{
- sLog->outError("LFGMgr::Update: [" UI64FMTD "] queued with null queue info!", itQueue->first);
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::Update: [" UI64FMTD "] queued with null queue info!", itQueue->first);
continue;
}
uint32 dungeonId = (*queue->dungeons.begin());
@@ -863,7 +863,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid);
if (itQueue == m_QueueInfoMap.end() || GetState(guid) != LFG_STATE_QUEUED)
{
- sLog->outError("LFGMgr::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", (*it));
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", (*it));
RemoveFromQueue(guid);
return false;
}
@@ -1404,13 +1404,13 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
LfgProposalPlayer* player = pProposal->players[(*it)->GetGUID()];
uint32 lowgroupguid = (*it)->GetGroup() ? (*it)->GetGroup()->GetLowGUID() : 0;
if (player->groupLowGuid != lowgroupguid)
- sLog->outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, player->groupLowGuid);
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, player->groupLowGuid);
uint64 guid2 = player->groupLowGuid ? MAKE_NEW_GUID(player->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID();
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid2);
if (itQueue == m_QueueInfoMap.end())
{
- sLog->outError("LFGMgr::UpdateProposal: Queue info for guid [" UI64FMTD "] not found!", guid);
+ sLog->outError(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Queue info for guid [" UI64FMTD "] not found!", guid);
waitTimesMap[(*it)->GetGUID()] = -1;
}
else
@@ -1813,7 +1813,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
AreaTrigger const* at = sObjectMgr->GetMapEntranceTrigger(dungeon->map);
if (!at)
{
- sLog->outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "]: No areatrigger found for map: %u difficulty: %u", player->GetGUID(), dungeon->map, dungeon->difficulty);
+ sLog->outError(LOG_FILTER_LFG, "LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "]: No areatrigger found for map: %u difficulty: %u", player->GetGUID(), dungeon->map, dungeon->difficulty);
error = LFG_TELEPORTERROR_INVALID_LOCATION;
}
else
@@ -1843,7 +1843,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
else
{
error = LFG_TELEPORTERROR_INVALID_LOCATION;
- sLog->outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", player->GetGUID(), mapid);
+ sLog->outError(LOG_FILTER_LFG, "LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", player->GetGUID(), mapid);
}
}
}
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index 1fa7fe0ca9f..e4b67e22221 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -23,9 +23,10 @@
#include "SharedDefines.h"
#include "Player.h"
#include "Group.h"
-#include "ScriptPCH.h"
#include "LFGScripts.h"
#include "LFGMgr.h"
+#include "ScriptMgr.h"
+#include "ObjectAccessor.h"
LFGPlayerScript::LFGPlayerScript() : PlayerScript("LFGPlayerScript")
{
diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h
index 4b332c7d731..ac1f66abbda 100644
--- a/src/server/game/DungeonFinding/LFGScripts.h
+++ b/src/server/game/DungeonFinding/LFGScripts.h
@@ -21,7 +21,7 @@
#include "Common.h"
#include "SharedDefines.h"
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
class Player;
class Group;
diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp
index ae76863c362..653a731b5b2 100755
--- a/src/server/game/Entities/Corpse/Corpse.cpp
+++ b/src/server/game/Entities/Corpse/Corpse.cpp
@@ -78,7 +78,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner)
if (!IsPositionValid())
{
- sLog->outError("Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_PLAYER, "Corpse (guidlow %d, owner %s) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow, owner->GetName(), owner->GetPositionX(), owner->GetPositionY());
return false;
}
@@ -134,7 +134,7 @@ void Corpse::DeleteBonesFromWorld()
if (!corpse)
{
- sLog->outError("Bones %u not found in world.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Bones %u not found in world.", GetGUIDLow());
return;
}
@@ -194,7 +194,7 @@ bool Corpse::LoadCorpseFromDB(uint32 guid, Field* fields)
if (!IsPositionValid())
{
- sLog->outError("Corpse (guid: %u, owner: %u) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
+ sLog->outError(LOG_FILTER_PLAYER, "Corpse (guid: %u, owner: %u) is not created, given coordinates are not valid (X: %f, Y: %f, Z: %f)",
GetGUIDLow(), GUID_LOPART(GetOwnerGUID()), posX, posY, posZ);
return false;
}
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index aa538437491..c46fc0d91d5 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -173,7 +173,7 @@ Creature::~Creature()
i_AI = NULL;
//if (m_uint32Values)
- // sLog->outError("Deconstruct Creature Entry = %u", GetEntry());
+ // sLog->outError(LOG_FILTER_UNITS, "Deconstruct Creature Entry = %u", GetEntry());
}
void Creature::AddToWorld()
@@ -261,7 +261,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
CreatureTemplate const* normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!normalInfo)
{
- sLog->outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature::InitEntry creature entry %u does not exist.", Entry);
return false;
}
@@ -299,7 +299,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
// Cancel load if no model defined
if (!(cinfo->GetFirstValidModelId()))
{
- sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
return false;
}
@@ -307,7 +307,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (!minfo) // Cancel load if no model defined
{
- sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
return false;
}
@@ -472,11 +472,11 @@ void Creature::Update(uint32 diff)
{
case JUST_RESPAWNED:
// Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting.
- sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_RESPAWNED (4)", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (GUID: %u Entry: %u) in wrong state: JUST_RESPAWNED (4)", GetGUIDLow(), GetEntry());
break;
case JUST_DIED:
// Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting.
- sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry());
break;
case DEAD:
{
@@ -525,7 +525,7 @@ void Creature::Update(uint32 diff)
else if (m_corpseRemoveTime <= time(NULL))
{
RemoveCorpse(false);
- sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
+ sLog->outDebug(LOG_FILTER_UNITS, "Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
}
break;
}
@@ -757,7 +757,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
- sLog->outErrorDb("Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
return false;
}
@@ -771,7 +771,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry,
if (!IsPositionValid())
{
- sLog->outError("Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
+ sLog->outError(LOG_FILTER_UNITS, "Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang);
return false;
}
@@ -838,7 +838,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const
if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS)
{
- sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
+ sLog->outError(LOG_FILTER_SQL, "Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
GetGUIDLow(), GetEntry());
return false;
}
@@ -1040,7 +1040,7 @@ void Creature::SaveToDB()
CreatureData const* data = sObjectMgr->GetCreatureData(m_DBTableGuid);
if (!data)
{
- sLog->outError("Creature::SaveToDB failed, cannot get creature data!");
+ sLog->outError(LOG_FILTER_UNITS, "Creature::SaveToDB failed, cannot get creature data!");
return;
}
@@ -1268,7 +1268,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
- sLog->outErrorDb("Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
return false;
}
@@ -1294,7 +1294,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap)
if (!data)
{
- sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ", guid);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) not found in table `creature`, can't load. ", guid);
return false;
}
@@ -1410,7 +1410,7 @@ void Creature::DeleteFromDB()
{
if (!m_DBTableGuid)
{
- sLog->outError("Trying to delete not saved creature! LowGUID: %u, Entry: %u", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Trying to delete not saved creature! LowGUID: %u, Entry: %u", GetGUIDLow(), GetEntry());
return;
}
@@ -1616,7 +1616,7 @@ void Creature::Respawn(bool force)
if (m_DBTableGuid)
GetMap()->RemoveCreatureRespawnTime(m_DBTableGuid);
- sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName(), GetGUIDLow(), GetGUID(), GetEntry());
+ sLog->outDebug(LOG_FILTER_UNITS, "Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName(), GetGUIDLow(), GetGUID(), GetEntry());
m_respawnTime = 0;
lootForPickPocketed = false;
lootForBody = false;
@@ -1730,7 +1730,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
+ sLog->outError(LOG_FILTER_UNITS, "WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1781,7 +1781,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
+ sLog->outError(LOG_FILTER_UNITS, "WORLD: unknown spell id %i", m_spells[i]);
continue;
}
@@ -1853,7 +1853,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
if (dist > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > MAX_VISIBILITY_DISTANCE. Distance set to ATTACK_DISTANCE.", GetGUIDLow(), GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > MAX_VISIBILITY_DISTANCE. Distance set to ATTACK_DISTANCE.", GetGUIDLow(), GetEntry());
dist = ATTACK_DISTANCE;
}
@@ -2137,7 +2137,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
if (!AdditionalSpellInfo)
{
- sLog->outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
continue;
}
@@ -2145,7 +2145,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
if (HasAura(*itr))
{
if (!reload)
- sLog->outErrorDb("Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
continue;
}
@@ -2172,7 +2172,7 @@ void Creature::SetInCombatWithZone()
{
if (!CanHaveThreatList())
{
- sLog->outError("Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry());
return;
}
@@ -2180,7 +2180,7 @@ void Creature::SetInCombatWithZone()
if (!map->IsDungeon())
{
- sLog->outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
+ sLog->outError(LOG_FILTER_UNITS, "Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), map->GetId());
return;
}
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index 54953ef5420..21ed1a23828 100755
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -84,8 +84,8 @@ void FormationMgr::LoadCreatureFormations()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
+
return;
}
@@ -118,14 +118,14 @@ void FormationMgr::LoadCreatureFormations()
{
if (!sObjectMgr->GetCreatureData(group_member->leaderGUID))
{
- sLog->outErrorDb("creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID);
+ sLog->outError(LOG_FILTER_SQL, "creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID);
delete group_member;
continue;
}
if (!sObjectMgr->GetCreatureData(memberGUID))
{
- sLog->outErrorDb("creature_formations table member guid %u incorrect (not exist)", memberGUID);
+ sLog->outError(LOG_FILTER_SQL, "creature_formations table member guid %u incorrect (not exist)", memberGUID);
delete group_member;
continue;
}
@@ -136,8 +136,8 @@ void FormationMgr::LoadCreatureFormations()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_UNITS, ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void CreatureGroup::AddMember(Creature* member)
diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp
index e2f5ad99b78..4e5762b87c8 100755
--- a/src/server/game/Entities/Creature/GossipDef.cpp
+++ b/src/server/game/Entities/Creature/GossipDef.cpp
@@ -177,7 +177,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poiId) const
PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(poiId);
if (!poi)
{
- sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.", poiId);
+ sLog->outError(LOG_FILTER_SQL, "Request to send non-existing POI (Id: %u), ignored.", poiId);
return;
}
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 2af6b4c04fd..43b29c600d6 100755
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -159,7 +159,7 @@ void TempSummon::Update(uint32 diff)
}
default:
UnSummon();
- sLog->outError("Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type);
+ sLog->outError(LOG_FILTER_UNITS, "Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type);
break;
}
}
@@ -267,7 +267,7 @@ void TempSummon::RemoveFromWorld()
owner->m_SummonSlot[slot] = 0;
//if (GetOwnerGUID())
- // sLog->outError("Unit %u has owner guid when removed from world", GetEntry());
+ // sLog->outError(LOG_FILTER_UNITS, "Unit %u has owner guid when removed from world", GetEntry());
Creature::RemoveFromWorld();
}
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
index 23257b34758..065333dc9e2 100755
--- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
@@ -85,7 +85,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe
Relocate(pos);
if (!IsPositionValid())
{
- sLog->outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
+ sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY());
return false;
}
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index cb35533484f..00b98ce2cc1 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -119,7 +119,7 @@ void GameObject::RemoveFromOwner()
else if (IS_PET_GUID(ownerGUID))
ownerType = "pet";
- sLog->outCrash("Delete GameObject (GUID: %u Entry: %u SpellId %u LinkedGO %u) that lost references to owner (GUID %u Type '%s') GO list. Crash possible later.",
+ sLog->outFatal(LOG_FILTER_GENERAL, "Delete GameObject (GUID: %u Entry: %u SpellId %u LinkedGO %u) that lost references to owner (GUID %u Type '%s') GO list. Crash possible later.",
GetGUIDLow(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), GUID_LOPART(ownerGUID), ownerType);
SetOwnerGUID(0);
}
@@ -170,7 +170,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
Relocate(x, y, z, ang);
if (!IsPositionValid())
{
- sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
+ sLog->outError(LOG_FILTER_GENERAL, "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y);
return false;
}
@@ -187,7 +187,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id);
if (!goinfo)
{
- sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), x, y, z);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), x, y, z);
return false;
}
@@ -197,7 +197,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
if (goinfo->type >= MAX_GAMEOBJECT_TYPE)
{
- sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: non-existing GO type '%u' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry: %u) not created: non-existing GO type '%u' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type);
return false;
}
@@ -269,7 +269,7 @@ void GameObject::Update(uint32 diff)
if (!AI())
{
if (!AIM_Initialize())
- sLog->outError("Could not initialize GameObjectAI");
+ sLog->outError(LOG_FILTER_GENERAL, "Could not initialize GameObjectAI");
} else
AI()->UpdateAI(diff);
@@ -648,7 +648,7 @@ void GameObject::SaveToDB()
GameObjectData const* data = sObjectMgr->GetGOData(m_DBTableGuid);
if (!data)
{
- sLog->outError("GameObject::SaveToDB failed, cannot get gameobject data!");
+ sLog->outError(LOG_FILTER_GENERAL, "GameObject::SaveToDB failed, cannot get gameobject data!");
return;
}
@@ -722,7 +722,7 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap)
if (!data)
{
- sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid);
return false;
}
@@ -1303,7 +1303,7 @@ void GameObject::Use(Unit* user)
//provide error, no fishable zone or area should be 0
if (!zone_skill)
- sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
+ sLog->outError(LOG_FILTER_SQL, "Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone);
int32 skill = player->GetSkillValue(SKILL_FISHING);
@@ -1319,7 +1319,7 @@ void GameObject::Use(Unit* user)
int32 roll = irand(1, 100);
- sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll);
// but you will likely cause junk in areas that require a high fishing skill (not yet implemented)
if (chance >= roll)
@@ -1613,7 +1613,7 @@ void GameObject::Use(Unit* user)
}
default:
if (GetGoType() >= MAX_GAMEOBJECT_TYPE)
- sLog->outError("GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
+ sLog->outError(LOG_FILTER_GENERAL, "GameObject::Use(): unit (type: %u, guid: %u, name: %s) tries to use object (guid: %u, entry: %u, name: %s) of unknown type (%u)",
user->GetTypeId(), user->GetGUIDLow(), user->GetName(), GetGUIDLow(), GetEntry(), GetGOInfo()->name.c_str(), GetGoType());
break;
}
@@ -1625,7 +1625,7 @@ void GameObject::Use(Unit* user)
if (!spellInfo)
{
if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this))
- sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
+ sLog->outError(LOG_FILTER_GENERAL, "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType());
else
sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId);
return;
diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp
index c4d4adeb6f2..db563c712cd 100755
--- a/src/server/game/Entities/Item/Container/Bag.cpp
+++ b/src/server/game/Entities/Item/Container/Bag.cpp
@@ -41,7 +41,7 @@ Bag::~Bag()
{
if (item->IsInWorld())
{
- sLog->outCrash("Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
+ sLog->outFatal(LOG_FILTER_PLAYER_ITEMS, "Item %u (slot %u, bag slot %u) in bag %u (slot %u, bag slot %u, m_bagslot %u) is to be deleted but is still in world.",
item->GetEntry(), (uint32)item->GetSlot(), (uint32)item->GetBagSlot(),
GetEntry(), (uint32)GetSlot(), (uint32)GetBagSlot(), (uint32)i);
item->RemoveFromWorld();
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 3dae2aa581c..2b5cb1e359a 100755
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -36,7 +36,7 @@ void AddItemsSetItem(Player* player, Item* item)
if (!set)
{
- sLog->outErrorDb("Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId);
+ sLog->outError(LOG_FILTER_SQL, "Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId);
return;
}
@@ -96,7 +96,7 @@ void AddItemsSetItem(Player* player, Item* item)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid);
break;
}
@@ -117,7 +117,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
if (!set)
{
- sLog->outErrorDb("Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId);
+ sLog->outError(LOG_FILTER_SQL, "Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId);
return;
}
@@ -597,7 +597,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
// item can have not null only one from field values
if ((itemProto->RandomProperty) && (itemProto->RandomSuffix))
{
- sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
+ sLog->outError(LOG_FILTER_SQL, "Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix);
return 0;
}
@@ -608,7 +608,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomPropertiesEntry const* random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (!random_id)
{
- sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
+ sLog->outError(LOG_FILTER_SQL, "Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
return 0;
}
@@ -621,7 +621,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
ItemRandomSuffixEntry const* random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
if (!random_id)
{
- sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
+ sLog->outError(LOG_FILTER_SQL, "Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
return 0;
}
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
index f3d7d7fd56c..0478173b96e 100755
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
@@ -70,13 +70,13 @@ void LoadRandomEnchantmentsTable()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_PLAYER_ITEMS, ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
else
{
- sLog->outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
+
}
}
@@ -91,7 +91,7 @@ uint32 GetItemEnchantMod(int32 entry)
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
if (tab == RandomItemEnch.end())
{
- sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry);
return 0;
}
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index ec1cb8d7728..264672fc5c9 100755..100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -91,7 +91,7 @@ WorldObject::~WorldObject()
{
if (GetTypeId() == TYPEID_CORPSE)
{
- sLog->outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
ASSERT(false);
}
ResetMap();
@@ -102,16 +102,16 @@ Object::~Object()
{
if (IsInWorld())
{
- sLog->outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
if (isType(TYPEMASK_ITEM))
- sLog->outCrash("Item slot %u", ((Item*)this)->GetSlot());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Item slot %u", ((Item*)this)->GetSlot());
ASSERT(false);
RemoveFromWorld();
}
if (m_objectUpdated)
{
- sLog->outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
ASSERT(false);
sObjectAccessor->RemoveUpdateObject(this);
}
@@ -955,6 +955,8 @@ void Object::GetUpdateFieldData(Player const* target, uint32*& flags, bool& isOw
flags = CorpseUpdateFieldFlags;
isOwner = ToCorpse()->GetOwnerGUID() == target->GetGUID();
break;
+ case TYPEID_OBJECT:
+ break;
}
}
@@ -1150,7 +1152,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value)
if (offset > 4)
{
- sLog->outError("Object::SetByteValue: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::SetByteValue: wrong offset %u", offset);
return;
}
@@ -1174,7 +1176,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value)
if (offset > 2)
{
- sLog->outError("Object::SetUInt16Value: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::SetUInt16Value: wrong offset %u", offset);
return;
}
@@ -1286,7 +1288,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
if (offset > 4)
{
- sLog->outError("Object::SetByteFlag: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::SetByteFlag: wrong offset %u", offset);
return;
}
@@ -1309,7 +1311,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
if (offset > 4)
{
- sLog->outError("Object::RemoveByteFlag: wrong offset %u", offset);
+ sLog->outError(LOG_FILTER_GENERAL, "Object::RemoveByteFlag: wrong offset %u", offset);
return;
}
@@ -1328,7 +1330,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
bool Object::PrintIndexError(uint32 index, bool set) const
{
- sLog->outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u", (set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType);
+ sLog->outError(LOG_FILTER_GENERAL, "Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u", (set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType);
// ASSERT must fail after function call
return false;
@@ -1383,32 +1385,32 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st
void MovementInfo::OutDebug()
{
- sLog->outString("MOVEMENT INFO");
- sLog->outString("guid " UI64FMTD, guid);
- sLog->outString("flags %u", flags);
- sLog->outString("flags2 %u", flags2);
- sLog->outString("time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
- sLog->outString("position: `%s`", pos.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "MOVEMENT INFO");
+ sLog->outInfo(LOG_FILTER_GENERAL, "guid " UI64FMTD, guid);
+ sLog->outInfo(LOG_FILTER_GENERAL, "flags %u", flags);
+ sLog->outInfo(LOG_FILTER_GENERAL, "flags2 %u", flags2);
+ sLog->outInfo(LOG_FILTER_GENERAL, "time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
+ sLog->outInfo(LOG_FILTER_GENERAL, "position: `%s`", pos.ToString().c_str());
if (t_guid)
{
- sLog->outString("TRANSPORT:");
- sLog->outString("guid: " UI64FMTD, t_guid);
- sLog->outString("position: `%s`", t_pos.ToString().c_str());
- sLog->outString("seat: %i", t_seat);
- sLog->outString("time: %u", t_time);
+ sLog->outInfo(LOG_FILTER_GENERAL, "TRANSPORT:");
+ sLog->outInfo(LOG_FILTER_GENERAL, "guid: " UI64FMTD, t_guid);
+ sLog->outInfo(LOG_FILTER_GENERAL, "position: `%s`", t_pos.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "seat: %i", t_seat);
+ sLog->outInfo(LOG_FILTER_GENERAL, "time: %u", t_time);
if (flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT)
- sLog->outString("time2: %u", t_time2);
+ sLog->outInfo(LOG_FILTER_GENERAL, "time2: %u", t_time2);
}
if ((flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))
- sLog->outString("pitch: %f", pitch);
+ sLog->outInfo(LOG_FILTER_GENERAL, "pitch: %f", pitch);
- sLog->outString("fallTime: %u", fallTime);
+ sLog->outInfo(LOG_FILTER_GENERAL, "fallTime: %u", fallTime);
if (flags & MOVEMENTFLAG_FALLING)
- sLog->outString("j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed);
+ sLog->outInfo(LOG_FILTER_GENERAL, "j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed);
if (flags & MOVEMENTFLAG_SPLINE_ELEVATION)
- sLog->outString("splineElevation: %f", splineElevation);
+ sLog->outInfo(LOG_FILTER_GENERAL, "splineElevation: %f", splineElevation);
}
WorldObject::WorldObject(bool isWorldObject): WorldLocation(),
@@ -2330,7 +2332,7 @@ void WorldObject::SetMap(Map* map)
return;
if (m_currMap)
{
- sLog->outCrash("WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
+ sLog->outFatal(LOG_FILTER_GENERAL, "WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
ASSERT(false);
}
m_currMap = map;
@@ -2365,7 +2367,7 @@ void WorldObject::AddObjectToRemoveList()
Map* map = FindMap();
if (!map)
{
- sLog->outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).", GetTypeId(), GetEntry(), GetGUIDLow(), GetMapId());
+ sLog->outError(LOG_FILTER_GENERAL, "Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).", GetTypeId(), GetEntry(), GetGUIDLow(), GetMapId());
return;
}
@@ -2531,7 +2533,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
pet->Relocate(x, y, z, ang);
if (!pet->IsPositionValid())
{
- sLog->outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
+ sLog->outError(LOG_FILTER_GENERAL, "Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY());
delete pet;
return NULL;
}
@@ -2540,7 +2542,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
- sLog->outError("no such creature entry %u", entry);
+ sLog->outError(LOG_FILTER_GENERAL, "no such creature entry %u", entry);
delete pet;
return NULL;
}
@@ -2617,7 +2619,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
if (!goinfo)
{
- sLog->outErrorDb("Gameobject template %u not found in database!", entry);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject template %u not found in database!", entry);
return NULL;
}
Map* map = GetMap();
@@ -2919,7 +2921,7 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle)
// Prevent invalid coordinates here, position is unchanged
if (!Trinity::IsValidMapCoord(destx, desty))
{
- sLog->outCrash("WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
+ sLog->outFatal(LOG_FILTER_GENERAL, "WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty);
return;
}
@@ -2965,7 +2967,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
// Prevent invalid coordinates here, position is unchanged
if (!Trinity::IsValidMapCoord(destx, desty))
{
- sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
+ sLog->outFatal(LOG_FILTER_GENERAL, "WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty);
return;
}
diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp
index afe43ca245c..afe43ca245c 100755..100644
--- a/src/server/game/Entities/Object/Updates/UpdateData.cpp
+++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 36736bb63a7..8392fbb9e49 100755
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -183,7 +183,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
if (!IsPositionValid())
{
- sLog->outError("Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_PETS, "Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
@@ -227,7 +227,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
break;
default:
if (!IsPetGhoul())
- sLog->outError("Pet have incorrect type (%u) for pet loading.", getPetType());
+ sLog->outError(LOG_FILTER_PETS, "Pet have incorrect type (%u) for pet loading.", getPetType());
break;
}
@@ -553,7 +553,7 @@ void Pet::Update(uint32 diff)
{
if (owner->GetPetGUID() != GetGUID())
{
- sLog->outError("Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName());
+ sLog->outError(LOG_FILTER_PETS, "Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName());
Remove(getPetType() == HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT);
return;
}
@@ -718,7 +718,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
if (!IsPositionValid())
{
- sLog->outError("Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_PETS, "Pet (guidlow %d, entry %d) not created base at creature. Suggested coordinates isn't valid (X: %f Y: %f)",
GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
@@ -726,7 +726,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
CreatureTemplate const* cinfo = GetCreatureTemplate();
if (!cinfo)
{
- sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
+ sLog->outError(LOG_FILTER_PETS, "CreateBaseAtCreature() failed, creatureInfo is missing!");
return false;
}
@@ -799,7 +799,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
m_unitTypeMask |= UNIT_MASK_HUNTER_PET;
}
else
- sLog->outError("Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass());
+ sLog->outError(LOG_FILTER_PETS, "Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass());
}
uint32 creature_ID = (petType == HUNTER_PET) ? 1 : cinfo->Entry;
@@ -1077,7 +1077,7 @@ void Pet::_LoadSpellCooldowns()
if (!sSpellMgr->GetSpellInfo(spell_id))
{
- sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id);
+ sLog->outError(LOG_FILTER_PETS, "Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id);
continue;
}
@@ -1228,7 +1228,7 @@ void Pet::_LoadAuras(uint32 timediff)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
- sLog->outError("Unknown aura (spellid %u), ignore.", spellid);
+ sLog->outError(LOG_FILTER_PETS, "Unknown aura (spellid %u), ignore.", spellid);
continue;
}
@@ -1259,7 +1259,7 @@ void Pet::_LoadAuras(uint32 timediff)
}
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
aura->ApplyForTargets();
- sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
+ sLog->outInfo(LOG_FILTER_PETS, "Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
}
}
while (result->NextRow());
@@ -1335,7 +1335,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
// do pet spell book cleanup
if (state == PETSPELL_UNCHANGED) // spell load case
{
- sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spellId);
+ sLog->outError(LOG_FILTER_PETS, "Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_PET_SPELL);
@@ -1344,7 +1344,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ sLog->outError(LOG_FILTER_PETS, "Pet::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
return false;
}
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 487ae4a34cf..7250feefc21 100755..100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -721,7 +721,6 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep
m_MirrorTimerFlagsLast = UNDERWATER_NONE;
m_isInWater = false;
m_drunkTimer = 0;
- m_drunk = 0;
m_restTime = 0;
m_deathTimer = 0;
m_deathExpireTime = 0;
@@ -911,7 +910,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class);
if (!info)
{
- sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class);
return false;
}
@@ -924,7 +923,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(createInfo->Class);
if (!cEntry)
{
- sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Class);
return false;
}
@@ -940,7 +939,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
if (!IsValidGender(createInfo->Gender))
{
- sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so",
GetSession()->GetAccountId(), m_name.c_str(), createInfo->Gender);
return false;
}
@@ -1204,7 +1203,7 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
}
// item can't be added
- sLog->outError("STORAGE: Can't equip or store initial item %u for race %u class %u, error msg = %u", titem_id, getRace(), getClass(), msg);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Can't equip or store initial item %u for race %u class %u, error msg = %u", titem_id, getRace(), getClass(), msg);
return false;
}
@@ -1271,7 +1270,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
{
if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage
{
- sLog->outStaticDebug("We are fall to death, loosing 10 percents durability");
+ sLog->outDebug(LOG_FILTER_PLAYER, "We are fall to death, loosing 10 percents durability");
DurabilityLossAll(0.10f, false);
// durability lost message
WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0);
@@ -1434,49 +1433,51 @@ void Player::HandleDrowning(uint32 time_diff)
m_MirrorTimerFlagsLast = m_MirrorTimerFlags;
}
-///The player sobers by 256 every 10 seconds
+///The player sobers by 1% every 9 seconds
void Player::HandleSobering()
{
m_drunkTimer = 0;
- uint32 drunk = (m_drunk <= 256) ? 0 : (m_drunk - 256);
+ uint8 currentDrunkValue = GetDrunkValue();
+ uint8 drunk = currentDrunkValue ? --currentDrunkValue : 0;
SetDrunkValue(drunk);
}
-DrunkenState Player::GetDrunkenstateByValue(uint16 value)
+DrunkenState Player::GetDrunkenstateByValue(uint8 value)
{
- if (value >= 23000)
+ if (value >= 90)
return DRUNKEN_SMASHED;
- if (value >= 12800)
+ if (value >= 50)
return DRUNKEN_DRUNK;
- if (value & 0xFFFE)
+ if (value)
return DRUNKEN_TIPSY;
return DRUNKEN_SOBER;
}
-void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
+void Player::SetDrunkValue(uint8 newDrunkValue, uint32 itemId /*= 0*/)
{
- uint32 oldDrunkenState = Player::GetDrunkenstateByValue(m_drunk);
+ bool isSobering = newDrunkValue < GetDrunkValue();
+ uint32 oldDrunkenState = Player::GetDrunkenstateByValue(GetDrunkValue());
+ if (newDrunkValue > 100)
+ newDrunkValue = 100;
// select drunk percent or total SPELL_AURA_MOD_FAKE_INEBRIATE amount, whichever is higher for visibility updates
- int32 drunkPercent = newDrunkenValue * 100 / 0xFFFF;
- drunkPercent = std::max(drunkPercent, GetTotalAuraModifier(SPELL_AURA_MOD_FAKE_INEBRIATE));
-
+ int32 drunkPercent = std::max<int32>(newDrunkValue, GetTotalAuraModifier(SPELL_AURA_MOD_FAKE_INEBRIATE));
if (drunkPercent)
{
m_invisibilityDetect.AddFlag(INVISIBILITY_DRUNK);
m_invisibilityDetect.SetValue(INVISIBILITY_DRUNK, drunkPercent);
}
- else if (!HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE) && !newDrunkenValue)
+ else if (!HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE) && !newDrunkValue)
m_invisibilityDetect.DelFlag(INVISIBILITY_DRUNK);
- m_drunk = newDrunkenValue;
- SetUInt32Value(PLAYER_BYTES_3, (GetUInt32Value(PLAYER_BYTES_3) & 0xFFFF0001) | (m_drunk & 0xFFFE));
-
- uint32 newDrunkenState = Player::GetDrunkenstateByValue(m_drunk);
-
+ uint32 newDrunkenState = Player::GetDrunkenstateByValue(newDrunkValue);
+ SetByteValue(PLAYER_BYTES_3, 1, newDrunkValue);
UpdateObjectVisibility();
+ if (!isSobering)
+ m_drunkTimer = 0; // reset sobering timer
+
if (newDrunkenState == oldDrunkenState)
return;
@@ -1484,7 +1485,6 @@ void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId)
data << uint64(GetGUID());
data << uint32(newDrunkenState);
data << uint32(itemId);
-
SendMessageToSet(&data, true);
}
@@ -1508,9 +1508,9 @@ void Player::Update(uint32 p_time)
//ASSERT (!m_spellModTakingSpell);
if (m_spellModTakingSpell)
{
- //sLog->outCrash("Player has m_pad %u during update!", m_pad);
+ //sLog->outFatal(LOG_FILTER_PLAYER, "Player has m_pad %u during update!", m_pad);
//if (m_spellModTakingSpell)
- sLog->outCrash("Player has m_spellModTakingSpell %u during update!", m_spellModTakingSpell->m_spellInfo->Id);
+ sLog->outFatal(LOG_FILTER_SPELLS_AURAS, "Player has m_spellModTakingSpell %u during update!", m_spellModTakingSpell->m_spellInfo->Id);
m_spellModTakingSpell = NULL;
}
@@ -1707,7 +1707,7 @@ void Player::Update(uint32 p_time)
{
// m_nextSave reseted in SaveToDB call
SaveToDB();
- sLog->outDetail("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_PLAYER, "Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
}
else
m_nextSave -= p_time;
@@ -1725,11 +1725,10 @@ void Player::Update(uint32 p_time)
m_Last_tick = now;
}
- if (m_drunk)
+ if (GetDrunkValue())
{
m_drunkTimer += p_time;
-
- if (m_drunkTimer > 10*IN_MILLISECONDS)
+ if (m_drunkTimer > 9 * IN_MILLISECONDS)
HandleSobering();
}
@@ -1797,7 +1796,7 @@ void Player::setDeathState(DeathState s)
{
if (!cur)
{
- sLog->outError("setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow());
return;
}
@@ -2105,14 +2104,14 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation))
{
- sLog->outError("TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).",
+ sLog->outError(LOG_FILTER_MAPS, "TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).",
mapid, x, y, z, orientation, GetGUIDLow(), GetName(), GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
return false;
}
if (AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()) && DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, mapid, this))
{
- sLog->outError("Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid);
+ sLog->outError(LOG_FILTER_MAPS, "Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid);
SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED);
return false;
}
@@ -2469,7 +2468,7 @@ void Player::RemoveFromWorld()
{
if (WorldObject* viewpoint = GetViewpoint())
{
- sLog->outCrash("Player %s has viewpoint %u %u when removed from world", GetName(), viewpoint->GetEntry(), viewpoint->GetTypeId());
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has viewpoint %u %u when removed from world", GetName(), viewpoint->GetEntry(), viewpoint->GetTypeId());
SetViewpoint(viewpoint, false);
}
}
@@ -3411,7 +3410,7 @@ void Player::SendInitialSpells()
GetSession()->SendPacket(&data);
- sLog->outDetail("CHARACTER: Sent Initial Spells");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "CHARACTER: Sent Initial Spells");
}
void Player::RemoveMail(uint32 id)
@@ -3492,7 +3491,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3501,7 +3500,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
return false;
}
@@ -3511,7 +3510,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3520,7 +3519,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addTalent: Broken spell #%u learning not allowed.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addTalent: Broken spell #%u learning not allowed.", spellId);
return false;
}
@@ -3565,7 +3564,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3574,7 +3573,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Non-existed in SpellStore spell #%u request.", spellId);
return false;
}
@@ -3584,7 +3583,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
// do character spell book cleanup (all characters)
if (!IsInWorld() && !learning) // spell load case
{
- sLog->outError("Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.", spellId);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_SPELL);
@@ -3593,7 +3592,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent
CharacterDatabase.Execute(stmt);
}
else
- sLog->outError("Player::addSpell: Broken spell #%u learning not allowed.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Player::addSpell: Broken spell #%u learning not allowed.", spellId);
return false;
}
@@ -4308,7 +4307,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result)
if (!sSpellMgr->GetSpellInfo(spell_id))
{
- sLog->outError("Player %u has unknown spell %u in `character_spell_cooldown`, skipping.", GetGUIDLow(), spell_id);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Player %u has unknown spell %u in `character_spell_cooldown`, skipping.", GetGUIDLow(), spell_id);
continue;
}
@@ -4972,7 +4971,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
break;
}
default:
- sLog->outError("Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
}
if (updateRealmChars)
@@ -5002,7 +5001,7 @@ void Player::DeleteOldCharacters()
*/
void Player::DeleteOldCharacters(uint32 keepDays)
{
- sLog->outString("Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays);
+ sLog->outInfo(LOG_FILTER_PLAYER, "Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_OLD_CHARS);
stmt->setUInt32(0, uint32(time(NULL) - time_t(keepDays * DAY)));
@@ -5010,7 +5009,7 @@ void Player::DeleteOldCharacters(uint32 keepDays)
if (result)
{
- sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", result->GetRowCount());
+ sLog->outDebug(LOG_FILTER_PLAYER, "Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", result->GetRowCount());
do
{
Field* fields = result->Fetch();
@@ -5041,7 +5040,7 @@ void Player::BuildPlayerRepop()
// the player cannot have a corpse already, only bones which are not returned by GetCorpse
if (GetCorpse())
{
- sLog->outError("BuildPlayerRepop: player %s(%d) already has a corpse", GetName(), GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "BuildPlayerRepop: player %s(%d) already has a corpse", GetName(), GetGUIDLow());
return;
}
@@ -5050,7 +5049,7 @@ void Player::BuildPlayerRepop()
Corpse* corpse = GetCorpse();
if (!corpse)
{
- sLog->outError("Error creating corpse for Player %s [%u]", GetName(), GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Error creating corpse for Player %s [%u]", GetName(), GetGUIDLow());
return;
}
GetMap()->AddToMap(corpse);
@@ -5402,7 +5401,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityCostsEntry const* dcost = sDurabilityCostsStore.LookupEntry(ditemProto->ItemLevel);
if (!dcost)
{
- sLog->outError("RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
return TotalCost;
}
@@ -5410,7 +5409,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
DurabilityQualityEntry const* dQualitymodEntry = sDurabilityQualityStore.LookupEntry(dQualitymodEntryId);
if (!dQualitymodEntry)
{
- sLog->outError("RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
return TotalCost;
}
@@ -5426,7 +5425,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
{
if (GetGuildId() == 0)
{
- sLog->outStaticDebug("You are not member of a guild");
+ sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "You are not member of a guild");
return TotalCost;
}
@@ -5441,7 +5440,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
}
else if (!HasEnoughMoney(uint64(costs)))
{
- sLog->outStaticDebug("You do not have enough money");
+ sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "You do not have enough money");
return TotalCost;
}
else
@@ -5649,7 +5648,7 @@ void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, floa
{
if (modGroup >= BASEMOD_END || modType >= MOD_END)
{
- sLog->outError("ERROR in HandleBaseModValue(): non existed BaseModGroup of wrong BaseModType!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "ERROR in HandleBaseModValue(): non existed BaseModGroup of wrong BaseModType!");
return;
}
@@ -5680,7 +5679,7 @@ float Player::GetBaseModValue(BaseModGroup modGroup, BaseModType modType) const
{
if (modGroup >= BASEMOD_END || modType > MOD_END)
{
- sLog->outError("trial to access non existed BaseModGroup or wrong BaseModType!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "trial to access non existed BaseModGroup or wrong BaseModType!");
return 0.0f;
}
@@ -5694,7 +5693,7 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const
{
if (modGroup >= BASEMOD_END)
{
- sLog->outError("wrong BaseModGroup in GetTotalBaseModValue()!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "wrong BaseModGroup in GetTotalBaseModValue()!");
return 0.0f;
}
@@ -6434,7 +6433,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(id);
if (!pSkill)
{
- sLog->outError("Skill not found in SkillLineStore: skill #%u", id);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill not found in SkillLineStore: skill #%u", id);
return;
}
@@ -6616,8 +6615,6 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const
void Player::SendActionButtons(uint32 state) const
{
- sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), GetActiveSpec());
-
WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4));
/*
state can be 0, 1, 2
@@ -6639,20 +6636,20 @@ void Player::SendActionButtons(uint32 state) const
data << uint8(state);
GetSession()->SendPacket(&data);
- sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), GetActiveSpec());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), GetActiveSpec());
}
bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
{
if (button >= MAX_ACTION_BUTTONS)
{
- sLog->outError("Action %u not added into button %u for player %s: button must be < %u", action, button, GetName(), MAX_ACTION_BUTTONS);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Action %u not added into button %u for player %s: button must be < %u", action, button, GetName(), MAX_ACTION_BUTTONS);
return false;
}
if (action >= MAX_ACTION_BUTTON_ACTION_VALUE)
{
- sLog->outError("Action %u not added into button %u for player %s: action must be < %u", action, button, GetName(), MAX_ACTION_BUTTON_ACTION_VALUE);
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Action %u not added into button %u for player %s: action must be < %u", action, button, GetName(), MAX_ACTION_BUTTON_ACTION_VALUE);
return false;
}
@@ -6661,7 +6658,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
case ACTION_BUTTON_SPELL:
if (!sSpellMgr->GetSpellInfo(action))
{
- sLog->outError("Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName());
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName());
return false;
}
@@ -6674,7 +6671,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type)
case ACTION_BUTTON_ITEM:
if (!sObjectMgr->GetItemTemplate(action))
{
- sLog->outError("Item action %u not added into button %u for player %s: item not exist", action, button, GetName());
+ sLog->outError(LOG_FILTER_PLAYER_LOADING, "Item action %u not added into button %u for player %s: item not exist", action, button, GetName());
return false;
}
break;
@@ -6696,7 +6693,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
// set data and update to CHANGED if not NEW
ab.SetActionAndType(action, ActionButtonType(type));
- sLog->outDetail("Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button);
+ sLog->outInfo(LOG_FILTER_PLAYER_LOADING, "Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button);
return &ab;
}
@@ -6711,7 +6708,7 @@ void Player::removeActionButton(uint8 button)
else
buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save
- sLog->outDetail("Action Button '%u' Removed from Player '%u'", button, GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_PLAYER_LOADING, "Action Button '%u' Removed from Player '%u'", button, GetGUIDLow());
}
ActionButton const* Player::GetActionButton(uint8 button)
@@ -6823,7 +6820,7 @@ void Player::CheckAreaExploreAndOutdoor()
if (offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
- sLog->outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE);
+ sLog->outError(LOG_FILTER_PLAYER, "Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE);
return;
}
@@ -6839,7 +6836,7 @@ void Player::CheckAreaExploreAndOutdoor()
AreaTableEntry const* areaEntry = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId());
if (!areaEntry)
{
- sLog->outError("Player %u discovered unknown area (x: %f y: %f z: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId());
+ sLog->outError(LOG_FILTER_PLAYER, "Player %u discovered unknown area (x: %f y: %f z: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId());
return;
}
@@ -6876,7 +6873,7 @@ void Player::CheckAreaExploreAndOutdoor()
GiveXP(XP, NULL);
SendExplorationExperience(area, XP);
}
- sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area);
+ sLog->outInfo(LOG_FILTER_PLAYER, "Player %u discovered a new area: %u", GetGUIDLow(), area);
}
}
}
@@ -6890,10 +6887,10 @@ uint32 Player::TeamForRace(uint8 race)
case 1: return HORDE;
case 7: return ALLIANCE;
}
- sLog->outError("Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
+ sLog->outError(LOG_FILTER_PLAYER, "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
}
else
- sLog->outError("Race (%u) not found in DBC: wrong DBC files?", uint32(race));
+ sLog->outError(LOG_FILTER_PLAYER, "Race (%u) not found in DBC: wrong DBC files?", uint32(race));
return ALLIANCE;
}
@@ -7823,7 +7820,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
if (item->IsBroken())
return;
- sLog->outDetail("applying mods for item %u ", item->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_PLAYER_ITEMS, "applying mods for item %u ", item->GetGUIDLow());
uint8 attacktype = Player::GetAttackBySlot(slot);
@@ -8277,7 +8274,7 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply,
return;
}
- sLog->outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
+ sLog->outDebug(LOG_FILTER_PLAYER, "WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
CastSpell(this, spellInfo, true, item);
}
@@ -8383,7 +8380,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown Item spellid %i", spellData.SpellId);
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "WORLD: unknown Item spellid %i", spellData.SpellId);
continue;
}
@@ -8455,7 +8452,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
- sLog->outError("Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...",
+ sLog->outError(LOG_FILTER_PLAYER_ITEMS, "Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...",
GetGUIDLow(), GetName(), pEnchant->ID, pEnchant->spellid[s]);
continue;
}
@@ -8500,7 +8497,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(learn_spell_id);
if (!spellInfo)
{
- sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id);
SendEquipError(EQUIP_ERR_NONE, item, NULL);
return;
}
@@ -8532,7 +8529,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (!spellInfo)
{
- sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId);
continue;
}
@@ -8563,7 +8560,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
- sLog->outError("Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
continue;
}
@@ -9181,6 +9178,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
case 1519: // Stormwind City
case 1537: // Ironforge
case 2257: // Deeprun Tram
+ case 3703: // Shattrath City
break;
case 139: // Eastern Plaguelands
if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_EP)
@@ -9587,7 +9585,6 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(3610) << uint32(0x0); // 9 show
}
break;
- case 3703: // Shattrath City
case 4384: // Strand of the Ancients
if (bg && bg->GetTypeID(true) == BATTLEGROUND_SA)
bg->FillInitialWorldStates(data);
@@ -9730,7 +9727,7 @@ uint32 Player::GetXPRestBonus(uint32 xp)
SetRestBonus(GetRestBonus() - rested_bonus);
- sLog->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus());
+ sLog->outInfo(LOG_FILTER_PLAYER, "Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus());
return rested_bonus;
}
@@ -9762,7 +9759,7 @@ void Player::ResetPetTalents()
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("Object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
+ sLog->outError(LOG_FILTER_PLAYER, "Object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return;
}
pet->resetTalents();
@@ -11396,7 +11393,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest
// Currency tokens are not supposed to be swapped out of their hidden bag
if(pItem->IsCurrencyToken())
{
- sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!",
+ sLog->outError(LOG_FILTER_PLAYER, "Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!",
GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId);
return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED;
}
@@ -11966,7 +11963,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update)
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cooldownSpell);
if (!spellProto)
- sLog->outError("Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell);
+ sLog->outError(LOG_FILTER_PLAYER, "Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell);
else
{
m_weaponChangeTimer = spellProto->StartRecoveryTime;
@@ -13947,7 +13944,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
// nothing do..
break;
default:
- sLog->outError("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
+ sLog->outError(LOG_FILTER_PLAYER, "Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type);
break;
} /*switch (enchant_display_type)*/
} /*for*/
@@ -14118,7 +14115,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
VendorItemData const* vendorItems = creature->GetVendorItems();
if (!vendorItems || vendorItems->Empty())
{
- sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", creature->GetGUIDLow(), creature->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", creature->GetGUIDLow(), creature->GetEntry());
canTalk = false;
}
break;
@@ -14167,7 +14164,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
canTalk = false;
break;
default:
- sLog->outErrorDb("Creature entry %u have unknown gossip option %u for menu %u", creature->GetEntry(), itr->second.OptionType, itr->second.MenuId);
+ sLog->outError(LOG_FILTER_SQL, "Creature entry %u have unknown gossip option %u for menu %u", creature->GetEntry(), itr->second.OptionType, itr->second.MenuId);
canTalk = false;
break;
}
@@ -14262,7 +14259,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
{
if (gossipOptionId > GOSSIP_OPTION_QUESTGIVER)
{
- sLog->outError("Player guid %u request invalid gossip option for GameObject entry %u", GetGUIDLow(), source->GetEntry());
+ sLog->outError(LOG_FILTER_PLAYER, "Player guid %u request invalid gossip option for GameObject entry %u", GetGUIDLow(), source->GetEntry());
return;
}
}
@@ -14366,7 +14363,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
{
- sLog->outError("a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", GetGUIDLow());
return;
}
@@ -16479,7 +16476,7 @@ void Player::_LoadArenaTeamInfo(PreparedQueryResult result)
ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(arenaTeamId);
if (!arenaTeam)
{
- sLog->outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenaTeamId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenaTeamId);
continue;
}
@@ -16632,7 +16629,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (!result)
{
- sLog->outError("Player (GUID: %u) not found in table `characters`, can't load. ", guid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) not found in table `characters`, can't load. ", guid);
return false;
}
@@ -16644,13 +16641,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// player should be able to load/delete character only with correct account!
if (dbAccountId != GetSession()->GetAccountId())
{
- sLog->outError("Player (GUID: %u) loading from wrong account (is: %u, should be: %u)", guid, GetSession()->GetAccountId(), dbAccountId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) loading from wrong account (is: %u, should be: %u)", guid, GetSession()->GetAccountId(), dbAccountId);
return false;
}
if (holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBANNED))
{
- sLog->outError("Player (GUID: %u) is banned, can't load.", guid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) is banned, can't load.", guid);
return false;
}
@@ -16678,7 +16675,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
uint8 Gender = fields[5].GetUInt8();
if (!IsValidGender(Gender))
{
- sLog->outError("Player (GUID: %u) has wrong gender (%hu), can't be loaded.", guid, Gender);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) has wrong gender (%hu), can't be loaded.", guid, Gender);
return false;
}
@@ -16709,7 +16706,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32());
SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32());
- SetUInt32Value(PLAYER_BYTES_3, (fields[47].GetUInt16() & 0xFFFE) | fields[5].GetUInt8());
+ SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8());
+ SetByteValue(PLAYER_BYTES_3, 1, fields[47].GetUInt8());
SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32());
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[46].GetUInt32());
@@ -16794,7 +16792,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (!mapEntry || !IsPositionValid())
{
- sLog->outError("Player (guidlow %d) have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
RelocateToHomebind();
}
// Player was saved in Arena or Bg
@@ -16832,7 +16830,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (mapId == MAPID_INVALID) // Battleground Entry Point not found (???)
{
- sLog->outError("Player (guidlow %d) was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.", guid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.", guid);
RelocateToHomebind();
}
else
@@ -16854,7 +16852,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// transport size limited
m_movementInfo.t_pos.m_positionX > 250 || m_movementInfo.t_pos.m_positionY > 250 || m_movementInfo.t_pos.m_positionZ > 250)
{
- sLog->outError("Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.",
guid, GetPositionX()+m_movementInfo.t_pos.m_positionX, GetPositionY()+m_movementInfo.t_pos.m_positionY,
GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.m_orientation);
@@ -16874,7 +16872,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
}
if (!m_transport)
{
- sLog->outError("Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.",
guid, transGUID);
RelocateToHomebind();
@@ -16901,12 +16899,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (!nodeEntry) // don't know taxi start node, to homebind
{
- sLog->outError("Character %u have wrong data in taxi destination list, teleport to homebind.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u have wrong data in taxi destination list, teleport to homebind.", GetGUIDLow());
RelocateToHomebind();
}
else // have start node, to it
{
- sLog->outError("Character %u have too short taxi destination list, teleport to original node.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u have too short taxi destination list, teleport to original node.", GetGUIDLow());
mapId = nodeEntry->map_id;
Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f);
}
@@ -16956,13 +16954,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
AreaTrigger const* at = sObjectMgr->GetGoBackTrigger(mapId);
if (at)
{
- sLog->outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation());
mapId = at->target_mapId;
}
else
{
- sLog->outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
RelocateToHomebind();
}
@@ -16972,11 +16970,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
mapId = info->mapId;
Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
- sLog->outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
map = sMapMgr->CreateMap(mapId, this);
if (!map)
{
- sLog->outError("Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
return false;
}
}
@@ -16990,7 +16988,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
Relocate(at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
else
{
- sLog->outError("Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no area-trigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no area-trigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), mapId);
RelocateToHomebind();
}
}
@@ -17012,13 +17010,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
// set value, including drunk invisibility detection
// calculate sobering. after 15 minutes logged out, the player will be sober again
- float soberFactor;
- if (time_diff > 15*MINUTE)
- soberFactor = 0;
- else
- soberFactor = 1-time_diff/(15.0f*MINUTE);
- uint16 newDrunkenValue = uint16(soberFactor*(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE));
- SetDrunkValue(newDrunkenValue);
+ uint8 newDrunkValue = 0;
+ if (time_diff < GetDrunkValue() * 9)
+ newDrunkValue = GetDrunkValue() - time_diff / 9;
+
+ SetDrunkValue(newDrunkValue);
m_cinematic = fields[18].GetUInt8();
m_Played_time[PLAYED_TIME_TOTAL]= fields[19].GetUInt32();
@@ -17034,7 +17030,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
m_stableSlots = fields[33].GetUInt8();
if (m_stableSlots > MAX_PET_STABLES)
{
- sLog->outError("Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots));
+ sLog->outError(LOG_FILTER_PLAYER, "Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots));
m_stableSlots = MAX_PET_STABLES;
}
@@ -17112,7 +17108,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
if (GetSpecsCount() > MAX_TALENT_SPECS || GetActiveSpec() > MAX_TALENT_SPEC || GetSpecsCount() < MIN_TALENT_SPECS)
{
SetActiveSpec(0);
- sLog->outError("Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), GetSpecsCount(), GetActiveSpec());
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), GetSpecsCount(), GetActiveSpec());
}
_LoadTalents(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADTALENTS));
@@ -17344,7 +17340,7 @@ void Player::_LoadActions(PreparedQueryResult result)
ab->uState = ACTIONBUTTON_UNCHANGED;
else
{
- sLog->outError(" ...at loading, and will deleted in DB also");
+ sLog->outError(LOG_FILTER_PLAYER, " ...at loading, and will deleted in DB also");
// Will deleted in DB at next save (it can create data until save but marked as deleted)
m_actionButtons[button].uState = ACTIONBUTTON_DELETED;
@@ -17388,7 +17384,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
- sLog->outError("Unknown aura (spellid %u), ignore.", spellid);
+ sLog->outError(LOG_FILTER_PLAYER, "Unknown aura (spellid %u), ignore.", spellid);
continue;
}
@@ -17422,7 +17418,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff)
aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]);
aura->ApplyForTargets();
- sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
+ sLog->outInfo(LOG_FILTER_PLAYER, "Added aura spellid %u, effectmask %u", spellInfo->Id, effmask);
}
}
while (result->NextRow());
@@ -17445,13 +17441,13 @@ void Player::_LoadGlyphAuras()
continue;
}
else
- sLog->outError("Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags);
}
else
- sLog->outError("Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i);
}
else
- sLog->outError("Player %s has not existing glyph entry %u on index %u", m_name.c_str(), glyph, i);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s has not existing glyph entry %u on index %u", m_name.c_str(), glyph, i);
// On any error remove glyph
SetGlyph(i, 0);
@@ -17561,7 +17557,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
}
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?",
GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), bagGuid, slot);
item->DeleteFromInventoryDB(trans);
delete item;
@@ -17575,7 +17571,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff)
item->SetState(ITEM_UNCHANGED, this);
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which can't be loaded into inventory (Bag GUID: %u, slot: %u) by reason %u. Item will be sent by mail.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which can't be loaded into inventory (Bag GUID: %u, slot: %u) by reason %u. Item will be sent by mail.",
GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), bagGuid, slot, err);
item->DeleteFromInventoryDB(trans);
problematicItems.push_back(item);
@@ -17623,25 +17619,25 @@ void Player::_LoadVoidStorage(PreparedQueryResult result)
if (!itemId)
{
- sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid id (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
+ sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid id (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
continue;
}
if (!sObjectMgr->GetItemTemplate(itemEntry))
{
- sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid entry (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
+ sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid entry (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry);
continue;
}
if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT)
{
- sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, slot);
+ sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, slot);
continue;
}
if (!sObjectMgr->GetPlayerByLowGUID(creatorGuid))
{
- sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: %u, entry: %u, creatorGuid: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, creatorGuid);
+ sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: %u, entry: %u, creatorGuid: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, creatorGuid);
creatorGuid = 0;
}
@@ -17747,7 +17743,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
}
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has broken item (GUID: %u, entry: %u) in inventory. Deleting item.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has broken item (GUID: %u, entry: %u) in inventory. Deleting item.",
GetGUIDLow(), GetName(), itemGuid, itemEntry);
remove = true;
}
@@ -17762,7 +17758,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F
}
else
{
- sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has unknown item (entry: %u) in inventory. Deleting item.",
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadInventory: player (GUID: %u, name: '%s') has unknown item (entry: %u) in inventory. Deleting item.",
GetGUIDLow(), GetName(), itemEntry);
Item::DeleteFromInventoryDB(trans, itemGuid);
Item::DeleteFromDB(trans, itemGuid);
@@ -17793,7 +17789,7 @@ void Player::_LoadMailedItems(Mail* mail)
if (!proto)
{
- sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), itemGuid, itemTemplate, mail->messageID);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), itemGuid, itemTemplate, mail->messageID);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_MAIL_ITEM);
stmt->setUInt32(0, itemGuid);
@@ -17809,7 +17805,7 @@ void Player::_LoadMailedItems(Mail* mail)
if (!item->LoadFromDB(itemGuid, MAKE_NEW_GUID(fields[13].GetUInt32(), 0, HIGHGUID_PLAYER), fields, itemTemplate))
{
- sLog->outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM);
stmt->setUInt32(0, itemGuid);
@@ -17872,7 +17868,7 @@ void Player::_LoadMail()
if (m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId))
{
- sLog->outError("Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
m->mailTemplateId = 0;
}
@@ -17929,7 +17925,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
else
{
questStatusData.Status = QUEST_STATUS_INCOMPLETE;
- sLog->outError("Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
GetName(), GetGUIDLow(), quest_id, qstatus);
}
@@ -18053,7 +18049,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result)
if (quest_daily_idx >= PLAYER_MAX_DAILY_QUESTS) // max amount with exist data in query
{
- sLog->outError("Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`", GetGUIDLow());
break;
}
@@ -18184,12 +18180,12 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
if (!mapEntry || !mapEntry->IsDungeon())
{
- sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId);
deleteInstance = true;
}
else if (difficulty >= MAX_DIFFICULTY)
{
- sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
deleteInstance = true;
}
else
@@ -18197,12 +18193,12 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty));
if (!mapDiff)
{
- sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId);
deleteInstance = true;
}
else if (!perm && group)
{
- sLog->outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d, %d, %d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty);
+ sLog->outError(LOG_FILTER_PLAYER, "_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d, %d, %d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty);
deleteInstance = true;
}
}
@@ -18551,7 +18547,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
if (!info)
{
- sLog->outError("Player (Name %s) has incorrect race/class (%u/%u) pair. Can't be loaded.", GetName(), uint32(getRace()), uint32(getClass()));
+ sLog->outError(LOG_FILTER_PLAYER, "Player (Name %s) has incorrect race/class (%u/%u) pair. Can't be loaded.", GetName(), uint32(getRace()), uint32(getClass()));
return false;
}
@@ -18599,7 +18595,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
CharacterDatabase.Execute(stmt);
}
- sLog->outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f",
+ sLog->outDebug(LOG_FILTER_PLAYER, "Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f",
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ);
return true;
@@ -18690,7 +18686,7 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_CHOSEN_TITLE));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX));
- stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE));
+ stmt->setUInt8(index++, GetDrunkValue());
stmt->setUInt32(index++, GetHealth());
uint32 storedPowers = 0;
@@ -18812,7 +18808,7 @@ void Player::SaveToDB(bool create /*=false*/)
stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_CHOSEN_TITLE));
stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX));
- stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE));
+ stmt->setUInt8(index++, GetDrunkValue());
stmt->setUInt32(index++, GetHealth());
uint32 storedPowers = 0;
@@ -19067,7 +19063,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
}
else
{
- sLog->outError("Can't find item guid %u but is in refundable storage for player %u ! Removing.", *itr, GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Can't find item guid %u but is in refundable storage for player %u ! Removing.", *itr, GetGUIDLow());
m_refundableItems.erase(itr);
}
}
@@ -19098,7 +19094,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
uint32 bagTestGUID = 0;
if (Item* test2 = GetItemByPos(INVENTORY_SLOT_BAG_0, item->GetBagSlot()))
bagTestGUID = test2->GetGUIDLow();
- sLog->outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u (state %d) are incorrect, the player doesn't have an item at that position!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), (int32)item->GetState());
+ sLog->outError(LOG_FILTER_PLAYER, "Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u (state %d) are incorrect, the player doesn't have an item at that position!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), (int32)item->GetState());
// according to the test that was just performed nothing should be in this slot, delete
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT);
stmt->setUInt32(0, bagTestGUID);
@@ -19114,7 +19110,7 @@ void Player::_SaveInventory(SQLTransaction& trans)
}
else if (test != item)
{
- sLog->outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u are incorrect, the item with guid %u is there instead!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u are incorrect, the item with guid %u is there instead!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), test->GetGUIDLow());
// save all changes to the item...
if (item->GetState() != ITEM_NEW) // only for existing items, no dupes
item->SaveToDB(trans);
@@ -19555,7 +19551,7 @@ void Player::_SaveStats(SQLTransaction& trans)
void Player::outDebugValues() const
{
- if (!sLog->IsOutDebug()) // optimize disabled debug output
+ if (!sLog->ShouldLog(LOG_FILTER_UNITS, LOG_LEVEL_DEBUG))
return;
sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u", GetMaxHealth(), GetMaxPower(POWER_MANA));
@@ -19875,7 +19871,7 @@ Pet* Player::GetPet() const
return pet;
//there may be a guardian in slot
- //sLog->outError("Player::GetPet: Pet %u not exist.", GUID_LOPART(pet_guid));
+ //sLog->outError(LOG_FILTER_PLAYER, "Player::GetPet: Pet %u not exist.", GUID_LOPART(pet_guid));
//const_cast<Player*>(this)->SetPetGUID(0);
}
@@ -19977,10 +19973,10 @@ void Player::StopCastingCharm()
if (GetCharmGUID())
{
- sLog->outCrash("Player %s (GUID: " UI64FMTD " is not able to uncharm unit (GUID: " UI64FMTD " Entry: %u, Type: %u)", GetName(), GetGUID(), GetCharmGUID(), charm->GetEntry(), charm->GetTypeId());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Player %s (GUID: " UI64FMTD " is not able to uncharm unit (GUID: " UI64FMTD " Entry: %u, Type: %u)", GetName(), GetGUID(), GetCharmGUID(), charm->GetEntry(), charm->GetTypeId());
if (charm->GetCharmerGUID())
{
- sLog->outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID());
ASSERT(false);
}
else
@@ -20173,7 +20169,7 @@ void Player::PossessSpellInitialize()
if (!charmInfo)
{
- sLog->outError("Player::PossessSpellInitialize(): charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
+ sLog->outError(LOG_FILTER_PLAYER, "Player::PossessSpellInitialize(): charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
return;
}
@@ -20285,7 +20281,7 @@ void Player::CharmSpellInitialize()
CharmInfo* charmInfo = charm->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("Player::CharmSpellInitialize(): the player's charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
+ sLog->outError(LOG_FILTER_PLAYER, "Player::CharmSpellInitialize(): the player's charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
return;
}
@@ -21000,7 +20996,7 @@ void Player::InitDisplayIds()
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
if (!info)
{
- sLog->outError("Player %u has incorrect race/class pair. Can't init display ids.", GetGUIDLow());
+ sLog->outError(LOG_FILTER_PLAYER, "Player %u has incorrect race/class pair. Can't init display ids.", GetGUIDLow());
return;
}
@@ -21016,7 +21012,7 @@ void Player::InitDisplayIds()
SetNativeDisplayId(info->displayId_m);
break;
default:
- sLog->outError("Invalid gender %u for player", gender);
+ sLog->outError(LOG_FILTER_PLAYER, "Invalid gender %u for player", gender);
return;
}
}
@@ -21153,7 +21149,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost);
if (!iece)
{
- sLog->outError("Item %u have wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost);
+ sLog->outError(LOG_FILTER_PLAYER, "Item %u have wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost);
return false;
}
@@ -21182,7 +21178,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
uint32 maxCount = MAX_MONEY_AMOUNT / pProto->BuyPrice;
if ((uint32)count > maxCount)
{
- sLog->outError("Player %s tried to buy %u item id %u, causing overflow", GetName(), (uint32)count, pProto->ItemId);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s tried to buy %u item id %u, causing overflow", GetName(), (uint32)count, pProto->ItemId);
count = (uint8)maxCount;
}
price = pProto->BuyPrice * count; //it should not exceed MAX_MONEY_AMOUNT
@@ -21662,7 +21658,7 @@ void Player::SetBattlegroundEntryPoint()
if (const WorldSafeLocsEntry* entry = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()))
m_bgData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f);
else
- sLog->outError("SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId());
+ sLog->outError(LOG_FILTER_PLAYER, "SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId());
}
// If new entry point is not BG or arena set it
else if (!GetMap()->IsBattlegroundOrArena())
@@ -22882,7 +22878,7 @@ bool Player::HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item cons
break;
}
default:
- sLog->outError("HasItemFitToSpellRequirements: Not handled spell requirement for item class %u", spellInfo->EquippedItemClass);
+ sLog->outError(LOG_FILTER_PLAYER, "HasItemFitToSpellRequirements: Not handled spell requirement for item class %u", spellInfo->EquippedItemClass);
break;
}
@@ -22960,7 +22956,7 @@ uint32 Player::GetResurrectionSpellId()
case 27239: spell_id = 27240; break; // rank 6
case 47883: spell_id = 47882; break; // rank 7
default:
- sLog->outError("Unhandled spell %u: S.Resurrection", (*itr)->GetId());
+ sLog->outError(LOG_FILTER_PLAYER, "Unhandled spell %u: S.Resurrection", (*itr)->GetId());
continue;
}
@@ -23516,7 +23512,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
if (!AddUInt64Value(PLAYER_FARSIGHT, target->GetGUID()))
{
- sLog->outCrash("Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName());
return;
}
@@ -23532,7 +23528,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
if (!RemoveUInt64Value(PLAYER_FARSIGHT, target->GetGUID()))
{
- sLog->outCrash("Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName());
+ sLog->outFatal(LOG_FILTER_PLAYER, "Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName());
return;
}
@@ -24019,7 +24015,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill);
if (!pSkill)
{
- sLog->outError("Character %u has skill %u that does not exist.", GetGUIDLow(), skill);
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u has skill %u that does not exist.", GetGUIDLow(), skill);
continue;
}
@@ -24037,7 +24033,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
}
if (value == 0)
{
- sLog->outError("Character %u has skill %u with value 0. Will be deleted.", GetGUIDLow(), skill);
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u has skill %u with value 0. Will be deleted.", GetGUIDLow(), skill);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SKILL);
@@ -24080,7 +24076,7 @@ void Player::_LoadSkills(PreparedQueryResult result)
if (count >= PLAYER_MAX_SKILLS) // client limit
{
- sLog->outError("Character %u has more than %u skills.", GetGUIDLow(), PLAYER_MAX_SKILLS);
+ sLog->outError(LOG_FILTER_PLAYER, "Character %u has more than %u skills.", GetGUIDLow(), PLAYER_MAX_SKILLS);
break;
}
}
@@ -24215,7 +24211,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
{
// calculate total z distance of the fall
float z_diff = m_lastFallZ - movementInfo.pos.GetPositionZ();
- //sLog->outDebug("zDiff = %f", z_diff);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "zDiff = %f", z_diff);
//Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
// 14.57 can be calculated by resolving damageperc formula below to 0
@@ -24254,7 +24250,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
}
//Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
- sLog->outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
+ sLog->outDebug(LOG_FILTER_PLAYER, "FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
}
}
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LANDING); // No fly zone - Parachute
@@ -24379,7 +24375,7 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank)
uint32 spellid = talentInfo->RankID[talentRank];
if (spellid == 0)
{
- sLog->outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ sLog->outError(LOG_FILTER_PLAYER, "Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
return false;
}
@@ -24391,7 +24387,7 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank)
learnSpell(spellid, false);
AddTalent(spellid, GetActiveSpec(), true);
- sLog->outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, GetActiveSpec());
+ sLog->outInfo(LOG_FILTER_GENERAL, "TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, GetActiveSpec());
// set talent tree for player
if (!GetPrimaryTalentTree(GetActiveSpec()))
@@ -24527,7 +24523,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
uint32 spellid = talentInfo->RankID[talentRank];
if (spellid == 0)
{
- sLog->outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
+ sLog->outError(LOG_FILTER_PLAYER, "Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank);
return;
}
@@ -24537,7 +24533,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
// learn! (other talent ranks will unlearned at learning)
pet->learnSpell(spellid);
- sLog->outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
+ sLog->outInfo(LOG_FILTER_PLAYER, "PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid);
// update free talent points
pet->SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1));
@@ -24852,7 +24848,7 @@ void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset)
if (!found) // something wrong...
{
- sLog->outError("Player %s tried to save equipment set "UI64FMTD" (index %u), but that equipment set not found!", GetName(), eqset.Guid, index);
+ sLog->outError(LOG_FILTER_PLAYER, "Player %s tried to save equipment set "UI64FMTD" (index %u), but that equipment set not found!", GetName(), eqset.Guid, index);
return;
}
}
@@ -25677,7 +25673,7 @@ void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item)
if (_voidStorageItems[slot])
{
- sLog->outError("Player::AddVoidStorageItemAtSlot - Player (GUID: %u, name: %s) tried to add an item to an used slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), _voidStorageItems[slot]->ItemId, _voidStorageItems[slot]->ItemEntry, slot);
+ sLog->outError(LOG_FILTER_GENERAL, "Player::AddVoidStorageItemAtSlot - Player (GUID: %u, name: %s) tried to add an item to an used slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), _voidStorageItems[slot]->ItemId, _voidStorageItems[slot]->ItemEntry, slot);
GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1);
return;
}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index e192c88b2c2..cea45d06936 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2117,9 +2117,9 @@ class Player : public Unit, public GridObject<Player>
inline SpellCooldowns GetSpellCooldowns() const { return m_spellCooldowns; }
- void SetDrunkValue(uint16 newDrunkValue, uint32 itemid=0);
- uint16 GetDrunkValue() const { return m_drunk; }
- static DrunkenState GetDrunkenstateByValue(uint16 value);
+ void SetDrunkValue(uint8 newDrunkValue, uint32 itemId = 0);
+ uint8 GetDrunkValue() const { return GetByteValue(PLAYER_BYTES_3, 1); }
+ static DrunkenState GetDrunkenstateByValue(uint8 value);
uint32 GetDeathTimer() const { return m_deathTimer; }
uint32 GetCorpseReclaimDelay(bool pvp) const;
@@ -2803,7 +2803,6 @@ class Player : public Unit, public GridObject<Player>
time_t m_lastDailyQuestTime;
uint32 m_drunkTimer;
- uint16 m_drunk;
uint32 m_weaponChangeTimer;
uint32 m_zoneUpdateId;
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index e44f67f128d..aa5c33d8c67 100755
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -35,8 +35,8 @@ void MapManager::LoadTransports()
if (!result)
{
- sLog->outString(">> Loaded 0 transports. DB table `transports` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded 0 transports. DB table `transports` is empty!");
+
return;
}
@@ -56,17 +56,17 @@ void MapManager::LoadTransports()
if (!goinfo)
{
- sLog->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str());
continue;
}
if (goinfo->type != GAMEOBJECT_TYPE_MO_TRANSPORT)
{
- sLog->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str());
continue;
}
- // sLog->outString("Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, "Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name);
std::set<uint32> mapsUsed;
@@ -74,7 +74,7 @@ void MapManager::LoadTransports()
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
- sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
+ sLog->outError(LOG_FILTER_SQL, "Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId);
delete t;
continue;
}
@@ -116,13 +116,13 @@ void MapManager::LoadTransports()
uint32 guid = fields[0].GetUInt32();
uint32 entry = fields[1].GetUInt32();
std::string name = fields[2].GetString();
- sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports must not have any records in `gameobject` or its behavior will be unpredictable/bugged.", entry, name.c_str(), guid);
+ sLog->outError(LOG_FILTER_SQL, "Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports must not have any records in `gameobject` or its behavior will be unpredictable/bugged.", entry, name.c_str(), guid);
}
while (result->NextRow());
}
- sLog->outString(">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void MapManager::LoadTransportNPCs()
@@ -134,8 +134,8 @@ void MapManager::LoadTransportNPCs()
if (!result)
{
- sLog->outString(">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!");
+
return;
}
@@ -166,8 +166,8 @@ void MapManager::LoadTransportNPCs()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
Transport::Transport(uint32 period, uint32 script) : GameObject(), m_pathTime(0), m_timer(0),
@@ -197,7 +197,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
if (!IsPositionValid())
{
- sLog->outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
+ sLog->outError(LOG_FILTER_TRANSPORTS, "Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",
guidlow, x, y);
return false;
}
@@ -208,7 +208,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa
if (!goinfo)
{
- sLog->outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
+ sLog->outError(LOG_FILTER_SQL, "Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang);
return false;
}
@@ -354,7 +354,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
}
// for (int i = 0; i < keyFrames.size(); ++i) {
- // sLog->outString("%f, %f, %f, %f, %f, %f, %f", keyFrames[i].x, keyFrames[i].y, keyFrames[i].distUntilStop, keyFrames[i].distSinceStop, keyFrames[i].distFromPrev, keyFrames[i].tFrom, keyFrames[i].tTo);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, "%f, %f, %f, %f, %f, %f, %f", keyFrames[i].x, keyFrames[i].y, keyFrames[i].distUntilStop, keyFrames[i].distSinceStop, keyFrames[i].distFromPrev, keyFrames[i].tFrom, keyFrames[i].tTo);
// }
// Now we're completely set up; we can move along the length of each waypoint at 100 ms intervals
@@ -397,7 +397,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
cM = keyFrames[i].node->mapid;
}
- // sLog->outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, "T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
if (teleport)
m_WayPoints[t] = WayPoint(keyFrames[i].node->mapid, newX, newY, newZ, teleport, 0);
}
@@ -445,14 +445,14 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
m_WayPoints[t] = WayPoint(keyFrames[i + 1].node->mapid, keyFrames[i + 1].node->x, keyFrames[i + 1].node->y, keyFrames[i + 1].node->z, teleport,
0, keyFrames[i + 1].node->arrivalEventID, keyFrames[i + 1].node->departureEventID);
- // sLog->outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, "T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
t += keyFrames[i + 1].node->delay * 1000;
}
uint32 timer = t;
- // sLog->outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
+ // sLog->outInfo(LOG_FILTER_TRANSPORTS, " Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer);
m_curr = m_WayPoints.begin();
m_next = GetNextWayPoint();
@@ -511,7 +511,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
bool Transport::AddPassenger(Player* passenger)
{
if (m_passengers.insert(passenger).second)
- sLog->outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName());
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, "Player %s boarded transport %s.", passenger->GetName(), GetName());
sScriptMgr->OnAddPassenger(this, passenger);
return true;
@@ -520,7 +520,7 @@ bool Transport::AddPassenger(Player* passenger)
bool Transport::RemovePassenger(Player* passenger)
{
if (m_passengers.erase(passenger))
- sLog->outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName());
+ sLog->outInfo(LOG_FILTER_TRANSPORTS, "Player %s removed from transport %s.", passenger->GetName(), GetName());
sScriptMgr->OnRemovePassenger(this, passenger);
return true;
@@ -531,7 +531,7 @@ void Transport::Update(uint32 p_diff)
if (!AI())
{
if (!AIM_Initialize())
- sLog->outError("Could not initialize GameObjectAI for Transport");
+ sLog->outError(LOG_FILTER_TRANSPORTS, "Could not initialize GameObjectAI for Transport");
} else
AI()->UpdateAI(p_diff);
@@ -659,7 +659,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
if (!creature->IsPositionValid())
{
- sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", creature->GetGUIDLow(), creature->GetEntry(), creature->GetPositionX(), creature->GetPositionY());
+ sLog->outError(LOG_FILTER_TRANSPORTS, "Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", creature->GetGUIDLow(), creature->GetEntry(), creature->GetPositionX(), creature->GetPositionY());
delete creature;
return 0;
}
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index f8c0142c801..e57c5a99acd 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -629,10 +629,10 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
return 0;
}
- sLog->outStaticDebug("DealDamageStart");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageStart");
uint32 health = victim->GetHealth();
- sLog->outDetail("deal dmg:%d to health:%d ", damage, health);
+ sLog->outInfo(LOG_FILTER_UNITS, "deal dmg:%d to health:%d ", damage, health);
// duel ends when player has 1 or less hp
bool duel_hasEnded = false;
@@ -686,7 +686,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
if (health <= damage)
{
- sLog->outStaticDebug("DealDamage: victim just died");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamage: victim just died");
if (victim->GetTypeId() == TYPEID_PLAYER && victim != this)
{
@@ -701,7 +701,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
}
else
{
- sLog->outStaticDebug("DealDamageAlive");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageAlive");
if (victim->GetTypeId() == TYPEID_PLAYER)
victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage);
@@ -785,7 +785,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
}
}
- sLog->outStaticDebug("DealDamageEnd returned %d damage", damage);
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageEnd returned %d damage", damage);
return damage;
}
@@ -801,7 +801,7 @@ void Unit::CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo
{
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
@@ -829,7 +829,7 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
@@ -872,7 +872,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit*
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
SpellCastTargets targets;
@@ -886,7 +886,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
SpellCastTargets targets;
@@ -900,7 +900,7 @@ void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castI
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
+ sLog->outError(LOG_FILTER_UNITS, "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry()));
return;
}
SpellCastTargets targets;
@@ -1890,10 +1890,10 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext
DealMeleeDamage(&damageInfo, true);
if (GetTypeId() == TYPEID_PLAYER)
- sLog->outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
+ sLog->outDebug(LOG_FILTER_UNITS, "AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
else
- sLog->outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
+ sLog->outDebug(LOG_FILTER_UNITS, "AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
}
}
@@ -1924,7 +1924,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
float parry_chance = victim->GetUnitParryChance();
// Useful if want to specify crit & miss chances for melee, else it could be removed
- sLog->outStaticDebug("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance);
+ sLog->outDebug(LOG_FILTER_UNITS, "MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance);
return RollMeleeOutcomeAgainst(victim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100), int32(parry_chance*100), int32(block_chance*100));
}
@@ -1945,22 +1945,22 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
int32 sum = 0, tmp = 0;
int32 roll = urand (0, 10000);
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
roll, miss_chance, dodge_chance, parry_chance, block_chance, crit_chance);
tmp = miss_chance;
if (tmp > 0 && roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: MISS");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: MISS");
return MELEE_HIT_MISS;
}
// always crit against a sitting target (except 0 crit chance)
if (victim->GetTypeId() == TYPEID_PLAYER && crit_chance > 0 && !victim->IsStandState())
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRIT (sitting victim)");
return MELEE_HIT_CRIT;
}
@@ -1969,7 +1969,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
// only players can't dodge if attacker is behind
if (victim->GetTypeId() == TYPEID_PLAYER && !victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
}
else
{
@@ -1988,7 +1988,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
&& ((tmp -= skillBonus) > 0)
&& roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum);
return MELEE_HIT_DODGE;
}
}
@@ -1997,7 +1997,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
// check if attack comes from behind, nobody can parry or block if attacker is behind
if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind.");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: attack came from behind.");
else
{
// Reduce parry chance by attacker expertise rating
@@ -2013,7 +2013,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
&& (tmp2 -= skillBonus) > 0
&& roll < (sum += tmp2))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum);
return MELEE_HIT_PARRY;
}
}
@@ -2025,7 +2025,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
&& (tmp -= skillBonus) > 0
&& roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum);
return MELEE_HIT_BLOCK;
}
}
@@ -2036,9 +2036,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
if (tmp > 0 && roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRIT DISABLED)");
else
return MELEE_HIT_CRIT;
}
@@ -2058,7 +2058,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
tmp = tmp > 4000 ? 4000 : tmp;
if (roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum);
return MELEE_HIT_GLANCING;
}
}
@@ -2082,13 +2082,13 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
tmp = tmp * 200 - 1500;
if (roll < (sum += tmp))
{
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum);
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum);
return MELEE_HIT_CRUSHING;
}
}
}
- sLog->outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL");
+ sLog->outDebug(LOG_FILTER_UNITS, "RollMeleeOutcomeAgainst: NORMAL");
return MELEE_HIT_NORMAL;
}
@@ -2153,7 +2153,7 @@ void Unit::SendMeleeAttackStart(Unit* victim)
data << uint64(GetGUID());
data << uint64(victim->GetGUID());
SendMessageToSet(&data, true);
- sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART");
+ sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sent SMSG_ATTACKSTART");
}
void Unit::SendMeleeAttackStop(Unit* victim)
@@ -2163,12 +2163,12 @@ void Unit::SendMeleeAttackStop(Unit* victim)
data.append(victim ? victim->GetPackGUID() : 0);
data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation
SendMessageToSet(&data, true);
- sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP");
+ sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sent SMSG_ATTACKSTOP");
if (victim)
- sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_UNITS, "%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
else
- sLog->outDetail("%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_UNITS, "%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());
}
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
@@ -2338,7 +2338,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell)
case MELEE_HIT_BLOCK: canBlock = false; break;
case MELEE_HIT_PARRY: canParry = false; break;
default:
- sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
+ sLog->outDebug(LOG_FILTER_UNITS, "Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
break;
}
}
@@ -4778,7 +4778,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo)
data << float(pInfo->multiplier); // gain multiplier
break;
default:
- sLog->outError("Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
+ sLog->outError(LOG_FILTER_UNITS, "Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType()));
return;
}
@@ -4939,7 +4939,7 @@ bool Unit::HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
if (!triggerEntry)
{
- sLog->outError("Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", hasteSpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", hasteSpell->Id, triggered_spell_id);
return false;
}
@@ -4997,7 +4997,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf
if (!triggerEntry)
{
- sLog->outError("Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id);
return false;
}
@@ -5639,7 +5639,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 31571: triggered_spell_id = 57529; break;
case 31572: triggered_spell_id = 57531; break;
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u", dummySpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u", dummySpell->Id);
return false;
}
break;
@@ -5725,7 +5725,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 12847: basepoints0 = int32(0.16f * damage); break;
case 12848: basepoints0 = int32(0.20f * damage); break;
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id);
return false;
}
@@ -5843,7 +5843,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 29834: triggered_spell_id=29841; break;
case 42770: triggered_spell_id=42771; break;
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id);
return false;
}
@@ -7079,7 +7079,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 3787:spellId = 58804; break; // 8 Rank
default:
{
- sLog->outError("Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)",
castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)), dummySpell->Id);
return false;
}
@@ -7088,7 +7088,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* windfurySpellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!windfurySpellInfo)
{
- sLog->outError("Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non-existing spell id: %u (Windfury)", spellId);
return false;
}
@@ -7418,7 +7418,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
case 49270: spellId = 49268; break; // Rank 7
case 49271: spellId = 49269; break; // Rank 8
default:
- sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id);
return false;
}
@@ -7732,7 +7732,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id);
if (!triggerEntry)
{
- sLog->outError("Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -7790,7 +7790,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffec
// Try handle unknown trigger spells
if (!triggerEntry)
{
- sLog->outError("Unit::HandleObsModEnergyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleObsModEnergyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -7843,7 +7843,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura
if (!triggerEntry)
{
- sLog->outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleModDamagePctTakenAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id);
return false;
}
@@ -8230,7 +8230,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
trigger_spell_id = 31643;
break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id);
return false;
}
}
@@ -8306,7 +8306,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 27815: trigger_spell_id = 27817; break;
case 27816: trigger_spell_id = 27818; break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id);
return false;
}
basepoints0 = CalculatePctN(int32(damage), triggerAmount) / 3;
@@ -8366,7 +8366,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
trigger_spell_id = 63468;
break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id);
return false;
}
SpellInfo const* TriggerPS = sSpellMgr->GetSpellInfo(trigger_spell_id);
@@ -8479,14 +8479,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
case 48820: originalSpellId = 48824; break;
case 48821: originalSpellId = 48825; break;
default:
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id);
return false;
}
}
SpellInfo const* originalSpell = sSpellMgr->GetSpellInfo(originalSpellId);
if (!originalSpell)
{
- sLog->outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId);
return false;
}
// percent stored in effect 1 (class scripts) base points
@@ -8640,7 +8640,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
if (triggerEntry == NULL)
{
// Don't cast unknown spell
- // sLog->outError("Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
+ // sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u has 0 in EffectTriggered[%d]. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
return false;
}
@@ -9149,7 +9149,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
if (!triggerEntry)
{
- sLog->outError("Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId);
return false;
}
@@ -9212,11 +9212,11 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
if (GetGUID() != guid)
{
if (Player const* player = ToPlayer())
- sLog->outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction());
+ sLog->outError(LOG_FILTER_UNITS, "Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction());
else if (Creature const* creature = ToCreature())
- sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
+ sLog->outError(LOG_FILTER_UNITS, "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
else
- sLog->outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction());
+ sLog->outError(LOG_FILTER_UNITS, "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction());
guid = GetGUID();
}
@@ -9564,7 +9564,7 @@ void Unit::RemoveAllAttackers()
AttackerSet::iterator iter = m_attackers.begin();
if (!(*iter)->AttackStop())
{
- sLog->outError("WORLD: Unit has an attacker that isn't attacking it!");
+ sLog->outError(LOG_FILTER_UNITS, "WORLD: Unit has an attacker that isn't attacking it!");
m_attackers.erase(iter);
}
}
@@ -9732,7 +9732,7 @@ Minion *Unit::GetFirstMinion() const
if (pet->HasUnitTypeMask(UNIT_MASK_MINION))
return (Minion*)pet;
- sLog->outError("Unit::GetFirstMinion: Minion %u not exist.", GUID_LOPART(pet_guid));
+ sLog->outError(LOG_FILTER_UNITS, "Unit::GetFirstMinion: Minion %u not exist.", GUID_LOPART(pet_guid));
const_cast<Unit*>(this)->SetMinionGUID(0);
}
@@ -9747,7 +9747,7 @@ Guardian* Unit::GetGuardianPet() const
if (pet->HasUnitTypeMask(UNIT_MASK_GUARDIAN))
return (Guardian*)pet;
- sLog->outCrash("Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid);
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid);
const_cast<Unit*>(this)->SetPetGUID(0);
}
@@ -9761,7 +9761,7 @@ Unit* Unit::GetCharm() const
if (Unit* pet = ObjectAccessor::GetUnit(*this, charm_guid))
return pet;
- sLog->outError("Unit::GetCharm: Charmed creature %u not exist.", GUID_LOPART(charm_guid));
+ sLog->outError(LOG_FILTER_UNITS, "Unit::GetCharm: Charmed creature %u not exist.", GUID_LOPART(charm_guid));
const_cast<Unit*>(this)->SetUInt64Value(UNIT_FIELD_CHARM, 0);
}
@@ -9776,7 +9776,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
{
if (minion->GetOwnerGUID())
{
- sLog->outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
return;
}
@@ -9850,7 +9850,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
{
if (minion->GetOwnerGUID() != GetGUID())
{
- sLog->outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry());
return;
}
@@ -9962,7 +9962,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
if (GetTypeId() == TYPEID_PLAYER)
{
if (!AddUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
- sLog->outCrash("Player %s is trying to charm unit %u, but it already has a charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Player %s is trying to charm unit %u, but it already has a charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
charm->m_ControlledByPlayer = true;
// TODO: maybe we can use this flag to check if controlled by player
@@ -9975,7 +9975,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
if (!charm->AddUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
- sLog->outCrash("Unit %u is being charmed, but it already has a charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is being charmed, but it already has a charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
{
@@ -9990,11 +9990,11 @@ void Unit::SetCharm(Unit* charm, bool apply)
if (GetTypeId() == TYPEID_PLAYER)
{
if (!RemoveUInt64Value(UNIT_FIELD_CHARM, charm->GetGUID()))
- sLog->outCrash("Player %s is trying to uncharm unit %u, but it has another charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Player %s is trying to uncharm unit %u, but it has another charmed unit " UI64FMTD "", GetName(), charm->GetEntry(), GetCharmGUID());
}
if (!charm->RemoveUInt64Value(UNIT_FIELD_CHARMEDBY, GetGUID()))
- sLog->outCrash("Unit %u is being uncharmed, but it has another charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is being uncharmed, but it has another charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID());
if (charm->GetTypeId() == TYPEID_PLAYER)
{
@@ -10128,14 +10128,14 @@ void Unit::RemoveAllControlled()
else if (target->GetOwnerGUID() == GetGUID() && target->isSummon())
target->ToTempSummon()->UnSummon();
else
- sLog->outError("Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Unit %u is trying to release unit %u which is neither charmed nor owned by it", GetEntry(), target->GetEntry());
}
if (GetPetGUID())
- sLog->outCrash("Unit %u is not able to release its pet " UI64FMTD, GetEntry(), GetPetGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is not able to release its pet " UI64FMTD, GetEntry(), GetPetGUID());
if (GetMinionGUID())
- sLog->outCrash("Unit %u is not able to release its minion " UI64FMTD, GetEntry(), GetMinionGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is not able to release its minion " UI64FMTD, GetEntry(), GetMinionGUID());
if (GetCharmGUID())
- sLog->outCrash("Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID());
}
Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
@@ -10877,6 +10877,8 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas
case 379: // Earth Shield
case 33778: // Lifebloom Final Bloom
case 64844: // Divine Hymn
+ case 71607: // Item - Bauble of True Blood 10m
+ case 71646: // Item - Bauble of True Blood 25m
break;
default:
return false;
@@ -12665,7 +12667,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
break;
}
default:
- sLog->outError("Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
return;
}
@@ -12918,7 +12920,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
data.WriteByteSeq(bytes[4]);
break;
default:
- sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
return;
}
@@ -13154,7 +13156,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced)
data.WriteByteSeq(bytes[4]);
break;
default:
- sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype);
return;
}
SendMessageToSet(&data, true);
@@ -13807,7 +13809,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
{
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{
- sLog->outError("ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
+ sLog->outError(LOG_FILTER_UNITS, "ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
return false;
}
@@ -13871,7 +13873,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co
{
if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END)
{
- sLog->outError("attempt to access non-existing modifier value from UnitMods!");
+ sLog->outError(LOG_FILTER_UNITS, "attempt to access non-existing modifier value from UnitMods!");
return 0.0f;
}
@@ -13901,7 +13903,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const
{
if (unitMod >= UNIT_MOD_END)
{
- sLog->outError("attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
+ sLog->outError(LOG_FILTER_UNITS, "attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
return 0.0f;
}
@@ -14240,7 +14242,7 @@ void Unit::RemoveFromWorld()
if (GetCharmerGUID())
{
- sLog->outCrash("Unit %u has charmer guid when removed from world", GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u has charmer guid when removed from world", GetEntry());
ASSERT(false);
}
@@ -14248,7 +14250,7 @@ void Unit::RemoveFromWorld()
{
if (owner->m_Controlled.find(this) != owner->m_Controlled.end())
{
- sLog->outCrash("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
ASSERT(false);
}
}
@@ -15677,7 +15679,7 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
if (!pet->InitStatsForLevel(level))
{
- sLog->outError("Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry());
+ sLog->outError(LOG_FILTER_UNITS, "Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry());
return false;
}
@@ -15855,7 +15857,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura)
damageSpellId = 43594;
break;
default:
- sLog->outError("Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::HandleAuraRaidProcFromCharge, received unhandled spell: %u", spellProto->Id);
return false;
}
@@ -16017,7 +16019,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
if (!spiritOfRedemption)
{
- sLog->outStaticDebug("SET JUST_DIED");
+ sLog->outDebug(LOG_FILTER_UNITS, "SET JUST_DIED");
victim->setDeathState(JUST_DIED);
}
@@ -16042,7 +16044,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
// only if not player and not controlled by player pet. And not at BG
if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP)))
{
- sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
+ sLog->outDebug(LOG_FILTER_UNITS, "We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH));
plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false);
// durability lost message
WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0);
@@ -16062,7 +16064,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
}
else // creature died
{
- sLog->outStaticDebug("DealDamageNotPlayer");
+ sLog->outDebug(LOG_FILTER_UNITS, "DealDamageNotPlayer");
if (!creature->isPet())
{
@@ -16431,7 +16433,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (this == charmer)
{
- sLog->outCrash("Unit::SetCharmedBy: Unit %u (GUID %u) is trying to charm itself!", GetEntry(), GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: Unit %u (GUID %u) is trying to charm itself!", GetEntry(), GetGUIDLow());
return false;
}
@@ -16440,14 +16442,14 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport())
{
- sLog->outCrash("Unit::SetCharmedBy: Player on transport is trying to charm %u (GUID %u)", GetEntry(), GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: Player on transport is trying to charm %u (GUID %u)", GetEntry(), GetGUIDLow());
return false;
}
// Already charmed
if (GetCharmerGUID())
{
- sLog->outCrash("Unit::SetCharmedBy: %u (GUID %u) has already been charmed but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: %u (GUID %u) has already been charmed but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
return false;
}
@@ -16472,7 +16474,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
// StopCastingCharm may remove a possessed pet?
if (!IsInWorld())
{
- sLog->outCrash("Unit::SetCharmedBy: %u (GUID %u) is not in world but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
+ sLog->outFatal(LOG_FILTER_UNITS, "Unit::SetCharmedBy: %u (GUID %u) is not in world but %u (GUID %u) is trying to charm it!", GetEntry(), GetGUIDLow(), charmer->GetEntry(), charmer->GetGUIDLow());
return false;
}
@@ -16572,7 +16574,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
charmer = GetCharmer();
if (charmer != GetCharmer()) // one aura overrides another?
{
-// sLog->outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
+// sLog->outFatal(LOG_FILTER_UNITS, "Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
// GetGUID(), GetCharmerGUID(), charmer->GetGUID());
// ASSERT(false);
return;
@@ -16650,7 +16652,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
if (GetCharmInfo())
GetCharmInfo()->SetPetNumber(0, true);
else
- sLog->outError("Aura::HandleModCharm: target="UI64FMTD" with typeid=%d has a charm aura but no charm info!", GetGUID(), GetTypeId());
+ sLog->outError(LOG_FILTER_UNITS, "Aura::HandleModCharm: target="UI64FMTD" with typeid=%d has a charm aura but no charm info!", GetGUID(), GetTypeId());
}
}
break;
@@ -17514,7 +17516,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
if (!valid)
{
- sLog->outErrorDb("Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
return false;
}
@@ -17984,39 +17986,44 @@ void Unit::StopAttackFaction(uint32 faction_id)
void Unit::OutDebugInfo() const
{
- sLog->outError("Unit::OutDebugInfo");
- sLog->outString("GUID "UI64FMTD", entry %u, type %u, name %s", GetGUID(), GetEntry(), (uint32)GetTypeId(), GetName());
- sLog->outString("OwnerGUID "UI64FMTD", MinionGUID "UI64FMTD", CharmerGUID "UI64FMTD", CharmedGUID "UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID());
- sLog->outString("In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
+ sLog->outError(LOG_FILTER_UNITS, "Unit::OutDebugInfo");
+ sLog->outInfo(LOG_FILTER_UNITS, "GUID "UI64FMTD", entry %u, type %u, name %s", GetGUID(), GetEntry(), (uint32)GetTypeId(), GetName());
+ sLog->outInfo(LOG_FILTER_UNITS, "OwnerGUID "UI64FMTD", MinionGUID "UI64FMTD", CharmerGUID "UI64FMTD", CharmedGUID "UI64FMTD, GetOwnerGUID(), GetMinionGUID(), GetCharmerGUID(), GetCharmGUID());
+ sLog->outInfo(LOG_FILTER_UNITS, "In world %u, unit type mask %u", (uint32)(IsInWorld() ? 1 : 0), m_unitTypeMask);
if (IsInWorld())
- sLog->outString("Mapid %u", GetMapId());
+ sLog->outInfo(LOG_FILTER_UNITS, "Mapid %u", GetMapId());
- sLog->outStringInLine("Summon Slot: ");
+ std::ostringstream o;
+ o << "Summon Slot: ";
for (uint32 i = 0; i < MAX_SUMMON_SLOT; ++i)
- sLog->outStringInLine(UI64FMTD", ", m_SummonSlot[i]);
- sLog->outString();
+ o << m_SummonSlot[i] << ", ";
- sLog->outStringInLine("Controlled List: ");
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
+ o.str("");
+
+ o << "Controlled List: ";
for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
- sLog->outStringInLine(UI64FMTD", ", (*itr)->GetGUID());
- sLog->outString();
+ o << (*itr)->GetGUID() << ", ";
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
+ o.str("");
- sLog->outStringInLine("Aura List: ");
+ o << "Aura List: ";
for (AuraApplicationMap::const_iterator itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr)
- sLog->outStringInLine("%u, ", itr->first);
- sLog->outString();
+ o << itr->first << ", ";
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
+ o.str("");
if (IsVehicle())
{
- sLog->outStringInLine("Passenger List: ");
+ o << "Passenger List: ";
for (SeatMap::iterator itr = GetVehicleKit()->Seats.begin(); itr != GetVehicleKit()->Seats.end(); ++itr)
if (Unit* passenger = ObjectAccessor::GetUnit(*GetVehicleBase(), itr->second.Passenger))
- sLog->outStringInLine(UI64FMTD", ", passenger->GetGUID());
- sLog->outString();
+ o << passenger->GetGUID() << ", ";
+ sLog->outInfo(LOG_FILTER_UNITS, "%s", o.str().c_str());
}
if (GetVehicle())
- sLog->outString("On vehicle %u.", GetVehicleBase()->GetEntry());
+ sLog->outInfo(LOG_FILTER_UNITS, "On vehicle %u.", GetVehicleBase()->GetEntry());
}
uint32 Unit::GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex) const
diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp
index d5e85d2cf2f..0936275e90c 100755
--- a/src/server/game/Events/GameEventMgr.cpp
+++ b/src/server/game/Events/GameEventMgr.cpp
@@ -210,8 +210,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
mGameEvent.clear();
- sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 game events. DB table `game_event` is empty.");
+
return;
}
@@ -223,7 +223,7 @@ void GameEventMgr::LoadFromDB()
uint8 event_id = fields[0].GetUInt8();
if (event_id == 0)
{
- sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used.");
+ sLog->outError(LOG_FILTER_SQL, "`game_event` game event entry 0 is reserved and can't be used.");
continue;
}
@@ -241,7 +241,7 @@ void GameEventMgr::LoadFromDB()
if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check
{
- sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id);
continue;
}
@@ -249,7 +249,7 @@ void GameEventMgr::LoadFromDB()
{
if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id))
{
- sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id);
pGameEvent.holiday_id = HOLIDAY_NONE;
}
}
@@ -260,11 +260,11 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
- sLog->outString("Loading Game Event Saves Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Saves Data...");
{
uint32 oldMSTime = getMSTime();
@@ -273,8 +273,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty.");
+
}
else
{
@@ -287,7 +287,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id);
continue;
}
@@ -298,7 +298,7 @@ void GameEventMgr::LoadFromDB()
}
else
{
- sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u", event_id);
+ sLog->outError(LOG_FILTER_SQL, "game_event_save includes event save for non-worldevent id %u", event_id);
continue;
}
@@ -306,12 +306,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Prerequisite Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Prerequisite Data...");
{
uint32 oldMSTime = getMSTime();
@@ -319,8 +319,8 @@ void GameEventMgr::LoadFromDB()
QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite");
if (!result)
{
- sLog->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty.");
+
}
else
{
@@ -333,7 +333,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -342,14 +342,14 @@ void GameEventMgr::LoadFromDB()
uint16 prerequisite_event = fields[1].GetUInt32();
if (prerequisite_event >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event);
continue;
}
mGameEvent[event_id].prerequisite_events.insert(prerequisite_event);
}
else
{
- sLog->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u", event_id);
+ sLog->outError(LOG_FILTER_SQL, "game_event_prerequisiste includes event entry for non-worldevent id %u", event_id);
continue;
}
@@ -357,12 +357,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Creature Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Creature Data...");
{
uint32 oldMSTime = getMSTime();
@@ -372,8 +372,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
+
}
else
{
@@ -389,7 +389,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -400,12 +400,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event GO Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Data...");
{
uint32 oldMSTime = getMSTime();
@@ -415,8 +415,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty.");
+
}
else
{
@@ -432,7 +432,7 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -443,12 +443,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Model/Equipment Change Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Model/Equipment Change Data...");
{
uint32 oldMSTime = getMSTime();
@@ -458,8 +458,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
+
}
else
{
@@ -473,7 +473,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventModelEquip.size())
{
- sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -488,7 +488,7 @@ void GameEventMgr::LoadFromDB()
{
if (!sObjectMgr->GetEquipmentInfo(newModelEquipSet.equipment_id))
{
- sLog->outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.",
+ sLog->outError(LOG_FILTER_SQL, "Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.",
guid, newModelEquipSet.equipment_id);
continue;
}
@@ -500,12 +500,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Quest Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Data...");
{
uint32 oldMSTime = getMSTime();
@@ -514,8 +514,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty.");
+
}
else
{
@@ -530,7 +530,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventCreatureQuests.size())
{
- sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -541,12 +541,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event GO Quest Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Quest Data...");
{
uint32 oldMSTime = getMSTime();
@@ -555,8 +555,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty.");
+
}
else
{
@@ -571,7 +571,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventGameObjectQuests.size())
{
- sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -582,12 +582,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Quest Condition Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Condition Data...");
{
uint32 oldMSTime = getMSTime();
@@ -596,8 +596,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty.");
+
}
else
{
@@ -613,7 +613,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -625,12 +625,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Condition Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Data...");
{
uint32 oldMSTime = getMSTime();
@@ -639,8 +639,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty.");
+
}
else
{
@@ -654,7 +654,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -667,12 +667,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Condition Save Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Save Data...");
{
uint32 oldMSTime = getMSTime();
@@ -681,8 +681,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty.");
+
}
else
{
@@ -696,7 +696,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -707,7 +707,7 @@ void GameEventMgr::LoadFromDB()
}
else
{
- sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition);
+ sLog->outError(LOG_FILTER_SQL, "game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition);
continue;
}
@@ -715,12 +715,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event NPCflag Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event NPCflag Data...");
{
uint32 oldMSTime = getMSTime();
@@ -729,8 +729,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty.");
+
}
else
{
@@ -745,7 +745,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -755,12 +755,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Seasonal Quest Relations...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Seasonal Quest Relations...");
{
uint32 oldMSTime = getMSTime();
@@ -769,8 +769,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
+
}
else
{
@@ -784,13 +784,13 @@ void GameEventMgr::LoadFromDB()
if (!sObjectMgr->GetQuestTemplate(questId))
{
- sLog->outErrorDb("`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` quest id (%u) does not exist in `quest_template`", questId);
continue;
}
if (eventEntry >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_seasonal_questrelation` event id (%u) is out of range compared to max event in `game_event`", eventEntry);
continue;
}
@@ -799,12 +799,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Vendor Additions Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Vendor Additions Data...");
{
uint32 oldMSTime = getMSTime();
@@ -813,8 +813,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty.");
+
}
else
{
@@ -827,7 +827,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEventVendors.size())
{
- sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -865,12 +865,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Battleground Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Battleground Data...");
{
uint32 oldMSTime = getMSTime();
@@ -879,8 +879,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty.");
+
}
else
{
@@ -893,7 +893,7 @@ void GameEventMgr::LoadFromDB()
if (event_id >= mGameEvent.size())
{
- sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id);
continue;
}
@@ -903,12 +903,12 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
- sLog->outString("Loading Game Event Pool Data...");
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Pool Data...");
{
uint32 oldMSTime = getMSTime();
@@ -918,8 +918,8 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty.");
+
}
else
{
@@ -935,13 +935,13 @@ void GameEventMgr::LoadFromDB()
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
+ sLog->outError(LOG_FILTER_SQL, "`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id);
continue;
}
if (!sPoolMgr->CheckPool(entry))
{
- sLog->outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
continue;
}
@@ -952,8 +952,8 @@ void GameEventMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
}
@@ -1015,7 +1015,7 @@ void GameEventMgr::StartArenaSeason()
if (!result)
{
- sLog->outError("ArenaSeason (%u) must be an existant Arena Season", season);
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "ArenaSeason (%u) must be an existant Arena Season", season);
return;
}
@@ -1024,13 +1024,13 @@ void GameEventMgr::StartArenaSeason()
if (eventId >= mGameEvent.size())
{
- sLog->outError("EventEntry %u for ArenaSeason (%u) does not exists", eventId, season);
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "EventEntry %u for ArenaSeason (%u) does not exists", eventId, season);
return;
}
StartEvent(eventId, true);
- sLog->outString("Arena Season %u started...", season);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Arena Season %u started...", season);
+
}
uint32 GameEventMgr::Update() // return the next event delay in ms
@@ -1043,7 +1043,7 @@ uint32 GameEventMgr::Update() // return the next e
{
// must do the activating first, and after that the deactivating
// so first queue it
- //sLog->outErrorDb("Checking event %u", itr);
+ //sLog->outError(LOG_FILTER_SQL, "Checking event %u", itr);
if (CheckOneGameEvent(itr))
{
// if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so
@@ -1064,14 +1064,14 @@ uint32 GameEventMgr::Update() // return the next e
// changed, save to DB the gameevent state, will be updated in next update cycle
SaveWorldEventStateToDB(itr);
- //sLog->outDebug("GameEvent %u is active", itr->first);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "GameEvent %u is active", itr->first);
// queue for activation
if (!IsActiveEvent(itr))
activate.insert(itr);
}
else
{
- //sLog->outDebug("GameEvent %u is not active", itr->first);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "GameEvent %u is not active", itr->first);
if (IsActiveEvent(itr))
deactivate.insert(itr);
else
@@ -1099,13 +1099,13 @@ uint32 GameEventMgr::Update() // return the next e
nextEventDelay = 0;
for (std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
StopEvent(*itr);
- sLog->outDetail("Next game event check in %u seconds.", nextEventDelay + 1);
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Next game event check in %u seconds.", nextEventDelay + 1);
return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call
}
void GameEventMgr::UnApplyEvent(uint16 event_id)
{
- sLog->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str());
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str());
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_END
RunSmartAIScripts(event_id, false);
// un-spawn positive event tagged objects
@@ -1137,7 +1137,7 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id)
break;
}
- sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str());
+ sLog->outInfo(LOG_FILTER_GAMEEVENTS, "GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str());
//! Run SAI scripts with SMART_EVENT_GAME_EVENT_END
RunSmartAIScripts(event_id, true);
@@ -1211,7 +1211,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventCreatureGuids.size());
return;
}
@@ -1229,7 +1229,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{
Creature* creature = new Creature;
- //sLog->outDebug("Spawning creature %u", *itr);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "Spawning creature %u", *itr);
if (!creature->LoadCreatureFromDB(*itr, map))
delete creature;
}
@@ -1238,7 +1238,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventGameobjectGuids.size());
return;
}
@@ -1256,7 +1256,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{
GameObject* pGameobject = new GameObject;
- //sLog->outDebug("Spawning gameobject %u", *itr);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "Spawning gameobject %u", *itr);
//TODO: find out when it is add to map
if (!pGameobject->LoadGameObjectFromDB(*itr, map, false))
delete pGameobject;
@@ -1271,7 +1271,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- sLog->outError("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",
internal_event_id, mGameEventPoolIds.size());
return;
}
@@ -1286,7 +1286,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventCreatureGuids.size());
return;
}
@@ -1308,7 +1308,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size()))
{
- sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")",
internal_event_id, mGameEventGameobjectGuids.size());
return;
}
@@ -1329,7 +1329,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
}
if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size()))
{
- sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size());
+ sLog->outError(LOG_FILTER_GAMEEVENTS, "GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size());
return;
}
diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp
index 9a99a28c7aa..81a132a40d8 100755
--- a/src/server/game/Globals/ObjectAccessor.cpp
+++ b/src/server/game/Globals/ObjectAccessor.cpp
@@ -290,7 +290,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
return NULL;
}
- sLog->outStaticDebug("Deleting Corpse and spawned bones.");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Deleting Corpse and spawned bones.");
// Map can be NULL
Map* map = corpse->FindMap();
diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h
index 92a7a24571e..5b31c6bfff4 100755
--- a/src/server/game/Globals/ObjectAccessor.h
+++ b/src/server/game/Globals/ObjectAccessor.h
@@ -155,14 +155,14 @@ class ObjectAccessor
CellCoord p = Trinity::ComputeCellCoord(x, y);
if (!p.IsCoordValid())
{
- sLog->outError("ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
+ sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
return NULL;
}
CellCoord q = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
if (!q.IsCoordValid())
{
- sLog->outError("ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
+ sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
return NULL;
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 24e307482ff..81fb8ad9646 100755..100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -296,8 +296,8 @@ void ObjectMgr::LoadCreatureLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadGossipMenuItemsLocales()
@@ -333,8 +333,8 @@ void ObjectMgr::LoadGossipMenuItemsLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadPointOfInterestLocales()
@@ -360,8 +360,8 @@ void ObjectMgr::LoadPointOfInterestLocales()
AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.IconName);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadCreatureTemplates()
@@ -388,8 +388,8 @@ void ObjectMgr::LoadCreatureTemplates()
if (!result)
{
- sLog->outString(">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
+
return;
}
@@ -493,8 +493,8 @@ void ObjectMgr::LoadCreatureTemplates()
for (CreatureTemplateContainer::const_iterator itr = _creatureTemplateStore.begin(); itr != _creatureTemplateStore.end(); ++itr)
CheckCreatureTemplate(&itr->second);
- sLog->outString(">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadCreatureTemplateAddons()
@@ -506,8 +506,8 @@ void ObjectMgr::LoadCreatureTemplateAddons()
if (!result)
{
- sLog->outString(">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
+
return;
}
@@ -520,7 +520,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
if (!sObjectMgr->GetCreatureTemplate(entry))
{
- sLog->outErrorDb("Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature template (Entry: %u) does not exist but has a record in `creature_template_addon`", entry);
continue;
}
@@ -540,7 +540,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(uint32(atol(*itr)));
if (!AdditionalSpellInfo)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr)));
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr)));
continue;
}
creatureAddon.auras[i++] = uint32(atol(*itr));
@@ -550,14 +550,14 @@ void ObjectMgr::LoadCreatureTemplateAddons()
{
if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount))
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.mount);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid displayInfoId (%u) for mount defined in `creature_template_addon`", entry, creatureAddon.mount);
creatureAddon.mount = 0;
}
}
if (!sEmotesStore.LookupEntry(creatureAddon.emote))
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote);
creatureAddon.emote = 0;
}
@@ -565,8 +565,8 @@ void ObjectMgr::LoadCreatureTemplateAddons()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
@@ -584,7 +584,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureTemplate const* difficultyInfo = GetCreatureTemplate(cInfo->DifficultyEntry[diff]);
if (!difficultyInfo)
{
- sLog->outErrorDb("Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u does not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u does not exist.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff]);
continue;
}
@@ -595,20 +595,20 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
ok2 = false;
if (_difficultyEntries[diff2].find(cInfo->Entry) != _difficultyEntries[diff2].end())
{
- sLog->outErrorDb("Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.",
cInfo->Entry, diff2 + 1, cInfo->DifficultyEntry[diff], diff + 1);
continue;
}
if (_difficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != _difficultyEntries[diff2].end())
{
- sLog->outErrorDb("Creature (Entry: %u) already listed as `difficulty_entry_%u` for another entry.", cInfo->DifficultyEntry[diff], diff2 + 1);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) already listed as `difficulty_entry_%u` for another entry.", cInfo->DifficultyEntry[diff], diff2 + 1);
continue;
}
if (_hasDifficultyEntries[diff2].find(cInfo->DifficultyEntry[diff]) != _hasDifficultyEntries[diff2].end())
{
- sLog->outErrorDb("Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u has itself a value in `difficulty_entry_%u`.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has `difficulty_entry_%u`=%u but creature entry %u has itself a value in `difficulty_entry_%u`.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff], cInfo->DifficultyEntry[diff], diff2 + 1);
continue;
}
@@ -619,51 +619,51 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (cInfo->unit_class != difficultyInfo->unit_class)
{
- sLog->outErrorDb("Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
cInfo->Entry, cInfo->unit_class, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->unit_class);
continue;
}
if (cInfo->npcflag != difficultyInfo->npcflag)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_class != difficultyInfo->trainer_class)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_race != difficultyInfo->trainer_race)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_type != difficultyInfo->trainer_type)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_spell != difficultyInfo->trainer_spell)
{
- sLog->outErrorDb("Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (!difficultyInfo->AIName.empty())
{
- sLog->outErrorDb("Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
if (difficultyInfo->ScriptID)
{
- sLog->outErrorDb("Creature (Entry: %u) lists difficulty %u mode entry %u with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.",
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `ScriptName` filled in. `ScriptName` of difficulty 0 mode creature is always used instead.",
cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
continue;
}
@@ -675,11 +675,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_A);
if (!factionTemplate)
- sLog->outErrorDb("Creature (Entry: %u) has non-existing faction_A template (%u).", cInfo->Entry, cInfo->faction_A);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing faction_A template (%u).", cInfo->Entry, cInfo->faction_A);
factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_H);
if (!factionTemplate)
- sLog->outErrorDb("Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H);
// used later for scale
CreatureDisplayInfoEntry const* displayScaleEntry = NULL;
@@ -689,7 +689,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid1);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1);
const_cast<CreatureTemplate*>(cInfo)->Modelid1 = 0;
}
else if (!displayScaleEntry)
@@ -697,7 +697,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid1);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry);
}
if (cInfo->Modelid2)
@@ -705,7 +705,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid2);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2);
const_cast<CreatureTemplate*>(cInfo)->Modelid2 = 0;
}
else if (!displayScaleEntry)
@@ -713,7 +713,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry);
}
if (cInfo->Modelid3)
@@ -721,7 +721,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid3);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3);
const_cast<CreatureTemplate*>(cInfo)->Modelid3 = 0;
}
else if (!displayScaleEntry)
@@ -729,7 +729,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid3);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry);
}
if (cInfo->Modelid4)
@@ -737,7 +737,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->Modelid4);
if (!displayEntry)
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4);
const_cast<CreatureTemplate*>(cInfo)->Modelid4 = 0;
}
else if (!displayScaleEntry)
@@ -745,11 +745,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);
if (!modelInfo)
- sLog->outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry);
}
if (!displayScaleEntry)
- sLog->outErrorDb("Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) does not have any existing display id in Modelid1/Modelid2/Modelid3/Modelid4.", cInfo->Entry);
for (int k = 0; k < MAX_KILL_CREDIT; ++k)
{
@@ -757,7 +757,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
if (!GetCreatureTemplate(cInfo->KillCredit[k]))
{
- sLog->outErrorDb("Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->Entry, cInfo->KillCredit[k], k + 1);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->Entry, cInfo->KillCredit[k], k + 1);
const_cast<CreatureTemplate*>(cInfo)->KillCredit[k] = 0;
}
}
@@ -765,13 +765,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (!cInfo->unit_class || ((1 << (cInfo->unit_class-1)) & CLASSMASK_ALL_CREATURES) == 0)
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class);
const_cast<CreatureTemplate*>(cInfo)->unit_class = UNIT_CLASS_WARRIOR;
}
if (cInfo->dmgschool >= MAX_SPELL_SCHOOL)
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->Entry, cInfo->dmgschool);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->Entry, cInfo->dmgschool);
const_cast<CreatureTemplate*>(cInfo)->dmgschool = SPELL_SCHOOL_NORMAL;
}
@@ -782,30 +782,30 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
const_cast<CreatureTemplate*>(cInfo)->rangeattacktime = BASE_ATTACK_TIME;
if ((cInfo->npcflag & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE)
- sLog->outErrorDb("Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type);
if (cInfo->type && !sCreatureTypeStore.LookupEntry(cInfo->type))
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type);
const_cast<CreatureTemplate*>(cInfo)->type = CREATURE_TYPE_HUMANOID;
}
// must exist or used hidden but used in data horse case
if (cInfo->family && !sCreatureFamilyStore.LookupEntry(cInfo->family) && cInfo->family != CREATURE_FAMILY_HORSE_CUSTOM)
{
- sLog->outErrorDb("Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family);
const_cast<CreatureTemplate*>(cInfo)->family = 0;
}
if (cInfo->InhabitType <= 0 || cInfo->InhabitType > INHABIT_ANYWHERE)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType);
const_cast<CreatureTemplate*>(cInfo)->InhabitType = INHABIT_ANYWHERE;
}
if (cInfo->HoverHeight < 0.0f)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight);
const_cast<CreatureTemplate*>(cInfo)->HoverHeight = 1.0f;
}
@@ -814,7 +814,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
VehicleEntry const* vehId = sVehicleStore.LookupEntry(cInfo->VehicleId);
if (!vehId)
{
- sLog->outErrorDb("Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId);
const_cast<CreatureTemplate*>(cInfo)->VehicleId = 0;
}
}
@@ -823,21 +823,21 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId);
if (!spellDataId)
- sLog->outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u).", cInfo->Entry, cInfo->PetSpellDataId);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing PetSpellDataId (%u).", cInfo->Entry, cInfo->PetSpellDataId);
}
for (uint8 j = 0; j < CREATURE_MAX_SPELLS; ++j)
{
if (cInfo->spells[j] && !sSpellMgr->GetSpellInfo(cInfo->spells[j]))
{
- sLog->outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->Entry, j+1, cInfo->spells[j]);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->Entry, j+1, cInfo->spells[j]);
const_cast<CreatureTemplate*>(cInfo)->spells[j] = 0;
}
}
if (cInfo->MovementType >= MAX_DB_MOTION_TYPE)
{
- sLog->outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->Entry, cInfo->MovementType);
+ sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->Entry, cInfo->MovementType);
const_cast<CreatureTemplate*>(cInfo)->MovementType = IDLE_MOTION_TYPE;
}
@@ -845,7 +845,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
if (!GetEquipmentInfo(cInfo->equipmentId))
{
- sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `equipment_id` %u not found in table `creature_equip_template`, set to no equipment.", cInfo->Entry, cInfo->equipmentId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with `equipment_id` %u not found in table `creature_equip_template`, set to no equipment.", cInfo->Entry, cInfo->equipmentId);
const_cast<CreatureTemplate*>(cInfo)->equipmentId = 0;
}
}
@@ -861,19 +861,19 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (cInfo->expansion > MAX_CREATURE_BASE_HP)
{
- sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with `exp` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion);
const_cast<CreatureTemplate*>(cInfo)->expansion = 0;
}
if (cInfo->expansionUnknown > MAX_CREATURE_BASE_HP)
{
- sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp_unk` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansionUnknown);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with `exp_unk` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansionUnknown);
const_cast<CreatureTemplate*>(cInfo)->expansionUnknown = 0;
}
if (uint32 badFlags = (cInfo->flags_extra & ~CREATURE_FLAG_EXTRA_DB_ALLOWED))
{
- sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags);
const_cast<CreatureTemplate*>(cInfo)->flags_extra &= CREATURE_FLAG_EXTRA_DB_ALLOWED;
}
@@ -889,8 +889,8 @@ void ObjectMgr::LoadCreatureAddons()
if (!result)
{
- sLog->outString(">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
+
return;
}
@@ -904,7 +904,7 @@ void ObjectMgr::LoadCreatureAddons()
CreatureData const* creData = GetCreatureData(guid);
if (!creData)
{
- sLog->outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) does not exist but has a record in `creature_addon`", guid);
continue;
}
@@ -914,7 +914,7 @@ void ObjectMgr::LoadCreatureAddons()
if (creData->movementType == WAYPOINT_MOTION_TYPE && !creatureAddon.path_id)
{
const_cast<CreatureData*>(creData)->movementType = IDLE_MOTION_TYPE;
- sLog->outErrorDb("Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID %u) has movement type set to WAYPOINT_MOTION_TYPE but no path assigned", guid);
}
creatureAddon.mount = fields[2].GetUInt32();
@@ -930,7 +930,7 @@ void ObjectMgr::LoadCreatureAddons()
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(uint32(atol(*itr)));
if (!AdditionalSpellInfo)
{
- sLog->outErrorDb("Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr)));
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr)));
continue;
}
creatureAddon.auras[i++] = uint32(atol(*itr));
@@ -940,14 +940,14 @@ void ObjectMgr::LoadCreatureAddons()
{
if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount))
{
- sLog->outErrorDb("Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", guid, creatureAddon.mount);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has invalid displayInfoId (%u) for mount defined in `creature_addon`", guid, creatureAddon.mount);
creatureAddon.mount = 0;
}
}
if (!sEmotesStore.LookupEntry(creatureAddon.emote))
{
- sLog->outErrorDb("Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote);
+ sLog->outError(LOG_FILTER_SQL, "Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote);
creatureAddon.emote = 0;
}
@@ -955,8 +955,8 @@ void ObjectMgr::LoadCreatureAddons()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid)
@@ -994,8 +994,8 @@ void ObjectMgr::LoadEquipmentTemplates()
if (!result)
{
- sLog->outString(">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
+
return;
}
@@ -1021,7 +1021,7 @@ void ObjectMgr::LoadEquipmentTemplates()
if (!dbcItem)
{
- sLog->outErrorDb("Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u, forced to 0.",
+ sLog->outError(LOG_FILTER_SQL, "Unknown item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u, forced to 0.",
equipmentInfo.ItemEntry[i], i+1, entry);
equipmentInfo.ItemEntry[i] = 0;
continue;
@@ -1037,7 +1037,7 @@ void ObjectMgr::LoadEquipmentTemplates()
dbcItem->InventoryType != INVTYPE_THROWN &&
dbcItem->InventoryType != INVTYPE_RANGEDRIGHT)
{
- sLog->outErrorDb("Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u is not equipable in a hand, forced to 0.",
+ sLog->outError(LOG_FILTER_SQL, "Item (entry=%u) in creature_equip_template.itemEntry%u for entry = %u is not equipable in a hand, forced to 0.",
equipmentInfo.ItemEntry[i], i+1, entry);
equipmentInfo.ItemEntry[i] = 0;
}
@@ -1047,8 +1047,8 @@ void ObjectMgr::LoadEquipmentTemplates()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId)
@@ -1105,7 +1105,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
{
CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->modelid_other_gender);
if (!minfo_tmp)
- sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender);
+ sLog->outError(LOG_FILTER_SQL, "Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender);
else
{
// Model ID changed
@@ -1125,8 +1125,8 @@ void ObjectMgr::LoadCreatureModelInfo()
if (!result)
{
- sLog->outString(">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
+
return;
}
@@ -1149,17 +1149,17 @@ void ObjectMgr::LoadCreatureModelInfo()
// Checks
if (!sCreatureDisplayInfoStore.LookupEntry(modelId))
- sLog->outErrorDb("Table `creature_model_info` has model for not existed display id (%u).", modelId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has model for not existed display id (%u).", modelId);
if (modelInfo.gender > GENDER_NONE)
{
- sLog->outErrorDb("Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(modelInfo.gender), modelId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(modelInfo.gender), modelId);
modelInfo.gender = GENDER_MALE;
}
if (modelInfo.modelid_other_gender && !sCreatureDisplayInfoStore.LookupEntry(modelInfo.modelid_other_gender))
{
- sLog->outErrorDb("Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", modelInfo.modelid_other_gender, modelId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", modelInfo.modelid_other_gender, modelId);
modelInfo.modelid_other_gender = 0;
}
@@ -1170,8 +1170,8 @@ void ObjectMgr::LoadCreatureModelInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadLinkedRespawn()
@@ -1184,8 +1184,8 @@ void ObjectMgr::LoadLinkedRespawn()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
+
return;
}
@@ -1206,7 +1206,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1214,7 +1214,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1222,14 +1222,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1243,7 +1243,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* slave = GetCreatureData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1251,7 +1251,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1259,14 +1259,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1280,7 +1280,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1288,7 +1288,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* master = GetGOData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1296,14 +1296,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1317,7 +1317,7 @@ void ObjectMgr::LoadLinkedRespawn()
const GameObjectData* slave = GetGOData(guidLow);
if (!slave)
{
- sLog->outErrorDb("Couldn't get gameobject data for GUIDLow %u", guidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get gameobject data for GUIDLow %u", guidLow);
error = true;
break;
}
@@ -1325,7 +1325,7 @@ void ObjectMgr::LoadLinkedRespawn()
const CreatureData* master = GetCreatureData(linkedGuidLow);
if (!master)
{
- sLog->outErrorDb("Couldn't get creature data for GUIDLow %u", linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Couldn't get creature data for GUIDLow %u", linkedGuidLow);
error = true;
break;
}
@@ -1333,14 +1333,14 @@ void ObjectMgr::LoadLinkedRespawn()
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
error = true;
break;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
error = true;
break;
}
@@ -1356,8 +1356,8 @@ void ObjectMgr::LoadLinkedRespawn()
}
while (result->NextRow());
- sLog->outString(">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime));
+
}
bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
@@ -1382,13 +1382,13 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow)
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
if (!map || !map->Instanceable() || (master->mapid != slave->mapid))
{
- sLog->outErrorDb("Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "Creature '%u' linking to '%u' on an unpermitted map.", guidLow, linkedGuidLow);
return false;
}
if (!(master->spawnMask & slave->spawnMask)) // they must have a possibility to meet (normal/heroic difficulty)
{
- sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
+ sLog->outError(LOG_FILTER_SQL, "LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask", guidLow, linkedGuidLow);
return false;
}
@@ -1416,8 +1416,8 @@ void ObjectMgr::LoadCreatures()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 creatures. DB table `creature` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creatures. DB table `creature` is empty.");
+
return;
}
@@ -1441,7 +1441,7 @@ void ObjectMgr::LoadCreatures()
CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
if (!cInfo)
{
- sLog->outErrorDb("Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry);
continue;
}
@@ -1471,19 +1471,19 @@ void ObjectMgr::LoadCreatures()
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
if (!mapEntry)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.mapid);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.mapid);
continue;
}
if (data.spawnMask & ~spawnMasks[data.mapid])
- sLog->outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u) spawnMasks[data.mapid]: %u.", guid, data.spawnMask, data.mapid, spawnMasks[data.mapid]);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u) spawnMasks[data.mapid]: %u.", guid, data.spawnMask, data.mapid, spawnMasks[data.mapid]);
bool ok = true;
for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff)
{
if (_difficultyEntries[diff].find(data.id) != _difficultyEntries[diff].end())
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.",
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.",
guid, diff + 1, data.id);
ok = false;
}
@@ -1496,7 +1496,7 @@ void ObjectMgr::LoadCreatures()
{
if (!GetEquipmentInfo(data.equipmentId))
{
- sLog->outErrorDb("Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.id, data.equipmentId);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (Entry: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", data.id, data.equipmentId);
data.equipmentId = -1;
}
}
@@ -1504,19 +1504,19 @@ void ObjectMgr::LoadCreatures()
if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
{
if (!mapEntry || !mapEntry->IsDungeon())
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `creature_template`.`flags_extra` including CREATURE_FLAG_EXTRA_INSTANCE_BIND but creature are not in instance.", guid, data.id);
}
if (data.spawndist < 0.0f)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `spawndist`< 0, set to 0.", guid, data.id);
data.spawndist = 0.0f;
}
else if (data.movementType == RANDOM_MOTION_TYPE)
{
if (data.spawndist == 0.0f)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=1 (random movement) but with `spawndist`=0, replace by idle movement type (0).", guid, data.id);
data.movementType = IDLE_MOTION_TYPE;
}
}
@@ -1524,14 +1524,14 @@ void ObjectMgr::LoadCreatures()
{
if (data.spawndist != 0.0f)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `MovementType`=0 (idle) have `spawndist`<>0, set to 0.", guid, data.id);
data.spawndist = 0.0f;
}
}
if (data.phaseMask == 0)
{
- sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
data.phaseMask = 1;
}
@@ -1543,8 +1543,8 @@ void ObjectMgr::LoadCreatures()
} while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data)
@@ -1614,7 +1614,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
GameObject* go = new GameObject;
if (!go->LoadGameObjectFromDB(guid, map))
{
- sLog->outError("AddGOData: cannot add gameobject entry %u to map", entry);
+ sLog->outError(LOG_FILTER_GENERAL, "AddGOData: cannot add gameobject entry %u to map", entry);
delete go;
return 0;
}
@@ -1649,7 +1649,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos)
Creature* creature = new Creature;
if (!creature->LoadCreatureFromDB(guid, map))
{
- sLog->outError("AddCreature: cannot add creature entry %u to map", guid);
+ sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", guid);
delete creature;
return false;
}
@@ -1701,7 +1701,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
Creature* creature = new Creature;
if (!creature->LoadCreatureFromDB(guid, map))
{
- sLog->outError("AddCreature: cannot add creature entry %u to map", entry);
+ sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", entry);
delete creature;
return 0;
}
@@ -1726,8 +1726,8 @@ void ObjectMgr::LoadGameobjects()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
+
return;
}
@@ -1750,7 +1750,7 @@ void ObjectMgr::LoadGameobjects()
GameObjectTemplate const* gInfo = GetGameObjectTemplate(entry);
if (!gInfo)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry);
continue;
}
@@ -1762,14 +1762,14 @@ void ObjectMgr::LoadGameobjects()
case GAMEOBJECT_TYPE_SPELL_FOCUS:
break;
default:
- sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) doesn't have a displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry %u GoType: %u) doesn't have a displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
break;
}
}
if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId))
{
- sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId);
continue;
}
@@ -1790,13 +1790,13 @@ void ObjectMgr::LoadGameobjects()
MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid);
if (!mapEntry)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) spawned on a non-existed map (Id: %u), skip", guid, data.id, data.mapid);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) spawned on a non-existed map (Id: %u), skip", guid, data.id, data.mapid);
continue;
}
if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction())
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id);
}
data.animprogress = fields[12].GetUInt8();
@@ -1805,7 +1805,7 @@ void ObjectMgr::LoadGameobjects()
uint32 go_state = fields[13].GetUInt8();
if (go_state >= MAX_GO_STATE)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state);
continue;
}
data.go_state = GOState(go_state);
@@ -1813,7 +1813,7 @@ void ObjectMgr::LoadGameobjects()
data.spawnMask = fields[14].GetUInt8();
if (data.spawnMask & ~spawnMasks[data.mapid])
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid);
data.phaseMask = fields[15].GetUInt16();
int16 gameEvent = fields[16].GetInt8();
@@ -1821,25 +1821,25 @@ void ObjectMgr::LoadGameobjects()
if (data.rotation2 < -1.0f || data.rotation2 > 1.0f)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2);
continue;
}
if (data.rotation3 < -1.0f || data.rotation3 > 1.0f)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3);
continue;
}
if (!MapManager::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation))
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id);
continue;
}
if (data.phaseMask == 0)
{
- sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id);
data.phaseMask = 1;
}
@@ -1848,8 +1848,8 @@ void ObjectMgr::LoadGameobjects()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data)
@@ -2017,8 +2017,8 @@ void ObjectMgr::LoadItemLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void FillItemDamageFields(float* minDamage, float* maxDamage, float* dps, uint32 itemLevel, uint32 itemClass, uint32 itemSubClass, uint32 quality, uint32 delay, float statScalingFactor, uint32 inventoryType, uint32 flags2)
@@ -2540,10 +2540,9 @@ void ObjectMgr::LoadItemTemplates()
}
for (std::set<uint32>::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr)
- sLog->outErrorDb("Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr);
+ sLog->outError(LOG_FILTER_SQL, "Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr);
- sLog->outString(">> Loaded %u item templates from Item-sparse.db2 and %u from database in %u ms", sparseCount, dbCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u item templates from Item-sparse.db2 and %u from database in %u ms", sparseCount, dbCount, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadItemTemplateAddon()
@@ -2560,7 +2559,7 @@ void ObjectMgr::LoadItemTemplateAddon()
uint32 itemId = fields[0].GetUInt32();
if (!GetItemTemplate(itemId))
{
- sLog->outErrorDb("Item %u specified in `item_template_addon` does not exist, skipped.", itemId);
+ sLog->outError(LOG_FILTER_SQL, "Item %u specified in `item_template_addon` does not exist, skipped.", itemId);
continue;
}
@@ -2568,7 +2567,7 @@ void ObjectMgr::LoadItemTemplateAddon()
uint32 maxMoneyLoot = fields[4].GetUInt32();
if (minMoneyLoot > maxMoneyLoot)
{
- sLog->outErrorDb("Minimum money loot specified in `item_template_addon` for item %u was greater than maximum amount, swapping.", itemId);
+ sLog->outError(LOG_FILTER_SQL, "Minimum money loot specified in `item_template_addon` for item %u was greater than maximum amount, swapping.", itemId);
std::swap(minMoneyLoot, maxMoneyLoot);
}
@@ -2582,8 +2581,7 @@ void ObjectMgr::LoadItemTemplateAddon()
} while (result->NextRow());
}
- sLog->outString(">> Loaded %u item addon templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u item addon templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadItemScriptNames()
@@ -2600,7 +2598,7 @@ void ObjectMgr::LoadItemScriptNames()
uint32 itemId = fields[0].GetUInt32();
if (!GetItemTemplate(itemId))
{
- sLog->outErrorDb("Item %u specified in `item_script_names` does not exist, skipped.", itemId);
+ sLog->outError(LOG_FILTER_SQL, "Item %u specified in `item_script_names` does not exist, skipped.", itemId);
continue;
}
@@ -2609,8 +2607,7 @@ void ObjectMgr::LoadItemScriptNames()
} while (result->NextRow());
}
- sLog->outString(">> Loaded %u item script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u item script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry)
@@ -2635,8 +2632,8 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
+
return;
}
@@ -2653,19 +2650,19 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
if (!sObjectMgr->GetCreatureTemplate(uiEntry))
{
- sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry);
continue;
}
if (!sObjectMgr->GetCreatureTemplate(uiAccessory))
{
- sLog->outErrorDb("Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory);
continue;
}
if (_spellClickInfoStore.find(uiEntry) == _spellClickInfoStore.end())
{
- sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry);
continue;
}
@@ -2675,8 +2672,8 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadVehicleAccessories()
@@ -2692,8 +2689,8 @@ void ObjectMgr::LoadVehicleAccessories()
if (!result)
{
- sLog->outString(">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
return;
}
@@ -2710,7 +2707,7 @@ void ObjectMgr::LoadVehicleAccessories()
if (!sObjectMgr->GetCreatureTemplate(uiAccessory))
{
- sLog->outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory);
+ sLog->outError(LOG_FILTER_SQL, "Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory);
continue;
}
@@ -2720,8 +2717,8 @@ void ObjectMgr::LoadVehicleAccessories()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadPetLevelInfo()
@@ -2733,8 +2730,8 @@ void ObjectMgr::LoadPetLevelInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
+
return;
}
@@ -2747,7 +2744,7 @@ void ObjectMgr::LoadPetLevelInfo()
uint32 creature_id = fields[0].GetUInt32();
if (!sObjectMgr->GetCreatureTemplate(creature_id))
{
- sLog->outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id);
+ sLog->outError(LOG_FILTER_SQL, "Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id);
continue;
}
@@ -2755,17 +2752,17 @@ void ObjectMgr::LoadPetLevelInfo()
if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
- sLog->outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
else
{
- sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level);
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
}
continue;
}
else if (current_level < 1)
{
- sLog->outErrorDb("Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level);
continue;
}
@@ -2798,7 +2795,7 @@ void ObjectMgr::LoadPetLevelInfo()
// fatal error if no level 1 data
if (!pInfo || pInfo[0].health == 0)
{
- sLog->outErrorDb("Creature %u does not have pet stats data for Level 1!", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Creature %u does not have pet stats data for Level 1!", itr->first);
exit(1);
}
@@ -2807,14 +2804,14 @@ void ObjectMgr::LoadPetLevelInfo()
{
if (pInfo[level].health == 0)
{
- sLog->outErrorDb("Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level);
+ sLog->outError(LOG_FILTER_SQL, "Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level);
pInfo[level] = pInfo[level-1];
}
}
}
- sLog->outString(">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) const
@@ -2836,7 +2833,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
else
{
if (count < -1)
- sLog->outErrorDb("Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId);
+ sLog->outError(LOG_FILTER_SQL, "Invalid count %i specified on item %u be removed from original player create info (use -1)!", count, itemId);
uint32 RaceClass = (race_) | (class_ << 8);
bool doneOne = false;
@@ -2858,7 +2855,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
}
if (!found)
- sLog->outErrorDb("Item %u specified to be removed from original create info not found in dbc!", itemId);
+ sLog->outError(LOG_FILTER_SQL, "Item %u specified to be removed from original create info not found in dbc!", itemId);
if (!doneOne)
doneOne = true;
@@ -2880,8 +2877,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outString();
- sLog->outErrorDb(">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
+
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
exit(1);
}
else
@@ -2903,39 +2900,39 @@ void ObjectMgr::LoadPlayerInfo()
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
continue;
}
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race);
if (!rEntry)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
continue;
}
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
continue;
}
if (!sChrClassesStore.LookupEntry(current_class))
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
continue;
}
// accept DB data only for valid position (and non instanceable)
if (!MapManager::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation))
{
- sLog->outErrorDb("Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
continue;
}
if (sMapStore.LookupEntry(mapId)->Instanceable())
{
- sLog->outErrorDb("Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
+ sLog->outError(LOG_FILTER_SQL, "Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
continue;
}
@@ -2955,13 +2952,13 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// Load playercreate items
- sLog->outString("Loading Player Create Items Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Items Data...");
{
uint32 oldMSTime = getMSTime();
// 0 1 2 3
@@ -2969,8 +2966,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outString(">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
+
}
else
{
@@ -2983,14 +2980,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class);
continue;
}
@@ -2998,7 +2995,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!GetItemTemplate(item_id))
{
- sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class);
+ sLog->outError(LOG_FILTER_SQL, "Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class);
continue;
}
@@ -3006,7 +3003,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!amount)
{
- sLog->outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class);
+ sLog->outError(LOG_FILTER_SQL, "Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class);
continue;
}
@@ -3027,13 +3024,13 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// Load playercreate spells
- sLog->outString("Loading Player Create Spell Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Spell Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3042,8 +3039,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell");
+
}
else
{
@@ -3056,14 +3053,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class);
continue;
}
@@ -3084,13 +3081,13 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// Load playercreate actions
- sLog->outString("Loading Player Create Action Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Action Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3099,8 +3096,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
+
}
else
{
@@ -3113,14 +3110,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class);
continue;
}
@@ -3131,13 +3128,13 @@ void ObjectMgr::LoadPlayerInfo()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// Loading levels data (class/race dependent)
- sLog->outString("Loading Player Create Level Stats Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Level Stats Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3146,8 +3143,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
+
exit(1);
}
@@ -3160,14 +3157,14 @@ void ObjectMgr::LoadPlayerInfo()
uint32 current_race = fields[0].GetUInt8();
if (current_race >= MAX_RACES)
{
- sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.", current_race);
+ sLog->outError(LOG_FILTER_SQL, "Wrong race %u in `player_levelstats` table, ignoring.", current_race);
continue;
}
uint32 current_class = fields[1].GetUInt8();
if (current_class >= MAX_CLASSES)
{
- sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.", current_class);
+ sLog->outError(LOG_FILTER_SQL, "Wrong class %u in `player_levelstats` table, ignoring.", current_class);
continue;
}
@@ -3175,10 +3172,10 @@ void ObjectMgr::LoadPlayerInfo()
if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
- sLog->outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level);
else
{
- sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level);
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
}
continue;
@@ -3230,7 +3227,7 @@ void ObjectMgr::LoadPlayerInfo()
// fatal error if no level 1 data
if (!pInfo->levelInfo || pInfo->levelInfo[0].stats[0] == 0)
{
- sLog->outErrorDb("Race %i Class %i Level 1 does not have stats data!", race, class_);
+ sLog->outError(LOG_FILTER_SQL, "Race %i Class %i Level 1 does not have stats data!", race, class_);
exit(1);
}
@@ -3239,19 +3236,19 @@ void ObjectMgr::LoadPlayerInfo()
{
if (pInfo->levelInfo[level].stats[0] == 0)
{
- sLog->outErrorDb("Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level);
+ sLog->outError(LOG_FILTER_SQL, "Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level);
pInfo->levelInfo[level] = pInfo->levelInfo[level-1];
}
}
}
}
- sLog->outString(">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
// Loading xp per level data
- sLog->outString("Loading Player Create XP Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create XP Data...");
{
uint32 oldMSTime = getMSTime();
@@ -3264,8 +3261,8 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
+
exit(1);
}
@@ -3281,10 +3278,10 @@ void ObjectMgr::LoadPlayerInfo()
if (current_level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
{
if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum
- sLog->outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level);
+ sLog->outError(LOG_FILTER_SQL, "Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level);
else
{
- sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level);
++count; // make result loading percent "expected" correct in case disabled detail mode for example.
}
continue;
@@ -3300,13 +3297,13 @@ void ObjectMgr::LoadPlayerInfo()
{
if (_playerXPperLevel[level] == 0)
{
- sLog->outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level);
+ sLog->outError(LOG_FILTER_SQL, "Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level);
_playerXPperLevel[level] = _playerXPperLevel[level-1]+100;
}
}
- sLog->outString(">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
@@ -3323,7 +3320,7 @@ void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& base
if (!hp || !mp)
{
- sLog->outError("Tried to get non-existant Class-Level combination data for base hp/mp. Class %u Level %u", class_, level);
+ sLog->outError(LOG_FILTER_GENERAL, "Tried to get non-existant Class-Level combination data for base hp/mp. Class %u Level %u", class_, level);
return;
}
@@ -3475,8 +3472,8 @@ void ObjectMgr::LoadQuests()
" FROM quest_template");
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
+
return;
}
@@ -3505,18 +3502,18 @@ void ObjectMgr::LoadQuests()
// additional quest integrity checks (GO, creature_template and item_template must be loaded already)
if (qinfo->GetQuestMethod() >= 3)
- sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod());
if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED)
{
- sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u",
qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20);
qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED;
}
if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY)
{
- sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u is marked as daily quest in `Flags`, removed daily flag.", qinfo->GetQuestId());
qinfo->Flags &= ~QUEST_FLAGS_DAILY;
}
@@ -3524,7 +3521,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
{
- sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
}
}
@@ -3533,7 +3530,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE))
{
- sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId());
qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE;
}
}
@@ -3545,7 +3542,7 @@ void ObjectMgr::LoadQuests()
{
if (uint32 id = qinfo->RewardChoiceItemId[j])
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item from `RewardChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest ignore this data
}
@@ -3557,7 +3554,7 @@ void ObjectMgr::LoadQuests()
{
if (!GetAreaEntryByAreaID(qinfo->ZoneOrSort))
{
- sLog->outErrorDb("Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.",
qinfo->GetQuestId(), qinfo->ZoneOrSort);
// no changes, quest not dependent from this value but can have problems at client
}
@@ -3568,7 +3565,7 @@ void ObjectMgr::LoadQuests()
QuestSortEntry const* qSort = sQuestSortStore.LookupEntry(-int32(qinfo->ZoneOrSort));
if (!qSort)
{
- sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.",
qinfo->GetQuestId(), qinfo->ZoneOrSort);
// no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check)
}
@@ -3577,7 +3574,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredSkillId != skill_id)
{
- sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ZoneOrSort` = %i but `RequiredSkillId` does not have a corresponding value (%d).",
qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id);
//override, and force proper value here?
}
@@ -3589,7 +3586,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->RequiredClasses & CLASSMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u does not contain any playable classes in `RequiredClasses` (%u), value set to 0 (all classes).", qinfo->GetQuestId(), qinfo->RequiredClasses);
qinfo->RequiredClasses = 0;
}
}
@@ -3598,7 +3595,7 @@ void ObjectMgr::LoadQuests()
{
if (!(qinfo->RequiredRaces & RACEMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u does not contain any playable races in `RequiredRaces` (%u), value set to 0 (all races).", qinfo->GetQuestId(), qinfo->RequiredRaces);
qinfo->RequiredRaces = 0;
}
}
@@ -3607,7 +3604,7 @@ void ObjectMgr::LoadQuests()
{
if (!sSkillLineStore.LookupEntry(qinfo->RequiredSkillId))
{
- sLog->outErrorDb("Quest %u has `RequiredSkillId` = %u but this skill does not exist",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSkillId` = %u but this skill does not exist",
qinfo->GetQuestId(), qinfo->RequiredSkillId);
}
}
@@ -3616,7 +3613,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredSkillPoints > sWorld->GetConfigMaxSkillValue())
{
- sLog->outErrorDb("Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSkillPoints` = %u but max possible skill is %u, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredSkillPoints, sWorld->GetConfigMaxSkillValue());
// no changes, quest can't be done for this requirement
}
@@ -3625,77 +3622,77 @@ void ObjectMgr::LoadQuests()
if (qinfo->RequiredFactionId2 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId2))
{
- sLog->outErrorDb("Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionId2` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredFactionId2, qinfo->RequiredFactionId2);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredFactionId1 && !sFactionStore.LookupEntry(qinfo->RequiredFactionId1))
{
- sLog->outErrorDb("Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionId1` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredFactionId1, qinfo->RequiredFactionId1);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMinRepFaction))
{
- sLog->outErrorDb("Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMinRepFaction, qinfo->RequiredMinRepFaction);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMaxRepFaction))
{
- sLog->outErrorDb("Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMaxRepFaction, qinfo->RequiredMaxRepFaction);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > ReputationMgr::Reputation_Cap)
{
- sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMinRepValue, ReputationMgr::Reputation_Cap);
// no changes, quest can't be done for this requirement
}
if (qinfo->RequiredMinRepValue && qinfo->RequiredMaxRepValue && qinfo->RequiredMaxRepValue <= qinfo->RequiredMinRepValue)
{
- sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.",
qinfo->GetQuestId(), qinfo->RequiredMaxRepValue, qinfo->RequiredMinRepValue);
// no changes, quest can't be done for this requirement
}
if (!qinfo->RequiredFactionId1 && qinfo->RequiredFactionValue1 != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionValue1` = %d but `RequiredFactionId1` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredFactionValue1);
// warning
}
if (!qinfo->RequiredFactionId2 && qinfo->RequiredFactionValue2 != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredFactionValue2` = %d but `RequiredFactionId2` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredFactionValue2);
// warning
}
if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredMinRepValue);
// warning
}
if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue != 0)
{
- sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
qinfo->GetQuestId(), qinfo->RequiredMaxRepValue);
// warning
}
if (qinfo->RewardTitleId && !sCharTitlesStore.LookupEntry(qinfo->RewardTitleId))
{
- sLog->outErrorDb("Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.",
qinfo->GetQuestId(), qinfo->GetCharTitleId(), qinfo->GetCharTitleId());
qinfo->RewardTitleId = 0;
// quest can't reward this title
@@ -3705,20 +3702,20 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(qinfo->SourceItemId))
{
- sLog->outErrorDb("Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = %u but item with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->SourceItemId, qinfo->SourceItemId);
qinfo->SourceItemId = 0; // quest can't be done for this requirement
}
else if (qinfo->SourceItemIdCount == 0)
{
- sLog->outErrorDb("Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = %u but `SourceItemIdCount` = 0, set to 1 but need fix in DB.",
qinfo->GetQuestId(), qinfo->SourceItemId);
qinfo->SourceItemIdCount = 1; // update to 1 for allow quest work for backward compatibility with DB
}
}
else if (qinfo->SourceItemIdCount>0)
{
- sLog->outErrorDb("Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceItemId` = 0 but `SourceItemIdCount` = %u, useless value.",
qinfo->GetQuestId(), qinfo->SourceItemIdCount);
qinfo->SourceItemIdCount=0; // no quest work changes in fact
}
@@ -3728,13 +3725,13 @@ void ObjectMgr::LoadQuests()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->SourceSpellid);
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceSpellid` = %u but spell %u doesn't exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
- sLog->outErrorDb("Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SourceSpellid` = %u but spell %u is broken, quest can't be done.",
qinfo->GetQuestId(), qinfo->SourceSpellid, qinfo->SourceSpellid);
qinfo->SourceSpellid = 0; // quest can't be done for this requirement
}
@@ -3747,7 +3744,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredItemCount[j] == 0)
{
- sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = %u but `RequiredItemCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest can't be done for this requirement
}
@@ -3756,14 +3753,14 @@ void ObjectMgr::LoadQuests()
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, id);
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
}
}
else if (qinfo->RequiredItemCount[j] > 0)
{
- sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]);
qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest
}
@@ -3776,7 +3773,7 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, id);
// no changes, quest can't be done for this requirement
}
@@ -3785,7 +3782,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredSourceItemCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemCount[j]);
// no changes, quest ignore this data
}
@@ -3800,7 +3797,7 @@ void ObjectMgr::LoadQuests()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, id);
continue;
}
@@ -3822,7 +3819,7 @@ void ObjectMgr::LoadQuests()
{
if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
+ sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
// this will prevent quest completing without objective
const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
@@ -3830,7 +3827,7 @@ void ObjectMgr::LoadQuests()
}
else
{
- sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1, id);
// no changes, quest can't be done for this requirement
}
@@ -3843,14 +3840,14 @@ void ObjectMgr::LoadQuests()
int32 id = qinfo->RequiredNpcOrGo[j];
if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id))
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %i but gameobject %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, uint32(-id));
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
}
if (id > 0 && !sObjectMgr->GetCreatureTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %i but creature with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, id, uint32(id));
qinfo->RequiredNpcOrGo[j] = 0; // quest can't be done for this requirement
}
@@ -3863,14 +3860,14 @@ void ObjectMgr::LoadQuests()
if (!qinfo->RequiredNpcOrGoCount[j])
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = %u but `RequiredNpcOrGoCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest can be incorrectly done, but we already report this
}
}
else if (qinfo->RequiredNpcOrGoCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredNpcOrGo%d` = 0 but `RequiredNpcOrGoCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredNpcOrGoCount[j]);
// no changes, quest ignore this data
}
@@ -3883,21 +3880,21 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
qinfo->GetQuestId(), j+1, id, id);
qinfo->RewardChoiceItemId[j] = 0; // no changes, quest will not reward this
}
if (!qinfo->RewardChoiceItemCount[j])
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = %u but `RewardChoiceItemCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes, quest can't be done
}
}
else if (qinfo->RewardChoiceItemCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardChoiceItemId%d` = 0 but `RewardChoiceItemCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardChoiceItemCount[j]);
// no changes, quest ignore this data
}
@@ -3910,21 +3907,21 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetItemTemplate(id))
{
- sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.",
qinfo->GetQuestId(), j+1, id, id);
qinfo->RewardItemId[j] = 0; // no changes, quest will not reward this item
}
if (!qinfo->RewardItemIdCount[j])
{
- sLog->outErrorDb("Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = %u but `RewardItemIdCount%d` = 0, quest will not reward this item.",
qinfo->GetQuestId(), j+1, id, j+1);
// no changes
}
}
else if (qinfo->RewardItemIdCount[j]>0)
{
- sLog->outErrorDb("Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardItemId%d` = 0 but `RewardItemIdCount%d` = %u.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardItemIdCount[j]);
// no changes, quest ignore this data
}
@@ -3936,18 +3933,18 @@ void ObjectMgr::LoadQuests()
{
if (abs(qinfo->RewardFactionValueId[j]) > 9)
{
- sLog->outErrorDb("Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has RewardFactionValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewardFactionValueId[j]);
}
if (!sFactionStore.LookupEntry(qinfo->RewardFactionId[j]))
{
- sLog->outErrorDb("Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]);
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardFactionId%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewardFactionId[j], qinfo->RewardFactionId[j]);
qinfo->RewardFactionId[j] = 0; // quest will not reward this
}
}
else if (qinfo->RewardFactionValueIdOverride[j] != 0)
{
- sLog->outErrorDb("Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardFactionId%d` = 0 but `RewardFactionValueIdOverride%d` = %i.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardFactionValueIdOverride[j]);
// no changes, quest ignore this data
}
@@ -3959,21 +3956,21 @@ void ObjectMgr::LoadQuests()
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u does not exist, spell removed as display reward.",
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
qinfo->RewardSpell = 0; // no spell reward will display for this quest
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is broken, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
qinfo->RewardSpell = 0; // no spell reward will display for this quest
}
else if (GetTalentSpellCost(qinfo->RewardSpell))
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpell, qinfo->RewardSpell);
qinfo->RewardSpell = 0; // no spell reward will display for this quest
}
@@ -3985,21 +3982,21 @@ void ObjectMgr::LoadQuests()
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
qinfo->RewardSpellCast = 0; // no spell will be casted on player
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
- sLog->outErrorDb("Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpellCast` = %u but spell %u is broken, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
qinfo->RewardSpellCast = 0; // no spell will be casted on player
}
else if (GetTalentSpellCost(qinfo->RewardSpellCast))
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
qinfo->RewardSpellCast = 0; // no spell will be casted on player
}
@@ -4009,7 +4006,7 @@ void ObjectMgr::LoadQuests()
{
if (!sMailTemplateStore.LookupEntry(qinfo->RewardMailTemplateId))
{
- sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.",
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId);
qinfo->RewardMailTemplateId = 0; // no mail will send to player
qinfo->RewardMailDelay = 0; // no mail will send to player
@@ -4017,7 +4014,7 @@ void ObjectMgr::LoadQuests()
else if (usedMailTemplates.find(qinfo->RewardMailTemplateId) != usedMailTemplates.end())
{
std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewardMailTemplateId);
- sLog->outErrorDb("Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.",
qinfo->GetQuestId(), qinfo->RewardMailTemplateId, qinfo->RewardMailTemplateId, used_mt_itr->second);
qinfo->RewardMailTemplateId = 0; // no mail will send to player
qinfo->RewardMailDelay = 0; // no mail will send to player
@@ -4031,7 +4028,7 @@ void ObjectMgr::LoadQuests()
QuestMap::iterator qNextItr = _questTemplates.find(qinfo->NextQuestIdChain);
if (qNextItr == _questTemplates.end())
{
- sLog->outErrorDb("Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `NextQuestIdChain` = %u but quest %u does not exist, quest chain will not work.",
qinfo->GetQuestId(), qinfo->NextQuestIdChain, qinfo->NextQuestIdChain);
qinfo->NextQuestIdChain = 0;
}
@@ -4046,7 +4043,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RewardCurrencyCount[j] == 0)
{
- sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = %u but `RewardCurrencyCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardCurrencyId%d` = %u but `RewardCurrencyCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, currency, j+1);
// no changes, quest can't be done for this requirement
}
@@ -4054,14 +4051,14 @@ void ObjectMgr::LoadQuests()
/* TODO: Re-enable once currency dbc getters are implemented
if (!sObjectMgr->GetCurrency(currency))
{
- sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, currency, currency);
qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest
}*/
}
else if (qinfo->RewardCurrencyCount[j] > 0)
{
- sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = 0 but `RewardCurrencyCount%d` = %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardCurrencyId%d` = 0 but `RewardCurrencyCount%d` = %u, quest can't be done.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RewardCurrencyCount[j]);
qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest
}
@@ -4074,7 +4071,7 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RequiredCurrencyCount[j] == 0)
{
- sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = %u but `RequiredCurrencyCount%d` = 0, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredCurrencyId%d` = %u but `RequiredCurrencyCount%d` = 0, quest can't be done.",
qinfo->GetQuestId(), j+1, currency, j+1);
// no changes, quest can't be done for this requirement
}
@@ -4082,14 +4079,14 @@ void ObjectMgr::LoadQuests()
/* TODO: Re-enable once currency dbc getters are implemented
if (!sObjectMgr->GetCurrency(currency))
{
- sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), j+1, currency, currency);
qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest
}*/
}
else if (qinfo->RequiredCurrencyCount[j] > 0)
{
- sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = 0 but `RequiredCurrencyCount%d` = %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredCurrencyId%d` = 0 but `RequiredCurrencyCount%d` = %u, quest can't be done.",
qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredCurrencyCount[j]);
qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest
}
@@ -4099,7 +4096,7 @@ void ObjectMgr::LoadQuests()
{
if (!sSoundEntriesStore.LookupEntry(qinfo->SoundAccept))
{
- sLog->outErrorDb("Quest %u has `SoundAccept` = %u but sound %u does not exist, set to 0.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SoundAccept` = %u but sound %u does not exist, set to 0.",
qinfo->GetQuestId(), qinfo->SoundAccept, qinfo->SoundAccept);
qinfo->SoundAccept = 0; // no sound will be played
}
@@ -4109,7 +4106,7 @@ void ObjectMgr::LoadQuests()
{
if (!sSoundEntriesStore.LookupEntry(qinfo->SoundTurnIn))
{
- sLog->outErrorDb("Quest %u has `SoundTurnIn` = %u but sound %u does not exist, set to 0.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `SoundTurnIn` = %u but sound %u does not exist, set to 0.",
qinfo->GetQuestId(), qinfo->SoundTurnIn, qinfo->SoundTurnIn);
qinfo->SoundTurnIn = 0; // no sound will be played
}
@@ -4121,14 +4118,14 @@ void ObjectMgr::LoadQuests()
if (!spellInfo)
{
- sLog->outErrorDb("Quest %u has `RequiredSpell` = %u but spell %u does not exist, quest will not require a spell.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSpell` = %u but spell %u does not exist, quest will not require a spell.",
qinfo->GetQuestId(), qinfo->RequiredSpell, qinfo->RequiredSpell);
qinfo->RequiredSpell = 0; // no spell will be required
}
else if (!SpellMgr::IsSpellValid(spellInfo))
{
- sLog->outErrorDb("Quest %u has `RequiredSpell` = %u but spell %u is broken, quest will not require a spell.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredSpell` = %u but spell %u is broken, quest will not require a spell.",
qinfo->GetQuestId(), qinfo->RequiredSpell, qinfo->RequiredSpell);
qinfo->RequiredSpell = 0; // no spell will be required
}
@@ -4136,7 +4133,7 @@ void ObjectMgr::LoadQuests()
/* Can we require talents?
else if (GetTalentSpellCost(qinfo->RewardSpellCast))
{
- sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.",
qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast);
qinfo->RewardSpellCast = 0; // no spell will be casted on player
}
@@ -4147,12 +4144,12 @@ void ObjectMgr::LoadQuests()
{
if (!sSkillLineStore.LookupEntry(qinfo->RewardSkillId))
{
- sLog->outErrorDb("Quest %u has `RewardSkillId` = %u but this skill does not exist",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSkillId` = %u but this skill does not exist",
qinfo->GetQuestId(), qinfo->RewardSkillId);
}
if (!qinfo->RewardSkillPoints)
{
- sLog->outErrorDb("Quest %u has `RewardSkillId` = %u but `RewardSkillPoints` is 0",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSkillId` = %u but `RewardSkillPoints` is 0",
qinfo->GetQuestId(), qinfo->RewardSkillId);
}
}
@@ -4161,13 +4158,13 @@ void ObjectMgr::LoadQuests()
{
if (qinfo->RewardSkillPoints > sWorld->GetConfigMaxSkillValue())
{
- sLog->outErrorDb("Quest %u has `RewardSkillPoints` = %u but max possible skill is %u, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSkillPoints` = %u but max possible skill is %u, quest can't be done.",
qinfo->GetQuestId(), qinfo->RewardSkillPoints, sWorld->GetConfigMaxSkillValue());
// no changes, quest can't be done for this requirement
}
if (!qinfo->RewardSkillId)
{
- sLog->outErrorDb("Quest %u has `RewardSkillPoints` = %u but `RewardSkillId` is 0",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardSkillPoints` = %u but `RewardSkillId` is 0",
qinfo->GetQuestId(), qinfo->RewardSkillPoints);
}
}
@@ -4176,7 +4173,7 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestGiverPortrait))
{
- sLog->outErrorDb("Quest %u has `QuestGiverPortrait` = %u but creature with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `QuestGiverPortrait` = %u but creature with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->QuestGiverPortrait, qinfo->QuestGiverPortrait);
qinfo->QuestGiverPortrait = 0;
}
@@ -4186,7 +4183,7 @@ void ObjectMgr::LoadQuests()
{
if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestTurnInPortrait))
{
- sLog->outErrorDb("Quest %u has `QuestTurnInPortrait` = %u but creature with entry %u does not exist, quest can't be done.",
+ sLog->outError(LOG_FILTER_SQL, "Quest %u has `QuestTurnInPortrait` = %u but creature with entry %u does not exist, quest can't be done.",
qinfo->GetQuestId(), qinfo->QuestTurnInPortrait, qinfo->QuestTurnInPortrait);
qinfo->QuestTurnInPortrait = 0;
}
@@ -4199,7 +4196,7 @@ void ObjectMgr::LoadQuests()
{
if (_questTemplates.find(abs(qinfo->GetPrevQuestId())) == _questTemplates.end())
{
- sLog->outErrorDb("Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId());
}
else
{
@@ -4212,7 +4209,7 @@ void ObjectMgr::LoadQuests()
QuestMap::iterator qNextItr = _questTemplates.find(abs(qinfo->GetNextQuestId()));
if (qNextItr == _questTemplates.end())
{
- sLog->outErrorDb("Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
+ sLog->outError(LOG_FILTER_SQL, "Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId());
}
else
{
@@ -4251,7 +4248,7 @@ void ObjectMgr::LoadQuests()
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id);
// this will prevent quest completing without objective
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
@@ -4259,8 +4256,8 @@ void ObjectMgr::LoadQuests()
}
}
- sLog->outString(">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadQuestLocales()
@@ -4313,8 +4310,8 @@ void ObjectMgr::LoadQuestLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadScripts(ScriptsType type)
@@ -4332,7 +4329,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (sScriptMgr->IsScriptScheduled()) // function cannot be called when scripts are in use.
return;
- sLog->outString("Loading %s...", tableName.c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading %s...", tableName.c_str());
scripts->clear(); // need for reload support
@@ -4342,8 +4339,8 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (!result)
{
- sLog->outString(">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str());
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str());
+
return;
}
@@ -4374,19 +4371,19 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (tmp.Talk.ChatType > CHAT_TYPE_WHISPER && tmp.Talk.ChatType != CHAT_MSG_RAID_BOSS_WHISPER)
{
- sLog->outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(), tmp.Talk.ChatType, tmp.id);
continue;
}
if (!tmp.Talk.TextID)
{
- sLog->outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(), tmp.Talk.TextID, tmp.id);
continue;
}
if (tmp.Talk.TextID < MIN_DB_SCRIPT_STRING_ID || tmp.Talk.TextID >= MAX_DB_SCRIPT_STRING_ID)
{
- sLog->outErrorDb("Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u",
tableName.c_str(), tmp.Talk.TextID, MIN_DB_SCRIPT_STRING_ID, MAX_DB_SCRIPT_STRING_ID, tmp.id);
continue;
}
@@ -4398,7 +4395,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sEmotesStore.LookupEntry(tmp.Emote.EmoteID))
{
- sLog->outErrorDb("Table `%s` has invalid emote id (datalong = %u) in SCRIPT_COMMAND_EMOTE for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid emote id (datalong = %u) in SCRIPT_COMMAND_EMOTE for script id %u",
tableName.c_str(), tmp.Emote.EmoteID, tmp.id);
continue;
}
@@ -4409,14 +4406,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sMapStore.LookupEntry(tmp.TeleportTo.MapID))
{
- sLog->outErrorDb("Table `%s` has invalid map (Id: %u) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid map (Id: %u) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
tableName.c_str(), tmp.TeleportTo.MapID, tmp.id);
continue;
}
if (!Trinity::IsValidMapCoord(tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation))
{
- sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TELEPORT_TO for script id %u",
tableName.c_str(), tmp.TeleportTo.DestX, tmp.TeleportTo.DestY, tmp.TeleportTo.DestZ, tmp.TeleportTo.Orientation, tmp.id);
continue;
}
@@ -4428,14 +4425,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
Quest const* quest = GetQuestTemplate(tmp.QuestExplored.QuestID);
if (!quest)
{
- sLog->outErrorDb("Table `%s` has invalid quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id);
continue;
}
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.",
tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id);
// this will prevent quest completing without objective
@@ -4446,21 +4443,21 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (float(tmp.QuestExplored.Distance) > DEFAULT_VISIBILITY_DISTANCE)
{
- sLog->outErrorDb("Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u",
tableName.c_str(), tmp.QuestExplored.Distance, tmp.id);
continue;
}
if (tmp.QuestExplored.Distance && float(tmp.QuestExplored.Distance) > DEFAULT_VISIBILITY_DISTANCE)
{
- sLog->outErrorDb("Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, max distance is %f or 0 for disable distance check",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has too large distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, max distance is %f or 0 for disable distance check",
tableName.c_str(), tmp.QuestExplored.Distance, tmp.id, DEFAULT_VISIBILITY_DISTANCE);
continue;
}
if (tmp.QuestExplored.Distance && float(tmp.QuestExplored.Distance) < INTERACTION_DISTANCE)
{
- sLog->outErrorDb("Table `%s` has too small distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, min distance is %f or 0 for disable distance check",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has too small distance (%u) for exploring objective complete in `datalong2` in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, min distance is %f or 0 for disable distance check",
tableName.c_str(), tmp.QuestExplored.Distance, tmp.id, INTERACTION_DISTANCE);
continue;
}
@@ -4472,7 +4469,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!GetCreatureTemplate(tmp.KillCredit.CreatureEntry))
{
- sLog->outErrorDb("Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u",
tableName.c_str(), tmp.KillCredit.CreatureEntry, tmp.id);
continue;
}
@@ -4484,7 +4481,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectData const* data = GetGOData(tmp.RespawnGameobject.GOGuid);
if (!data)
{
- sLog->outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid gameobject (GUID: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
tableName.c_str(), tmp.RespawnGameobject.GOGuid, tmp.id);
continue;
}
@@ -4492,7 +4489,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectTemplate const* info = GetGameObjectTemplate(data->id);
if (!info)
{
- sLog->outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
tableName.c_str(), tmp.RespawnGameobject.GOGuid, data->id, tmp.id);
continue;
}
@@ -4503,7 +4500,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
info->type == GAMEOBJECT_TYPE_BUTTON ||
info->type == GAMEOBJECT_TYPE_TRAP)
{
- sLog->outErrorDb("Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u",
tableName.c_str(), info->entry, tmp.id);
continue;
}
@@ -4514,14 +4511,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!Trinity::IsValidMapCoord(tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation))
{
- sLog->outErrorDb("Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid coordinates (X: %f Y: %f Z: %f O: %f) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
tableName.c_str(), tmp.TempSummonCreature.PosX, tmp.TempSummonCreature.PosY, tmp.TempSummonCreature.PosZ, tmp.TempSummonCreature.Orientation, tmp.id);
continue;
}
if (!GetCreatureTemplate(tmp.TempSummonCreature.CreatureEntry))
{
- sLog->outErrorDb("Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE for script id %u",
tableName.c_str(), tmp.TempSummonCreature.CreatureEntry, tmp.id);
continue;
}
@@ -4534,7 +4531,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectData const* data = GetGOData(tmp.ToggleDoor.GOGuid);
if (!data)
{
- sLog->outErrorDb("Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has invalid gameobject (GUID: %u) in %s for script id %u",
tableName.c_str(), tmp.ToggleDoor.GOGuid, GetScriptCommandName(tmp.command).c_str(), tmp.id);
continue;
}
@@ -4542,14 +4539,14 @@ void ObjectMgr::LoadScripts(ScriptsType type)
GameObjectTemplate const* info = GetGameObjectTemplate(data->id);
if (!info)
{
- sLog->outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u",
tableName.c_str(), tmp.ToggleDoor.GOGuid, data->id, GetScriptCommandName(tmp.command).c_str(), tmp.id);
continue;
}
if (info->type != GAMEOBJECT_TYPE_DOOR)
{
- sLog->outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has gameobject type (%u) non supported by command %s for script id %u",
tableName.c_str(), info->entry, GetScriptCommandName(tmp.command).c_str(), tmp.id);
continue;
}
@@ -4561,13 +4558,13 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sSpellMgr->GetSpellInfo(tmp.RemoveAura.SpellID))
{
- sLog->outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
tableName.c_str(), tmp.RemoveAura.SpellID, tmp.id);
continue;
}
if (tmp.RemoveAura.Flags & ~0x1) // 1 bits (0, 1)
{
- sLog->outErrorDb("Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u",
tableName.c_str(), tmp.RemoveAura.Flags, tmp.id);
continue;
}
@@ -4578,25 +4575,25 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!sSpellMgr->GetSpellInfo(tmp.CastSpell.SpellID))
{
- sLog->outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.SpellID, tmp.id);
continue;
}
if (tmp.CastSpell.Flags > 4) // targeting type
{
- sLog->outErrorDb("Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown target in datalong2 (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.Flags, tmp.id);
continue;
}
if (tmp.CastSpell.Flags != 4 && tmp.CastSpell.CreatureEntry & ~0x1) // 1 bit (0, 1)
{
- sLog->outErrorDb("Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.CreatureEntry, tmp.id);
continue;
}
else if (tmp.CastSpell.Flags == 4 && !GetCreatureTemplate(tmp.CastSpell.CreatureEntry))
{
- sLog->outErrorDb("Table `%s` using invalid creature entry in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` using invalid creature entry in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u",
tableName.c_str(), tmp.CastSpell.CreatureEntry, tmp.id);
continue;
}
@@ -4607,13 +4604,13 @@ void ObjectMgr::LoadScripts(ScriptsType type)
{
if (!GetItemTemplate(tmp.CreateItem.ItemEntry))
{
- sLog->outErrorDb("Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u",
tableName.c_str(), tmp.CreateItem.ItemEntry, tmp.id);
continue;
}
if (!tmp.CreateItem.Amount)
{
- sLog->outErrorDb("Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u",
tableName.c_str(), tmp.CreateItem.Amount, tmp.id);
continue;
}
@@ -4634,8 +4631,8 @@ void ObjectMgr::LoadScripts(ScriptsType type)
}
while (result->NextRow());
- sLog->outString(">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadGameObjectScripts()
@@ -4646,7 +4643,7 @@ void ObjectMgr::LoadGameObjectScripts()
for (ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr)
{
if (!GetGOData(itr->first))
- sLog->outErrorDb("Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first);
}
}
@@ -4658,7 +4655,7 @@ void ObjectMgr::LoadQuestEndScripts()
for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr)
{
if (!GetQuestTemplate(itr->first))
- sLog->outErrorDb("Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first);
}
}
@@ -4670,7 +4667,7 @@ void ObjectMgr::LoadQuestStartScripts()
for (ScriptMapMap::const_iterator itr = sQuestStartScripts.begin(); itr != sQuestStartScripts.end(); ++itr)
{
if (!GetQuestTemplate(itr->first))
- sLog->outErrorDb("Table `quest_start_scripts` has not existing quest (Id: %u) as script id", itr->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `quest_start_scripts` has not existing quest (Id: %u) as script id", itr->first);
}
}
@@ -4686,14 +4683,14 @@ void ObjectMgr::LoadSpellScripts()
if (!spellInfo)
{
- sLog->outErrorDb("Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId);
continue;
}
uint8 i = (uint8)((uint32(itr->first) >> 24) & 0x000000FF);
//check for correct spellEffect
if (!spellInfo->Effects[i].Effect || (spellInfo->Effects[i].Effect != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->Effects[i].Effect != SPELL_EFFECT_DUMMY))
- sLog->outErrorDb("Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i);
+ sLog->outError(LOG_FILTER_SQL, "Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i);
}
}
@@ -4735,7 +4732,7 @@ void ObjectMgr::LoadEventScripts()
{
std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
if (itr2 == evt_scripts.end())
- sLog->outErrorDb("Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u",
+ sLog->outError(LOG_FILTER_SQL, "Table `event_scripts` has script (Id: %u) not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u",
itr->first, SPELL_EFFECT_SEND_EVENT);
}
}
@@ -4766,7 +4763,7 @@ void ObjectMgr::LoadWaypointScripts()
}
for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr)
- sLog->outErrorDb("There is no waypoint which links to the waypoint script %u", *itr);
+ sLog->outError(LOG_FILTER_SQL, "There is no waypoint which links to the waypoint script %u", *itr);
}
void ObjectMgr::LoadSpellScriptNames()
@@ -4779,8 +4776,8 @@ void ObjectMgr::LoadSpellScriptNames()
if (!result)
{
- sLog->outString(">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
+
return;
}
@@ -4804,7 +4801,7 @@ void ObjectMgr::LoadSpellScriptNames()
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32());
+ sLog->outError(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32());
continue;
}
@@ -4812,7 +4809,7 @@ void ObjectMgr::LoadSpellScriptNames()
{
if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId))
{
- sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32());
+ sLog->outError(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32());
continue;
}
while (spellInfo)
@@ -4827,8 +4824,8 @@ void ObjectMgr::LoadSpellScriptNames()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::ValidateSpellScripts()
@@ -4837,8 +4834,8 @@ void ObjectMgr::ValidateSpellScripts()
if (_spellScriptsStore.empty())
{
- sLog->outString(">> Validated 0 scripts.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Validated 0 scripts.");
+
return;
}
@@ -4858,7 +4855,7 @@ void ObjectMgr::ValidateSpellScripts()
bool valid = true;
if (!spellScript && !auraScript)
{
- sLog->outError("TSCR: Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second));
+ sLog->outError(LOG_FILTER_TSCR, "Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second));
valid = false;
}
if (spellScript)
@@ -4885,8 +4882,8 @@ void ObjectMgr::ValidateSpellScripts()
++count;
}
- sLog->outString(">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadPageTexts()
@@ -4898,8 +4895,8 @@ void ObjectMgr::LoadPageTexts()
if (!result)
{
- sLog->outString(">> Loaded 0 page texts. DB table `page_text` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 page texts. DB table `page_text` is empty!");
+
return;
}
@@ -4923,13 +4920,13 @@ void ObjectMgr::LoadPageTexts()
{
PageTextContainer::const_iterator itr2 = _pageTextStore.find(itr->second.NextPage);
if (itr2 == _pageTextStore.end())
- sLog->outErrorDb("Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage);
+ sLog->outError(LOG_FILTER_SQL, "Page text (Id: %u) has not existing next page (Id: %u)", itr->first, itr->second.NextPage);
}
}
- sLog->outString(">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
PageText const* ObjectMgr::GetPageText(uint32 pageEntry)
@@ -4964,8 +4961,8 @@ void ObjectMgr::LoadPageTextLocales()
AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Text);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadInstanceTemplate()
@@ -4977,8 +4974,8 @@ void ObjectMgr::LoadInstanceTemplate()
if (!result)
{
- sLog->outString(">> Loaded 0 instance templates. DB table `page_text` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 instance templates. DB table `page_text` is empty!");
+
return;
}
@@ -4991,7 +4988,7 @@ void ObjectMgr::LoadInstanceTemplate()
if (!MapManager::IsValidMAP(mapID, true))
{
- sLog->outErrorDb("ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID);
+ sLog->outError(LOG_FILTER_SQL, "ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", mapID);
continue;
}
@@ -5007,8 +5004,8 @@ void ObjectMgr::LoadInstanceTemplate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID)
@@ -5028,8 +5025,8 @@ void ObjectMgr::LoadInstanceEncounters()
QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters");
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 instance encounters, table is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 instance encounters, table is empty!");
+
return;
}
@@ -5045,13 +5042,13 @@ void ObjectMgr::LoadInstanceEncounters()
DungeonEncounterEntry const* dungeonEncounter = sDungeonEncounterStore.LookupEntry(entry);
if (!dungeonEncounter)
{
- sLog->outErrorDb("Table `instance_encounters` has an invalid encounter id %u, skipped!", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid encounter id %u, skipped!", entry);
continue;
}
if (lastEncounterDungeon && !sLFGDungeonStore.LookupEntry(lastEncounterDungeon))
{
- sLog->outErrorDb("Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName, lastEncounterDungeon);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName, lastEncounterDungeon);
continue;
}
@@ -5060,7 +5057,7 @@ void ObjectMgr::LoadInstanceEncounters()
{
if (itr != dungeonLastBosses.end())
{
- sLog->outErrorDb("Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName, itr->second->id, itr->second->encounterName);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName, itr->second->id, itr->second->encounterName);
continue;
}
@@ -5074,7 +5071,7 @@ void ObjectMgr::LoadInstanceEncounters()
CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry);
if (!creatureInfo)
{
- sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
continue;
}
const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
@@ -5083,12 +5080,12 @@ void ObjectMgr::LoadInstanceEncounters()
case ENCOUNTER_CREDIT_CAST_SPELL:
if (!sSpellMgr->GetSpellInfo(creditEntry))
{
- sLog->outErrorDb("Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
continue;
}
break;
default:
- sLog->outErrorDb("Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName);
+ sLog->outError(LOG_FILTER_SQL, "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName);
continue;
}
@@ -5097,8 +5094,8 @@ void ObjectMgr::LoadInstanceEncounters()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
GossipText const* ObjectMgr::GetGossipText(uint32 Text_ID) const
@@ -5118,8 +5115,8 @@ void ObjectMgr::LoadGossipText()
int count = 0;
if (!result)
{
- sLog->outString(">> Loaded %u npc texts", count);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u npc texts", count);
+
return;
}
_gossipTextStore.rehash(result->GetRowCount());
@@ -5136,7 +5133,7 @@ void ObjectMgr::LoadGossipText()
uint32 Text_ID = fields[cic++].GetUInt32();
if (!Text_ID)
{
- sLog->outErrorDb("Table `npc_text` has record wit reserved id 0, ignore.");
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_text` has record wit reserved id 0, ignore.");
continue;
}
@@ -5158,8 +5155,8 @@ void ObjectMgr::LoadGossipText()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadNpcTextLocales()
@@ -5201,8 +5198,8 @@ void ObjectMgr::LoadNpcTextLocales()
}
} while (result->NextRow());
- sLog->outString(">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
//not very fast function but it is called only once a day, or on starting-up
@@ -5213,7 +5210,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
time_t curTime = time(NULL);
tm* lt = localtime(&curTime);
uint64 basetime(curTime);
- sLog->outDetail("Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec);
// Delete all old mails without item and without body immediately, if starting server
if (!serverUp)
@@ -5227,8 +5224,8 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
- sLog->outString(">> No expired mails found.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> No expired mails found.");
+
return; // any mails need to be returned or deleted
}
@@ -5331,8 +5328,8 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
}
while (result->NextRow());
- sLog->outString(">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadQuestAreaTriggers()
@@ -5345,8 +5342,8 @@ void ObjectMgr::LoadQuestAreaTriggers()
if (!result)
{
- sLog->outString(">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
+
return;
}
@@ -5364,7 +5361,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID);
continue;
}
@@ -5372,13 +5369,13 @@ void ObjectMgr::LoadQuestAreaTriggers()
if (!quest)
{
- sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID);
+ sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID);
continue;
}
if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT))
{
- sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID);
+ sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID);
// this will prevent quest completing without objective
const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT);
@@ -5390,8 +5387,8 @@ void ObjectMgr::LoadQuestAreaTriggers()
} while (result->NextRow());
- sLog->outString(">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadTavernAreaTriggers()
@@ -5404,8 +5401,8 @@ void ObjectMgr::LoadTavernAreaTriggers()
if (!result)
{
- sLog->outString(">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
+
return;
}
@@ -5422,15 +5419,15 @@ void ObjectMgr::LoadTavernAreaTriggers()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
continue;
}
_tavernAreaTriggerStore.insert(Trigger_ID);
} while (result->NextRow());
- sLog->outString(">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadAreaTriggerScripts()
@@ -5442,8 +5439,8 @@ void ObjectMgr::LoadAreaTriggerScripts()
if (!result)
{
- sLog->outString(">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
+
return;
}
@@ -5461,14 +5458,14 @@ void ObjectMgr::LoadAreaTriggerScripts()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
continue;
}
_areaTriggerScriptStore[Trigger_ID] = GetScriptId(scriptName);
} while (result->NextRow());
- sLog->outString(">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team)
@@ -5563,7 +5560,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
mount_id = mount_info->GetRandomValidModelId();
if (!mount_id)
{
- sLog->outErrorDb("No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
+ sLog->outError(LOG_FILTER_SQL, "No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry);
return false;
}
}
@@ -5586,8 +5583,8 @@ void ObjectMgr::LoadGraveyardZones()
if (!result)
{
- sLog->outString(">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty.");
+
return;
}
@@ -5606,35 +5603,35 @@ void ObjectMgr::LoadGraveyardZones()
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(safeLocId);
if (!entry)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId);
continue;
}
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
if (!areaEntry)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId);
continue;
}
if (areaEntry->zone != 0)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId);
continue;
}
if (team != 0 && team != HORDE && team != ALLIANCE)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team);
continue;
}
if (!AddGraveYardLink(safeLocId, zoneId, team, false))
- sLog->outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId);
} while (result->NextRow());
- sLog->outString(">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team)
@@ -5661,7 +5658,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
{
if (z > -500)
{
- sLog->outError("ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
+ sLog->outError(LOG_FILTER_GENERAL, "ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z);
return GetDefaultGraveYard(team);
}
}
@@ -5680,7 +5677,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
if (graveLow == graveUp && !map->IsBattleArena())
{
- sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
return GetDefaultGraveYard(team);
}
@@ -5706,7 +5703,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(data.safeLocId);
if (!entry)
{
- sLog->outErrorDb("Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId);
+ sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId);
continue;
}
@@ -5824,7 +5821,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
GraveYardContainer::iterator graveUp = GraveYardStore.upper_bound(zoneId);
if (graveLow == graveUp)
{
- //sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
+ //sLog->outError(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);
return;
}
@@ -5879,8 +5876,8 @@ void ObjectMgr::LoadAreaTriggerTeleports()
QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM areatrigger_teleport");
if (!result)
{
- sLog->outString(">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
+
return;
}
@@ -5905,20 +5902,20 @@ void ObjectMgr::LoadAreaTriggerTeleports()
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
if (!atEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID);
continue;
}
MapEntry const* mapEntry = sMapStore.LookupEntry(at.target_mapId);
if (!mapEntry)
{
- sLog->outErrorDb("Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.target_mapId);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.target_mapId);
continue;
}
if (at.target_X == 0 && at.target_Y == 0 && at.target_Z == 0)
{
- sLog->outErrorDb("Area trigger (ID:%u) target coordinates not provided.", Trigger_ID);
+ sLog->outError(LOG_FILTER_SQL, "Area trigger (ID:%u) target coordinates not provided.", Trigger_ID);
continue;
}
@@ -5926,8 +5923,8 @@ void ObjectMgr::LoadAreaTriggerTeleports()
} while (result->NextRow());
- sLog->outString(">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadAccessRequirements()
@@ -5940,8 +5937,8 @@ void ObjectMgr::LoadAccessRequirements()
QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement");
if (!result)
{
- sLog->outString(">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty.");
+
return;
}
@@ -5973,7 +5970,7 @@ void ObjectMgr::LoadAccessRequirements()
ItemTemplate const* pProto = GetItemTemplate(ar.item);
if (!pProto)
{
- sLog->outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty);
ar.item = 0;
}
}
@@ -5983,7 +5980,7 @@ void ObjectMgr::LoadAccessRequirements()
ItemTemplate const* pProto = GetItemTemplate(ar.item2);
if (!pProto)
{
- sLog->outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty);
ar.item2 = 0;
}
}
@@ -5992,7 +5989,7 @@ void ObjectMgr::LoadAccessRequirements()
{
if (!GetQuestTemplate(ar.quest_A))
{
- sLog->outErrorDb("Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_A, mapid, difficulty);
+ sLog->outError(LOG_FILTER_SQL, "Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_A, mapid, difficulty);
ar.quest_A = 0;
}
}
@@ -6001,7 +5998,7 @@ void ObjectMgr::LoadAccessRequirements()
{
if (!GetQuestTemplate(ar.quest_H))
{
- sLog->outErrorDb("Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_H, mapid, difficulty);
+ sLog->outError(LOG_FILTER_SQL, "Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_H, mapid, difficulty);
ar.quest_H = 0;
}
}
@@ -6010,7 +6007,7 @@ void ObjectMgr::LoadAccessRequirements()
{
if (!sAchievementStore.LookupEntry(ar.achievement))
{
- sLog->outErrorDb("Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty);
+ sLog->outError(LOG_FILTER_SQL, "Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty);
ar.achievement = 0;
}
}
@@ -6018,8 +6015,8 @@ void ObjectMgr::LoadAccessRequirements()
_accessRequirementStore[requirement_ID] = ar;
} while (result->NextRow());
- sLog->outString(">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
/*
@@ -6137,7 +6134,7 @@ uint32 ObjectMgr::GenerateAuctionID()
{
if (_auctionId >= 0xFFFFFFFE)
{
- sLog->outError("Auctions ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Auctions ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _auctionId++;
@@ -6147,7 +6144,7 @@ uint64 ObjectMgr::GenerateEquipmentSetGuid()
{
if (_equipmentSetGuid >= uint64(0xFFFFFFFFFFFFFFFELL))
{
- sLog->outError("EquipmentSet guid overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "EquipmentSet guid overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _equipmentSetGuid++;
@@ -6157,7 +6154,7 @@ uint32 ObjectMgr::GenerateMailID()
{
if (_mailId >= 0xFFFFFFFE)
{
- sLog->outError("Mail ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Mail ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return _mailId++;
@@ -6247,8 +6244,8 @@ void ObjectMgr::LoadGameObjectLocales()
AddLocaleString(fields[i + (TOTAL_LOCALES - 1)].GetString(), LocaleConstant(i), data.CastBarCaption);
} while (result->NextRow());
- sLog->outString(">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime));
+
}
inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N)
@@ -6256,7 +6253,7 @@ inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32
if (sLockStore.LookupEntry(dataN))
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.",
goInfo->entry, goInfo->type, N, goInfo->door.lockId, goInfo->door.lockId);
}
@@ -6265,7 +6262,7 @@ inline void CheckGOLinkedTrapId(GameObjectTemplate const* goInfo, uint32 dataN,
if (GameObjectTemplate const* trapInfo = sObjectMgr->GetGameObjectTemplate(dataN))
{
if (trapInfo->type != GAMEOBJECT_TYPE_TRAP)
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.",
goInfo->entry, goInfo->type, N, dataN, dataN, GAMEOBJECT_TYPE_TRAP);
}
}
@@ -6275,7 +6272,7 @@ inline void CheckGOSpellId(GameObjectTemplate const* goInfo, uint32 dataN, uint3
if (sSpellMgr->GetSpellInfo(dataN))
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.",
goInfo->entry, goInfo->type, N, dataN, dataN);
}
@@ -6284,7 +6281,7 @@ inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo, uint32
if (dataN <= (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR))
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.",
goInfo->entry, goInfo->type, N, dataN, UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR);
// prevent client and server unexpected work
@@ -6297,7 +6294,7 @@ inline void CheckGONoDamageImmuneId(GameObjectTemplate* goTemplate, uint32 dataN
if (dataN <= 1)
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN);
}
inline void CheckGOConsumable(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N)
@@ -6306,7 +6303,7 @@ inline void CheckGOConsumable(GameObjectTemplate const* goInfo, uint32 dataN, ui
if (dataN <= 1)
return;
- sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.",
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.",
goInfo->entry, goInfo->type, N, dataN);
}
@@ -6326,8 +6323,8 @@ void ObjectMgr::LoadGameObjectTemplate()
if (!result)
{
- sLog->outString(">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
+
return;
}
@@ -6412,7 +6409,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (got.spellFocus.focusId)
{
if (!sSpellFocusObjectStore.LookupEntry(got.spellFocus.focusId))
- sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.",
entry, got.type, got.spellFocus.focusId, got.spellFocus.focusId);
}
@@ -6430,7 +6427,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (got.goober.pageId) // pageId
{
if (!GetPageText(got.goober.pageId))
- sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.",
entry, got.type, got.goober.pageId, got.goober.pageId);
}
CheckGONoDamageImmuneId(&got, got.goober.noDamageImmune, 11);
@@ -6455,7 +6452,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (got.moTransport.taxiPathId)
{
if (got.moTransport.taxiPathId >= sTaxiPathNodesByPath.size() || sTaxiPathNodesByPath[got.moTransport.taxiPathId].empty())
- sLog->outErrorDb("GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
+ sLog->outError(LOG_FILTER_SQL, "GameObject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.",
entry, got.type, got.moTransport.taxiPathId, got.moTransport.taxiPathId);
}
break;
@@ -6497,8 +6494,8 @@ void ObjectMgr::LoadGameObjectTemplate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadExplorationBaseXP()
@@ -6509,8 +6506,8 @@ void ObjectMgr::LoadExplorationBaseXP()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
+
return;
}
@@ -6526,8 +6523,8 @@ void ObjectMgr::LoadExplorationBaseXP()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
uint32 ObjectMgr::GetBaseXP(uint8 level)
@@ -6550,8 +6547,8 @@ void ObjectMgr::LoadPetNames()
if (!result)
{
- sLog->outString(">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
+
return;
}
@@ -6571,8 +6568,8 @@ void ObjectMgr::LoadPetNames()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadPetNumber()
@@ -6586,8 +6583,8 @@ void ObjectMgr::LoadPetNumber()
_hiPetNumber = fields[0].GetUInt32()+1;
}
- sLog->outString(">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime));
+
}
std::string ObjectMgr::GeneratePetName(uint32 entry)
@@ -6628,8 +6625,8 @@ void ObjectMgr::LoadCorpses()
PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES));
if (!result)
{
- sLog->outString(">> Loaded 0 corpses. DB table `corpse` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 corpses. DB table `corpse` is empty.");
+
return;
}
@@ -6641,7 +6638,7 @@ void ObjectMgr::LoadCorpses()
CorpseType type = CorpseType(fields[12].GetUInt8());
if (type >= MAX_CORPSE_TYPE)
{
- sLog->outError("Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid, type);
+ sLog->outError(LOG_FILTER_GENERAL, "Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid, type);
continue;
}
@@ -6657,8 +6654,8 @@ void ObjectMgr::LoadCorpses()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadReputationRewardRate()
@@ -6672,8 +6669,8 @@ void ObjectMgr::LoadReputationRewardRate()
if (!result)
{
- sLog->outErrorDb(">> Loaded `reputation_reward_rate`, table is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded `reputation_reward_rate`, table is empty!");
+
return;
}
@@ -6692,25 +6689,25 @@ void ObjectMgr::LoadReputationRewardRate()
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
if (!factionEntry)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_reward_rate`", factionId);
continue;
}
if (repRate.quest_rate < 0.0f)
{
- sLog->outErrorDb("Table reputation_reward_rate has quest_rate with invalid rate %f, skipping data for faction %u", repRate.quest_rate, factionId);
+ sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has quest_rate with invalid rate %f, skipping data for faction %u", repRate.quest_rate, factionId);
continue;
}
if (repRate.creature_rate < 0.0f)
{
- sLog->outErrorDb("Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.creature_rate, factionId);
+ sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has creature_rate with invalid rate %f, skipping data for faction %u", repRate.creature_rate, factionId);
continue;
}
if (repRate.spell_rate < 0.0f)
{
- sLog->outErrorDb("Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.spell_rate, factionId);
+ sLog->outError(LOG_FILTER_SQL, "Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.spell_rate, factionId);
continue;
}
@@ -6720,8 +6717,8 @@ void ObjectMgr::LoadReputationRewardRate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadReputationOnKill()
@@ -6741,8 +6738,8 @@ void ObjectMgr::LoadReputationOnKill()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
+
return;
}
@@ -6765,7 +6762,7 @@ void ObjectMgr::LoadReputationOnKill()
if (!GetCreatureTemplate(creature_id))
{
- sLog->outErrorDb("Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id);
continue;
}
@@ -6774,7 +6771,7 @@ void ObjectMgr::LoadReputationOnKill()
FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(repOnKill.RepFaction1);
if (!factionEntry1)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction1);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction1);
continue;
}
}
@@ -6784,7 +6781,7 @@ void ObjectMgr::LoadReputationOnKill()
FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(repOnKill.RepFaction2);
if (!factionEntry2)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction2);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.RepFaction2);
continue;
}
}
@@ -6794,8 +6791,8 @@ void ObjectMgr::LoadReputationOnKill()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadReputationSpilloverTemplate()
@@ -6809,8 +6806,8 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!result)
{
- sLog->outString(">> Loaded `reputation_spillover_template`, table is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded `reputation_spillover_template`, table is empty.");
+
return;
}
@@ -6839,13 +6836,13 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!factionEntry)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId);
continue;
}
if (factionEntry->team == 0)
{
- sLog->outErrorDb("Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId);
continue;
}
@@ -6857,19 +6854,19 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
if (!factionSpillover)
{
- sLog->outErrorDb("Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.faction[i], factionId);
+ sLog->outError(LOG_FILTER_SQL, "Spillover faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template` for faction %u, skipping", repTemplate.faction[i], factionId);
continue;
}
if (factionSpillover->reputationListID < 0)
{
- sLog->outErrorDb("Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId);
+ sLog->outError(LOG_FILTER_SQL, "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId);
continue;
}
if (repTemplate.faction_rank[i] >= MAX_REPUTATION_RANK)
{
- sLog->outErrorDb("Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]);
+ sLog->outError(LOG_FILTER_SQL, "Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]);
continue;
}
}
@@ -6878,25 +6875,25 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
FactionEntry const* factionEntry0 = sFactionStore.LookupEntry(repTemplate.faction[0]);
if (repTemplate.faction[0] && !factionEntry0)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[0]);
continue;
}
FactionEntry const* factionEntry1 = sFactionStore.LookupEntry(repTemplate.faction[1]);
if (repTemplate.faction[1] && !factionEntry1)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[1]);
continue;
}
FactionEntry const* factionEntry2 = sFactionStore.LookupEntry(repTemplate.faction[2]);
if (repTemplate.faction[2] && !factionEntry2)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[2]);
continue;
}
FactionEntry const* factionEntry3 = sFactionStore.LookupEntry(repTemplate.faction[3]);
if (repTemplate.faction[3] && !factionEntry3)
{
- sLog->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]);
+ sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]);
continue;
}
@@ -6906,8 +6903,8 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadPointsOfInterest()
@@ -6923,8 +6920,8 @@ void ObjectMgr::LoadPointsOfInterest()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
+
return;
}
@@ -6944,7 +6941,7 @@ void ObjectMgr::LoadPointsOfInterest()
if (!Trinity::IsValidMapCoord(POI.x, POI.y))
{
- sLog->outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y);
+ sLog->outError(LOG_FILTER_SQL, "Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y);
continue;
}
@@ -6953,8 +6950,8 @@ void ObjectMgr::LoadPointsOfInterest()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadQuestPOI()
@@ -6970,8 +6967,8 @@ void ObjectMgr::LoadQuestPOI()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
+
return;
}
@@ -7025,8 +7022,8 @@ void ObjectMgr::LoadQuestPOI()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadNPCSpellClickSpells()
@@ -7039,8 +7036,8 @@ void ObjectMgr::LoadNPCSpellClickSpells()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
+
return;
}
@@ -7054,7 +7051,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
CreatureTemplate const* cInfo = GetCreatureTemplate(npc_entry);
if (!cInfo)
{
- sLog->outErrorDb("Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry);
continue;
}
@@ -7062,13 +7059,13 @@ void ObjectMgr::LoadNPCSpellClickSpells()
SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellinfo)
{
- sLog->outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid);
+ sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid);
continue;
}
uint8 userType = fields[3].GetUInt16();
if (userType >= SPELL_CLICK_USER_MAX)
- sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType));
+ sLog->outError(LOG_FILTER_SQL, "Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType));
uint8 castFlags = fields[2].GetUInt8();
SpellClickInfo info;
@@ -7088,13 +7085,13 @@ void ObjectMgr::LoadNPCSpellClickSpells()
{
if ((itr->second.npcflag & UNIT_NPC_FLAG_SPELLCLICK) && _spellClickInfoStore.find(itr->second.Entry) == _spellClickInfoStore.end())
{
- sLog->outErrorDb("npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", itr->second.Entry);
+ sLog->outError(LOG_FILTER_SQL, "npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", itr->second.Entry);
const_cast<CreatureTemplate*>(&itr->second)->npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK;
}
}
- sLog->outString(">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::DeleteCreatureData(uint32 guid)
@@ -7143,8 +7140,8 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str());
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str());
+
return;
}
@@ -7160,7 +7157,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
if (_questTemplates.find(quest) == _questTemplates.end())
{
- sLog->outErrorDb("Table `%s`: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s`: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id);
continue;
}
@@ -7172,8 +7169,8 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadGameobjectQuestRelations()
@@ -7184,9 +7181,9 @@ void ObjectMgr::LoadGameobjectQuestRelations()
{
GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first);
if (!goInfo)
- sLog->outErrorDb("Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER)
- sLog->outErrorDb("Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7198,9 +7195,9 @@ void ObjectMgr::LoadGameobjectInvolvedRelations()
{
GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first);
if (!goInfo)
- sLog->outErrorDb("Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second);
else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER)
- sLog->outErrorDb("Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7212,9 +7209,9 @@ void ObjectMgr::LoadCreatureQuestRelations()
{
CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first);
if (!cInfo)
- sLog->outErrorDb("Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER))
- sLog->outErrorDb("Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7226,9 +7223,9 @@ void ObjectMgr::LoadCreatureInvolvedRelations()
{
CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first);
if (!cInfo)
- sLog->outErrorDb("Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second);
else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER))
- sLog->outErrorDb("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second);
}
}
@@ -7242,8 +7239,8 @@ void ObjectMgr::LoadReservedPlayersNames()
if (!result)
{
- sLog->outString(">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
+
return;
}
@@ -7258,7 +7255,7 @@ void ObjectMgr::LoadReservedPlayersNames()
std::wstring wstr;
if (!Utf8toWStr (name, wstr))
{
- sLog->outError("Table `reserved_name` have invalid name: %s", name.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Table `reserved_name` have invalid name: %s", name.c_str());
continue;
}
@@ -7269,8 +7266,8 @@ void ObjectMgr::LoadReservedPlayersNames()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool ObjectMgr::IsReservedName(const std::string& name) const
@@ -7423,8 +7420,8 @@ void ObjectMgr::LoadGameObjectForQuests()
if (sObjectMgr->GetGameObjectTemplates()->empty())
{
- sLog->outString(">> Loaded 0 GameObjects for quests");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 GameObjects for quests");
+
return;
}
@@ -7472,8 +7469,8 @@ void ObjectMgr::LoadGameObjectForQuests()
}
}
- sLog->outString(">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value)
@@ -7487,7 +7484,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
{
if (end_value >= start_value)
{
- sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
return false;
}
@@ -7500,7 +7497,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
{
if (start_value >= end_value)
{
- sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value);
return false;
}
}
@@ -7519,10 +7516,10 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
if (!result)
{
if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings
- sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table);
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table);
else
- sLog->outString(">> Loaded 0 string templates. DB table `%s` is empty.", table);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 string templates. DB table `%s` is empty.", table);
+
return false;
}
@@ -7536,12 +7533,12 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
if (entry == 0)
{
- sLog->outErrorDb("Table `%s` contain reserved entry 0, ignored.", table);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` contain reserved entry 0, ignored.", table);
continue;
}
else if (entry < start_value || entry >= end_value)
{
- sLog->outErrorDb("Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value);
continue;
}
@@ -7549,7 +7546,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
if (!data.Content.empty())
{
- sLog->outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry);
continue;
}
@@ -7561,11 +7558,11 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max
} while (result->NextRow());
if (min_value == MIN_TRINITY_STRING_ID)
- sLog->outString(">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outString(">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime));
+
- sLog->outString();
return true;
}
@@ -7580,9 +7577,9 @@ const char *ObjectMgr::GetTrinityString(int32 entry, LocaleConstant locale_idx)
}
if (entry > 0)
- sLog->outErrorDb("Entry %i not found in `trinity_string` table.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Entry %i not found in `trinity_string` table.", entry);
else
- sLog->outErrorDb("Trinity string entry %i not found in DB.", entry);
+ sLog->outError(LOG_FILTER_SQL, "Trinity string entry %i not found in DB.", entry);
return "<error>";
}
@@ -7596,8 +7593,8 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
+
return;
}
@@ -7612,7 +7609,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry);
if (!fArea)
{
- sLog->outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "AreaId %u defined in `skill_fishing_base_level` does not exist", entry);
continue;
}
@@ -7621,8 +7618,8 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names)
@@ -7705,8 +7702,8 @@ void ObjectMgr::LoadGameTele()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
+
return;
}
@@ -7729,13 +7726,13 @@ void ObjectMgr::LoadGameTele()
if (!MapManager::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation))
{
- sLog->outErrorDb("Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str());
+ sLog->outError(LOG_FILTER_SQL, "Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str());
continue;
}
if (!Utf8toWStr(gt.name, gt.wnameLow))
{
- sLog->outErrorDb("Wrong UTF8 name for id %u in `game_tele` table, ignoring.", id);
+ sLog->outError(LOG_FILTER_SQL, "Wrong UTF8 name for id %u in `game_tele` table, ignoring.", id);
continue;
}
@@ -7747,8 +7744,8 @@ void ObjectMgr::LoadGameTele()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
@@ -7846,8 +7843,8 @@ void ObjectMgr::LoadMailLevelRewards()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
+
return;
}
@@ -7864,25 +7861,25 @@ void ObjectMgr::LoadMailLevelRewards()
if (level > MAX_LEVEL)
{
- sLog->outErrorDb("Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level, MAX_LEVEL);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level, MAX_LEVEL);
continue;
}
if (!(raceMask & RACEMASK_ALL_PLAYABLE))
{
- sLog->outErrorDb("Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level);
continue;
}
if (!sMailTemplateStore.LookupEntry(mailTemplateId))
{
- sLog->outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level);
continue;
}
if (!GetCreatureTemplate(senderEntry))
{
- sLog->outErrorDb("Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level);
+ sLog->outError(LOG_FILTER_SQL, "Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level);
continue;
}
@@ -7892,8 +7889,8 @@ void ObjectMgr::LoadMailLevelRewards()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel)
@@ -7904,32 +7901,32 @@ void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost,
CreatureTemplate const* cInfo = GetCreatureTemplate(entry);
if (!cInfo)
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry for a non-existing creature template (Entry: %u), ignoring", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry for a non-existing creature template (Entry: %u), ignoring", entry);
return;
}
if (!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER))
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry for a creature template (Entry: %u) without trainer flag, ignoring", entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry for a creature template (Entry: %u) without trainer flag, ignoring", entry);
return;
}
SpellInfo const* spellinfo = sSpellMgr->GetSpellInfo(spell);
if (!spellinfo)
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell);
return;
}
if (!SpellMgr::IsSpellValid(spellinfo))
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a broken spell (Spell: %u), ignoring", entry, spell);
return;
}
if (GetTalentSpellCost(spell))
{
- sLog->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell);
return;
}
@@ -7957,7 +7954,7 @@ void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost,
if (spellinfo->Effects[i].TargetA.GetTarget() != 0 && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ALLY
&& spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_TARGET_ANY && spellinfo->Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER)
{
- sLog->outErrorDb("Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry);
continue;
}
@@ -7989,8 +7986,8 @@ void ObjectMgr::LoadTrainerSpell()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 Trainers. DB table `npc_trainer` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!");
+
return;
}
@@ -8013,8 +8010,8 @@ void ObjectMgr::LoadTrainerSpell()
}
while (result->NextRow());
- sLog->outString(">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
@@ -8070,8 +8067,8 @@ void ObjectMgr::LoadVendors()
QueryResult result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC");
if (!result)
{
- sLog->outString();
- sLog->outErrorDb(">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
+
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
return;
}
@@ -8104,8 +8101,8 @@ void ObjectMgr::LoadVendors()
}
while (result->NextRow());
- sLog->outString(">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadGossipMenu()
@@ -8118,8 +8115,8 @@ void ObjectMgr::LoadGossipMenu()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!");
+
return;
}
@@ -8136,7 +8133,7 @@ void ObjectMgr::LoadGossipMenu()
if (!GetGossipText(gMenu.text_id))
{
- sLog->outErrorDb("Table gossip_menu entry %u are using non-existing text_id %u", gMenu.entry, gMenu.text_id);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu entry %u are using non-existing text_id %u", gMenu.entry, gMenu.text_id);
continue;
}
@@ -8146,8 +8143,8 @@ void ObjectMgr::LoadGossipMenu()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadGossipMenuItems()
@@ -8165,8 +8162,8 @@ void ObjectMgr::LoadGossipMenuItems()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!");
+
return;
}
@@ -8192,16 +8189,16 @@ void ObjectMgr::LoadGossipMenuItems()
if (gMenuItem.OptionIcon >= GOSSIP_ICON_MAX)
{
- sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionIcon);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionIcon);
gMenuItem.OptionIcon = GOSSIP_ICON_CHAT;
}
if (gMenuItem.OptionType >= GOSSIP_OPTION_MAX)
- sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionType);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.OptionType);
if (gMenuItem.ActionPoiId && !GetPointOfInterest(gMenuItem.ActionPoiId))
{
- sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionPoiId);
+ sLog->outError(LOG_FILTER_SQL, "Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionPoiId);
gMenuItem.ActionPoiId = 0;
}
@@ -8210,8 +8207,8 @@ void ObjectMgr::LoadGossipMenuItems()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist /*= true*/)
@@ -8263,7 +8260,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry);
return false;
}
@@ -8274,7 +8271,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).SendSysMessage(LANG_COMMAND_VENDORSELECTION);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry);
if (skip_vendors)
skip_vendors->insert(vendor_entry);
@@ -8287,7 +8284,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id);
return false;
}
@@ -8296,7 +8293,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry);
return false;
}
@@ -8305,7 +8302,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount);
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry);
return false;
}
else if (maxcount == 0 && incrtime > 0)
@@ -8313,7 +8310,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage("MaxCount == 0 but IncrTime<>= 0");
else
- sLog->outErrorDb("Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry);
return false;
}
@@ -8326,7 +8323,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost);
else
- sLog->outErrorDb("Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry);
return false;
}
@@ -8335,7 +8332,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
if (player)
ChatHandler(player).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS);
else
- sLog->outErrorDb("Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry);
+ sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry);
return false;
}
@@ -8374,8 +8371,8 @@ void ObjectMgr::LoadScriptNames()
if (!result)
{
- sLog->outString();
- sLog->outErrorDb(">> Loaded empty set of Script Names!");
+
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded empty set of Script Names!");
return;
}
@@ -8389,8 +8386,8 @@ void ObjectMgr::LoadScriptNames()
while (result->NextRow());
std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end());
- sLog->outString(">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
uint32 ObjectMgr::GetScriptId(const char *name)
@@ -8422,7 +8419,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids)
case SCRIPT_COMMAND_TALK:
{
if (!GetTrinityStringLocale (itrM->second.Talk.TextID))
- sLog->outErrorDb("Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first);
+ sLog->outError(LOG_FILTER_SQL, "Table `%s` references invalid text id %u from `db_script_string`, script id: %u.", GetScriptsTableNameByType(type).c_str(), itrM->second.Talk.TextID, itrMM->first);
if (ids.find(itrM->second.Talk.TextID) != ids.end())
ids.erase(itrM->second.Talk.TextID);
@@ -8448,7 +8445,7 @@ void ObjectMgr::LoadDbScriptStrings()
CheckScripts(ScriptsType(type), ids);
for (std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
- sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr);
+ sLog->outError(LOG_FILTER_SQL, "Table `db_script_string` has unused string id %u", *itr);
}
bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value)
@@ -8457,7 +8454,7 @@ bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value)
// start/end reversed for negative values
if (start_value > MAX_DB_SCRIPT_STRING_ID || end_value >= start_value)
{
- sLog->outErrorDb("Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1);
return false;
}
@@ -8493,8 +8490,8 @@ void ObjectMgr::LoadCreatureClassLevelStats()
if (!result)
{
- sLog->outString(">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
+
return;
}
@@ -8515,13 +8512,13 @@ void ObjectMgr::LoadCreatureClassLevelStats()
stats.BaseArmor = fields[6].GetUInt32();
if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0)
- sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class);
+ sLog->outError(LOG_FILTER_SQL, "Creature base stats for level %u has invalid class %u", Level, Class);
for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i)
{
if (stats.BaseHealth[i] < 1)
{
- sLog->outErrorDb("Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i);
+ sLog->outError(LOG_FILTER_SQL, "Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i);
stats.BaseHealth[i] = 1;
}
}
@@ -8538,12 +8535,12 @@ void ObjectMgr::LoadCreatureClassLevelStats()
for (uint16 lvl = itr->second.minlevel; lvl <= itr->second.maxlevel; ++lvl)
{
if (_creatureBaseStatsStore.find(MAKE_PAIR16(lvl, itr->second.unit_class)) == _creatureBaseStatsStore.end())
- sLog->outErrorDb("Missing base stats for creature class %u level %u", itr->second.unit_class, lvl);
+ sLog->outError(LOG_FILTER_SQL, "Missing base stats for creature class %u level %u", itr->second.unit_class, lvl);
}
}
- sLog->outString(">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadFactionChangeAchievements()
@@ -8554,8 +8551,8 @@ void ObjectMgr::LoadFactionChangeAchievements()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
+
return;
}
@@ -8569,9 +8566,9 @@ void ObjectMgr::LoadFactionChangeAchievements()
uint32 horde = fields[1].GetUInt32();
if (!sAchievementStore.LookupEntry(alliance))
- sLog->outErrorDb("Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance);
else if (!sAchievementStore.LookupEntry(horde))
- sLog->outErrorDb("Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde);
else
FactionChange_Achievements[alliance] = horde;
@@ -8579,8 +8576,8 @@ void ObjectMgr::LoadFactionChangeAchievements()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadFactionChangeItems()
@@ -8591,8 +8588,8 @@ void ObjectMgr::LoadFactionChangeItems()
if (!result)
{
- sLog->outString(">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
+
return;
}
@@ -8606,9 +8603,9 @@ void ObjectMgr::LoadFactionChangeItems()
uint32 horde = fields[1].GetUInt32();
if (!GetItemTemplate(alliance))
- sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance);
else if (!GetItemTemplate(horde))
- sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde);
else
FactionChange_Items[alliance] = horde;
@@ -8616,8 +8613,8 @@ void ObjectMgr::LoadFactionChangeItems()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadFactionChangeSpells()
@@ -8628,8 +8625,8 @@ void ObjectMgr::LoadFactionChangeSpells()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
+
return;
}
@@ -8643,9 +8640,9 @@ void ObjectMgr::LoadFactionChangeSpells()
uint32 horde = fields[1].GetUInt32();
if (!sSpellMgr->GetSpellInfo(alliance))
- sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance);
else if (!sSpellMgr->GetSpellInfo(horde))
- sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde);
else
FactionChange_Spells[alliance] = horde;
@@ -8653,8 +8650,8 @@ void ObjectMgr::LoadFactionChangeSpells()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadFactionChangeReputations()
@@ -8665,8 +8662,8 @@ void ObjectMgr::LoadFactionChangeReputations()
if (!result)
{
- sLog->outString(">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
+
return;
}
@@ -8680,9 +8677,9 @@ void ObjectMgr::LoadFactionChangeReputations()
uint32 horde = fields[1].GetUInt32();
if (!sFactionStore.LookupEntry(alliance))
- sLog->outErrorDb("Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance);
+ sLog->outError(LOG_FILTER_SQL, "Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", alliance);
else if (!sFactionStore.LookupEntry(horde))
- sLog->outErrorDb("Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde);
+ sLog->outError(LOG_FILTER_SQL, "Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde);
else
FactionChange_Reputation[alliance] = horde;
@@ -8690,8 +8687,8 @@ void ObjectMgr::LoadFactionChangeReputations()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void ObjectMgr::LoadHotfixData()
@@ -8702,8 +8699,7 @@ void ObjectMgr::LoadHotfixData()
if (!result)
{
- sLog->outString(">> Loaded 0 hotfix info entries. DB table `hotfix_data` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 hotfix info entries. DB table `hotfix_data` is empty.");
return;
}
@@ -8725,8 +8721,7 @@ void ObjectMgr::LoadHotfixData()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u hotfix info entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u hotfix info entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry)
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 9ffb6019717..7850eda6c83 100755
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -781,13 +781,13 @@ class ObjectMgr
void LoadQuests();
void LoadQuestRelations()
{
- sLog->outString("Loading GO Start Quest Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading GO Start Quest Data...");
LoadGameobjectQuestRelations();
- sLog->outString("Loading GO End Quest Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading GO End Quest Data...");
LoadGameobjectInvolvedRelations();
- sLog->outString("Loading Creature Start Quest Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Start Quest Data...");
LoadCreatureQuestRelations();
- sLog->outString("Loading Creature End Quest Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature End Quest Data...");
LoadCreatureInvolvedRelations();
}
void LoadGameobjectQuestRelations();
diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h
index cf649f8d896..ad888b26dd3 100755
--- a/src/server/game/Grids/GridStates.h
+++ b/src/server/game/Grids/GridStates.h
@@ -32,7 +32,7 @@ class GridState
{
if (i_Magic != MAGIC_TESTVAL)
{
- sLog->outError("!!! GridState: Magic value gone !!!");
+ sLog->outError(LOG_FILTER_GENERAL, "!!! GridState: Magic value gone !!!");
return false;
}
return true;
diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp
index 519a53ad184..3b2d59dd998 100755
--- a/src/server/game/Grids/ObjectGridLoader.cpp
+++ b/src/server/game/Grids/ObjectGridLoader.cpp
@@ -94,7 +94,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<T>
{
T* obj = new T;
uint32 guid = *i_guid;
- //sLog->outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid);
+ //sLog->outInfo(LOG_FILTER_GENERAL, "DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid);
if (!obj->LoadFromDB(guid, map))
{
delete obj;
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 9866f2a06ad..34fa9f300ab 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -73,7 +73,7 @@ Group::~Group()
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Group::~Group: battleground group being deleted.");
if (m_bgGroup->GetBgRaid(ALLIANCE) == this) m_bgGroup->SetBgRaid(ALLIANCE, NULL);
else if (m_bgGroup->GetBgRaid(HORDE) == this) m_bgGroup->SetBgRaid(HORDE, NULL);
- else sLog->outError("Group::~Group: battleground group is not linked to the correct battleground.");
+ else sLog->outError(LOG_FILTER_GENERAL, "Group::~Group: battleground group is not linked to the correct battleground.");
}
Rolls::iterator itr;
while (!RollId.empty())
@@ -946,7 +946,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
item = sObjectMgr->GetItemTemplate(i->itemid);
if (!item)
{
- //sLog->outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
continue;
}
@@ -1033,7 +1033,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
item = sObjectMgr->GetItemTemplate(i->itemid);
if (!item)
{
- //sLog->outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "Group::GroupLoot: missing item prototype for item with id: %d", i->itemid);
continue;
}
@@ -2119,7 +2119,7 @@ void Group::BroadcastGroupUpdate(void)
{
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE);
- sLog->outStaticDebug("-- Forced group value update for '%s'", pp->GetName());
+ sLog->outDebug(LOG_FILTER_GENERAL, "-- Forced group value update for '%s'", pp->GetName());
}
}
}
diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp
index f372f08c941..3a758f6df30 100644
--- a/src/server/game/Groups/GroupMgr.cpp
+++ b/src/server/game/Groups/GroupMgr.cpp
@@ -46,7 +46,7 @@ uint32 GroupMgr::GenerateNewGroupDbStoreId()
if (newStorageId == NextGroupDbStoreId)
{
- sLog->outError("Group storage ID overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Group storage ID overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
@@ -84,7 +84,7 @@ uint32 GroupMgr::GenerateGroupId()
{
if (NextGroupId >= 0xFFFFFFFE)
{
- sLog->outError("Group guid overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GENERAL, "Group guid overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return NextGroupId++;
@@ -125,8 +125,8 @@ void GroupMgr::LoadGroups()
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.guid, lfg.dungeon, lfg.state FROM groups g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
if (!result)
{
- sLog->outString(">> Loaded 0 group definitions. DB table `groups` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 group definitions. DB table `groups` is empty!");
+
return;
}
@@ -151,11 +151,11 @@ void GroupMgr::LoadGroups()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
- sLog->outString("Loading Group members...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Group members...");
{
uint32 oldMSTime = getMSTime();
@@ -169,8 +169,8 @@ void GroupMgr::LoadGroups()
QueryResult result = CharacterDatabase.Query("SELECT guid, memberGuid, memberFlags, subgroup, roles FROM group_member ORDER BY guid");
if (!result)
{
- sLog->outString(">> Loaded 0 group members. DB table `group_member` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 group members. DB table `group_member` is empty!");
+
return;
}
@@ -184,17 +184,17 @@ void GroupMgr::LoadGroups()
if (group)
group->LoadMemberFromDB(fields[1].GetUInt32(), fields[2].GetUInt8(), fields[3].GetUInt8(), fields[4].GetUInt8());
else
- sLog->outError("GroupMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32());
+ sLog->outError(LOG_FILTER_GENERAL, "GroupMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32());
++count;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
- sLog->outString("Loading Group instance saves...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Group instance saves...");
{
uint32 oldMSTime = getMSTime();
// 0 1 2 3 4 5 6
@@ -203,8 +203,8 @@ void GroupMgr::LoadGroups()
"LEFT JOIN character_instance ci LEFT JOIN groups g ON g.leaderGuid = ci.guid ON ci.instance = gi.instance AND ci.permanent = 1 GROUP BY gi.instance ORDER BY gi.guid");
if (!result)
{
- sLog->outString(">> Loaded 0 group-instance saves. DB table `group_instance` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 group-instance saves. DB table `group_instance` is empty!");
+
return;
}
@@ -218,14 +218,14 @@ void GroupMgr::LoadGroups()
MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt16());
if (!mapEntry || !mapEntry->IsDungeon())
{
- sLog->outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt16());
+ sLog->outError(LOG_FILTER_SQL, "Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt16());
continue;
}
uint32 diff = fields[4].GetUInt8();
if (diff >= uint32(mapEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
{
- sLog->outErrorDb("Wrong dungeon difficulty use in group_instance table: %d", diff + 1);
+ sLog->outError(LOG_FILTER_SQL, "Wrong dungeon difficulty use in group_instance table: %d", diff + 1);
diff = 0; // default for both difficaly types
}
@@ -235,7 +235,7 @@ void GroupMgr::LoadGroups()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 697156f5e1b..66e0c968d2c 100755..100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -51,7 +51,7 @@ void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, Guil
data << uint32(errCode);
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)");
}
void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode)
@@ -60,10 +60,9 @@ void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode
data << uint32(errCode);
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)");
}
-///////////////////////////////////////////////////////////////////////////////
// LogHolder
Guild::LogHolder::~LogHolder()
{
@@ -326,21 +325,21 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields)
uint32 itemEntry = fields[15].GetUInt32();
if (slotId >= GUILD_BANK_MAX_SLOTS)
{
- sLog->outError("Invalid slot for item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
+ sLog->outError(LOG_FILTER_GUILD, "Invalid slot for item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
return false;
}
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemEntry);
if (!proto)
{
- sLog->outError("Unknown item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
+ sLog->outError(LOG_FILTER_GUILD, "Unknown item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry);
return false;
}
Item* pItem = NewItemOrBag(proto);
if (!pItem->LoadFromDB(itemGuid, 0, fields, itemEntry))
{
- sLog->outError("Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
+ sLog->outError(LOG_FILTER_GUILD, "Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry);
PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM);
stmt->setUInt32(0, m_guildId);
@@ -588,7 +587,7 @@ bool Guild::Member::LoadFromDB(Field* fields)
if (!m_zoneId)
{
- sLog->outError("Player (GUID: %u) has broken zone-data", GUID_LOPART(m_guid));
+ sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has broken zone-data", GUID_LOPART(m_guid));
m_zoneId = Player::GetZoneIdFromDB(m_guid);
}
return true;
@@ -599,12 +598,12 @@ bool Guild::Member::CheckStats() const
{
if (m_level < 1)
{
- sLog->outError("Player (GUID: %u) has a broken data in field `characters`.`level`, deleting him from guild!", GUID_LOPART(m_guid));
+ sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has a broken data in field `characters`.`level`, deleting him from guild!", GUID_LOPART(m_guid));
return false;
}
if (m_class < CLASS_WARRIOR || m_class >= MAX_CLASSES)
{
- sLog->outError("Player (GUID: %u) has a broken data in field `characters`.`class`, deleting him from guild!", GUID_LOPART(m_guid));
+ sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has a broken data in field `characters`.`class`, deleting him from guild!", GUID_LOPART(m_guid));
return false;
}
return true;
@@ -1259,7 +1258,7 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/)
session->SendPacket(&data);
else
BroadcastPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_ROSTER)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_ROSTER)");
}
void Guild::HandleQuery(WorldSession* session)
@@ -1301,7 +1300,8 @@ void Guild::HandleQuery(WorldSession* session)
data << uint32(_GetRanksSize()); // Number of ranks used
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)");
+
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)");
}
void Guild::HandleGuildRanks(WorldSession* session)
@@ -1603,7 +1603,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name)
data.WriteByteSeq(oldGuildGuid[4]);
pInvitee->GetSession()->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_INVITE)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_INVITE)");
}
void Guild::HandleAcceptMember(WorldSession* session)
@@ -1906,7 +1906,7 @@ void Guild::SendInfo(WorldSession* session) const
data << m_accountsNumber; // Number of accounts
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_INFO)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_INFO)");
}
void Guild::SendEventLog(WorldSession* session) const
@@ -1957,7 +1957,7 @@ void Guild::SendBankTabsInfo(WorldSession* session) const
data << uint8(0); // Do not send tab content
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
void Guild::SendBankTabText(WorldSession* session, uint8 tabId) const
@@ -2097,13 +2097,13 @@ bool Guild::LoadBankEventLogFromDB(Field* fields)
{
if (!isMoneyTab)
{
- sLog->outError("GuildBankEventLog ERROR: MoneyEvent(LogGuid: %u, Guild: %u) does not belong to money tab (%u), ignoring...", guid, m_id, dbTabId);
+ sLog->outError(LOG_FILTER_GUILD, "GuildBankEventLog ERROR: MoneyEvent(LogGuid: %u, Guild: %u) does not belong to money tab (%u), ignoring...", guid, m_id, dbTabId);
return false;
}
}
else if (isMoneyTab)
{
- sLog->outError("GuildBankEventLog ERROR: non-money event (LogGuid: %u, Guild: %u) belongs to money tab, ignoring...", guid, m_id);
+ sLog->outError(LOG_FILTER_GUILD, "GuildBankEventLog ERROR: non-money event (LogGuid: %u, Guild: %u) belongs to money tab, ignoring...", guid, m_id);
return false;
}
pLog->LoadEvent(new BankEventLogEntry(
@@ -2126,7 +2126,7 @@ bool Guild::LoadBankTabFromDB(Field* fields)
uint8 tabId = fields[1].GetUInt8();
if (tabId >= _GetPurchasedTabsSize())
{
- sLog->outError("Invalid tab (tabId: %u) in guild bank, skipped.", tabId);
+ sLog->outError(LOG_FILTER_GUILD, "Invalid tab (tabId: %u) in guild bank, skipped.", tabId);
return false;
}
return m_bankTabs[tabId]->LoadFromDB(fields);
@@ -2137,7 +2137,7 @@ bool Guild::LoadBankItemFromDB(Field* fields)
uint8 tabId = fields[12].GetUInt8();
if (tabId >= _GetPurchasedTabsSize())
{
- sLog->outError("Invalid tab for item (GUID: %u, id: #%u) in guild bank, skipped.",
+ sLog->outError(LOG_FILTER_GUILD, "Invalid tab for item (GUID: %u, id: #%u) in guild bank, skipped.",
fields[14].GetUInt32(), fields[15].GetUInt32());
return false;
}
@@ -2155,7 +2155,7 @@ bool Guild::Validate()
bool broken_ranks = false;
if (_GetRanksSize() < GUILD_RANKS_MIN_COUNT || _GetRanksSize() > GUILD_RANKS_MAX_COUNT)
{
- sLog->outError("Guild %u has invalid number of ranks, creating new...", m_id);
+ sLog->outError(LOG_FILTER_GUILD, "Guild %u has invalid number of ranks, creating new...", m_id);
broken_ranks = true;
}
else
@@ -2165,7 +2165,7 @@ bool Guild::Validate()
RankInfo* rankInfo = GetRankInfo(rankId);
if (rankInfo->GetId() != rankId)
{
- sLog->outError("Guild %u has broken rank id %u, creating default set of ranks...", m_id, rankId);
+ sLog->outError(LOG_FILTER_GUILD, "Guild %u has broken rank id %u, creating default set of ranks...", m_id, rankId);
broken_ranks = true;
}
}
@@ -2736,7 +2736,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
/*
if (pItemSrc->GetCount() == 0)
{
- sLog->outCrash("Guild::SwapItems: Player %s(GUIDLow: %u) tried to move item %u from tab %u slot %u to tab %u slot %u, but item %u has a stack of zero!",
+ sLog->outFatal(LOG_FILTER_GENERAL, "Guild::SwapItems: Player %s(GUIDLow: %u) tried to move item %u from tab %u slot %u to tab %u slot %u, but item %u has a stack of zero!",
player->GetName(), player->GetGUIDLow(), pItemSrc->GetEntry(), tabId, slotId, destTabId, destSlotId, pItemSrc->GetEntry());
//return; // Commented out for now, uncomment when it's verified that this causes a crash!!
}
@@ -2846,7 +2846,7 @@ void Guild::_SendBankContent(WorldSession* session, uint8 tabId) const
session->SendPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
}
@@ -2861,7 +2861,7 @@ void Guild::_SendBankMoneyUpdate(WorldSession* session) const
data << uint8(0); // No items
BroadcastPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const
@@ -2921,7 +2921,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const
player->GetSession()->SendPacket(&data);
}
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)");
}
}
@@ -2945,7 +2945,7 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par
BroadcastPacket(&data);
- sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GUILD_EVENT");
+ sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent SMSG_GUILD_EVENT");
}
void Guild::SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 rank)
diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp
index a6b73664695..72c791e8a9f 100644
--- a/src/server/game/Guilds/GuildMgr.cpp
+++ b/src/server/game/Guilds/GuildMgr.cpp
@@ -43,7 +43,7 @@ uint32 GuildMgr::GenerateGuildId()
{
if (NextGuildId >= 0xFFFFFFFE)
{
- sLog->outError("Guild ids overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_GUILD, "Guild ids overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
return NextGuildId++;
@@ -104,7 +104,7 @@ Guild* GuildMgr::GetGuildByLeader(uint64 guid) const
void GuildMgr::LoadGuilds()
{
// 1. Load all guilds
- sLog->outString("Loading guilds definitions...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Loading guilds definitions...");
{
uint32 oldMSTime = getMSTime();
@@ -116,8 +116,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild definitions. DB table `guild` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild definitions. DB table `guild` is empty.");
+
return;
}
else
@@ -139,13 +139,13 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// 2. Load all guild ranks
- sLog->outString("Loading guild ranks...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Loading guild ranks...");
{
uint32 oldMSTime = getMSTime();
@@ -157,8 +157,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
+
}
else
{
@@ -175,13 +175,13 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// 3. Load all guild members
- sLog->outString("Loading guild members...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Loading guild members...");
{
uint32 oldMSTime = getMSTime();
@@ -200,8 +200,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild members. DB table `guild_member` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild members. DB table `guild_member` is empty.");
+
}
else
{
@@ -219,13 +219,13 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// 4. Load all guild bank tab rights
- sLog->outString("Loading bank tab rights...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Loading bank tab rights...");
{
uint32 oldMSTime = getMSTime();
@@ -237,8 +237,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
+
}
else
{
@@ -255,13 +255,13 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// 5. Load all event logs
- sLog->outString("Loading guild event logs...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Loading guild event logs...");
{
uint32 oldMSTime = getMSTime();
@@ -272,8 +272,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
+
}
else
{
@@ -290,13 +290,13 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// 6. Load all bank event logs
- sLog->outString("Loading guild bank event logs...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Loading guild bank event logs...");
{
uint32 oldMSTime = getMSTime();
@@ -308,8 +308,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
+
}
else
{
@@ -326,13 +326,13 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// 7. Load all guild bank tabs
- sLog->outString("Loading guild bank tabs...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Loading guild bank tabs...");
{
uint32 oldMSTime = getMSTime();
@@ -344,8 +344,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
+
}
else
{
@@ -362,13 +362,13 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
// 8. Fill all guild bank tabs
- sLog->outString("Filling bank tabs with items...");
+ sLog->outInfo(LOG_FILTER_GUILD, "Filling bank tabs with items...");
{
uint32 oldMSTime = getMSTime();
@@ -382,8 +382,8 @@ void GuildMgr::LoadGuilds()
if (!result)
{
- sLog->outString(">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
+
}
else
{
@@ -400,8 +400,8 @@ void GuildMgr::LoadGuilds()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
@@ -424,7 +424,7 @@ void GuildMgr::LoadGuilds()
}
// 10. Validate loaded guild data
- sLog->outString("Validating data of loaded guilds...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Validating data of loaded guilds...");
{
uint32 oldMSTime = getMSTime();
@@ -441,7 +441,7 @@ void GuildMgr::LoadGuilds()
}
}
- sLog->outString(">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GUILD, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
}
diff --git a/src/server/game/Handlers/AddonHandler.cpp b/src/server/game/Handlers/AddonHandler.cpp
index ef537cb6198..f86dacbc55e 100755
--- a/src/server/game/Handlers/AddonHandler.cpp
+++ b/src/server/game/Handlers/AddonHandler.cpp
@@ -135,7 +135,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target)
}
else
{
- sLog->outError("Addon packet uncompress error :(");
+ sLog->outError(LOG_FILTER_NETWORKIO, "Addon packet uncompress error :(");
return false;
}
return true;
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index 11b6067e929..385bb8abb45 100755..100644
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -262,7 +262,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
- sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
sAuctionMgr->AddAItem(item);
auctionHouse->AddAuction(AH);
@@ -285,7 +285,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
Item* newItem = item->CloneItem(finalCount, _player);
if (!newItem)
{
- sLog->outError("CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
+ sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR);
return;
}
@@ -308,7 +308,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData)
AH->deposit = deposit;
AH->auctionHouseEntry = auctionHouseEntry;
- sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
sAuctionMgr->AddAItem(newItem);
auctionHouse->AddAuction(AH);
@@ -530,7 +530,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData)
}
else
{
- sLog->outError("Auction id: %u got non existing item (item guid : %u)!", auction->Id, auction->item_guidlow);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Auction id: %u got non existing item (item guid : %u)!", auction->Id, auction->item_guidlow);
SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR);
return;
}
@@ -539,7 +539,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData)
{
SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR);
//this code isn't possible ... maybe there should be assert
- sLog->outError("CHEATER: %u tried to cancel auction (id: %u) of another player or auction is NULL", player->GetGUIDLow(), auctionId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "CHEATER: %u tried to cancel auction (id: %u) of another player or auction is NULL", player->GetGUIDLow(), auctionId);
return;
}
@@ -571,7 +571,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recvData)
recvData >> outbiddedCount;
if (recvData.size() != (16 + outbiddedCount * 4))
{
- sLog->outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recvData.size(), (16 + outbiddedCount * 4));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recvData.size(), (16 + outbiddedCount * 4));
outbiddedCount = 0;
}
@@ -693,7 +693,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData)
AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
- //sLog->outDebug("Auctionhouse search (GUID: %u TypeId: %u)",, list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
+ //sLog->outDebug(LOG_FILTER_GENERAL, "Auctionhouse search (GUID: %u TypeId: %u)",, list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
// GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4+4+4));
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index db3c9b7675b..6836d5b3e9f 100755
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -86,7 +86,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData)
if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
{
- sLog->outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUIDLow());
return;
}
@@ -360,13 +360,13 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
GroupQueueInfo ginfo;
if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo))
{
- sLog->outError("BattlegroundHandler: itrplayerstatus not found.");
+ sLog->outError(LOG_FILTER_NETWORKIO, "BattlegroundHandler: itrplayerstatus not found.");
return;
}
// if action == 1, then instanceId is required
if (!ginfo.IsInvitedToBGInstanceGUID && action == 1)
{
- sLog->outError("BattlegroundHandler: instance not found.");
+ sLog->outError(LOG_FILTER_NETWORKIO, "BattlegroundHandler: instance not found.");
return;
}
@@ -377,7 +377,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
if (!bg)
{
- sLog->outError("BattlegroundHandler: bg_template not found for type id %u.", bgTypeId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "BattlegroundHandler: bg_template not found for type id %u.", bgTypeId);
return;
}
@@ -402,7 +402,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
//if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
if (_player->getLevel() > bg->GetMaxLevel())
{
- sLog->outError("Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!",
_player->GetName(), _player->GetGUIDLow(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID());
action = 0;
}
@@ -472,7 +472,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId);
break;
default:
- sLog->outError("Battleground port: unknown action %u", action);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground port: unknown action %u", action);
break;
}
}
@@ -638,7 +638,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
arenatype = ARENA_TYPE_5v5;
break;
default:
- sLog->outError("Unknown arena slot %u at HandleBattlemasterJoinArena()", arenaslot);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Unknown arena slot %u at HandleBattlemasterJoinArena()", arenaslot);
return;
}
@@ -646,7 +646,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData)
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(BATTLEGROUND_AA);
if (!bg)
{
- sLog->outError("Battleground: template bg (all arenas) not found");
+ sLog->outError(LOG_FILTER_NETWORKIO, "Battleground: template bg (all arenas) not found");
return;
}
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index 298c742fc3a..e83f0f55a44 100755
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -73,7 +73,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
}
else
{
- sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Invite found with id [" UI64FMTD "]", *it);
+ sLog->outError(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR: No Invite found with id [" UI64FMTD "]", *it);
data << uint64(0);
data << uint64(0);
data << uint8(0);
@@ -99,7 +99,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
}
else
{
- sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Event found with id [" UI64FMTD "]", *it);
+ sLog->outError(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR: No Event found with id [" UI64FMTD "]", *it);
data << uint64(0);
data << uint8(0);
data << uint32(0);
@@ -251,7 +251,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData)
if (inviteCount != 1 || invitee != guid)
{
- sLog->outError("HandleCalendarAddEvent: [" UI64FMTD
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleCalendarAddEvent: [" UI64FMTD
"]: More than one invite (%d) or Invitee [" UI64FMTD
"] differs", guid, inviteCount, invitee);
return;
@@ -643,7 +643,7 @@ void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, Calenda
data << uint8(0) << uint8(0) << uint8(0) << uint8(0)
<< uint64(0) << uint32(0) << uint8(0);
- sLog->outError("SendCalendarEvent: No Invite found with id [" UI64FMTD "]", *it);
+ sLog->outError(LOG_FILTER_NETWORKIO, "SendCalendarEvent: No Invite found with id [" UI64FMTD "]", *it);
}
}
SendPacket(&data);
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 41ae8659b07..7a728ac1dd0 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -227,7 +227,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result)
{
uint32 guidLow = (*result)[0].GetUInt32();
- sLog->outDetail("Loading char guid %u from account %u.", guidLow, GetAccountId());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Loading char guid %u from account %u.", guidLow, GetAccountId());
Player::BuildEnumData(result, &dataBuffer, &bitBuffer);
@@ -310,7 +310,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recvData)
{
data << (uint8)CHAR_CREATE_FAILED;
SendPacket(&data);
- sLog->outError("Class (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", class_, GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Class (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", class_, GetAccountId());
return;
}
@@ -319,7 +319,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recvData)
{
data << (uint8)CHAR_CREATE_FAILED;
SendPacket(&data);
- sLog->outError("Race (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", race_, GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Race (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", race_, GetAccountId());
return;
}
@@ -327,7 +327,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recvData)
if (raceEntry->expansion > Expansion())
{
data << (uint8)CHAR_CREATE_EXPANSION;
- sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_);
SendPacket(&data);
return;
}
@@ -336,7 +336,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recvData)
if (classEntry->expansion > Expansion())
{
data << (uint8)CHAR_CREATE_EXPANSION_CLASS;
- sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_);
SendPacket(&data);
return;
}
@@ -365,7 +365,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recvData)
{
data << (uint8)CHAR_NAME_NO_NAME;
SendPacket(&data);
- sLog->outError("Account:[%d] but tried to Create character with empty [name] ", GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Account:[%d] but tried to Create character with empty [name] ", GetAccountId());
return;
}
@@ -675,8 +675,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
SendPacket(&data);
std::string IP_str = GetRemoteAddress();
- sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow());
- sLog->outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow());
sScriptMgr->OnPlayerCreate(&newChar);
sWorld->AddCharacterNameData(newChar.GetGUIDLow(), std::string(newChar.GetName()), newChar.getGender(), newChar.getRace(), newChar.getClass());
@@ -704,7 +703,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData)
if (sGuildMgr->GetGuildByLeader(guid))
{
WorldPacket data(SMSG_CHAR_DELETE, 1);
- data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER;
+ data << uint8(CHAR_DELETE_FAILED_GUILD_LEADER);
SendPacket(&data);
return;
}
@@ -713,18 +712,15 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData)
if (sArenaTeamMgr->GetArenaTeamByCaptain(guid))
{
WorldPacket data(SMSG_CHAR_DELETE, 1);
- data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN;
+ data << uint8(CHAR_DELETE_FAILED_ARENA_CAPTAIN);
SendPacket(&data);
return;
}
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_NAME_BY_GUID);
-
stmt->setUInt32(0, GUID_LOPART(guid));
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
-
- if (result)
+ if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
{
Field* fields = result->Fetch();
accountId = fields[0].GetUInt32();
@@ -736,22 +732,21 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData)
return;
std::string IP_str = GetRemoteAddress();
- sLog->outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
- sLog->outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
sScriptMgr->OnPlayerDelete(guid);
sWorld->DeleteCharaceterNameData(GUID_LOPART(guid));
- if (sLog->IsOutCharDump()) // optimize GetPlayerDump call
+ if (sLog->ShouldLog(LOG_FILTER_CHARACTER, LOG_LEVEL_DEBUG)) // optimize GetPlayerDump call
{
std::string dump;
if (PlayerDumpWriter().GetDump(GUID_LOPART(guid), dump))
- sLog->outCharDump(dump.c_str(), GetAccountId(), GUID_LOPART(guid), name.c_str());
+ sLog->outDebug(LOG_FILTER_CHARACTER, dump.c_str(), GetAccountId(), GUID_LOPART(guid), name.c_str());
}
Player::DeleteFromDB(guid, GetAccountId());
WorldPacket data(SMSG_CHAR_DELETE, 1);
- data << (uint8)CHAR_DELETE_SUCCESS;
+ data << uint8(CHAR_DELETE_SUCCESS);
SendPacket(&data);
}
@@ -759,14 +754,14 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
{
if (PlayerLoading() || GetPlayer() != NULL)
{
- sLog->outError("Player tries to login again, AccountId = %d", GetAccountId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player tries to login again, AccountId = %d", GetAccountId());
return;
}
m_playerLoading = true;
ObjectGuid playerGuid;
- sLog->outStaticDebug("WORLD: Recvd Player Logon Message");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd Player Logon Message");
playerGuid[2] = recvData.ReadBit();
playerGuid[3] = recvData.ReadBit();
playerGuid[0] = recvData.ReadBit();
@@ -789,7 +784,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
if (!CharCanLogin(GUID_LOPART(playerGuid)))
{
- sLog->outError("Account (%u) can't login with that character (%u).", GetAccountId(), GUID_LOPART(playerGuid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Account (%u) can't login with that character (%u).", GetAccountId(), GUID_LOPART(playerGuid));
KickPlayer();
return;
}
@@ -807,7 +802,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
void WorldSession::HandleLoadScreenOpcode(WorldPacket& recvPacket)
{
- sLog->outStaticDebug("WORLD: Recvd CMSG_LOAD_SCREEN");
+ sLog->outInfo(LOG_FILTER_GENERAL, "WORLD: Recvd CMSG_LOAD_SCREEN");
uint32 mapID;
recvPacket >> mapID;
@@ -909,13 +904,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
data.put(0, linecount);
SendPacket(&data);
- sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_MOTD)");
// send server info
if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1)
chH.PSendSysMessage(_FULLVERSION);
- sLog->outStaticDebug("WORLD: Sent server info");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent server info");
}
//QueryResult* result = CharacterDatabase.PQuery("SELECT guildid, rank FROM guild_member WHERE guid = '%u'", pCurrChar->GetGUIDLow());
@@ -990,7 +985,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
}
sObjectAccessor->AddObject(pCurrChar);
- //sLog->outDebug("Player %s added to Map.", pCurrChar->GetName());
+ //sLog->outDebug(LOG_FILTER_GENERAL, "Player %s added to Map.", pCurrChar->GetName());
if (pCurrChar->GetGuildId() != 0)
{
@@ -999,7 +994,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
else
{
// remove wrong guild data
- sLog->outError("Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId());
+ sLog->outError(LOG_FILTER_GENERAL, "Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId());
pCurrChar->SetInGuild(0);
}
}
@@ -1085,7 +1080,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
SendNotification(LANG_GM_ON);
std::string IP_str = GetRemoteAddress();
- sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d",
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d",
GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->getLevel());
if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED))
@@ -1099,7 +1094,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
void WorldSession::HandleSetFactionAtWar(WorldPacket & recvData)
{
- sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_ATWAR");
uint32 repListID;
uint8 flag;
@@ -1113,7 +1108,7 @@ void WorldSession::HandleSetFactionAtWar(WorldPacket & recvData)
//I think this function is never used :/ I dunno, but i guess this opcode not exists
void WorldSession::HandleSetFactionCheat(WorldPacket & /*recvData*/)
{
- sLog->outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
GetPlayer()->GetReputationMgr().SendStates();
}
@@ -1147,7 +1142,7 @@ void WorldSession::HandleTutorialReset(WorldPacket & /*recvData*/)
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recvData)
{
- sLog->outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_WATCHED_FACTION");
uint32 fact;
recvData >> fact;
GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact);
@@ -1155,7 +1150,7 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recvData)
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData)
{
- sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_FACTION_INACTIVE");
uint32 replistid;
uint8 inactive;
recvData >> replistid >> inactive;
@@ -1165,14 +1160,14 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData)
void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData)
{
- sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_HELM for %s", _player->GetName());
recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
}
void WorldSession::HandleShowingCloakOpcode(WorldPacket& recvData)
{
- sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SHOWING_CLOAK for %s", _player->GetName());
recvData.read_skip<uint8>(); // unknown, bool?
_player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
}
@@ -1262,7 +1257,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult resu
CharacterDatabase.Execute(stmt);
- sLog->outChar("Account: %d (IP: %s) Character:[%s] (guid:%u) Changed name to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldName.c_str(), guidLow, newName.c_str());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Character:[%s] (guid:%u) Changed name to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldName.c_str(), guidLow, newName.c_str());
WorldPacket data(SMSG_CHAR_RENAME, 1+8+(newName.size()+1));
data << uint8(RESPONSE_SUCCESS);
@@ -1527,7 +1522,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData)
if (result)
{
std::string oldname = result->Fetch()[0].GetString();
- sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str());
}
Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair);
@@ -2116,13 +2111,13 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData)
if (!Player::IsValidRace(race))
{
- sLog->outError("Invalid race (%u) sent by accountId: %u", race, GetAccountId());
+ sLog->outError(LOG_FILTER_GENERAL, "Invalid race (%u) sent by accountId: %u", race, GetAccountId());
return;
}
if (!Player::IsValidGender(gender))
{
- sLog->outError("Invalid gender (%u) sent by accountId: %u", gender, GetAccountId());
+ sLog->outError(LOG_FILTER_GENERAL, "Invalid gender (%u) sent by accountId: %u", gender, GetAccountId());
return;
}
diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp
index c8b94a8aa8b..8b994c2fedc 100755..100644
--- a/src/server/game/Handlers/ChatHandler.cpp
+++ b/src/server/game/Handlers/ChatHandler.cpp
@@ -52,7 +52,7 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && AccountMgr::IsPlayerAccount(GetSecurity())
&& !ChatHandler(this).isValidChatMessage(msg.c_str()))
{
- sLog->outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
GetPlayer()->GetGUIDLow(), msg.c_str());
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK))
KickPlayer();
@@ -110,21 +110,21 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
type = CHAT_MSG_RAID_WARNING;
break;
default:
- sLog->outDetail("HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode());
recvData.hexlike();
return;
}
if (type >= MAX_CHAT_MSG_TYPE)
{
- sLog->outError("CHAT: Wrong message type received: %u", type);
+ sLog->outError(LOG_FILTER_NETWORKIO, "CHAT: Wrong message type received: %u", type);
recvData.rfinish();
return;
}
Player* sender = GetPlayer();
- //sLog->outDebug("CHAT: packet received. type %u, lang %u", type, lang);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "CHAT: packet received. type %u, lang %u", type, lang);
// no language sent with emote packet.
if (type != CHAT_MSG_EMOTE && type != CHAT_MSG_AFK && type != CHAT_MSG_DND)
@@ -504,7 +504,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
}
} break;
default:
- sLog->outError("CHAT: unknown message type %u, lang: %u", type, lang);
+ sLog->outError(LOG_FILTER_NETWORKIO, "CHAT: unknown message type %u, lang: %u", type, lang);
break;
}
}
@@ -535,7 +535,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
type = CHAT_MSG_WHISPER;
break;
default:
- sLog->outDetail("HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode());
recvData.hexlike();
return;
}
@@ -639,7 +639,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
}
default:
{
- sLog->outError("HandleAddonMessagechatOpcode: unknown addon message type %u", type);
+ sLog->outError(LOG_FILTER_GENERAL, "HandleAddonMessagechatOpcode: unknown addon message type %u", type);
break;
}
}
diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp
index 37fa684fffe..1cd86afc6d2 100755
--- a/src/server/game/Handlers/CombatHandler.cpp
+++ b/src/server/game/Handlers/CombatHandler.cpp
@@ -80,7 +80,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData)
if (sheathed >= MAX_SHEATH_STATE)
{
- sLog->outError("Unknown sheath state %u ??", sheathed);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Unknown sheath state %u ??", sheathed);
return;
}
diff --git a/src/server/game/Handlers/DuelHandler.cpp b/src/server/game/Handlers/DuelHandler.cpp
index 8afd9f3b978..1b3f71c8cf1 100755
--- a/src/server/game/Handlers/DuelHandler.cpp
+++ b/src/server/game/Handlers/DuelHandler.cpp
@@ -42,8 +42,8 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket)
return;
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_DUEL_ACCEPTED");
- sLog->outStaticDebug("Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName());
- sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName());
time_t now = time(NULL);
player->duel->startTimer = now;
diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp
index c6a3224348d..4e492c6626d 100755..100644
--- a/src/server/game/Handlers/GroupHandler.cpp
+++ b/src/server/game/Handlers/GroupHandler.cpp
@@ -342,7 +342,7 @@ void WorldSession::HandleGroupInviteResponseOpcode(WorldPacket& recvData)
if (group->GetLeaderGUID() == GetPlayer()->GetGUID())
{
- sLog->outError("HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
@@ -409,7 +409,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recvData)
//can't uninvite yourself
if (guid == GetPlayer()->GetGUID())
{
- sLog->outError("WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
@@ -459,7 +459,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recvData)
// can't uninvite yourself
if (GetPlayer()->GetName() == membername)
{
- sLog->outError("WorldSession::HandleGroupUninviteOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleGroupUninviteOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
@@ -595,7 +595,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
recvData >> x;
recvData >> y;
- //sLog->outDebug("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y);
/** error handling **/
/********************/
@@ -624,7 +624,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
// everything's fine, do it
roll = urand(minimum, maximum);
- //sLog->outDebug("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll);
+ //sLog->outDebug(LOG_FILTER_GENERAL, "ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll);
WorldPacket data(MSG_RANDOM_ROLL, 4+4+4+8);
data << uint32(minimum);
@@ -1113,7 +1113,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData)
/*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recvData)
{
- sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL.");
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got CMSG_GROUP_CANCEL.");
}*/
void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData)
@@ -1127,7 +1127,7 @@ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData)
if (!GetPlayer()) // needed because STATUS_AUTHED
{
if (passOnLoot)
- sLog->outError("CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!");
+ sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!");
return;
}
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 6a8cc5b1c5f..73c90498eaa 100755..100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -458,12 +458,12 @@ void WorldSession::HandleReadItem(WorldPacket& recvData)
if (msg == EQUIP_ERR_OK)
{
data.Initialize(SMSG_READ_ITEM_OK, 8);
- sLog->outDetail("STORAGE: Item page sent");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Item page sent");
}
else
{
data.Initialize(SMSG_READ_ITEM_FAILED, 8);
- sLog->outDetail("STORAGE: Unable to read item");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "STORAGE: Unable to read item");
_player->SendEquipError(msg, pItem, NULL);
}
data << pItem->GetGUID();
@@ -482,7 +482,7 @@ void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recvData)
recvData >> itemid >> guid;
- sLog->outDetail("Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u",
itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid));
}
@@ -564,7 +564,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData)
Item* pNewItem = pItem->CloneItem(count, _player);
if (!pNewItem)
{
- sLog->outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count);
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0);
return;
}
@@ -916,7 +916,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
// next slot
++slot;
- sLog->outDetail("PLAYER: Buy bank bag slot, slot number = %u", slot);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "PLAYER: Buy bank bag slot, slot number = %u", slot);
BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot);
diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp
index 33ebbeb2fcd..c3c61d126da 100755..100644
--- a/src/server/game/Handlers/MailHandler.cpp
+++ b/src/server/game/Handlers/MailHandler.cpp
@@ -130,13 +130,13 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
if (!rc)
{
- sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, " UI64FMTD " copper and " UI64FMTD " COD copper with unk1 = %u, unk2 = %u",
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, " UI64FMTD " copper and " UI64FMTD " COD copper with unk1 = %u, unk2 = %u",
player->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND);
return;
}
- sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, " UI64FMTD " copper and " UI64FMTD " COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, " UI64FMTD " copper and " UI64FMTD " COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2);
if (player->GetGUID() == rc)
{
@@ -758,7 +758,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData)
bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender);
bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK);
- sLog->outDetail("HandleMailCreateTextItem mailid=%u", mailId);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleMailCreateTextItem mailid=%u", mailId);
ItemPosCountVec dest;
uint8 msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, bodyItem, false);
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 79895e59622..34ed6a8ef15 100755..100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -962,7 +962,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recvData)
if (decompressedSize > 0xFFFF)
{
recvData.rfinish(); // unnneded warning spam in this case
- sLog->outError("UAD: Account data packet too big, size %u", decompressedSize);
+ sLog->outError(LOG_FILTER_NETWORKIO, "UAD: Account data packet too big, size %u", decompressedSize);
return;
}
@@ -973,7 +973,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recvData)
if (uncompress(const_cast<uint8*>(dest.contents()), &realSize, const_cast<uint8*>(recvData.contents() + recvData.rpos()), recvData.size() - recvData.rpos()) != Z_OK)
{
recvData.rfinish(); // unnneded warning spam in this case
- sLog->outError("UAD: Failed to decompress account data");
+ sLog->outError(LOG_FILTER_NETWORKIO, "UAD: Failed to decompress account data");
return;
}
@@ -1045,10 +1045,10 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recvData)
uint32 action = ACTION_BUTTON_ACTION(packetData);
uint8 type = ACTION_BUTTON_TYPE(packetData);
- sLog->outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
if (!packetData)
{
- sLog->outDetail("MISC: Remove action from button %u", button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Remove action from button %u", button);
GetPlayer()->removeActionButton(button);
}
else
@@ -1057,19 +1057,19 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recvData)
{
case ACTION_BUTTON_MACRO:
case ACTION_BUTTON_CMACRO:
- sLog->outDetail("MISC: Added Macro %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added Macro %u into button %u", action, button);
break;
case ACTION_BUTTON_EQSET:
- sLog->outDetail("MISC: Added EquipmentSet %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added EquipmentSet %u into button %u", action, button);
break;
case ACTION_BUTTON_SPELL:
- sLog->outDetail("MISC: Added Spell %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added Spell %u into button %u", action, button);
break;
case ACTION_BUTTON_ITEM:
- sLog->outDetail("MISC: Added Item %u into button %u", action, button);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MISC: Added Item %u into button %u", action, button);
break;
default:
- sLog->outError("MISC: Unknown action button type %u for action %u into button %u for player %s (GUID: %u)", type, action, button, _player->GetName(), _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "MISC: Unknown action button type %u for action %u into button %u for player %s (GUID: %u)", type, action, button, _player->GetName(), _player->GetGUIDLow());
return;
}
GetPlayer()->addActionButton(button, action, type);
@@ -1196,7 +1196,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recvPacket)
if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED)
{
if (actionBar != 0)
- sLog->outError("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(actionBar));
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(actionBar));
return;
}
@@ -1447,7 +1447,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recvData)
if (WorldObject* target = _player->GetViewpoint())
_player->SetSeer(target);
else
- sLog->outError("Player %s requests non-existing seer " UI64FMTD, _player->GetName(), _player->GetUInt64Value(PLAYER_FARSIGHT));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %s requests non-existing seer " UI64FMTD, _player->GetName(), _player->GetUInt64Value(PLAYER_FARSIGHT));
break;
default:
sLog->outDebug(LOG_FILTER_NETWORKIO, "Unhandled mode in CMSG_FAR_SIGHT: %u", apply);
@@ -1518,7 +1518,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recvData)
if (mode >= MAX_DUNGEON_DIFFICULTY)
{
- sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
return;
}
@@ -1529,7 +1529,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recvData)
Map* map = _player->FindMap();
if (map && map->IsDungeon())
{
- sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: %s, GUID: %u) tried to reset the instance while player is inside!", _player->GetName(), _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: %s, GUID: %u) tried to reset the instance while player is inside!", _player->GetName(), _player->GetGUIDLow());
return;
}
@@ -1549,7 +1549,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recvData)
if (groupGuy->GetMap()->IsNonRaidDungeon())
{
- sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName(), groupGuy->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName(), groupGuy->GetGUIDLow());
return;
}
}
@@ -1575,7 +1575,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recvData)
if (mode >= MAX_RAID_DIFFICULTY)
{
- sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode);
return;
}
@@ -1583,7 +1583,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recvData)
Map* map = _player->FindMap();
if (map && map->IsDungeon())
{
- sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
return;
}
@@ -1606,7 +1606,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recvData)
if (groupGuy->GetMap()->IsRaid())
{
- sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow());
return;
}
}
@@ -1746,7 +1746,7 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket)
if (!_player->HasPendingBind())
{
- sLog->outDetail("InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", _player->GetName(), _player->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", _player->GetName(), _player->GetGUIDLow());
return;
}
@@ -1800,7 +1800,7 @@ void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket)
SendItemSparseDb2Reply(entry);
break;
default:
- sLog->outError("CMSG_REQUEST_HOTFIX: Received unknown hotfix type: %u", type);
+ sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_REQUEST_HOTFIX: Received unknown hotfix type: %u", type);
recvPacket.rfinish();
break;
}
@@ -1882,5 +1882,5 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket)
recvPacket.ReadByteSeq(guid[5]);
WorldObject* obj = ObjectAccessor::GetWorldObject(*GetPlayer(), guid);
- sLog->outError("Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName(), GetGuidLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName(), GetGuidLow());
}
diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp
index f892ecfeb13..da2e7e5bfd2 100755..100644
--- a/src/server/game/Handlers/MovementHandler.cpp
+++ b/src/server/game/Handlers/MovementHandler.cpp
@@ -67,7 +67,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
Map* oldMap = GetPlayer()->GetMap();
if (GetPlayer()->IsInWorld())
{
- sLog->outError("Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId());
oldMap->RemovePlayerFromMap(GetPlayer(), false);
}
@@ -77,7 +77,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// while the player is in transit, for example the map may get full
if (!newMap || !newMap->CanEnter(GetPlayer()))
{
- sLog->outError("Map %d could not be created for player %d, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Map %d could not be created for player %d, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUIDLow());
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}
@@ -90,7 +90,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->SendInitialPacketsBeforeAddToMap();
if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer()))
{
- sLog->outError("WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.GetMapId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.GetMapId());
GetPlayer()->ResetMap();
GetPlayer()->SetMap(oldMap);
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
@@ -214,8 +214,8 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recvPacket)
recvPacket.ReadByteSeq(guid[3]);
recvPacket.ReadByteSeq(guid[0]);
- sLog->outStaticDebug("Guid " UI64FMTD, uint64(guid));
- sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS);
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Guid " UI64FMTD, uint64(guid));
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Flags %u, time %u", flags, time/IN_MILLISECONDS);
Player* plMover = _player->m_mover->ToPlayer();
@@ -280,12 +280,12 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
// prevent tampered movement data
if (movementInfo.guid != mover->GetGUID())
{
- sLog->outError("HandleMovementOpcodes: guid error");
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleMovementOpcodes: guid error");
return;
}
if (!movementInfo.pos.IsPositionValid())
{
- sLog->outError("HandleMovementOpcodes: Invalid Position");
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleMovementOpcodes: Invalid Position");
return;
}
@@ -468,7 +468,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData)
//case CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break;
//case CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break;
default:
- sLog->outError("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
return;
}
@@ -485,13 +485,13 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData)
{
if (_player->GetSpeed(move_type) > newspeed) // must be greater - just correct
{
- sLog->outError("%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
+ sLog->outError(LOG_FILTER_NETWORKIO, "%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
move_type_name[move_type], _player->GetName(), _player->GetSpeed(move_type), newspeed);
_player->SetSpeed(move_type, _player->GetSpeedRate(move_type), true);
}
else // must be lesser - cheating
{
- sLog->outBasic("Player %s from account id %u kicked for incorrect speed (must be %f instead %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player %s from account id %u kicked for incorrect speed (must be %f instead %f)",
_player->GetName(), _player->GetSession()->GetAccountId(), _player->GetSpeed(move_type), newspeed);
_player->GetSession()->KickPlayer();
}
@@ -525,7 +525,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvPacket)
if (GetPlayer()->IsInWorld())
{
if (_player->m_mover->GetGUID() != guid)
- sLog->outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID());
}
}
@@ -643,7 +643,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi)
MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
if (sequence == NULL)
{
- sLog->outError("WorldSession::ReadMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode()));
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::ReadMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode()));
return;
}
@@ -918,7 +918,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi)
MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode());
if (!sequence)
{
- sLog->outError("WorldSession::WriteMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode()));
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::WriteMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode()));
return;
}
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 09c4c817ef3..c0345e17fcd 100755..100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -74,17 +74,17 @@ void WorldSession::HandlePetAction(WorldPacket & recvData)
// used also for charmed creature
Unit* pet= ObjectAccessor::GetUnit(*_player, guid1);
- sLog->outDetail("HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2)));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2)));
if (!pet)
{
- sLog->outError("HandlePetAction: Pet (GUID: %u) doesn't exist for player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetAction: Pet (GUID: %u) doesn't exist for player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
return;
}
if (pet != GetPlayer()->GetFirstControlled())
{
- sLog->outError("HandlePetAction: Pet (GUID: %u) does not belong to player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetAction: Pet (GUID: %u) does not belong to player '%s'", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName());
return;
}
@@ -126,13 +126,13 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData)
if (!pet)
{
- sLog->outError("HandlePetStopAttack: Pet %u does not exist", uint32(GUID_LOPART(guid)));
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetStopAttack: Pet %u does not exist", uint32(GUID_LOPART(guid)));
return;
}
if (pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm())
{
- sLog->outError("HandlePetStopAttack: Pet GUID %u isn't a pet or charmed creature of player %s", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetStopAttack: Pet GUID %u isn't a pet or charmed creature of player %s", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
@@ -147,7 +147,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!",
guid1, guid2, spellid, flag, pet->GetGUIDLow(), pet->GetTypeId());
return;
}
@@ -268,7 +268,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
}
break;
default:
- sLog->outError("WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
}
break;
case ACT_REACTION: // 0x6
@@ -297,7 +297,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown PET spell id %i", spellid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET spell id %i", spellid);
return;
}
@@ -402,13 +402,13 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid
break;
}
default:
- sLog->outError("WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid);
}
}
void WorldSession::HandlePetNameQuery(WorldPacket & recvData)
{
- sLog->outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetNameQuery. CMSG_PET_NAME_QUERY");
uint32 petnumber;
uint64 petguid;
@@ -459,7 +459,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
{
if (!GetPlayer()->isGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
{
- sLog->outStaticDebug("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
return false;
}
}
@@ -468,7 +468,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
{
if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER))
{
- sLog->outStaticDebug("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid));
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid));
return false;
}
}
@@ -477,7 +477,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
void WorldSession::HandlePetSetAction(WorldPacket & recvData)
{
- sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetSetAction. CMSG_PET_SET_ACTION");
uint64 petguid;
uint8 count;
@@ -488,14 +488,14 @@ void WorldSession::HandlePetSetAction(WorldPacket & recvData)
if (!pet || pet != _player->GetFirstControlled())
{
- sLog->outError("HandlePetSetAction: Unknown pet (GUID: %u) or pet owner (GUID: %u)", GUID_LOPART(petguid), _player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetSetAction: Unknown pet (GUID: %u) or pet owner (GUID: %u)", GUID_LOPART(petguid), _player->GetGUIDLow());
return;
}
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return;
}
@@ -557,7 +557,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recvData)
uint32 spell_id = UNIT_ACTION_BUTTON_ACTION(data[i]);
uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]);
- sLog->outDetail("Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", _player->GetName(), position[i], spell_id, uint32(act_state));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", _player->GetName(), position[i], spell_id, uint32(act_state));
//if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add
if (!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_PASSIVE) && spell_id && !pet->HasSpell(spell_id)))
@@ -593,7 +593,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recvData)
void WorldSession::HandlePetRename(WorldPacket & recvData)
{
- sLog->outDetail("HandlePetRename. CMSG_PET_RENAME");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetRename. CMSG_PET_RENAME");
uint64 petguid;
uint8 isdeclined;
@@ -680,7 +680,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recvData)
{
uint64 guid;
recvData >> guid; //pet guid
- sLog->outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid));
if (!_player->IsInWorld())
return;
@@ -698,7 +698,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recvData)
void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
{
- sLog->outDetail("CMSG_PET_SPELL_AUTOCAST");
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_PET_SPELL_AUTOCAST");
uint64 guid;
uint32 spellid;
uint8 state; //1 for on, 0 for off
@@ -714,7 +714,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
if (!pet || (pet != _player->GetGuardianPet() && pet != _player->GetCharm()))
{
- sLog->outError("HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
@@ -726,7 +726,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
CharmInfo* charmInfo = pet->GetCharmInfo();
if (!charmInfo)
{
- sLog->outError("WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId());
return;
}
@@ -759,14 +759,14 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
if (!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm()))
{
- sLog->outError("HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown PET spell id %i", spellId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET spell id %i", spellId);
return;
}
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index 66632f5e7b5..c8b79a9da10 100755
--- a/src/server/game/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -479,7 +479,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData)
if (!result)
{
- sLog->outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionGuid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Petition %u is not found for player %u %s", GUID_LOPART(petitionGuid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName());
return;
}
@@ -767,7 +767,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData)
}
else
{
- sLog->outError("Player %s (guid: %u) tried to turn in petition (guid: %u) that is not present in the database", _player->GetName(), _player->GetGUIDLow(), GUID_LOPART(petitionGuid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %s (guid: %u) tried to turn in petition (guid: %u) that is not present in the database", _player->GetName(), _player->GetGUIDLow(), GUID_LOPART(petitionGuid));
return;
}
diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp
index 8fac7aa88cc..63035a5095f 100755
--- a/src/server/game/Handlers/QueryHandler.cpp
+++ b/src/server/game/Handlers/QueryHandler.cpp
@@ -70,7 +70,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket& recvData)
recvData >> guid;
// This is disable by default to prevent lots of console spam
- // sLog->outString("HandleNameQueryOpcode %u", guid);
+ // sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleNameQueryOpcode %u", guid);
SendNameQueryOpcode(guid);
}
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index 0fb8f557f13..8b7319b760b 100755..100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -43,7 +43,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData)
Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
if (!questgiver)
{
- sLog->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid));
return;
}
@@ -71,7 +71,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData)
break;
}
default:
- sLog->outError("QuestGiver called for unexpected type %u", questgiver->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "QuestGiver called for unexpected type %u", questgiver->GetTypeId());
break;
}
@@ -289,7 +289,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
if (reward >= QUEST_REWARD_CHOICES_COUNT)
{
- sLog->outError("Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (probably packet hacking)", _player->GetName(), _player->GetGUIDLow(), reward);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player %s (guid %d) tried to get invalid reward (%u) (probably packet hacking)", _player->GetName(), _player->GetGUIDLow(), reward);
return;
}
@@ -308,7 +308,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) ||
(_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete()))
{
- sLog->outError("HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!",
_player->GetName(), _player->GetGUIDLow(), questId);
return;
}
@@ -435,7 +435,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
_player->RemoveActiveQuest(questId);
_player->GetAchievementMgr().RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
- sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Player %u abandoned quest %u", _player->GetGUIDLow(), questId);
}
_player->SetQuestSlot(slot, 0);
@@ -500,7 +500,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData)
{
if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE)
{
- sLog->outError("Possible hacking attempt: Player %s [playerGuid: %u] tried to complete questId [entry: %u] without being in possession of the questId!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [playerGuid: %u] tried to complete questId [entry: %u] without being in possession of the questId!",
_player->GetName(), _player->GetGUIDLow(), questId);
return;
}
@@ -634,7 +634,7 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32
}
default:
//its imposible, but check ^)
- sLog->outError("Warning: GetDialogStatus called for unexpected type %u", questgiver->GetTypeId());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Warning: GetDialogStatus called for unexpected type %u", questgiver->GetTypeId());
return DIALOG_STATUS_NONE;
}
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 161b93cce4b..31cce5b7239 100755
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -209,7 +209,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
recvPacket >> bagIndex >> slot;
- sLog->outDetail("bagIndex: %u, slot: %u", bagIndex, slot);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "bagIndex: %u, slot: %u", bagIndex, slot);
Item* item = pUser->GetItemByPos(bagIndex, slot);
if (!item)
@@ -229,7 +229,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
if (!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))
{
pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
- sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!",
pUser->GetName(), pUser->GetGUIDLow(), item->GetGUIDLow(), proto->ItemId);
return;
}
@@ -243,7 +243,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
if (!lockInfo)
{
pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, item, NULL);
- sLog->outError("WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", item->GetGUIDLow(), lockId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", item->GetGUIDLow(), lockId);
return;
}
@@ -276,7 +276,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
}
else
{
- sLog->outError("Wrapped item %u don't have record in character_gifts table and will deleted", item->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Wrapped item %u don't have record in character_gifts table and will deleted", item->GetGUIDLow());
pUser->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
return;
}
@@ -354,7 +354,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
if (!spellInfo)
{
- sLog->outError("WORLD: unknown spell id %u", spellId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown spell id %u", spellId);
recvPacket.rfinish(); // prevent spam at ignore packet
return;
}
@@ -471,7 +471,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
{
- sLog->outError("WORLD: unknown PET spell id %u", spellId);
+ sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET spell id %u", spellId);
return;
}
@@ -479,13 +479,13 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
if (!pet)
{
- sLog->outError("HandlePetCancelAura: Attempt to cancel an aura for non-existant pet %u by player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetCancelAura: Attempt to cancel an aura for non-existant pet %u by player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm())
{
- sLog->outError("HandlePetCancelAura: Pet %u is not a pet of player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandlePetCancelAura: Pet %u is not a pet of player '%s'", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
return;
}
diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp
index f510e7eca73..13881d919f7 100755
--- a/src/server/game/Handlers/TradeHandler.cpp
+++ b/src/server/game/Handlers/TradeHandler.cpp
@@ -253,21 +253,21 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
if (myItems[i])
{
if (!traderCanTrade)
- sLog->outError("trader can't store item: %u", myItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "trader can't store item: %u", myItems[i]->GetGUIDLow());
if (_player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, myItems[i], false) == EQUIP_ERR_OK)
_player->MoveItemToInventory(playerDst, myItems[i], true, true);
else
- sLog->outError("player can't take item back: %u", myItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "player can't take item back: %u", myItems[i]->GetGUIDLow());
}
// return the already removed items to the original owner
if (hisItems[i])
{
if (!playerCanTrade)
- sLog->outError("player can't store item: %u", hisItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "player can't store item: %u", hisItems[i]->GetGUIDLow());
if (trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, hisItems[i], false) == EQUIP_ERR_OK)
trader->MoveItemToInventory(traderDst, hisItems[i], true, true);
else
- sLog->outError("trader can't take item back: %u", hisItems[i]->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "trader can't take item back: %u", hisItems[i]->GetGUIDLow());
}
}
}
@@ -285,7 +285,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m
{
if (Item* item = myTrade->GetItem(TradeSlots(i)))
{
- sLog->outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
//Can return NULL
myItems[i] = item;
myItems[i]->SetInTrade();
@@ -293,7 +293,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m
if (Item* item = hisTrade->GetItem(TradeSlots(i)))
{
- sLog->outStaticDebug("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot());
hisItems[i] = item;
hisItems[i]->SetInTrade();
}
diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp
index 937ede6c8a9..c8fca388478 100644
--- a/src/server/game/Handlers/VehicleHandler.cpp
+++ b/src/server/game/Handlers/VehicleHandler.cpp
@@ -63,7 +63,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData)
if (!seat->CanSwitchFromSeat())
{
recvData.rfinish(); // prevent warnings spam
- sLog->outError("HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.",
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.",
recvData.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags);
return;
}
@@ -150,7 +150,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
if (!vehicle)
{
data.rfinish(); // prevent warnings spam
- sLog->outError("HandleEjectPassenger: Player %u is not in a vehicle!", GetPlayer()->GetGUIDLow());
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleEjectPassenger: Player %u is not in a vehicle!", GetPlayer()->GetGUIDLow());
return;
}
@@ -162,13 +162,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
Player* player = ObjectAccessor::FindPlayer(guid);
if (!player)
{
- sLog->outError("Player %u tried to eject player %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject player %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
if (!player->IsOnVehicle(vehicle->GetBase()))
{
- sLog->outError("Player %u tried to eject player %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject player %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
@@ -177,7 +177,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
if (seat->IsEjectable())
player->ExitVehicle();
else
- sLog->outError("Player %u attempted to eject player %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u attempted to eject player %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
}
else if (IS_CREATURE_GUID(guid))
@@ -185,13 +185,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
if (!unit) // creatures can be ejected too from player mounts
{
- sLog->outError("Player %u tried to eject creature guid %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject creature guid %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
if (!unit->IsOnVehicle(vehicle->GetBase()))
{
- sLog->outError("Player %u tried to eject unit %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to eject unit %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
return;
}
@@ -203,10 +203,10 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data)
unit->ExitVehicle();
}
else
- sLog->outError("Player %u attempted to eject creature GUID %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u attempted to eject creature GUID %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid));
}
else
- sLog->outError("HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid);
+ sLog->outError(LOG_FILTER_NETWORKIO, "HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid);
}
void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
@@ -220,7 +220,7 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
if (seat->CanEnterOrExit())
GetPlayer()->ExitVehicle();
else
- sLog->outError("Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
+ sLog->outError(LOG_FILTER_NETWORKIO, "Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
GetPlayer()->GetGUIDLow(), seat->m_ID, seat->m_flags);
}
}
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp
index 59bb86cb68e..4ca7f97c02b 100755
--- a/src/server/game/Instances/InstanceSaveMgr.cpp
+++ b/src/server/game/Instances/InstanceSaveMgr.cpp
@@ -75,19 +75,19 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance
const MapEntry* entry = sMapStore.LookupEntry(mapId);
if (!entry)
{
- sLog->outError("InstanceSaveManager::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::AddInstanceSave: wrong mapid = %d, instanceid = %d!", mapId, instanceId);
return NULL;
}
if (instanceId == 0)
{
- sLog->outError("InstanceSaveManager::AddInstanceSave: mapid = %d, wrong instanceid = %d!", mapId, instanceId);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::AddInstanceSave: mapid = %d, wrong instanceid = %d!", mapId, instanceId);
return NULL;
}
if (difficulty >= (entry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY))
{
- sLog->outError("InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty);
return NULL;
}
@@ -275,8 +275,8 @@ void InstanceSaveManager::LoadInstances()
// Load reset times and clean expired instances
sInstanceSaveMgr->LoadResetTimes();
- sLog->outString(">> Loaded instances in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded instances in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void InstanceSaveManager::LoadResetTimes()
@@ -364,7 +364,7 @@ void InstanceSaveManager::LoadResetTimes()
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
if (!mapDiff)
{
- sLog->outError("InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty);
CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid, difficulty);
continue;
}
@@ -458,7 +458,7 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev
}
if (itr == m_resetTimeQueue.end())
- sLog->outError("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d, %d, %d) was not found!", event.type, event.mapid, event.instanceId);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d, %d, %d) was not found!", event.type, event.mapid, event.instanceId);
}
}
else
@@ -566,7 +566,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty);
if (!mapDiff || !mapDiff->resetTime)
{
- sLog->outError("InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);
+ sLog->outError(LOG_FILTER_GENERAL, "InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid);
return;
}
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 90a669b8615..6888f77916a 100755
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -46,7 +46,7 @@ void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject* go)
if (go)
go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: InstanceScript: HandleGameObject failed");
+ sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript: HandleGameObject failed");
}
bool InstanceScript::IsEncounterInProgress() const
@@ -197,7 +197,7 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state)
if (bossInfo->state == TO_BE_DECIDED) // loading
{
bossInfo->state = state;
- //sLog->outError("Inialize boss %u state as %u.", id, (uint32)state);
+ //sLog->outError(LOG_FILTER_GENERAL, "Inialize boss %u state as %u.", id, (uint32)state);
return false;
}
else
@@ -267,7 +267,7 @@ void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime,
go->ResetDoorOrButton();
}
else
- sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", go->GetEntry(), go->GetGoType());
+ sLog->outError(LOG_FILTER_GENERAL, "SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", go->GetEntry(), go->GetGoType());
}
}
@@ -298,7 +298,7 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
player->SendUpdateWorldState(uiStateId, uiStateData);
}
else
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map.");
+ sLog->outDebug(LOG_FILTER_TSCR, "DoUpdateWorldState attempt send data but no players in map.");
}
// Send Notify to all players in instance
@@ -384,7 +384,7 @@ void InstanceScript::DoCastSpellOnPlayers(uint32 spell)
bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/)
{
- sLog->outError("Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
+ sLog->outError(LOG_FILTER_GENERAL, "Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u",
instance->GetId(), criteria_id);
return false;
}
diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h
index 469948d8e2d..130e06b67c0 100755
--- a/src/server/game/Instances/InstanceScript.h
+++ b/src/server/game/Instances/InstanceScript.h
@@ -25,11 +25,11 @@
//#include "GameObject.h"
//#include "Map.h"
-#define OUT_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
-#define OUT_SAVE_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
-#define OUT_LOAD_INST_DATA(a) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
-#define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
-#define OUT_LOAD_INST_DATA_FAIL sLog->outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_SAVE_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_LOAD_INST_DATA(a) sLog->outDebug(LOG_FILTER_TSCR, "Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a)
+#define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
+#define OUT_LOAD_INST_DATA_FAIL sLog->outError(LOG_FILTER_TSCR, "Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId())
class Map;
class Unit;
@@ -134,7 +134,6 @@ typedef std::map<uint32 /*entry*/, MinionInfo> MinionInfoMap;
class InstanceScript : public ZoneScript
{
public:
-
explicit InstanceScript(Map* map) : instance(map), completedEncounters(0) {}
virtual ~InstanceScript() {}
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 62ce976f1a8..275e8f93d8b 100755
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -121,7 +121,7 @@ uint32 LootStore::LoadLootTable()
if (maxcount > std::numeric_limits<uint8>::max())
{
- sLog->outErrorDb("Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max());
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max());
continue; // error already printed to log/console.
}
@@ -225,12 +225,12 @@ void LootStore::ReportUnusedIds(LootIdSet const& lootIdSet) const
{
// all still listed ids isn't referenced
for (LootIdSet::const_iterator itr = lootIdSet.begin(); itr != lootIdSet.end(); ++itr)
- sLog->outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName());
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName());
}
void LootStore::ReportNotExistedId(uint32 id) const
{
- sLog->outErrorDb("Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName());
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName());
}
//
@@ -259,13 +259,13 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
{
if (group >= 1 << 7) // it stored in 7 bit field
{
- sLog->outErrorDb("Table '%s' entry %d item %d: group (%u) must be less %u - skipped", store.GetName(), entry, itemid, group, 1 << 7);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: group (%u) must be less %u - skipped", store.GetName(), entry, itemid, group, 1 << 7);
return false;
}
if (mincountOrRef == 0)
{
- sLog->outErrorDb("Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef);
return false;
}
@@ -274,36 +274,36 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid);
if (!proto)
{
- sLog->outErrorDb("Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
return false;
}
if (chance == 0 && group == 0) // Zero chance is allowed for grouped entries only
{
- sLog->outErrorDb("Table '%s' entry %d item %d: equal-chanced grouped entry, but group not defined - skipped", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: equal-chanced grouped entry, but group not defined - skipped", store.GetName(), entry, itemid);
return false;
}
if (chance != 0 && chance < 0.000001f) // loot with low chance
{
- sLog->outErrorDb("Table '%s' entry %d item %d: low chance (%f) - skipped",
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: low chance (%f) - skipped",
store.GetName(), entry, itemid, chance);
return false;
}
if (maxcount < mincountOrRef) // wrong max count
{
- sLog->outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef);
return false;
}
}
else // mincountOrRef < 0
{
if (needs_quest)
- sLog->outErrorDb("Table '%s' entry %d item %d: quest chance will be treated as non-quest chance", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: quest chance will be treated as non-quest chance", store.GetName(), entry, itemid);
else if (chance == 0) // no chance for the reference
{
- sLog->outErrorDb("Table '%s' entry %d item %d: zero chance is specified for a reference, skipped", store.GetName(), entry, itemid);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %d item %d: zero chance is specified for a reference, skipped", store.GetName(), entry, itemid);
return false;
}
}
@@ -409,7 +409,7 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo
if (!tab)
{
if (!noEmptyError)
- sLog->outErrorDb("Table '%s' loot id #%u used but it doesn't have records.", store.GetName(), lootId);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' loot id #%u used but it doesn't have records.", store.GetName(), lootId);
return false;
}
@@ -1179,12 +1179,12 @@ void LootTemplate::LootGroup::Verify(LootStore const& lootstore, uint32 id, uint
float chance = RawTotalChance();
if (chance > 101.0f) // TODO: replace with 100% when DBs will be ready
{
- sLog->outErrorDb("Table '%s' entry %u group %d has total chance > 100%% (%f)", lootstore.GetName(), id, group_id, chance);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %u group %d has total chance > 100%% (%f)", lootstore.GetName(), id, group_id, chance);
}
if (chance >= 100.0f && !EqualChanced.empty())
{
- sLog->outErrorDb("Table '%s' entry %u group %d has items with chance=0%% but group total chance >= 100%% (%f)", lootstore.GetName(), id, group_id, chance);
+ sLog->outError(LOG_FILTER_SQL, "Table '%s' entry %u group %d has items with chance=0%% but group total chance >= 100%% (%f)", lootstore.GetName(), id, group_id, chance);
}
}
@@ -1392,7 +1392,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
if (!cond || !cond->isLoaded())//should never happen, checked at loading
{
- sLog->outError("LootTemplate::addConditionItem: condition is null");
+ sLog->outError(LOG_FILTER_LOOT, "LootTemplate::addConditionItem: condition is null");
return false;
}
if (!Entries.empty())
@@ -1451,7 +1451,7 @@ bool LootTemplate::isReference(uint32 id)
void LoadLootTemplates_Creature()
{
- sLog->outString("Loading creature loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading creature loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1478,16 +1478,16 @@ void LoadLootTemplates_Creature()
LootTemplates_Creature.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Disenchant()
{
- sLog->outString("Loading disenchanting loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading disenchanting loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1514,15 +1514,15 @@ void LoadLootTemplates_Disenchant()
LootTemplates_Disenchant.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty");
+
}
void LoadLootTemplates_Fishing()
{
- sLog->outString("Loading fishing loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading fishing loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1539,16 +1539,16 @@ void LoadLootTemplates_Fishing()
LootTemplates_Fishing.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Gameobject()
{
- sLog->outString("Loading gameobject loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading gameobject loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1575,16 +1575,16 @@ void LoadLootTemplates_Gameobject()
LootTemplates_Gameobject.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Item()
{
- sLog->outString("Loading item loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading item loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1601,16 +1601,16 @@ void LoadLootTemplates_Item()
LootTemplates_Item.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 item loot templates. DB table `item_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Milling()
{
- sLog->outString("Loading milling loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading milling loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1632,16 +1632,16 @@ void LoadLootTemplates_Milling()
LootTemplates_Milling.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Pickpocketing()
{
- sLog->outString("Loading pickpocketing loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading pickpocketing loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1668,16 +1668,16 @@ void LoadLootTemplates_Pickpocketing()
LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Prospecting()
{
- sLog->outString("Loading prospecting loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading prospecting loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1699,16 +1699,16 @@ void LoadLootTemplates_Prospecting()
LootTemplates_Prospecting.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Mail()
{
- sLog->outString("Loading mail loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading mail loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1725,16 +1725,16 @@ void LoadLootTemplates_Mail()
LootTemplates_Mail.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Skinning()
{
- sLog->outString("Loading skinning loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading skinning loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1761,16 +1761,16 @@ void LoadLootTemplates_Skinning()
LootTemplates_Skinning.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty");
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty");
+
- sLog->outString();
}
void LoadLootTemplates_Spell()
{
- sLog->outString("Loading spell loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading spell loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1805,15 +1805,15 @@ void LoadLootTemplates_Spell()
LootTemplates_Spell.ReportUnusedIds(lootIdSet);
if (count)
- sLog->outString(">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outErrorDb(">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty");
+
}
void LoadLootTemplates_Reference()
{
- sLog->outString("Loading reference loot templates...");
+ sLog->outInfo(LOG_FILTER_LOOT, "Loading reference loot templates...");
uint32 oldMSTime = getMSTime();
@@ -1836,6 +1836,6 @@ void LoadLootTemplates_Reference()
// output error for any still listed ids (not referenced from any loot table)
LootTemplates_Reference.ReportUnusedIds(lootIdSet);
- sLog->outString(">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp
index 3c3888eb9f8..929a1d81d57 100755
--- a/src/server/game/Mails/Mail.cpp
+++ b/src/server/game/Mails/Mail.cpp
@@ -50,7 +50,7 @@ MailSender::MailSender(Object* sender, MailStationery stationery) : m_stationery
default:
m_messageType = MAIL_NORMAL;
m_senderId = 0; // will show mail from not existed player
- sLog->outError("MailSender::MailSender - Mail have unexpected sender typeid (%u)", sender->GetTypeId());
+ sLog->outError(LOG_FILTER_GENERAL, "MailSender::MailSender - Mail have unexpected sender typeid (%u)", sender->GetTypeId());
break;
}
}
diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h
index 445d95c5112..7ae8f659788 100755
--- a/src/server/game/Mails/Mail.h
+++ b/src/server/game/Mails/Mail.h
@@ -56,8 +56,9 @@ enum MailStationery
MAIL_STATIONERY_DEFAULT = 41,
MAIL_STATIONERY_GM = 61,
MAIL_STATIONERY_AUCTION = 62,
- MAIL_STATIONERY_VAL = 64,
- MAIL_STATIONERY_CHR = 65,
+ MAIL_STATIONERY_VAL = 64, // Valentine
+ MAIL_STATIONERY_CHR = 65, // Christmas
+ MAIL_STATIONERY_ORP = 67, // Orphan
};
enum MailState
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 8df8feb6cac..c1510bef543 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -81,14 +81,14 @@ bool Map::ExistMap(uint32 mapid, int gx, int gy)
FILE* pf=fopen(tmp, "rb");
if (!pf)
- sLog->outError("Map file '%s': does not exist!", tmp);
+ sLog->outError(LOG_FILTER_MAPS, "Map file '%s': does not exist!", tmp);
else
{
map_fileheader header;
if (fread(&header, sizeof(header), 1, pf) == 1)
{
if (header.mapMagic != MapMagic.asUInt || header.versionMagic != MapVersionMagic.asUInt)
- sLog->outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", tmp);
+ sLog->outError(LOG_FILTER_MAPS, "Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", tmp);
else
ret = true;
}
@@ -108,7 +108,7 @@ bool Map::ExistVMap(uint32 mapid, int gx, int gy)
if (!exists)
{
std::string name = vmgr->getDirFileName(mapid, gx, gy);
- sLog->outError("VMap file '%s' is missing or points to wrong version of vmap file. Redo vmaps with latest version of vmap_assembler.exe.", (sWorld->GetDataPath()+"vmaps/"+name).c_str());
+ sLog->outError(LOG_FILTER_MAPS, "VMap file '%s' is missing or points to wrong version of vmap file. Redo vmaps with latest version of vmap_assembler.exe.", (sWorld->GetDataPath()+"vmaps/"+name).c_str());
return false;
}
}
@@ -124,13 +124,13 @@ void Map::LoadVMap(int gx, int gy)
switch (vmapLoadResult)
{
case VMAP::VMAP_LOAD_RESULT_OK:
- sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ sLog->outInfo(LOG_FILTER_MAPS, "VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
break;
case VMAP::VMAP_LOAD_RESULT_ERROR:
- sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ sLog->outInfo(LOG_FILTER_MAPS, "Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
break;
case VMAP::VMAP_LOAD_RESULT_IGNORED:
- sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+ sLog->outDebug(LOG_FILTER_MAPS, "Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
break;
}
}
@@ -157,7 +157,7 @@ void Map::LoadMap(int gx, int gy, bool reload)
//map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?)
if (GridMaps[gx][gy])
{
- sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId());
+ sLog->outInfo(LOG_FILTER_MAPS, "Unloading previously loaded map %u before reloading.", GetId());
sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy);
delete (GridMaps[gx][gy]);
@@ -169,12 +169,12 @@ void Map::LoadMap(int gx, int gy, bool reload)
int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
tmp = new char[len];
snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy);
- sLog->outDetail("Loading map %s", tmp);
+ sLog->outInfo(LOG_FILTER_MAPS, "Loading map %s", tmp);
// loading data
GridMaps[gx][gy] = new GridMap();
if (!GridMaps[gx][gy]->loadData(tmp))
{
- sLog->outError("Error loading map file: \n %s\n", tmp);
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map file: \n %s\n", tmp);
}
delete [] tmp;
@@ -264,7 +264,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on)
CellCoord p = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
if (!p.IsCoordValid())
{
- sLog->outError("Map::SwitchGridContainers: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
+ sLog->outError(LOG_FILTER_MAPS, "Map::SwitchGridContainers: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
return;
}
@@ -272,7 +272,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on)
if (!IsGridLoaded(GridCoord(cell.data.Part.grid_x, cell.data.Part.grid_y)))
return;
- sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
+ sLog->outDebug(LOG_FILTER_MAPS, "Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(ngrid != NULL);
@@ -346,7 +346,7 @@ void Map::EnsureGridLoadedForActiveObject(const Cell &cell, WorldObject* object)
// refresh grid state & timer
if (grid->GetGridState() != GRID_STATE_ACTIVE)
{
- sLog->outStaticDebug("Active object "UI64FMTD" triggers loading of grid [%u, %u] on map %u", object->GetGUID(), cell.GridX(), cell.GridY(), GetId());
+ sLog->outDebug(LOG_FILTER_MAPS, "Active object "UI64FMTD" triggers loading of grid [%u, %u] on map %u", object->GetGUID(), cell.GridX(), cell.GridY(), GetId());
ResetGridExpiry(*grid, 0.1f);
grid->SetGridState(GRID_STATE_ACTIVE);
}
@@ -387,7 +387,7 @@ bool Map::AddPlayerToMap(Player* player)
CellCoord cellCoord = Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY());
if (!cellCoord.IsCoordValid())
{
- sLog->outError("Map::Add: Player (GUID: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
+ sLog->outError(LOG_FILTER_MAPS, "Map::Add: Player (GUID: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
return false;
}
@@ -439,7 +439,7 @@ bool Map::AddToMap(T *obj)
ASSERT(cellCoord.IsCoordValid());
if (!cellCoord.IsCoordValid())
{
- sLog->outError("Map::Add: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
+ sLog->outError(LOG_FILTER_MAPS, "Map::Add: Object " UI64FMTD " has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord);
return false; //Should delete object
}
@@ -449,7 +449,7 @@ bool Map::AddToMap(T *obj)
else
EnsureGridCreated(GridCoord(cell.GridX(), cell.GridY()));
AddToGrid(obj, cell);
- sLog->outStaticDebug("Object %u enters grid[%u, %u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
+ sLog->outDebug(LOG_FILTER_MAPS, "Object %u enters grid[%u, %u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
//Must already be set before AddToMap. Usually during obj->Create.
//obj->SetMap(this);
@@ -715,7 +715,7 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie
if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell))
{
- sLog->outStaticDebug("Player %s relocation grid[%u, %u]cell[%u, %u]->grid[%u, %u]cell[%u, %u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
+ sLog->outDebug(LOG_FILTER_MAPS, "Player %s relocation grid[%u, %u]cell[%u, %u]->grid[%u, %u]cell[%u, %u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY());
player->RemoveFromGrid();
@@ -1002,7 +1002,7 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll)
GridMaps[gx][gy] = NULL;
}
- sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId());
+ sLog->outDebug(LOG_FILTER_MAPS, "Unloading grid[%u, %u] for map %u finished", x, y, GetId());
return true;
}
@@ -1016,7 +1016,7 @@ void Map::RemoveAllPlayers()
if (!player->IsBeingTeleportedFar())
{
// this is happening for bg
- sLog->outError("Map::UnloadAll: player %s is still in map %u during unload, this should not happen!", player->GetName(), GetId());
+ sLog->outError(LOG_FILTER_MAPS, "Map::UnloadAll: player %s is still in map %u during unload, this should not happen!", player->GetName(), GetId());
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
}
}
@@ -1089,28 +1089,28 @@ bool GridMap::loadData(char *filename)
// loadup area data
if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
{
- sLog->outError("Error loading map area data\n");
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map area data\n");
fclose(in);
return false;
}
// loadup height data
if (header.heightMapOffset && !loadHeihgtData(in, header.heightMapOffset, header.heightMapSize))
{
- sLog->outError("Error loading map height data\n");
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map height data\n");
fclose(in);
return false;
}
// loadup liquid data
if (header.liquidMapOffset && !loadLiquidData(in, header.liquidMapOffset, header.liquidMapSize))
{
- sLog->outError("Error loading map liquids data\n");
+ sLog->outError(LOG_FILTER_MAPS, "Error loading map liquids data\n");
fclose(in);
return false;
}
fclose(in);
return true;
}
- sLog->outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", filename);
+ sLog->outError(LOG_FILTER_MAPS, "Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", filename);
fclose(in);
return false;
}
@@ -1700,7 +1700,7 @@ bool Map::IsOutdoors(float x, float y, float z) const
WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
if (wmoEntry)
{
- sLog->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
+ sLog->outDebug(LOG_FILTER_MAPS, "Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
atEntry = GetAreaEntryByAreaID(wmoEntry->areaId);
}
return IsOutdoorWMO(mogpFlags, adtId, rootId, groupId, wmoEntry, atEntry);
@@ -1987,7 +1987,7 @@ void Map::UpdateObjectsVisibilityFor(Player* player, Cell cell, CellCoord cellpa
void Map::SendInitSelf(Player* player)
{
- sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow());
+ sLog->outInfo(LOG_FILTER_MAPS, "Creating player data for himself %u", player->GetGUIDLow());
UpdateData data(player->GetMapId());
@@ -2071,7 +2071,7 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y)
{
if (x >= MAX_NUMBER_OF_GRIDS || y >= MAX_NUMBER_OF_GRIDS)
{
- sLog->outError("map::setNGrid() Invalid grid coordinates found: %d, %d!", x, y);
+ sLog->outError(LOG_FILTER_MAPS, "map::setNGrid() Invalid grid coordinates found: %d, %d!", x, y);
ASSERT(false);
}
i_grids[x][y] = grid;
@@ -2144,7 +2144,7 @@ void Map::RemoveAllObjectsInRemoveList()
{
Corpse* corpse = ObjectAccessor::GetCorpse(*obj, obj->GetGUID());
if (!corpse)
- sLog->outError("Tried to delete corpse/bones %u that is not in map.", obj->GetGUIDLow());
+ sLog->outError(LOG_FILTER_MAPS, "Tried to delete corpse/bones %u that is not in map.", obj->GetGUIDLow());
else
RemoveFromMap(corpse, true);
break;
@@ -2162,7 +2162,7 @@ void Map::RemoveAllObjectsInRemoveList()
RemoveFromMap(obj->ToCreature(), true);
break;
default:
- sLog->outError("Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId());
+ sLog->outError(LOG_FILTER_MAPS, "Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId());
break;
}
@@ -2239,7 +2239,7 @@ void Map::AddToActive(Creature* c)
else
{
GridCoord p2 = Trinity::ComputeGridCoord(c->GetPositionX(), c->GetPositionY());
- sLog->outError("Active creature (GUID: %u Entry: %u) added to grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
+ sLog->outError(LOG_FILTER_MAPS, "Active creature (GUID: %u Entry: %u) added to grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord);
}
}
@@ -2260,7 +2260,7 @@ void Map::RemoveFromActive(Creature* c)
else
{
GridCoord p2 = Trinity::ComputeGridCoord(c->GetPositionX(), c->GetPositionY());
- sLog->outError("Active creature (GUID: %u Entry: %u) removed from grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
+ sLog->outError(LOG_FILTER_MAPS, "Active creature (GUID: %u Entry: %u) removed from grid[%u, %u] but spawn grid[%u, %u] was not loaded.",
c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord);
}
}
@@ -2311,7 +2311,7 @@ bool InstanceMap::CanEnter(Player* player)
{
if (player->GetMapRef().getTarget() == this)
{
- sLog->outError("InstanceMap::CanEnter - player %s(%u) already in map %d, %d, %d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::CanEnter - player %s(%u) already in map %d, %d, %d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());
ASSERT(false);
return false;
}
@@ -2324,7 +2324,7 @@ bool InstanceMap::CanEnter(Player* player)
uint32 maxPlayers = GetMaxPlayers();
if (GetPlayersCountExceptGMs() >= maxPlayers)
{
- sLog->outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);
return false;
}
@@ -2394,7 +2394,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
if (!mapSave)
{
- sLog->outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
+ sLog->outInfo(LOG_FILTER_MAPS, "InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId());
mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
}
@@ -2405,7 +2405,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// cannot enter other instances if bound permanently
if (playerBind->save != mapSave)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is permanently bound to instance %d, %d, %d, %d, %d, %d but he is being put into instance %d, %d, %d, %d, %d, %d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is permanently bound to instance %d, %d, %d, %d, %d, %d but he is being put into instance %d, %d, %d, %d, %d, %d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset());
return false;
}
}
@@ -2417,9 +2417,9 @@ bool InstanceMap::AddPlayerToMap(Player* player)
InstanceGroupBind* groupBind = group->GetBoundInstance(this);
if (playerBind)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
if (groupBind)
- sLog->outError("InstanceMap::Add: the group is bound to the instance %d, %d, %d, %d, %d, %d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: the group is bound to the instance %d, %d, %d, %d, %d, %d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
//ASSERT(false);
return false;
}
@@ -2431,15 +2431,15 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// cannot jump to a different instance without resetting it
if (groupBind->save != mapSave)
{
- sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
if (mapSave)
- sLog->outError("MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
+ sLog->outError(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
else
- sLog->outError("MapSave NULL");
+ sLog->outError(LOG_FILTER_MAPS, "MapSave NULL");
if (groupBind->save)
- sLog->outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
+ sLog->outError(LOG_FILTER_MAPS, "GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
else
- sLog->outError("GroupBind save NULL");
+ sLog->outError(LOG_FILTER_MAPS, "GroupBind save NULL");
return false;
}
// if the group/leader is permanently bound to the instance
@@ -2479,7 +2479,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
// first player enters (no players yet)
SetResetSchedule(false);
- sLog->outDetail("MAP: Player '%s' entered instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Player '%s' entered instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName());
// initialize unload state
m_unloadTimer = 0;
m_resetAfterUnload = false;
@@ -2505,7 +2505,7 @@ void InstanceMap::Update(const uint32 t_diff)
void InstanceMap::RemovePlayerFromMap(Player* player, bool remove)
{
- sLog->outDetail("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
//if last player set unload timer
if (!m_unloadTimer && m_mapRefManager.getSize() == 1)
m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
@@ -2600,7 +2600,7 @@ void InstanceMap::PermBindAllPlayers(Player* source)
InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
if (!save)
{
- sLog->outError("Cannot bind player (GUID: %u, Name: %s), because no instance save is available for instance map (Name: %s, Entry: %u, InstanceId: %u)!", source->GetGUIDLow(), source->GetName(), source->GetMap()->GetMapName(), source->GetMapId(), GetInstanceId());
+ sLog->outError(LOG_FILTER_MAPS, "Cannot bind player (GUID: %u, Name: %s), because no instance save is available for instance map (Name: %s, Entry: %u, InstanceId: %u)!", source->GetGUIDLow(), source->GetName(), source->GetMap()->GetMapName(), source->GetMapId(), GetInstanceId());
return;
}
@@ -2654,7 +2654,7 @@ void InstanceMap::SetResetSchedule(bool on)
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()))
sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId()));
else
- sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, there is no save information for instance (map [id: %u, name: %s], instance id: %u, difficulty: %u)",
+ sLog->outError(LOG_FILTER_MAPS, "InstanceMap::SetResetSchedule: cannot turn schedule %s, there is no save information for instance (map [id: %u, name: %s], instance id: %u, difficulty: %u)",
on ? "on" : "off", GetId(), GetMapName(), GetInstanceId(), Difficulty(GetSpawnMode()));
}
}
@@ -2716,7 +2716,7 @@ bool BattlegroundMap::CanEnter(Player* player)
{
if (player->GetMapRef().getTarget() == this)
{
- sLog->outError("BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow());
+ sLog->outError(LOG_FILTER_MAPS, "BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow());
ASSERT(false);
return false;
}
@@ -2744,7 +2744,7 @@ bool BattlegroundMap::AddPlayerToMap(Player* player)
void BattlegroundMap::RemovePlayerFromMap(Player* player, bool remove)
{
- sLog->outDetail("MAP: Removing player '%s' from bg '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
+ sLog->outInfo(LOG_FILTER_MAPS, "MAP: Removing player '%s' from bg '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
Map::RemovePlayerFromMap(player, remove);
}
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index 2c1bdb00834..5fcca05361b 100755
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -193,13 +193,13 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
const MapEntry* entry = sMapStore.LookupEntry(GetId());
if (!entry)
{
- sLog->outError("CreateInstance: no entry for map %d", GetId());
+ sLog->outError(LOG_FILTER_MAPS, "CreateInstance: no entry for map %d", GetId());
ASSERT(false);
}
const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(GetId());
if (!iTemplate)
{
- sLog->outError("CreateInstance: no instance template for map %d", GetId());
+ sLog->outError(LOG_FILTER_MAPS, "CreateInstance: no instance template for map %d", GetId());
ASSERT(false);
}
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index 8736c8b3782..4c272430266 100755
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -77,7 +77,7 @@ void MapManager::checkAndCorrectGridStatesArray()
{
if (i_GridStates[i] != si_GridStates[i])
{
- sLog->outError("MapManager::checkGridStates(), GridState: si_GridStates is currupt !!!");
+ sLog->outError(LOG_FILTER_MAPS, "MapManager::checkGridStates(), GridState: si_GridStates is currupt !!!");
ok = false;
si_GridStates[i] = i_GridStates[i];
}
@@ -411,7 +411,7 @@ uint32 MapManager::GenerateInstanceId()
if (newInstanceId == _nextInstanceId)
{
- sLog->outError("Instance ID overflow!! Can't continue, shutting down server. ");
+ sLog->outError(LOG_FILTER_MAPS, "Instance ID overflow!! Can't continue, shutting down server. ");
World::StopNow(ERROR_EXIT_CODE);
}
diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h
index dacd9962251..212c391d186 100755
--- a/src/server/game/Miscellaneous/Formulas.h
+++ b/src/server/game/Miscellaneous/Formulas.h
@@ -130,7 +130,7 @@ namespace Trinity
nBaseExp = 1878;
break;
default:
- sLog->outError("BaseGain: Unsupported content level %u", content);
+ sLog->outError(LOG_FILTER_GENERAL, "BaseGain: Unsupported content level %u", content);
nBaseExp = 45;
break;
}
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index aec72835d86..a766108dbb0 100755
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -957,7 +957,10 @@ enum TrinityStrings
LANG_COMMAND_LOOKUP_MAX_RESULTS = 5029,
LANG_FLEE = 5030,
LANG_NPCINFO_AIINFO = 5031,
- // Room for more Trinity strings 5032-9999
+ LANG_COMMAND_NO_BATTLEGROUND_FOUND = 5032,
+ LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND = 5033,
+ LANG_COMMAND_NO_OUTDOOR_PVP_FORUND = 5034,
+ // Room for more Trinity strings 5035-9999
// Level requirement notifications
LANG_SAY_REQ = 6604,
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index bc0570bb73b..26e83773228 100755
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -189,7 +189,7 @@ void MotionMaster::MoveRandom(float spawndist)
{
if (_owner->GetTypeId() == TYPEID_UNIT)
{
- sLog->outStaticDebug("Creature (GUID: %u) start moving random", _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (GUID: %u) start moving random", _owner->GetGUIDLow());
Mutate(new RandomMovementGenerator<Creature>(spawndist), MOTION_SLOT_IDLE);
}
}
@@ -200,22 +200,22 @@ void MotionMaster::MoveTargetedHome()
if (_owner->GetTypeId()==TYPEID_UNIT && !((Creature*)_owner)->GetCharmerOrOwnerGUID())
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow());
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
}
else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID())
{
- sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow());
Unit *target = ((Creature*)_owner)->GetCharmerOrOwner();
if (target)
{
- sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow());
Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE);
}
}
else
{
- sLog->outError("Player (GUID: %u) attempt targeted home", _owner->GetGUIDLow());
+ sLog->outError(LOG_FILTER_GENERAL, "Player (GUID: %u) attempt targeted home", _owner->GetGUIDLow());
}
}
@@ -223,12 +223,12 @@ void MotionMaster::MoveConfused()
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) move confused", _owner->GetGUIDLow());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) move confused", _owner->GetGUIDLow());
Mutate(new ConfusedMovementGenerator<Player>(), MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) move confused",
_owner->GetEntry(), _owner->GetGUIDLow());
Mutate(new ConfusedMovementGenerator<Creature>(), MOTION_SLOT_CONTROLLED);
}
@@ -243,7 +243,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
//_owner->ClearUnitState(UNIT_STATE_FOLLOW);
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) chase to %s (GUID: %u)",
_owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
@@ -251,7 +251,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
@@ -268,14 +268,14 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
//_owner->AddUnitState(UNIT_STATE_FOLLOW);
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(),
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
Mutate(new FollowMovementGenerator<Player>(*target,dist,angle), slot);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(),
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
@@ -287,12 +287,12 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z), MOTION_SLOT_ACTIVE);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_ACTIVE);
}
@@ -303,7 +303,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos)
float x, y, z;
pos.GetPosition(x, y, z);
- sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
Movement::MoveSplineInit init(*_owner);
init.MoveTo(x,y,z);
@@ -317,7 +317,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos)
float x, y, z;
pos.GetPosition(x, y, z);
- sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z);
Movement::MoveSplineInit init(*_owner);
init.MoveTo(x,y,z);
@@ -335,9 +335,17 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa
float x, y, z;
float moveTimeHalf = speedZ / Movement::gravity;
float dist = 2 * moveTimeHalf * speedXY;
+ float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ);
_owner->GetNearPoint(_owner, x, y, z, _owner->GetObjectSize(), dist, _owner->GetAngle(srcX, srcY) + M_PI);
- MoveJump(x, y, z, speedXY, speedZ);
+
+ Movement::MoveSplineInit init(*_owner);
+ init.MoveTo(x,y,z);
+ init.SetParabolic(max_height,0);
+ init.SetOrientationFixed(true);
+ init.SetVelocity(speedXY);
+ init.Launch();
+ Mutate(new EffectMovementGenerator(0), MOTION_SLOT_CONTROLLED);
}
void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
@@ -356,7 +364,7 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id)
{
- sLog->outStaticDebug("Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
float moveTimeHalf = speedZ / Movement::gravity;
float max_height = -Movement::computeFallElevation(moveTimeHalf,false,-speedZ);
@@ -375,7 +383,7 @@ void MotionMaster::MoveFall(uint32 id/*=0*/)
float tz = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ(), true, MAX_FALL_DISTANCE);
if (tz <= INVALID_HEIGHT)
{
- sLog->outStaticDebug("MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).",
+ sLog->outDebug(LOG_FILTER_GENERAL, "MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).",
_owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ());
return;
}
@@ -404,12 +412,12 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUIDLow(), x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
}
@@ -419,11 +427,11 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outError("Player (GUID: %u) attempt to seek assistance", _owner->GetGUIDLow());
+ sLog->outError(LOG_FILTER_GENERAL, "Player (GUID: %u) attempt to seek assistance", _owner->GetGUIDLow());
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUIDLow(), x, y, z);
_owner->AttackStop();
_owner->ToCreature()->SetReactState(REACT_PASSIVE);
@@ -435,11 +443,11 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outError("Player (GUID: %u) attempt to call distract after assistance", _owner->GetGUIDLow());
+ sLog->outError(LOG_FILTER_GENERAL, "Player (GUID: %u) attempt to call distract after assistance", _owner->GetGUIDLow());
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(), time);
Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE);
}
@@ -455,14 +463,14 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(),
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(),
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow());
Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
_owner->GetEntry(), _owner->GetGUIDLow(),
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(),
@@ -480,19 +488,19 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
{
if (path < sTaxiPathNodesByPath.size())
{
- sLog->outStaticDebug("%s taxi to (Path %u node %u)", _owner->GetName(), path, pathnode);
+ sLog->outDebug(LOG_FILTER_GENERAL, "%s taxi to (Path %u node %u)", _owner->GetName(), path, pathnode);
FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(sTaxiPathNodesByPath[path], pathnode);
Mutate(mgen, MOTION_SLOT_CONTROLLED);
}
else
{
- sLog->outError("%s attempt taxi to (not existed Path %u node %u)",
+ sLog->outError(LOG_FILTER_GENERAL, "%s attempt taxi to (not existed Path %u node %u)",
_owner->GetName(), path, pathnode);
}
}
else
{
- sLog->outError("Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)",
+ sLog->outError(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)",
_owner->GetEntry(), _owner->GetGUIDLow(), path, pathnode);
}
}
@@ -504,11 +512,11 @@ void MotionMaster::MoveDistract(uint32 timer)
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- sLog->outStaticDebug("Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer);
+ sLog->outDebug(LOG_FILTER_GENERAL, "Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer);
}
else
{
- sLog->outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "Creature (Entry: %u GUID: %u) (timer: %u)",
_owner->GetEntry(), _owner->GetGUIDLow(), timer);
}
@@ -560,7 +568,7 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
//Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
- sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
+ sLog->outDebug(LOG_FILTER_GENERAL, "%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO");
}
@@ -619,7 +627,7 @@ void MotionMaster::DirectDelete(_Ty curr)
void MotionMaster::DelayedDelete(_Ty curr)
{
- sLog->outCrash("Unit (Entry %u) is trying to delete its updating MG (Type %u)!", _owner->GetEntry(), curr->GetMovementGeneratorType());
+ sLog->outFatal(LOG_FILTER_GENERAL, "Unit (Entry %u) is trying to delete its updating MG (Type %u)!", _owner->GetEntry(), curr->GetMovementGeneratorType());
if (isStatic(curr))
return;
if (!_expList)
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index 02c685de483..6de76a1d9bc 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -41,7 +41,7 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature &creature)
if (!i_path)
{
// No movement found for entry
- sLog->outErrorDb("WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %u) doesn't have waypoint path id: %u", creature.GetName(), creature.GetEntry(), creature.GetGUIDLow(), path_id);
+ sLog->outError(LOG_FILTER_SQL, "WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %u) doesn't have waypoint path id: %u", creature.GetName(), creature.GetEntry(), creature.GetGUIDLow(), path_id);
return;
}
@@ -316,11 +316,11 @@ void FlightPathMovementGenerator::PreloadEndGrid()
// Load the grid
if (endMap)
{
- sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1));
+ sLog->outInfo(LOG_FILTER_GENERAL, "Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1));
endMap->LoadGrid(_endGridX, _endGridY);
}
else
- sLog->outDetail("Unable to determine map to preload flightmaster grid");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Unable to determine map to preload flightmaster grid");
}
diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp
index 358c9f406e4..c020dc2a653 100644
--- a/src/server/game/Movement/Spline/MoveSpline.cpp
+++ b/src/server/game/Movement/Spline/MoveSpline.cpp
@@ -153,7 +153,7 @@ void MoveSpline::init_spline(const MoveSplineInitArgs& args)
// TODO: what to do in such cases? problem is in input data (all points are at same coords)
if (spline.length() < minimal_duration)
{
- sLog->outError("MoveSpline::init_spline: zero length spline, wrong input data?");
+ sLog->outError(LOG_FILTER_GENERAL, "MoveSpline::init_spline: zero length spline, wrong input data?");
spline.set_length(spline.last(), spline.isCyclic() ? 1000 : 1);
}
point_Idx = spline.first();
@@ -199,7 +199,7 @@ bool MoveSplineInitArgs::Validate() const
#define CHECK(exp) \
if (!(exp))\
{\
- sLog->outError("MoveSplineInitArgs::Validate: expression '%s' failed", #exp);\
+ sLog->outError(LOG_FILTER_GENERAL, "MoveSplineInitArgs::Validate: expression '%s' failed", #exp);\
return false;\
}
CHECK(path.size() > 1);
@@ -226,7 +226,7 @@ bool MoveSplineInitArgs::_checkPathBounds() const
offset = path[i] - middle;
if (fabs(offset.x) >= MAX_OFFSET || fabs(offset.y) >= MAX_OFFSET || fabs(offset.z) >= MAX_OFFSET)
{
- sLog->outError("MoveSplineInitArgs::_checkPathBounds check failed");
+ sLog->outError(LOG_FILTER_GENERAL, "MoveSplineInitArgs::_checkPathBounds check failed");
return false;
}
}
diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp
index 296c9eee50f..214fd23fc8a 100755
--- a/src/server/game/Movement/Waypoints/WaypointManager.cpp
+++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp
@@ -48,8 +48,8 @@ void WaypointMgr::Load()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
+
return;
}
@@ -86,8 +86,8 @@ void WaypointMgr::Load()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void WaypointMgr::ReloadPath(uint32 id)
diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
index dfdd4fc4ffc..4db35d5bc79 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp
@@ -123,7 +123,7 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, fl
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT)
{
- sLog->outError("OutdoorPvP: GO %u is not capture point!", entry);
+ sLog->outError(LOG_FILTER_OUTDOORPVP, "OutdoorPvP: GO %u is not capture point!", entry);
return false;
}
@@ -382,7 +382,7 @@ bool OPvPCapturePoint::Update(uint32 diff)
if (m_OldState != m_State)
{
- //sLog->outError("%u->%u", m_OldState, m_State);
+ //sLog->outError(LOG_FILTER_OUTDOORPVP, "%u->%u", m_OldState, m_State);
if (oldTeam != m_team)
ChangeTeam(oldTeam);
ChangeState();
diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
index a079d2f643b..5ada88cdf7a 100755
--- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
+++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp
@@ -46,8 +46,8 @@ void OutdoorPvPMgr::InitOutdoorPvP()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
+
return;
}
@@ -65,7 +65,7 @@ void OutdoorPvPMgr::InitOutdoorPvP()
if (typeId >= MAX_OUTDOORPVP_TYPES)
{
- sLog->outErrorDb("Invalid OutdoorPvPTypes value %u in outdoorpvp_template; skipped.", typeId);
+ sLog->outError(LOG_FILTER_SQL, "Invalid OutdoorPvPTypes value %u in outdoorpvp_template; skipped.", typeId);
continue;
}
@@ -85,20 +85,20 @@ void OutdoorPvPMgr::InitOutdoorPvP()
OutdoorPvPDataMap::iterator iter = m_OutdoorPvPDatas.find(OutdoorPvPTypes(i));
if (iter == m_OutdoorPvPDatas.end())
{
- sLog->outErrorDb("Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
+ sLog->outError(LOG_FILTER_SQL, "Could not initialize OutdoorPvP object for type ID %u; no entry in database.", uint32(i));
continue;
}
pvp = sScriptMgr->CreateOutdoorPvP(iter->second);
if (!pvp)
{
- sLog->outError("Could not initialize OutdoorPvP object for type ID %u; got NULL pointer from script.", uint32(i));
+ sLog->outError(LOG_FILTER_OUTDOORPVP, "Could not initialize OutdoorPvP object for type ID %u; got NULL pointer from script.", uint32(i));
continue;
}
if (!pvp->SetupOutdoorPvP())
{
- sLog->outError("Could not initialize OutdoorPvP object for type ID %u; SetupOutdoorPvP failed.", uint32(i));
+ sLog->outError(LOG_FILTER_OUTDOORPVP, "Could not initialize OutdoorPvP object for type ID %u; SetupOutdoorPvP failed.", uint32(i));
delete pvp;
continue;
}
@@ -106,8 +106,8 @@ void OutdoorPvPMgr::InitOutdoorPvP()
m_OutdoorPvPSet.push_back(pvp);
}
- sLog->outString(">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_OUTDOORPVP, ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP* handle)
diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp
index d8548b552d3..6ee70101af7 100755
--- a/src/server/game/Pools/PoolMgr.cpp
+++ b/src/server/game/Pools/PoolMgr.cpp
@@ -571,8 +571,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
mPoolTemplate.clear();
- sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 object pools. DB table `pool_template` is empty.");
return;
}
@@ -590,13 +589,12 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
// Creatures
- sLog->outString("Loading Creatures Pooling Data...");
+ sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Creatures Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -605,8 +603,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
}
else
{
@@ -622,17 +619,17 @@ void PoolMgr::LoadFromDB()
CreatureData const* data = sObjectMgr->GetCreatureData(guid);
if (!data)
{
- sLog->outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog->outErrorDb("`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
continue;
}
PoolTemplateData* pPoolTemplate = &mPoolTemplate[pool_id];
@@ -647,14 +644,13 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Gameobjects
- sLog->outString("Loading Gameobject Pooling Data...");
+ sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Gameobject Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -663,8 +659,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
}
else
{
@@ -680,7 +675,7 @@ void PoolMgr::LoadFromDB()
GameObjectData const* data = sObjectMgr->GetGOData(guid);
if (!data)
{
- sLog->outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
continue;
}
@@ -689,19 +684,19 @@ void PoolMgr::LoadFromDB()
goinfo->type != GAMEOBJECT_TYPE_GOOBER &&
goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE)
{
- sLog->outErrorDb("`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog->outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id);
continue;
}
@@ -717,14 +712,13 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// Pool of pools
- sLog->outString("Loading Mother Pooling Data...");
+ sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Mother Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -733,8 +727,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 pools in pools");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 pools in pools");
}
else
{
@@ -749,22 +742,22 @@ void PoolMgr::LoadFromDB()
if (mother_pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", mother_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", mother_pool_id);
continue;
}
if (child_pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.", child_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.", child_pool_id);
continue;
}
if (mother_pool_id == child_pool_id)
{
- sLog->outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.", child_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.", child_pool_id);
continue;
}
if (chance < 0 || chance > 100)
{
- sLog->outErrorDb("`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id);
continue;
}
PoolTemplateData* pPoolTemplateMother = &mPoolTemplate[mother_pool_id];
@@ -794,7 +787,7 @@ void PoolMgr::LoadFromDB()
ss << *itr << ' ';
ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool "
<< poolItr->first << " and child pool " << poolItr->second;
- sLog->outErrorDb("%s", ss.str().c_str());
+ sLog->outError(LOG_FILTER_SQL, "%s", ss.str().c_str());
mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first);
mPoolSearchMap.erase(poolItr);
--count;
@@ -803,12 +796,11 @@ void PoolMgr::LoadFromDB()
}
}
- sLog->outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
- sLog->outString("Loading Quest Pooling Data...");
+ sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Quest Pooling Data...");
{
uint32 oldMSTime = getMSTime();
@@ -817,8 +809,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Loaded 0 quests in pools");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 quests in pools");
}
else
{
@@ -844,19 +835,19 @@ void PoolMgr::LoadFromDB()
Quest const* quest = sObjectMgr->GetQuestTemplate(entry);
if (!quest)
{
- sLog->outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
continue;
}
if (pool_id > max_pool_id)
{
- sLog->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id);
continue;
}
if (!quest->IsDailyOrWeekly())
{
- sLog->outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id);
continue;
}
@@ -867,7 +858,7 @@ void PoolMgr::LoadFromDB()
if (poolTypeMap[pool_id] != currType)
{
- sLog->outErrorDb("`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.",
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.",
entry, currType == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY", pool_id, poolTypeMap[pool_id] == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY");
continue;
}
@@ -877,7 +868,7 @@ void PoolMgr::LoadFromDB()
if (creBounds.first == creBounds.second && goBounds.first == goBounds.second)
{
- sLog->outErrorDb("`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id);
+ sLog->outError(LOG_FILTER_SQL, "`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id);
continue;
}
@@ -893,13 +884,12 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
}
// The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks
- sLog->outString("Starting objects pooling system...");
+ sLog->outInfo(LOG_FILTER_POOLSYS, "Starting objects pooling system...");
{
uint32 oldMSTime = getMSTime();
@@ -909,8 +899,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
- sLog->outString(">> Pool handling system initialized, 0 pools spawned.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_POOLSYS, ">> Pool handling system initialized, 0 pools spawned.");
}
else
{
@@ -926,9 +915,9 @@ void PoolMgr::LoadFromDB()
if (pool_pool_id)
// The pool is a child pool in pool_pool table. Ideally we should remove it from the pool handler to ensure it never gets spawned,
// however that could recursively invalidate entire chain of mother pools. It can be done in the future but for now we'll do nothing.
- sLog->outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id %u and cannot be safely removed.", pool_entry, fields[2].GetUInt32());
+ sLog->outError(LOG_FILTER_SQL, "Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. This broken pool is a child pool of Id %u and cannot be safely removed.", pool_entry, fields[2].GetUInt32());
else
- sLog->outErrorDb("Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry);
+ sLog->outError(LOG_FILTER_SQL, "Pool Id %u has no equal chance pooled entites defined and explicit chance sum is not 100. The pool will not be spawned.", pool_entry);
continue;
}
@@ -941,8 +930,8 @@ void PoolMgr::LoadFromDB()
}
while (result->NextRow());
- sLog->outBasic("Pool handling system initialized, %u pools spawned in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outDebug(LOG_FILTER_POOLSYS, "Pool handling system initialized, %u pools spawned in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
}
}
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index 78f2e44c29a..edb4c0c1cf4 100755
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -45,7 +45,7 @@ bool ReputationMgr::IsAtWar(uint32 faction_id) const
if (!factionEntry)
{
- sLog->outError("ReputationMgr::IsAtWar: Can't get AtWar flag of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
+ sLog->outError(LOG_FILTER_GENERAL, "ReputationMgr::IsAtWar: Can't get AtWar flag of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
return 0;
}
@@ -68,7 +68,7 @@ int32 ReputationMgr::GetReputation(uint32 faction_id) const
if (!factionEntry)
{
- sLog->outError("ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
+ sLog->outError(LOG_FILTER_GENERAL, "ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.", _player->GetName(), faction_id);
return 0;
}
diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp
index 5387a3132c6..517ea6cb6bd 100755
--- a/src/server/game/Scripting/MapScripts.cpp
+++ b/src/server/game/Scripting/MapScripts.cpp
@@ -102,7 +102,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
{
Player* player = NULL;
if (!source && !target)
- sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
else
{
// Check target first, then source.
@@ -112,7 +112,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
player = source->ToPlayer();
if (!player)
- sLog->outError("%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
@@ -124,7 +124,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
{
Creature* creature = NULL;
if (!source && !target)
- sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str());
else
{
if (bReverse)
@@ -145,7 +145,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
}
if (!creature)
- sLog->outError("%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
@@ -157,15 +157,15 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
{
Unit* unit = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else if (!obj->isType(TYPEMASK_UNIT))
- sLog->outError("%s %s object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
else
{
unit = obj->ToUnit();
if (!unit)
- sLog->outError("%s %s object could not be casted to unit.",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object could not be casted to unit.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
}
return unit;
@@ -175,12 +175,12 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInf
{
Player* player = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
player = obj->ToPlayer();
if (!player)
- sLog->outError("%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return player;
@@ -190,12 +190,12 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const Scrip
{
Creature* creature = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
creature = obj->ToCreature();
if (!creature)
- sLog->outError("%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(),
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(),
isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return creature;
@@ -205,13 +205,13 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const
{
WorldObject* pWorldObject = NULL;
if (!obj)
- sLog->outError("%s %s object is NULL.",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is NULL.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
else
{
pWorldObject = dynamic_cast<WorldObject*>(obj);
if (!pWorldObject)
- sLog->outError("%s %s object is not a world object (TypeId: %u, Entry: %u, GUID: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s %s object is not a world object (TypeId: %u, Entry: %u, GUID: %u).",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUIDLow());
}
return pWorldObject;
@@ -227,29 +227,29 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, const Script
case SCRIPT_COMMAND_OPEN_DOOR: bOpen = true; break;
case SCRIPT_COMMAND_CLOSE_DOOR: break;
default:
- sLog->outError("%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str());
return;
}
if (!guid)
- sLog->outError("%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str());
else if (!source)
- sLog->outError("%s source object is NULL.", scriptInfo->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source object is NULL.", scriptInfo->GetDebugInfo().c_str());
else if (!source->isType(TYPEMASK_UNIT))
- sLog->outError("%s source object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.", scriptInfo->GetDebugInfo().c_str(),
+ sLog->outError(LOG_FILTER_TSCR, "%s source object is not unit (TypeId: %u, Entry: %u, GUID: %u), skipping.", scriptInfo->GetDebugInfo().c_str(),
source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
if (!wSource)
- sLog->outError("%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
scriptInfo->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
{
GameObject* pDoor = _FindGameObject(wSource, guid);
if (!pDoor)
- sLog->outError("%s gameobject was not found (guid: %u).", scriptInfo->GetDebugInfo().c_str(), guid);
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject was not found (guid: %u).", scriptInfo->GetDebugInfo().c_str(), guid);
else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR)
- sLog->outError("%s gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
scriptInfo->GetDebugInfo().c_str(), pDoor->GetGoType(), pDoor->GetEntry(), pDoor->GetGUIDLow());
else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY))
{
@@ -331,7 +331,7 @@ void Map::ScriptsProcess()
}
break;
default:
- sLog->outError("%s source with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s source with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
step.script->GetDebugInfo().c_str(), step.sourceGUID, GUID_HIPART(step.sourceGUID));
break;
}
@@ -359,7 +359,7 @@ void Map::ScriptsProcess()
target = HashMapHolder<Corpse>::Find(step.targetGUID);
break;
default:
- sLog->outError("%s target with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s target with unsupported high guid (GUID: " UI64FMTD ", high guid: %u).",
step.script->GetDebugInfo().c_str(), step.targetGUID, GUID_HIPART(step.targetGUID));
break;
}
@@ -370,7 +370,7 @@ void Map::ScriptsProcess()
case SCRIPT_COMMAND_TALK:
if (step.script->Talk.ChatType > CHAT_TYPE_WHISPER && step.script->Talk.ChatType != CHAT_MSG_RAID_BOSS_WHISPER)
{
- sLog->outError("%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType);
+ sLog->outError(LOG_FILTER_TSCR, "%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType);
break;
}
if (step.script->Talk.Flags & SF_TALK_USE_PLAYER)
@@ -397,7 +397,7 @@ void Map::ScriptsProcess()
{
uint64 targetGUID = target ? target->GetGUID() : 0;
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
- sLog->outError("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
player->Whisper(text, LANG_UNIVERSAL, targetGUID);
break;
@@ -429,13 +429,13 @@ void Map::ScriptsProcess()
break;
case CHAT_TYPE_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
- sLog->outError("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
cSource->Whisper(step.script->Talk.TextID, targetGUID);
break;
case CHAT_MSG_RAID_BOSS_WHISPER:
if (!targetGUID || !IS_PLAYER_GUID(targetGUID))
- sLog->outError("%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
else
cSource->MonsterWhisper(step.script->Talk.TextID, targetGUID, true);
break;
@@ -463,7 +463,7 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FieldSet.FieldID <= OBJECT_FIELD_ENTRY || step.script->FieldSet.FieldID >= cSource->GetValuesCount())
- sLog->outError("%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FieldSet.FieldID,
cSource->GetValuesCount(), cSource->GetTypeId(), cSource->GetEntry(), cSource->GetGUIDLow());
else
@@ -492,7 +492,7 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
- sLog->outError("%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
@@ -506,7 +506,7 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
- sLog->outError("%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s wrong field %u (max count: %u) in object (TypeId: %u, Entry: %u, GUID: %u) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID,
source->GetValuesCount(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
@@ -533,12 +533,12 @@ void Map::ScriptsProcess()
{
if (!source)
{
- sLog->outError("%s source object is NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source object is NULL.", step.script->GetDebugInfo().c_str());
break;
}
if (!target)
{
- sLog->outError("%s target object is NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s target object is NULL.", step.script->GetDebugInfo().c_str());
break;
}
@@ -549,7 +549,7 @@ void Map::ScriptsProcess()
{
if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
{
- sLog->outError("%s source is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s source is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
break;
}
@@ -562,7 +562,7 @@ void Map::ScriptsProcess()
{
if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
{
- sLog->outError("%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
break;
}
@@ -570,7 +570,7 @@ void Map::ScriptsProcess()
}
else
{
- sLog->outError("%s neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUIDLow(),
target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
break;
@@ -601,7 +601,7 @@ void Map::ScriptsProcess()
case SCRIPT_COMMAND_RESPAWN_GAMEOBJECT:
if (!step.script->RespawnGameobject.GOGuid)
{
- sLog->outError("%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str());
break;
}
@@ -611,7 +611,7 @@ void Map::ScriptsProcess()
GameObject* pGO = _FindGameObject(pSummoner, step.script->RespawnGameobject.GOGuid);
if (!pGO)
{
- sLog->outError("%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid);
+ sLog->outError(LOG_FILTER_TSCR, "%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid);
break;
}
@@ -620,7 +620,7 @@ void Map::ScriptsProcess()
pGO->GetGoType() == GAMEOBJECT_TYPE_BUTTON ||
pGO->GetGoType() == GAMEOBJECT_TYPE_TRAP)
{
- sLog->outError("%s can not be used with gameobject of type %u (guid: %u).",
+ sLog->outError(LOG_FILTER_TSCR, "%s can not be used with gameobject of type %u (guid: %u).",
step.script->GetDebugInfo().c_str(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid);
break;
}
@@ -643,7 +643,7 @@ void Map::ScriptsProcess()
if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script))
{
if (!step.script->TempSummonCreature.CreatureEntry)
- sLog->outError("%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str());
else
{
float x = step.script->TempSummonCreature.PosX;
@@ -652,7 +652,7 @@ void Map::ScriptsProcess()
float o = step.script->TempSummonCreature.Orientation;
if (!pSummoner->SummonCreature(step.script->TempSummonCreature.CreatureEntry, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, step.script->TempSummonCreature.DespawnDelay))
- sLog->outError("%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry);
+ sLog->outError(LOG_FILTER_TSCR, "%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry);
}
}
break;
@@ -670,13 +670,13 @@ void Map::ScriptsProcess()
// Target must be GameObject.
if (!target)
{
- sLog->outError("%s target object is NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s target object is NULL.", step.script->GetDebugInfo().c_str());
break;
}
if (target->GetTypeId() != TYPEID_GAMEOBJECT)
{
- sLog->outError("%s target object is not gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",
+ sLog->outError(LOG_FILTER_TSCR, "%s target object is not gameobject (TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow());
break;
}
@@ -700,7 +700,7 @@ void Map::ScriptsProcess()
// TODO: Allow gameobjects to be targets and casters
if (!source && !target)
{
- sLog->outError("%s source and target objects are NULL.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s source and target objects are NULL.", step.script->GetDebugInfo().c_str());
break;
}
@@ -733,13 +733,13 @@ void Map::ScriptsProcess()
if (!uSource || !uSource->isType(TYPEMASK_UNIT))
{
- sLog->outError("%s no source unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
+ sLog->outError(LOG_FILTER_TSCR, "%s no source unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
break;
}
if (!uTarget || !uTarget->isType(TYPEMASK_UNIT))
{
- sLog->outError("%s no target unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
+ sLog->outError(LOG_FILTER_TSCR, "%s no target unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
break;
}
@@ -799,7 +799,7 @@ void Map::ScriptsProcess()
if (Unit* unit = _GetScriptUnit(source, true, step.script))
{
if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID))
- sLog->outError("%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID);
+ sLog->outError(LOG_FILTER_TSCR, "%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID);
else
unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable);
}
@@ -809,12 +809,12 @@ void Map::ScriptsProcess()
{
if (!step.script->CallScript.CreatureEntry)
{
- sLog->outError("%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str());
break;
}
if (!step.script->CallScript.ScriptID)
{
- sLog->outError("%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str());
break;
}
@@ -840,7 +840,7 @@ void Map::ScriptsProcess()
if (!cTarget)
{
- sLog->outError("%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry);
+ sLog->outError(LOG_FILTER_TSCR, "%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry);
break;
}
@@ -849,7 +849,7 @@ void Map::ScriptsProcess()
//if no scriptmap present...
if (!datamap)
{
- sLog->outError("%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType);
+ sLog->outError(LOG_FILTER_TSCR, "%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType);
break;
}
@@ -863,7 +863,7 @@ void Map::ScriptsProcess()
if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
{
if (cSource->isDead())
- sLog->outError("%s creature is already dead (Entry: %u, GUID: %u)",
+ sLog->outError(LOG_FILTER_TSCR, "%s creature is already dead (Entry: %u, GUID: %u)",
step.script->GetDebugInfo().c_str(), cSource->GetEntry(), cSource->GetGUIDLow());
else
{
@@ -919,7 +919,7 @@ void Map::ScriptsProcess()
break;
default:
- sLog->outError("Unknown script command %s.", step.script->GetDebugInfo().c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Unknown script command %s.", step.script->GetDebugInfo().c_str());
break;
}
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 72af70f5c26..319fd1eb702 100755
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -50,6 +50,7 @@ void AddSC_ban_commandscript();
void AddSC_cast_commandscript();
void AddSC_character_commandscript();
void AddSC_debug_commandscript();
+void AddSC_disable_commandscript();
void AddSC_event_commandscript();
void AddSC_gm_commandscript();
void AddSC_go_commandscript();
@@ -60,6 +61,7 @@ void AddSC_instance_commandscript();
void AddSC_learn_commandscript();
void AddSC_list_commandscript();
void AddSC_lookup_commandscript();
+void AddSC_message_commandscript();
void AddSC_misc_commandscript();
void AddSC_modify_commandscript();
void AddSC_npc_commandscript();
@@ -662,6 +664,7 @@ void AddCommandScripts()
AddSC_cast_commandscript();
AddSC_character_commandscript();
AddSC_debug_commandscript();
+ AddSC_disable_commandscript();
AddSC_event_commandscript();
AddSC_gm_commandscript();
AddSC_go_commandscript();
@@ -672,6 +675,7 @@ void AddCommandScripts()
AddSC_learn_commandscript();
AddSC_lookup_commandscript();
AddSC_list_commandscript();
+ AddSC_message_commandscript();
AddSC_misc_commandscript();
AddSC_modify_commandscript();
AddSC_npc_commandscript();
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index f567dd2963b..480ab8ef4ae 100755
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -16,7 +16,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
#include "ScriptMgr.h"
#include "Config.h"
#include "DatabaseEnv.h"
@@ -27,6 +26,10 @@
#include "ScriptSystem.h"
#include "Transport.h"
#include "Vehicle.h"
+#include "SpellInfo.h"
+#include "SpellScript.h"
+#include "GossipDef.h"
+#include "CreatureAI.h"
// This is the global static registry of scripts.
template<class TScript>
@@ -51,7 +54,7 @@ class ScriptRegistry
{
if (it->second == script)
{
- sLog->outError("Script '%s' has same memory pointer as '%s'.",
+ sLog->outError(LOG_FILTER_TSCR, "Script '%s' has same memory pointer as '%s'.",
script->GetName().c_str(), it->second->GetName().c_str());
return;
@@ -87,7 +90,7 @@ class ScriptRegistry
else
{
// If the script is already assigned -> delete it!
- sLog->outError("Script '%s' already assigned with the same script name, so the script can't work.",
+ sLog->outError(LOG_FILTER_TSCR, "Script '%s' already assigned with the same script name, so the script can't work.",
script->GetName().c_str());
ASSERT(false); // Error that should be fixed ASAP.
@@ -97,7 +100,7 @@ class ScriptRegistry
{
// The script uses a script name from database, but isn't assigned to anything.
if (script->GetName().find("example") == std::string::npos && script->GetName().find("Smart") == std::string::npos)
- sLog->outErrorDb("Script named '%s' does not have a script name assigned in database.",
+ sLog->outError(LOG_FILTER_SQL, "Script named '%s' does not have a script name assigned in database.",
script->GetName().c_str());
}
}
@@ -159,13 +162,13 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
{
if (!pSource)
{
- sLog->outError("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i, invalid Source pointer.", iTextEntry);
return;
}
if (iTextEntry >= 0)
{
- sLog->outError("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
return;
}
@@ -173,18 +176,18 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (!pData)
{
- sLog->outError("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry);
return;
}
- sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote);
+ sLog->outDebug(LOG_FILTER_TSCR, "DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote);
if (pData->uiSoundId)
{
if (sSoundEntriesStore.LookupEntry(pData->uiSoundId))
pSource->SendPlaySound(pData->uiSoundId, false);
else
- sLog->outError("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId);
}
if (pData->uiEmote)
@@ -192,7 +195,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER)
((Unit*)pSource)->HandleEmoteCommand(pData->uiEmote);
else
- sLog->outError("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId());
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId());
}
switch (pData->uiType)
@@ -214,7 +217,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (target && target->GetTypeId() == TYPEID_PLAYER)
pSource->MonsterWhisper(iTextEntry, target->GetGUID());
else
- sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
break;
}
@@ -223,7 +226,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target)
if (target && target->GetTypeId() == TYPEID_PLAYER)
pSource->MonsterWhisper(iTextEntry, target->GetGUID(), true);
else
- sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
+ sLog->outError(LOG_FILTER_TSCR, "DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry);
break;
}
@@ -248,13 +251,13 @@ void ScriptMgr::Initialize()
LoadDatabase();
- sLog->outString("Loading C++ scripts");
+ sLog->outInfo(LOG_FILTER_TSCR, "Loading C++ scripts");
FillSpellSummary();
AddScripts();
- sLog->outString(">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
+
}
void ScriptMgr::Unload()
@@ -1440,7 +1443,7 @@ WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
: ScriptObject(name), MapScript<Map>(mapId)
{
if (GetEntry() && !GetEntry()->IsWorldMap())
- sLog->outError("WorldMapScript for map %u is invalid.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "WorldMapScript for map %u is invalid.", mapId);
ScriptRegistry<WorldMapScript>::AddScript(this);
}
@@ -1449,7 +1452,7 @@ InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId)
: ScriptObject(name), MapScript<InstanceMap>(mapId)
{
if (GetEntry() && !GetEntry()->IsDungeon())
- sLog->outError("InstanceMapScript for map %u is invalid.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "InstanceMapScript for map %u is invalid.", mapId);
ScriptRegistry<InstanceMapScript>::AddScript(this);
}
@@ -1458,7 +1461,7 @@ BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId)
: ScriptObject(name), MapScript<BattlegroundMap>(mapId)
{
if (GetEntry() && !GetEntry()->IsBattleground())
- sLog->outError("BattlegroundMapScript for map %u is invalid.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "BattlegroundMapScript for map %u is invalid.", mapId);
ScriptRegistry<BattlegroundMapScript>::AddScript(this);
}
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index 37a26d6e5c2..b16b877eded 100755
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -314,7 +314,7 @@ template<class TMap> class MapScript : public UpdatableScript<TMap>
: _mapEntry(sMapStore.LookupEntry(mapId))
{
if (!_mapEntry)
- sLog->outError("Invalid MapScript for %u; no such map ID.", mapId);
+ sLog->outError(LOG_FILTER_TSCR, "Invalid MapScript for %u; no such map ID.", mapId);
}
public:
diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp
index e48404b0643..f24b01306c5 100755
--- a/src/server/game/Scripting/ScriptSystem.cpp
+++ b/src/server/game/Scripting/ScriptSystem.cpp
@@ -16,19 +16,19 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
#include "ScriptSystem.h"
#include "ObjectMgr.h"
#include "DatabaseEnv.h"
+#include "ScriptMgr.h"
ScriptPointVector const SystemMgr::_empty;
void SystemMgr::LoadScriptTexts()
{
- sLog->outString("TSCR: Loading Script Texts...");
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Texts...");
LoadTrinityStrings("script_texts", TEXT_SOURCE_RANGE, 1+(TEXT_SOURCE_RANGE*2));
- sLog->outString("TSCR: Loading Script Texts additional data...");
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Texts additional data...");
uint32 oldMSTime = getMSTime();
// 0 1 2 3
@@ -36,8 +36,8 @@ void SystemMgr::LoadScriptTexts()
if (!result)
{
- sLog->outString(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty.");
+
return;
}
@@ -56,50 +56,50 @@ void SystemMgr::LoadScriptTexts()
if (iId >= 0)
{
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` is not a negative value.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` is not a negative value.", iId);
continue;
}
if (iId > TEXT_SOURCE_RANGE || iId <= TEXT_SOURCE_RANGE*2)
{
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId);
continue;
}
if (temp.uiSoundId)
{
if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
if (!GetLanguageDescByID(temp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
if (temp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
m_mTextDataMap[iId] = temp;
++uiCount;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime));
+
}
void SystemMgr::LoadScriptTextsCustom()
{
- sLog->outString("TSCR: Loading Custom Texts...");
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Custom Texts...");
LoadTrinityStrings("custom_texts", TEXT_SOURCE_RANGE*2, 1+(TEXT_SOURCE_RANGE*3));
- sLog->outString("TSCR: Loading Custom Texts additional data...");
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Custom Texts additional data...");
QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts");
if (!result)
{
- sLog->outString(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty.");
+
return;
}
@@ -118,35 +118,35 @@ void SystemMgr::LoadScriptTextsCustom()
if (iId >= 0)
{
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` is not a negative value.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` is not a negative value.", iId);
continue;
}
if (iId > TEXT_SOURCE_RANGE*2 || iId <= TEXT_SOURCE_RANGE*3)
{
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId);
continue;
}
if (temp.uiSoundId)
{
if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId);
}
if (!GetLanguageDescByID(temp.uiLanguage))
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, temp.uiLanguage);
if (temp.uiType > CHAT_TYPE_ZONE_YELL)
- sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, temp.uiType);
m_mTextDataMap[iId] = temp;
++uiCount;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u additional Custom Texts data.", uiCount);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u additional Custom Texts data.", uiCount);
+
}
void SystemMgr::LoadScriptWaypoints()
@@ -163,15 +163,15 @@ void SystemMgr::LoadScriptWaypoints()
if (result)
uiCreatureCount = result->GetRowCount();
- sLog->outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
+ sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
// 0 1 2 3 4 5
result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid");
if (!result)
{
- sLog->outString(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
+
return;
}
@@ -194,18 +194,18 @@ void SystemMgr::LoadScriptWaypoints()
if (!pCInfo)
{
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", temp.uiCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", temp.uiCreatureEntry);
continue;
}
if (!pCInfo->ScriptID)
- sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
+ sLog->outError(LOG_FILTER_SQL, "TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
m_mPointMoveMap[uiEntry].push_back(temp);
++count;
}
while (result->NextRow());
- sLog->outString(">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h
index cf6332b22f2..4211a63b043 100644
--- a/src/server/game/Scripting/ScriptSystem.h
+++ b/src/server/game/Scripting/ScriptSystem.h
@@ -5,6 +5,7 @@
#ifndef SC_SYSTEM_H
#define SC_SYSTEM_H
+#include "ScriptMgr.h"
#include <ace/Singleton.h>
#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index b856d7c53d7..8098dfd85dc 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -30,11 +30,11 @@ void InitOpcodes()
{
#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \
if (opcode == 0) \
- sLog->outError("Opcode %s got value 0", #opcode); \
+ sLog->outError(LOG_FILTER_NETWORKIO, "Opcode %s got value 0", #opcode); \
if (opcode < NUM_OPCODE_HANDLERS) { \
if (opcodeTable[opcode] != NULL) \
{ \
- sLog->outError("Tried to override handler of %s with %s (opcode %u)", \
+ sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", \
opcodeTable[opcode]->name, #opcode, opcode); \
} \
else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode##"_COMPRESSED", status, processing, handler); \
diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp
deleted file mode 100644
index cb6dcdbdb9e..00000000000
--- a/src/server/game/Server/Protocol/PacketLog.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "PacketLog.h"
-#include "Config.h"
-#include "ByteBuffer.h"
-#include "WorldPacket.h"
-
-PacketLog::PacketLog() : _file(NULL)
-{
- Initialize();
-}
-
-PacketLog::~PacketLog()
-{
- if (_file)
- fclose(_file);
-
- _file = NULL;
-}
-
-void PacketLog::Initialize()
-{
- std::string logsDir = ConfigMgr::GetStringDefault("LogsDir", "");
-
- if (!logsDir.empty())
- if ((logsDir.at(logsDir.length()-1) != '/') && (logsDir.at(logsDir.length()-1) != '\\'))
- logsDir.push_back('/');
-
- std::string logname = ConfigMgr::GetStringDefault("PacketLogFile", "");
- if (!logname.empty())
- _file = fopen((logsDir + logname).c_str(), "wb");
-}
-
-void PacketLog::LogPacket(WorldPacket const& packet, Direction direction)
-{
- ByteBuffer data(4+4+4+1+packet.size());
- data << int32(packet.GetOpcode());
- data << int32(packet.size());
- data << uint32(time(NULL));
- data << uint8(direction);
-
- for (uint32 i = 0; i < packet.size(); i++)
- data << const_cast<WorldPacket&>(packet)[i];
-
- fwrite(data.contents(), 1, data.size(), _file);
- fflush(_file);
-}
diff --git a/src/server/game/Server/Protocol/PacketLog.h b/src/server/game/Server/Protocol/PacketLog.h
deleted file mode 100644
index b899daae198..00000000000
--- a/src/server/game/Server/Protocol/PacketLog.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef TRINITY_PACKETLOG_H
-#define TRINITY_PACKETLOG_H
-
-#include "Common.h"
-#include <ace/Singleton.h>
-
-enum Direction
-{
- CLIENT_TO_SERVER,
- SERVER_TO_CLIENT
-};
-
-class WorldPacket;
-
-class PacketLog
-{
- friend class ACE_Singleton<PacketLog, ACE_Thread_Mutex>;
-
- private:
- PacketLog();
- ~PacketLog();
-
- public:
- void Initialize();
- bool CanLogPacket() const { return (_file != NULL); }
- void LogPacket(WorldPacket const& packet, Direction direction);
-
- private:
- FILE* _file;
-};
-
-#define sPacketLog ACE_Singleton<PacketLog, ACE_Thread_Mutex>::instance()
-#endif
diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp
index f072602a5e6..c8a971743af 100644
--- a/src/server/game/Server/WorldPacket.cpp
+++ b/src/server/game/Server/WorldPacket.cpp
@@ -25,7 +25,7 @@ void WorldPacket::Compress(z_stream* compressionStream)
Opcodes uncompressedOpcode = GetOpcode();
if (uncompressedOpcode & COMPRESSED_OPCODE_MASK)
{
- sLog->outError("Packet with opcode 0x%04X is already compressed!", uncompressedOpcode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Packet with opcode 0x%04X is already compressed!", uncompressedOpcode);
return;
}
@@ -46,7 +46,7 @@ void WorldPacket::Compress(z_stream* compressionStream)
append(&storage[0], destsize);
SetOpcode(opcode);
- sLog->outStaticDebug("Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize);
}
//! Compresses another packet and stores it in self (source left intact)
@@ -57,7 +57,7 @@ void WorldPacket::Compress(z_stream* compressionStream, WorldPacket const* sourc
Opcodes uncompressedOpcode = source->GetOpcode();
if (uncompressedOpcode & COMPRESSED_OPCODE_MASK)
{
- sLog->outError("Packet with opcode 0x%04X is already compressed!", uncompressedOpcode);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Packet with opcode 0x%04X is already compressed!", uncompressedOpcode);
return;
}
@@ -78,7 +78,7 @@ void WorldPacket::Compress(z_stream* compressionStream, WorldPacket const* sourc
SetOpcode(opcode);
- sLog->outStaticDebug("Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize);
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize);
}
void WorldPacket::Compress(void* dst, uint32 *dst_size, const void* src, int src_size)
@@ -91,14 +91,14 @@ void WorldPacket::Compress(void* dst, uint32 *dst_size, const void* src, int src
int32 z_res = deflate(_compressionStream, Z_SYNC_FLUSH);
if (z_res != Z_OK)
{
- sLog->outError("Can't compress packet (zlib: deflate) Error code: %i (%s, msg: %s)", z_res, zError(z_res), _compressionStream->msg);
+ sLog->outError(LOG_FILTER_NETWORKIO, "Can't compress packet (zlib: deflate) Error code: %i (%s, msg: %s)", z_res, zError(z_res), _compressionStream->msg);
*dst_size = 0;
return;
}
if (_compressionStream->avail_in != 0)
{
- sLog->outError("Can't compress packet (zlib: deflate not greedy)");
+ sLog->outError(LOG_FILTER_NETWORKIO, "Can't compress packet (zlib: deflate not greedy)");
*dst_size = 0;
return;
}
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index 0f7a63076e3..87cd026c244 100755..100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -122,7 +122,7 @@ isRecruiter(isARecruiter), timeLastWhoCommand(0)
int32 z_res = deflateInit(_compressionStream, sWorld->getIntConfig(CONFIG_COMPRESSION));
if (z_res != Z_OK)
{
- sLog->outError("Can't initialize packet compression (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Can't initialize packet compression (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res));
return;
}
}
@@ -155,7 +155,7 @@ WorldSession::~WorldSession()
int32 z_res = deflateEnd(_compressionStream);
if (z_res != Z_OK && z_res != Z_DATA_ERROR) // Z_DATA_ERROR signals that internal state was BUSY
{
- sLog->outError("Can't close packet compression stream (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res));
+ sLog->outError(LOG_FILTER_NETWORKIO, "Can't close packet compression stream (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res));
return;
}
@@ -164,7 +164,7 @@ WorldSession::~WorldSession()
void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
{
- sLog->outError("Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped",
+ sLog->outError(LOG_FILTER_GENERAL, "Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped",
GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size);
}
@@ -188,7 +188,7 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/
if (packet->GetOpcode() == NULL_OPCODE || packet->GetOpcode() == UNKNOWN_OPCODE)
{
- sLog->outError("Prevented sending of %s", packet->GetOpcode() == NULL_OPCODE ? "NULL_OPCODE" : "UNKNOWN_OPCODE");
+ sLog->outError(LOG_FILTER_NETWORKIO, "Prevented sending of %s", packet->GetOpcode() == NULL_OPCODE ? "NULL_OPCODE" : "UNKNOWN_OPCODE");
return;
}
@@ -196,7 +196,7 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/
{
if (!opcodeTable[packet->GetOpcode()])
{
- sLog->outError("Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode());
return;
}
}
@@ -226,8 +226,8 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/
{
uint64 minTime = uint64(cur_time - lastTime);
uint64 fullTime = uint64(lastTime - firstTime);
- 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));
- 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);
+ sLog->outInfo(LOG_FILTER_GENERAL, "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));
+ sLog->outInfo(LOG_FILTER_GENERAL, "Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime);
lastTime = cur_time;
sendLastPacketCount = 1;
@@ -316,7 +316,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
{
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle->handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
}
// lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer
@@ -330,7 +330,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
// not expected _player or must checked in packet hanlder
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle->handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
}
break;
@@ -343,7 +343,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
{
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle->handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
}
break;
@@ -362,11 +362,11 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle->handler)(*packet);
- if (sLog->IsOutDebug() && packet->rpos() < packet->wpos())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos())
LogUnprocessedTail(packet);
break;
case STATUS_NEVER:
- sLog->outError("SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)",
+ sLog->outError(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)",
GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "<none>",
LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode());
break;
@@ -379,11 +379,11 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
}
catch(ByteBufferException &)
{
- sLog->outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.",
packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId());
- if (sLog->IsOutDebug())
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE))
{
- sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:");
+ sLog->outTrace(LOG_FILTER_NETWORKIO, "Dumping error causing packet:");
packet->hexlike();
}
}
@@ -568,7 +568,7 @@ void WorldSession::LogoutPlayer(bool Save)
// e.g if he got disconnected during a transfer to another map
// calls to GetMap in this case may cause crashes
_player->CleanupsBeforeDelete();
- sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow(), _player->getLevel());
+ sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow(), _player->getLevel());
if (Map* _map = _player->FindMap())
_map->RemovePlayerFromMap(_player, true);
@@ -647,22 +647,30 @@ const char *WorldSession::GetTrinityString(int32 entry) const
void WorldSession::Handle_NULL(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received unhandled opcode %s (0x%.4X)", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_GENERAL, "SESSION: received unhandled opcode %s (0x%.4X)",
+ LookupOpcodeName(recvPacket.GetOpcode()),
+ recvPacket.GetOpcode());
}
void WorldSession::Handle_EarlyProccess(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_GENERAL, "SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead",
+ LookupOpcodeName(recvPacket.GetOpcode()),
+ recvPacket.GetOpcode());
}
void WorldSession::Handle_ServerSide(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received server-side opcode %s (0x%.4X)", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_GENERAL, "SESSION: received server-side opcode %s (0x%.4X)",
+ LookupOpcodeName(recvPacket.GetOpcode()),
+ recvPacket.GetOpcode());
}
void WorldSession::Handle_Deprecated(WorldPacket& recvPacket)
{
- sLog->outError("SESSION: received deprecated opcode %s (0x%.4X)", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode());
+ sLog->outError(LOG_FILTER_GENERAL, "SESSION: received deprecated opcode %s (0x%.4X)",
+ LookupOpcodeName(recvPacket.GetOpcode()),
+ recvPacket.GetOpcode());
}
void WorldSession::SendAuthWaitQue(uint32 position)
@@ -711,13 +719,15 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask)
uint32 type = fields[0].GetUInt8();
if (type >= NUM_ACCOUNT_DATA_TYPES)
{
- sLog->outError("Table `%s` have invalid account data type (%u), ignore.", mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
+ sLog->outError(LOG_FILTER_GENERAL, "Table `%s` have invalid account data type (%u), ignore.",
+ mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
continue;
}
if ((mask & (1 << type)) == 0)
{
- sLog->outError("Table `%s` have non appropriate for table account data type (%u), ignore.", mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
+ sLog->outError(LOG_FILTER_GENERAL, "Table `%s` have non appropriate for table account data type (%u), ignore.",
+ mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type);
continue;
}
@@ -821,7 +831,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
if (size > 0xFFFFF)
{
- sLog->outError("WorldSession::ReadAddonsInfo addon info too big, size %u", size);
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSession::ReadAddonsInfo addon info too big, size %u", size);
return;
}
@@ -851,7 +861,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
addonInfo >> enabled >> crc >> unk1;
- sLog->outDetail("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1);
AddonInfo addon(addonName, enabled, crc, 2, true);
@@ -864,15 +874,15 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
match = false;
if (!match)
- sLog->outDetail("ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC);
else
- sLog->outDetail("ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC);
}
else
{
AddonMgr::SaveAddon(addon);
- sLog->outDetail("ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC);
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC);
}
// TODO: Find out when to not use CRC/pubkey, and other possible states.
@@ -887,7 +897,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under-read!");
}
else
- sLog->outError("Addon packet uncompress error!");
+ sLog->outError(LOG_FILTER_GENERAL, "Addon packet uncompress error!");
}
void WorldSession::SendAddonsInfo()
@@ -926,7 +936,7 @@ void WorldSession::SendAddonsInfo()
data << uint8(usepk);
if (usepk) // if CRC is wrong, add public key (client need it)
{
- sLog->outDetail("ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey",
+ sLog->outInfo(LOG_FILTER_GENERAL, "ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey",
itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC);
data.append(addonPublicKey, sizeof(addonPublicKey));
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index 5eeb18550c5..213206083bc 100755..100644
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -42,7 +42,6 @@
#include "WorldSession.h"
#include "WorldSocketMgr.h"
#include "Log.h"
-#include "PacketLog.h"
#include "ScriptMgr.h"
#include "AccountMgr.h"
@@ -63,19 +62,19 @@ struct ServerPktHeader
if (isLargePacket())
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "initializing large server to client packet. Size: %u, cmd: %u", size, cmd);
- header[headerIndex++] = 0x80|(0xFF &(size>>16));
+ header[headerIndex++] = 0x80 | (0xFF & (size >> 16));
}
- header[headerIndex++] = 0xFF &(size>>8);
- header[headerIndex++] = 0xFF &size;
+ header[headerIndex++] = 0xFF &(size >> 8);
+ header[headerIndex++] = 0xFF & size;
header[headerIndex++] = 0xFF & cmd;
- header[headerIndex++] = 0xFF & (cmd>>8);
+ header[headerIndex++] = 0xFF & (cmd >> 8);
}
uint8 getHeaderLength()
{
// cmd = 2 bytes, size= 2||3bytes
- return 2+(isLargePacket()?3:2);
+ return 2 + (isLargePacket() ? 3 : 2);
}
bool isLargePacket() const
@@ -107,8 +106,8 @@ m_Seed(static_cast<uint32> (rand32()))
{
reference_counting_policy().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
- msg_queue()->high_water_mark(8*1024*1024);
- msg_queue()->low_water_mark(8*1024*1024);
+ msg_queue()->high_water_mark(8 * 1024 * 1024);
+ msg_queue()->low_water_mark(8 * 1024 * 1024);
}
WorldSocket::~WorldSocket (void)
@@ -159,9 +158,31 @@ int WorldSocket::SendPacket(WorldPacket const& pct)
if (closing_)
return -1;
- // Dump outgoing packet - uncompressed, easier to parse
- if (sPacketLog->CanLogPacket())
- sPacketLog->LogPacket(pct, SERVER_TO_CLIENT);
+ // Dump outgoing packet
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE))
+ {
+ char buff[250];
+ snprintf(buff, 250, "SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
+ uint32(get_handle()),
+ uint32(pct.size()),
+ LookupOpcodeName (pct.GetOpcode()),
+ pct.GetOpcode());
+
+ std::string data(buff);
+ uint32 p = 0;
+ while (p < pct.size())
+ {
+ for (uint32 j = 0; j < 16 && p < pct.size(); j++)
+ {
+ snprintf(buff, 250, "%.2X ", const_cast<WorldPacket&>(pct)[p++]);
+ data.append(buff);
+ }
+ data.append("\n");
+ }
+
+ data.append("\n");
+ sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", data.c_str());
+ }
WorldPacket const* pkt = &pct;
@@ -204,7 +225,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct)
if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
{
- sLog->outError("WorldSocket::SendPacket enqueue_tail failed");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::SendPacket enqueue_tail failed");
mb->release();
return -1;
}
@@ -247,7 +268,7 @@ int WorldSocket::open (void *a)
if (peer().get_remote_addr(remote_addr) == -1)
{
- sLog->outError("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
return -1;
}
@@ -264,7 +285,7 @@ int WorldSocket::open (void *a)
// Register with ACE Reactor
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
{
- sLog->outError("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
return -1;
}
@@ -300,14 +321,14 @@ int WorldSocket::handle_input (ACE_HANDLE)
return Update(); // interesting line, isn't it ?
}
- sLog->outStaticDebug("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
+ sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno));
errno = ECONNRESET;
return -1;
}
case 0:
{
- sLog->outStaticDebug("WorldSocket::handle_input: Peer has closed connection");
+ sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer has closed connection");
errno = ECONNRESET;
return -1;
@@ -376,7 +397,7 @@ int WorldSocket::handle_output_queue (GuardType& g)
if (msg_queue()->dequeue_head(mblk, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1)
{
- sLog->outError("WorldSocket::handle_output_queue dequeue_head");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue dequeue_head");
return -1;
}
@@ -411,7 +432,7 @@ int WorldSocket::handle_output_queue (GuardType& g)
if (msg_queue()->enqueue_head(mblk, (ACE_Time_Value*) &ACE_Time_Value::zero) == -1)
{
- sLog->outError("WorldSocket::handle_output_queue enqueue_head");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue enqueue_head");
mblk->release();
return -1;
}
@@ -483,7 +504,7 @@ int WorldSocket::handle_input_header (void)
if ((header.size < 4) || (header.size > 10240) || (header.cmd > 0xFFFF && (header.cmd >> 16) != 0x4C52)) // LR (from MSG_VERIFY_CONNECTIVITY)
{
Player* _player = m_Session ? m_Session->GetPlayer() : NULL;
- sLog->outError("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)",
m_Session ? m_Session->GetAccountId() : 0,
_player ? _player->GetGUIDLow() : 0,
_player ? _player->GetName() : "<none>",
@@ -589,7 +610,7 @@ int WorldSocket::handle_input_missing_data (void)
// hope this is not hack, as proper m_RecvWPct is asserted around
if (!m_RecvWPct)
{
- sLog->outError("Forcing close on input m_RecvWPct = NULL");
+ sLog->outError(LOG_FILTER_GENERAL, "Forcing close on input m_RecvWPct = NULL");
errno = EINVAL;
return -1;
}
@@ -635,7 +656,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g)
(this, ACE_Event_Handler::WRITE_MASK) == -1)
{
// would be good to store errno from reactor with errno guard
- sLog->outError("WorldSocket::cancel_wakeup_output");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::cancel_wakeup_output");
return -1;
}
@@ -654,7 +675,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g)
if (reactor()->schedule_wakeup
(this, ACE_Event_Handler::WRITE_MASK) == -1)
{
- sLog->outError("WorldSocket::schedule_wakeup_output");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::schedule_wakeup_output");
return -1;
}
@@ -673,9 +694,30 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
if (closing_)
return -1;
- // Dump received packet.
- if (sPacketLog->CanLogPacket())
- sPacketLog->LogPacket(*new_pct, CLIENT_TO_SERVER);
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE))
+ {
+ char buff[250];
+ snprintf(buff, 250, "CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n",
+ uint32(get_handle()),
+ uint32(new_pct->size()),
+ LookupOpcodeName (new_pct->GetOpcode()),
+ new_pct->GetOpcode());
+
+ std::string data(buff);
+ uint32 p = 0;
+ while (p < new_pct->size())
+ {
+ for (uint32 j = 0; j < 16 && p < new_pct->size(); j++)
+ {
+ snprintf(buff, 250, "%.2X ", const_cast<WorldPacket&>(*new_pct)[p++]);
+ data.append(buff);
+ }
+ data.append("\n");
+ }
+
+ data.append("\n");
+ sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", data.c_str());
+ }
sLog->outOpCode(uint32(Opcodes(opcode)), LookupOpcodeName(Opcodes(opcode)), false);
@@ -688,26 +730,26 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
case CMSG_AUTH_SESSION:
if (m_Session)
{
- sLog->outError("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
+ sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
return -1;
}
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
return HandleAuthSession(*new_pct);
case CMSG_KEEP_ALIVE:
- sLog->outStaticDebug("CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size()));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size()));
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
return 0;
case CMSG_LOG_DISCONNECT:
new_pct->rfinish(); // contains uint32 disconnectReason;
- sLog->outStaticDebug("CMSG_LOG_DISCONNECT , size: " UI64FMTD, uint64(new_pct->size()));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_LOG_DISCONNECT , size: " UI64FMTD, uint64(new_pct->size()));
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
return 0;
// not an opcode, client sends string "WORLD OF WARCRAFT CONNECTION - CLIENT TO SERVER" without opcode
// first 4 bytes become the opcode (2 dropped)
case MSG_VERIFY_CONNECTIVITY:
{
- sLog->outStaticDebug("MSG_VERIFY_CONNECTIVITY , size: " UI64FMTD, uint64(new_pct->size()));
+ sLog->outInfo(LOG_FILTER_NETWORKIO, "MSG_VERIFY_CONNECTIVITY , size: " UI64FMTD, uint64(new_pct->size()));
sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct));
std::string str;
*new_pct >> str;
@@ -725,7 +767,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
ACE_GUARD_RETURN(LockType, Guard, m_SessionLock, -1);
if (!opcodeTable[Opcodes(opcode)])
{
- sLog->outError("Opcode with no defined handler received from client: %u", new_pct->GetOpcode());
+ sLog->outError(LOG_FILTER_NETWORKIO, "Opcode with no defined handler received from client: %u", new_pct->GetOpcode());
return 0;
}
if (m_Session != NULL)
@@ -743,7 +785,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
}
else
{
- sLog->outError("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode));
return -1;
}
}
@@ -751,9 +793,9 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct)
}
catch (ByteBufferException &)
{
- sLog->outError("WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
- opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1);
- if (sLog->IsOutDebug())
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.",
+ opcode, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1);
+ if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_DEBUG))
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:");
new_pct->hexlike();
@@ -842,7 +884,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
packet << uint8(AUTH_REJECT);
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str());
return -1;
}
@@ -863,7 +905,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account).");
return -1;
}
@@ -874,7 +916,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
if (expansion > world_expansion)
expansion = world_expansion;
- sLog->outStaticDebug("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s",
+ sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s",
fields[5].GetCString(),
fields[4].GetCString());
@@ -889,7 +931,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
packet << uint8(AUTH_FAILED);
SendPacket(packet);
- sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
+ sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs).");
return -1;
}
}
@@ -955,7 +997,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
packet << uint8(AUTH_BANNED);
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned).");
return -1;
}
@@ -971,7 +1013,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
SendPacket(packet);
- sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
+ sLog->outInfo(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough");
return -1;
}
@@ -996,11 +1038,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
packet << uint8(AUTH_FAILED);
SendPacket(packet);
- sLog->outError("WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str());
return -1;
}
- sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
+ sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.",
account.c_str(),
address.c_str());
@@ -1076,7 +1118,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
if (m_Session && AccountMgr::IsPlayerAccount(m_Session->GetSecurity()))
{
Player* _player = m_Session->GetPlayer();
- sLog->outError("WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)",
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)",
m_Session->GetAccountId(),
_player ? _player->GetGUIDLow() : 0,
_player ? _player->GetName() : "<none>",
@@ -1098,7 +1140,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
m_Session->SetLatency (latency);
else
{
- sLog->outError("WorldSocket::HandlePing: peer sent CMSG_PING, "
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: peer sent CMSG_PING, "
"but is not authenticated or got recently kicked, "
" address = %s",
GetRemoteAddress().c_str());
diff --git a/src/server/game/Server/WorldSocketAcceptor.h b/src/server/game/Server/WorldSocketAcceptor.h
index a16c5c2189f..d4ff7823b02 100644
--- a/src/server/game/Server/WorldSocketAcceptor.h
+++ b/src/server/game/Server/WorldSocketAcceptor.h
@@ -44,7 +44,7 @@ protected:
virtual int handle_timeout(const ACE_Time_Value& /*current_time*/, const void* /*act = 0*/)
{
- sLog->outBasic("Resuming acceptor");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Resuming acceptor");
reactor()->cancel_timer(this, 1);
return reactor()->register_handler(this, ACE_Event_Handler::ACCEPT_MASK);
}
@@ -54,7 +54,7 @@ protected:
#if defined(ENFILE) && defined(EMFILE)
if (errno == ENFILE || errno == EMFILE)
{
- sLog->outError("Out of file descriptors, suspending incoming connections for 10 seconds");
+ sLog->outError(LOG_FILTER_GENERAL, "Out of file descriptors, suspending incoming connections for 10 seconds");
reactor()->remove_handler(this, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
reactor()->schedule_timer(this, NULL, ACE_Time_Value(10));
}
diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp
index d357651a5bf..ed960258c41 100755
--- a/src/server/game/Server/WorldSocketMgr.cpp
+++ b/src/server/game/Server/WorldSocketMgr.cpp
@@ -155,7 +155,7 @@ class ReactorRunnable : protected ACE_Task_Base
virtual int svc()
{
- sLog->outStaticDebug ("Network Thread Starting");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Network Thread Starting");
ACE_ASSERT (m_Reactor);
@@ -192,7 +192,7 @@ class ReactorRunnable : protected ACE_Task_Base
}
}
- sLog->outStaticDebug ("Network Thread exits");
+ sLog->outDebug(LOG_FILTER_GENERAL, "Network Thread exits");
return 0;
}
@@ -236,7 +236,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (num_threads <= 0)
{
- sLog->outError("Network.Threads is wrong in your config file");
+ sLog->outError(LOG_FILTER_GENERAL, "Network.Threads is wrong in your config file");
return -1;
}
@@ -244,7 +244,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
m_NetThreads = new ReactorRunnable[m_NetThreadsCount];
- sLog->outBasic ("Max allowed socket connections %d", ACE::max_handles());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Max allowed socket connections %d", ACE::max_handles());
// -1 means use default
m_SockOutKBuff = ConfigMgr::GetIntDefault ("Network.OutKBuff", -1);
@@ -253,7 +253,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (m_SockOutUBuff <= 0)
{
- sLog->outError("Network.OutUBuff is wrong in your config file");
+ sLog->outError(LOG_FILTER_GENERAL, "Network.OutUBuff is wrong in your config file");
return -1;
}
@@ -263,7 +263,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
if (m_Acceptor->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1)
{
- sLog->outError("Failed to open acceptor, check if the port is free");
+ sLog->outError(LOG_FILTER_GENERAL, "Failed to open acceptor, check if the port is free");
return -1;
}
@@ -276,7 +276,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
int
WorldSocketMgr::StartNetwork (ACE_UINT16 port, const char* address)
{
- if (!sLog->IsOutDebug())
+ if (!sLog->ShouldLog(LOG_FILTER_GENERAL, LOG_LEVEL_DEBUG))
ACE_Log_Msg::instance()->priority_mask (LM_ERROR, ACE_Log_Msg::PROCESS);
if (StartReactiveIO(port, address) == -1)
@@ -327,7 +327,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock)
(void*) & m_SockOutKBuff,
sizeof (int)) == -1 && errno != ENOTSUP)
{
- sLog->outError("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF");
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF");
return -1;
}
}
@@ -342,7 +342,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock)
(void*)&ndoption,
sizeof (int)) == -1)
{
- sLog->outError("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno));
+ sLog->outError(LOG_FILTER_GENERAL, "WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno));
return -1;
}
}
diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp
index e314fab07be..d9cfbe6b69c 100755
--- a/src/server/game/Skills/SkillDiscovery.cpp
+++ b/src/server/game/Skills/SkillDiscovery.cpp
@@ -55,8 +55,8 @@ void LoadSkillDiscoveryTable()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
+
return;
}
@@ -89,7 +89,7 @@ void LoadSkillDiscoveryTable()
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
- sLog->outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell);
reportedReqSpells.insert(absReqSkillOrSpell);
}
continue;
@@ -102,7 +102,7 @@ void LoadSkillDiscoveryTable()
{
if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end())
{
- sLog->outErrorDb("Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc"
" and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table",
absReqSkillOrSpell, spellId);
reportedReqSpells.insert(absReqSkillOrSpell);
@@ -118,7 +118,7 @@ void LoadSkillDiscoveryTable()
if (bounds.first == bounds.second)
{
- sLog->outErrorDb("Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId);
continue;
}
@@ -127,7 +127,7 @@ void LoadSkillDiscoveryTable()
}
else
{
- sLog->outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId);
continue;
}
@@ -136,7 +136,7 @@ void LoadSkillDiscoveryTable()
while (result->NextRow());
if (!ssNonDiscoverableEntries.str().empty())
- sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
+ sLog->outError(LOG_FILTER_SQL, "Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str());
// report about empty data for explicit discovery spells
for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id)
@@ -150,11 +150,11 @@ void LoadSkillDiscoveryTable()
continue;
if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end())
- sLog->outErrorDb("Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id);
}
- sLog->outString(">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player)
diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp
index 3bb435145f1..9cb4c145b3d 100755
--- a/src/server/game/Skills/SkillExtraItems.cpp
+++ b/src/server/game/Skills/SkillExtraItems.cpp
@@ -60,8 +60,8 @@ void LoadSkillExtraItemTable()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
+
return;
}
@@ -75,28 +75,28 @@ void LoadSkillExtraItemTable()
if (!sSpellMgr->GetSpellInfo(spellId))
{
- sLog->outError("Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId);
continue;
}
uint32 requiredSpecialization = fields[1].GetUInt32();
if (!sSpellMgr->GetSpellInfo(requiredSpecialization))
{
- sLog->outError("Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization);
continue;
}
float additionalCreateChance = fields[2].GetFloat();
if (additionalCreateChance <= 0.0f)
{
- sLog->outError("Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u has too low additional create chance in `skill_extra_item_template`!", spellId);
continue;
}
uint8 additionalMaxNum = fields[3].GetUInt8();
if (!additionalMaxNum)
{
- sLog->outError("Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
+ sLog->outError(LOG_FILTER_GENERAL, "Skill specialization %u has 0 max number of extra items in `skill_extra_item_template`!", spellId);
continue;
}
@@ -110,8 +110,8 @@ void LoadSkillExtraItemTable()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance, uint8 &additionalMax)
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 4ca9738cfcb..eb81e1f7412 100755..100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -911,21 +911,6 @@ void AuraEffect::CalculateSpellMod()
case SPELL_AURA_DUMMY:
switch (GetSpellInfo()->SpellFamilyName)
{
- case SPELLFAMILY_PRIEST:
- // Pain and Suffering
- if (m_spellInfo->SpellIconID == 2874)
- {
- if (!m_spellmod)
- {
- m_spellmod = new SpellModifier(GetBase());
- m_spellmod->op = SPELLMOD_DOT;
- m_spellmod->type = SPELLMOD_PCT;
- m_spellmod->spellId = GetId();
- m_spellmod->mask[1] = 0x00002000;
- }
- m_spellmod->value = GetAmount();
- }
- break;
case SPELLFAMILY_DRUID:
switch (GetId())
{
@@ -1172,7 +1157,7 @@ void AuraEffect::UpdatePeriodic(Unit* caster)
if (aurEff->GetAuraType() != SPELL_AURA_MOD_POWER_REGEN)
{
m_isPeriodic = false;
- sLog->outError("Aura %d structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura %d structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
}
else
{
@@ -2003,7 +1988,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
case FORM_SPIRITOFREDEMPTION: // 0x20
break;
default:
- sLog->outError("Auras: Unknown Shapeshift Type: %u", GetMiscValue());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Auras: Unknown Shapeshift Type: %u", GetMiscValue());
}
modelid = target->GetModelForForm(form);
@@ -2358,7 +2343,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode,
if (!ci)
{
target->SetDisplayId(16358); // pig pink ^_^
- sLog->outError("Auras: unknown creature id = %d (only need its modelid) From Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Auras: unknown creature id = %d (only need its modelid) From Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId());
}
else
{
@@ -2877,7 +2862,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry);
if (!ci)
{
- sLog->outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue());
+ sLog->outError(LOG_FILTER_SQL, "AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue());
return;
}
@@ -3439,7 +3424,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3471,7 +3455,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3509,7 +3492,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3553,7 +3535,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3588,7 +3569,6 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, apply);
target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
@@ -3968,7 +3948,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bo
if (GetMiscValue() < -2 || GetMiscValue() > 4)
{
- sLog->outError("WARNING: Spell %u effect %u has an unsupported misc value (%i) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "WARNING: Spell %u effect %u has an unsupported misc value (%i) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
return;
}
@@ -3994,7 +3974,7 @@ void AuraEffect::HandleModPercentStat(AuraApplication const* aurApp, uint8 mode,
if (GetMiscValue() < -1 || GetMiscValue() > 4)
{
- sLog->outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
return;
}
@@ -4124,7 +4104,7 @@ void AuraEffect::HandleAuraModResistenceOfStatPercent(AuraApplication const* aur
{
// support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
// and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
- sLog->outError("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
return;
}
@@ -6312,7 +6292,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo());
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb);
caster->DealDamageMods(target, damage, &absorb);
@@ -6382,7 +6362,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
if (target->GetHealth() < damage)
damage = uint32(target->GetHealth());
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb);
caster->SendSpellNonMeleeDamageLog(target, GetId(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
@@ -6514,7 +6494,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
if (crit)
damage = caster->SpellCriticalHealingBonus(m_spellInfo, damage, target);
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId());
uint32 absorb = 0;
@@ -6583,7 +6563,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
drainAmount = maxmana;
}
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId());
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
@@ -6644,7 +6624,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
// ignore negative values (can be result apply spellmods to aura damage
uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(powerType) /100;
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId());
SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
@@ -6679,7 +6659,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
target->SendPeriodicAuraLog(&pInfo);
- sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId());
int32 gain = target->ModifyPower(powerType, amount);
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 6a8ac5d4eef..3394d46fadf 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -439,7 +439,7 @@ void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraA
// TODO: Figure out why this happens
if (itr == m_applications.end())
{
- sLog->outError("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!",
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!",
target->GetGUIDLow(), caster->GetGUIDLow(), auraApp->GetBase()->GetSpellInfo()->Id);
ASSERT(false);
}
@@ -581,7 +581,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
if (!GetOwner()->IsSelfOrInSameMap(itr->first))
{
//TODO: There is a crash caused by shadowfiend load addon
- sLog->outCrash("Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id,
+ sLog->outFatal(LOG_FILTER_SPELLS_AURAS, "Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id,
GetOwner()->GetName(), GetOwner()->IsInWorld() ? GetOwner()->GetMap()->GetId() : uint32(-1),
itr->first->GetName(), itr->first->IsInWorld() ? itr->first->GetMap()->GetId() : uint32(-1));
ASSERT(false);
@@ -1196,7 +1196,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 31571: spellId = 57529; break;
case 31572: spellId = 57531; break;
default:
- sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId());
}
if (spellId)
caster->CastSpell(caster, spellId, true);
@@ -1292,7 +1292,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 49631: spellId = 50509; break;
case 49032: spellId = 50508; break;
default:
- sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId());
}
caster->CastSpell(target, spellId, true, 0, GetEffect(0));
}
@@ -1388,17 +1388,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_WARLOCK:
if (!caster)
break;
- // Curse of Doom
- if (GetSpellInfo()->SpellFamilyFlags[1] & 0x02)
- {
- if (removeMode == AURA_REMOVE_BY_DEATH)
- {
- if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target))
- caster->CastSpell(target, 18662, true, NULL, GetEffect(0));
- }
- }
// Improved Fear
- else if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
+ if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
{
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_WARLOCK, 98, 0))
{
@@ -1408,7 +1399,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case 53759: spellId = 60947; break;
case 53754: spellId = 60946; break;
default:
- sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Improved Fear (%d) found", aurEff->GetId());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Improved Fear (%d) found", aurEff->GetId());
}
if (spellId)
caster->CastSpell(target, spellId, true);
@@ -1617,6 +1608,14 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
switch (GetId())
{
case 19746:
+ // Improved concentration aura - linked aura
+ if (caster->HasAura(20254) || caster->HasAura(20255) || caster->HasAura(20256))
+ {
+ if (apply)
+ target->CastSpell(target, 63510, true);
+ else
+ target->RemoveAura(63510);
+ }
case 31821:
// Aura Mastery Triggered Spell Handler
// If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity
@@ -1625,6 +1624,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
// Do effects only on aura owner
if (GetCasterGUID() != target->GetGUID())
break;
+
if (apply)
{
if ((GetSpellInfo()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellInfo()->Id == 19746 && target->HasAura(31821)))
@@ -1644,6 +1644,26 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
}
+ if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA)
+ {
+ // Improved devotion aura
+ if (caster->HasAura(20140) || caster->HasAura(20138) || caster->HasAura(20139))
+ {
+ if (apply)
+ caster->CastSpell(target, 63514, true);
+ else
+ target->RemoveAura(63514);
+ }
+ // 63531 - linked aura for both Sanctified Retribution and Swift Retribution talents
+ // Not allow for Retribution Aura (prevent stacking)
+ if ((GetSpellInfo()->SpellIconID != 555) && (caster->HasAura(53648) || caster->HasAura(53484) || caster->HasAura(53379) || caster->HasAura(31869)))
+ {
+ if (apply)
+ caster->CastSpell(target, 63531, true);
+ else
+ target->RemoveAura(63531);
+ }
+ }
break;
case SPELLFAMILY_DEATHKNIGHT:
if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_PRESENCE)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 740ac97978d..391a52b8aa5 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -459,23 +459,23 @@ void SpellCastTargets::Update(Unit* caster)
void SpellCastTargets::OutDebug() const
{
if (!m_targetMask)
- sLog->outString("No targets");
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "No targets");
- sLog->outString("target mask: %u", m_targetMask);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "target mask: %u", m_targetMask);
if (m_targetMask & (TARGET_FLAG_UNIT_MASK | TARGET_FLAG_CORPSE_MASK | TARGET_FLAG_GAMEOBJECT_MASK))
- sLog->outString("Object target: " UI64FMTD, m_objectTargetGUID);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Object target: " UI64FMTD, m_objectTargetGUID);
if (m_targetMask & TARGET_FLAG_ITEM)
- sLog->outString("Item target: " UI64FMTD, m_itemTargetGUID);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Item target: " UI64FMTD, m_itemTargetGUID);
if (m_targetMask & TARGET_FLAG_TRADE_ITEM)
- sLog->outString("Trade item target: " UI64FMTD, m_itemTargetGUID);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Trade item target: " UI64FMTD, m_itemTargetGUID);
if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION)
- sLog->outString("Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_src._transportGUID, m_src._transportOffset.ToString().c_str(), m_src._position.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_src._transportGUID, m_src._transportOffset.ToString().c_str(), m_src._position.ToString().c_str());
if (m_targetMask & TARGET_FLAG_DEST_LOCATION)
- sLog->outString("Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dst._transportGUID, m_dst._transportOffset.ToString().c_str(), m_dst._position.ToString().c_str());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dst._transportGUID, m_dst._transportOffset.ToString().c_str(), m_dst._position.ToString().c_str());
if (m_targetMask & TARGET_FLAG_STRING)
- sLog->outString("String: %s", m_strTarget.c_str());
- sLog->outString("speed: %f", m_speed);
- sLog->outString("elevation: %f", m_elevation);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "String: %s", m_strTarget.c_str());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "speed: %f", m_speed);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "elevation: %f", m_elevation);
}
SpellValue::SpellValue(SpellInfo const* proto)
@@ -604,7 +604,7 @@ Spell::~Spell()
{
// Clean the reference to avoid later crash.
// If this error is repeating, we may have to add an ASSERT to better track down how we get into this case.
- sLog->outError("SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
*m_selfContainer = NULL;
}
@@ -1638,7 +1638,7 @@ void Spell::SelectImplicitTrajTargets()
float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d);
if (a > -0.0001f)
a = 0;
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: a %f b %f", a, b);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: a %f b %f", a, b);)
float bestDist = m_spellInfo->GetMaxRange(false);
@@ -1654,11 +1654,11 @@ void Spell::SelectImplicitTrajTargets()
const float objDist2d = m_targets.GetSrcPos()->GetExactDist2d(*itr) * cos(m_targets.GetSrcPos()->GetRelativeAngle(*itr));
const float dz = (*itr)->GetPositionZ() - m_targets.GetSrcPos()->m_positionZ;
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);)
float dist = objDist2d - size;
float height = dist * (a * dist + b);
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)
if (dist < bestDist && height < dz + size && height > dz - size)
{
bestDist = dist > 0 ? dist : 0;
@@ -1666,7 +1666,7 @@ void Spell::SelectImplicitTrajTargets()
}
#define CHECK_DIST {\
- DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\
if (dist > bestDist)\
continue;\
if (dist < objDist2d + size && dist > objDist2d - size)\
@@ -1728,7 +1728,7 @@ void Spell::SelectImplicitTrajTargets()
float distSq = (*itr)->GetExactDistSq(x, y, z);
float sizeSq = (*itr)->GetObjectSize();
sizeSq *= sizeSq;
- DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
if (distSq > sizeSq)
{
float factor = 1 - sqrt(sizeSq / distSq);
@@ -1737,7 +1737,7 @@ void Spell::SelectImplicitTrajTargets()
z += factor * ((*itr)->GetPositionZ() - z);
distSq = (*itr)->GetExactDistSq(x, y, z);
- DEBUG_TRAJ(sLog->outError("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
+ DEBUG_TRAJ(sLog->outError(LOG_FILTER_SPELLS_AURAS, "Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);)
}
}
@@ -2578,6 +2578,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
{
if (effectMask & (1 << effectNumber))
+ {
if (unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber))
effectMask &= ~(1 << effectNumber);
else if (m_spellInfo->Effects[effectNumber].IsAura() && !m_spellInfo->IsPositiveEffect(effectNumber))
@@ -2592,7 +2593,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
returnVal = SPELL_MISS_RESIST;
}
}
+ }
}
+
if (!effectMask)
return returnVal;
@@ -4303,7 +4306,7 @@ void Spell::TakeCastItem()
{
// This code is to avoid a crash
// I'm not sure, if this is really an error, but I guess every item needs a prototype
- sLog->outError("Cast item has no item prototype highId=%d, lowId=%d", m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Cast item has no item prototype highId=%d, lowId=%d", m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow());
return;
}
@@ -4393,7 +4396,7 @@ void Spell::TakePower()
if (powerType >= MAX_POWERS)
{
- sLog->outError("Spell::TakePower: Unknown power type '%d'", powerType);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::TakePower: Unknown power type '%d'", powerType);
return;
}
@@ -5562,7 +5565,7 @@ SpellCastResult Spell::CheckCasterAuras() const
// We use bitmasks so the loop is done only once and not on every aura check below.
if (m_spellInfo->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)
{
- for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_SCHOOL_IMMUNITY)
school_immune |= uint32(m_spellInfo->Effects[i].MiscValue);
@@ -5630,7 +5633,7 @@ SpellCastResult Spell::CheckCasterAuras() const
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (auraInfo->GetAllEffectsMechanicMask() & mechanic_immune)
continue;
- if (auraInfo->GetSchoolMask() & school_immune)
+ if (auraInfo->GetSchoolMask() & school_immune && !(auraInfo->AttributesEx & SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE))
continue;
if (auraInfo->GetDispelMask() & dispel_immune)
continue;
@@ -5792,7 +5795,7 @@ SpellCastResult Spell::CheckPower()
// Check valid power type
if (m_spellInfo->PowerType >= MAX_POWERS)
{
- sLog->outError("Spell::CheckPower: Unknown power type '%d'", m_spellInfo->PowerType);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::CheckPower: Unknown power type '%d'", m_spellInfo->PowerType);
return SPELL_FAILED_UNKNOWN;
}
@@ -6316,7 +6319,7 @@ void Spell::Delayed() // only called in DealDamage()
else
m_timer += delaytime;
- sLog->outDetail("Spell %u partially interrupted for (%d) ms at damage", m_spellInfo->Id, delaytime);
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Spell %u partially interrupted for (%d) ms at damage", m_spellInfo->Id, delaytime);
WorldPacket data(SMSG_SPELL_DELAYED, 8+4);
data.append(m_caster->GetPackGUID());
@@ -6532,7 +6535,7 @@ SpellEvent::~SpellEvent()
}
else
{
- sLog->outError("~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
(m_Spell->GetCaster()->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), m_Spell->GetCaster()->GetGUIDLow(), m_Spell->m_spellInfo->Id);
ASSERT(false);
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 9c0c3423827..8b620e1e9ea 100755..100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -476,20 +476,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
}
case SPELLFAMILY_PRIEST:
{
- // Shadow Word: Death - deals damage equal to damage done to caster
- if (m_spellInfo->SpellFamilyFlags[1] & 0x2)
- {
- int32 back_damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE);
- back_damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE);
- // Pain and Suffering reduces damage
- if (AuraEffect* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0))
- AddPctN(back_damage, -aurEff->GetAmount());
-
- if (back_damage < int32(unitTarget->GetHealth()))
- m_caster->CastCustomSpell(m_caster, 32409, &back_damage, 0, 0, true);
- }
// Improved Mind Blast (Mind Blast in shadow form bonus)
- else if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
+ if (m_caster->GetShapeshiftForm() == FORM_SHADOW && (m_spellInfo->SpellFamilyFlags[0] & 0x00002000))
{
Unit::AuraEffectList const& ImprMindBlast = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_FLAT_MODIFIER);
for (Unit::AuraEffectList::const_iterator i = ImprMindBlast.begin(); i != ImprMindBlast.end(); ++i)
@@ -789,7 +777,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
if (!spellInfo)
{
- sLog->outError("EffectDummy of spell %u: triggering unknown spell id %i\n", m_spellInfo->Id, spell_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectDummy of spell %u: triggering unknown spell id %i\n", m_spellInfo->Id, spell_id);
return;
}
@@ -1047,7 +1035,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex)
if (!spellInfo)
{
- sLog->outError("Spell::EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
return;
}
@@ -1092,7 +1080,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex)
if (!spellInfo)
{
- sLog->outError("EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id);
return;
}
@@ -1201,7 +1189,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
// If not exist data for dest location - return
if (!m_targets.HasDst())
{
- sLog->outError("Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id);
return;
}
@@ -1527,7 +1515,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
if (!targetAura)
{
- sLog->outError("Target(GUID:" UI64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Target(GUID:" UI64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID());
return;
}
@@ -2002,7 +1990,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
// Players shouldn't be able to loot gameobjects that are currently despawned
if (!gameObjTarget->isSpawned() && !player->isGameMaster())
{
- sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!",
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!",
player->GetName(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow());
return;
}
@@ -2300,7 +2288,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->Effects[effIndex].MiscValueB);
if (!properties)
{
- sLog->outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->Effects[effIndex].MiscValueB);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectSummonType: Unhandled summon type %u", m_spellInfo->Effects[effIndex].MiscValueB);
return;
}
@@ -2445,12 +2433,13 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
return;
// The spell that this effect will trigger. It has SPELL_AURA_CONTROL_VEHICLE
- uint32 spell = VEHICLE_SPELL_RIDE_HARDCODED;
- if (SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(m_spellInfo->Effects[effIndex].CalcValue()))
- spell = spellProto->Id;
+ uint32 spellId = VEHICLE_SPELL_RIDE_HARDCODED;
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spellInfo->Effects[effIndex].CalcValue());
+ if (spellInfo && spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE))
+ spellId = spellInfo->Id;
// Hard coded enter vehicle spell
- m_originalCaster->CastSpell(summon, spell, true);
+ m_originalCaster->CastSpell(summon, spellId, true);
uint32 faction = properties->Faction;
if (!faction)
@@ -2861,7 +2850,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
}
if (!add_socket)
{
- sLog->outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.",
m_spellInfo->Id, SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC, ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET);
return;
}
@@ -2909,14 +2898,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
if (!enchant_id)
{
- sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex);
return;
}
SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if (!pEnchant)
{
- sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id);
return;
}
@@ -3542,8 +3531,8 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex)
{
if (m_originalCaster)
{
- int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo), false, 1 << effIndex);
- unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), duration/*GetSpellDuration(m_spellInfo)*/);
+ int32 duration = m_spellInfo->GetDuration();
+ unitTarget->ProhibitSpellSchool(curSpellInfo->GetSchoolMask(), unitTarget->ModSpellDuration(m_spellInfo, unitTarget, duration, false, 1 << effIndex));
}
ExecuteLogEffectInterruptCast(effIndex, unitTarget, curSpellInfo->Id);
unitTarget->InterruptSpell(CurrentSpellTypes(i), false);
@@ -4165,7 +4154,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 31893: spell_heal = 48084; break;
case 31883: spell_heal = 48085; break;
default:
- sLog->outError("Unknown Lightwell spell caster %u", m_caster->GetEntry());
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unknown Lightwell spell caster %u", m_caster->GetEntry());
return;
}
@@ -4282,7 +4271,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 57774: spellId1 = 20185; break; // Judgement of Light
case 53408: spellId1 = 20186; break; // Judgement of Wisdom
default:
- sLog->outError("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect", m_spellInfo->Id);
return;
}
// all seals have aura dummy in 2 effect
@@ -4555,7 +4544,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
Player* target = (Player*)m_caster;
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck");
- sLog->outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", target->GetName(), target->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
if (target->isInFlight())
return;
@@ -4745,16 +4734,18 @@ void Spell::EffectInebriate(SpellEffIndex /*effIndex*/)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- Player* player = (Player*)unitTarget;
- uint16 currentDrunk = player->GetDrunkValue();
- uint16 drunkMod = damage * 256;
- if (currentDrunk + drunkMod > 0xFFFF)
+ Player* player = unitTarget->ToPlayer();
+ uint8 currentDrunk = player->GetDrunkValue();
+ uint8 drunkMod = damage;
+ if (currentDrunk + drunkMod > 100)
{
- currentDrunk = 0xFFFF;
- player->CastSpell(player, 67468, false);
+ currentDrunk = 100;
+ if (rand_chance() < 25.0f)
+ player->CastSpell(player, 67468, false); // Drunken Vomit
}
else
currentDrunk += drunkMod;
+
player->SetDrunkValue(currentDrunk, m_CastItem ? m_CastItem->GetEntry() : 0);
}
@@ -5167,6 +5158,10 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
if (creatureTarget->isWorldBoss() || creatureTarget->IsDungeonBoss())
return;
+ // Spells with SPELL_EFFECT_KNOCK_BACK(like Thunderstorm) can't knoback target if target has ROOT/STUN
+ if (unitTarget->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
+ return;
+
// Typhoon
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x01000000)
{
@@ -5473,7 +5468,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
if (!goinfo)
{
- sLog->outErrorDb("Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast", name_id, m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SQL, "Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast", name_id, m_spellInfo->Id);
return;
}
@@ -5577,7 +5572,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
ExecuteLogEffectSummonObject(effIndex, pGameObj);
- sLog->outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted");
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AddObject at SpellEfects.cpp EffectTransmitted");
//m_caster->AddGameObject(pGameObj);
//m_ObjToDel.push_back(pGameObj);
@@ -6120,7 +6115,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex)
if (!sSoundEntriesStore.LookupEntry(soundid))
{
- sLog->outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
return;
}
@@ -6171,7 +6166,7 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex)
if (!sSoundEntriesStore.LookupEntry(soundid))
{
- sLog->outError("EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id);
return;
}
@@ -6281,7 +6276,7 @@ void Spell::EffectBind(SpellEffIndex effIndex)
SpellTargetPosition const* st = sSpellMgr->GetSpellTargetPosition(m_spellInfo->Id);
if (!st)
{
- sLog->outError("Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id);
return;
}
@@ -6309,11 +6304,11 @@ void Spell::EffectBind(SpellEffIndex effIndex)
data << uint32(area_id);
player->SendDirectMessage(&data);
- sLog->outStaticDebug("New homebind X : %f", loc.m_positionX);
- sLog->outStaticDebug("New homebind Y : %f", loc.m_positionY);
- sLog->outStaticDebug("New homebind Z : %f", loc.m_positionZ);
- sLog->outStaticDebug("New homebind MapId : %u", loc.m_mapId);
- sLog->outStaticDebug("New homebind AreaId : %u", area_id);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind X : %f", loc.m_positionX);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Y : %f", loc.m_positionY);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind Z : %f", loc.m_positionZ);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind MapId : %u", loc.m_mapId);
+ sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "New homebind AreaId : %u", area_id);
// zone update
data.Initialize(SMSG_PLAYERBOUND, 8+4);
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index bb4815d5fc1..e2c17dfe28a 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1337,7 +1337,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form);
if (!shapeInfo)
{
- sLog->outError("GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form);
return SPELL_CAST_OK;
}
actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells
@@ -2092,7 +2092,7 @@ uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask)
// Else drain all power
if (PowerType < MAX_POWERS)
return caster->GetPower(Powers(PowerType));
- sLog->outError("SpellInfo::CalcPowerCost: Unknown power type '%d' in spell %d", PowerType, Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "SpellInfo::CalcPowerCost: Unknown power type '%d' in spell %d", PowerType, Id);
return 0;
}
@@ -2120,7 +2120,7 @@ uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask)
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Not implemented yet!");
break;
default:
- sLog->outError("CalculateManaCost: Unknown power type '%d' in spell %d", PowerType, Id);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Unknown power type '%d' in spell %d", PowerType, Id);
return 0;
}
}
@@ -2279,14 +2279,15 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
case SPELLFAMILY_GENERIC:
switch (Id)
{
+ case 29214: // Wrath of the Plaguebringer
case 34700: // Allergic Reaction
+ case 54836: // Wrath of the Plaguebringer
case 61987: // Avenging Wrath Marker
case 61988: // Divine Shield exclude aura
- case 62532: // Conservator's Grip
return false;
+ case 30877: // Tag Murloc
case 61716: // Rabbit Costume
case 61734: // Noblegarden Bunny
- case 30877: // Tag Murloc
case 62344: // Fists of Stone
return true;
default:
@@ -2372,6 +2373,8 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
case SPELL_EFFECT_HEAL_PCT:
case SPELL_EFFECT_ENERGIZE_PCT:
return true;
+ case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
+ return false;
// non-positive aura use
case SPELL_EFFECT_APPLY_AURA:
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 439b0c91324..e887f8caa22 100755..100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -370,7 +370,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Craft spell %u not have create item entry.", spellInfo->Id);
else
- sLog->outErrorDb("Craft spell %u not have create item entry.", spellInfo->Id);
+ sLog->outError(LOG_FILTER_SQL, "Craft spell %u not have create item entry.", spellInfo->Id);
}
return false;
}
@@ -384,7 +384,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
else
- sLog->outErrorDb("Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
+ sLog->outError(LOG_FILTER_SQL, "Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Effects[i].ItemType);
}
return false;
}
@@ -402,7 +402,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Spell %u learn to broken spell %u, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
else
- sLog->outErrorDb("Spell %u learn to invalid spell %u, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u learn to invalid spell %u, and then...", spellInfo->Id, spellInfo->Effects[i].TriggerSpell);
}
return false;
}
@@ -422,7 +422,7 @@ bool SpellMgr::IsSpellValid(SpellInfo const* spellInfo, Player* player, bool msg
if (player)
ChatHandler(player).PSendSysMessage("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
else
- sLog->outErrorDb("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
+ sLog->outError(LOG_FILTER_SQL, "Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]);
}
return false;
}
@@ -454,7 +454,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
uint32 mode = uint32(caster->GetMap()->GetSpawnMode());
if (mode >= MAX_DIFFICULTY)
{
- sLog->outError("SpellMgr::GetSpellIdForDifficulty: Incorrect Difficulty for spell %u.", spellId);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: Incorrect Difficulty for spell %u.", spellId);
return spellId; //return source spell
}
@@ -477,7 +477,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con
if (difficultyEntry->SpellID[mode] <= 0)
{
- sLog->outErrorDb("SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spellId, mode);
+ sLog->outError(LOG_FILTER_SQL, "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spellId, mode);
return spellId;
}
@@ -1155,8 +1155,8 @@ void SpellMgr::LoadSpellRanks()
if (!result)
{
- sLog->outString(">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
+
return;
}
@@ -1195,13 +1195,13 @@ void SpellMgr::LoadSpellRanks()
SpellInfo const* first = GetSpellInfo(lastSpell);
if (!first)
{
- sLog->outErrorDb("Spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell);
continue;
}
// check if chain is long enough
if (rankChain.size() < 2)
{
- sLog->outErrorDb("There is only 1 spell rank for identifier(first_spell_id) %u in `spell_ranks`, entry is not needed!", lastSpell);
+ sLog->outError(LOG_FILTER_SQL, "There is only 1 spell rank for identifier(first_spell_id) %u in `spell_ranks`, entry is not needed!", lastSpell);
continue;
}
int32 curRank = 0;
@@ -1212,14 +1212,14 @@ void SpellMgr::LoadSpellRanks()
SpellInfo const* spell = GetSpellInfo(itr->first);
if (!spell)
{
- sLog->outErrorDb("Spell %u (rank %u) listed in `spell_ranks` for chain %u does not exist!", itr->first, itr->second, lastSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u (rank %u) listed in `spell_ranks` for chain %u does not exist!", itr->first, itr->second, lastSpell);
valid = false;
break;
}
++curRank;
if (itr->second != curRank)
{
- sLog->outErrorDb("Spell %u (rank %u) listed in `spell_ranks` for chain %u does not have proper rank value(should be %u)!", itr->first, itr->second, lastSpell, curRank);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u (rank %u) listed in `spell_ranks` for chain %u does not have proper rank value(should be %u)!", itr->first, itr->second, lastSpell, curRank);
valid = false;
break;
}
@@ -1251,8 +1251,8 @@ void SpellMgr::LoadSpellRanks()
while (true);
} while (!finished);
- sLog->outString(">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellRequired()
@@ -1267,8 +1267,8 @@ void SpellMgr::LoadSpellRequired()
if (!result)
{
- sLog->outString(">> Loaded 0 spell required records. DB table `spell_required` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell required records. DB table `spell_required` is empty.");
+
return;
}
@@ -1284,26 +1284,26 @@ void SpellMgr::LoadSpellRequired()
SpellInfo const* spell = GetSpellInfo(spell_id);
if (!spell)
{
- sLog->outErrorDb("spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id);
+ sLog->outError(LOG_FILTER_SQL, "spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id);
continue;
}
SpellInfo const* req_spell = GetSpellInfo(spell_req);
if (!req_spell)
{
- sLog->outErrorDb("req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req);
+ sLog->outError(LOG_FILTER_SQL, "req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req);
continue;
}
if (GetFirstSpellInChain(spell_id) == GetFirstSpellInChain(spell_req))
{
- sLog->outErrorDb("req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id);
+ sLog->outError(LOG_FILTER_SQL, "req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id);
continue;
}
if (IsSpellRequiringSpell(spell_id, spell_req))
{
- sLog->outErrorDb("duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id);
+ sLog->outError(LOG_FILTER_SQL, "duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id);
continue;
}
@@ -1312,8 +1312,8 @@ void SpellMgr::LoadSpellRequired()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellLearnSkills()
@@ -1350,8 +1350,8 @@ void SpellMgr::LoadSpellLearnSkills()
}
}
- sLog->outString(">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellLearnSpells()
@@ -1364,8 +1364,8 @@ void SpellMgr::LoadSpellLearnSpells()
QueryResult result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
if (!result)
{
- sLog->outString(">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty.");
+
return;
}
@@ -1383,19 +1383,19 @@ void SpellMgr::LoadSpellLearnSpells()
if (!GetSpellInfo(spell_id))
{
- sLog->outErrorDb("Spell %u listed in `spell_learn_spell` does not exist", spell_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_learn_spell` does not exist", spell_id);
continue;
}
if (!GetSpellInfo(node.spell))
{
- sLog->outErrorDb("Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.spell);
continue;
}
if (GetTalentSpellCost(node.spell))
{
- sLog->outErrorDb("Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.spell);
continue;
}
@@ -1437,7 +1437,7 @@ void SpellMgr::LoadSpellLearnSpells()
{
if (itr->second.spell == dbc_node.spell)
{
- sLog->outErrorDb("Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.",
+ sLog->outError(LOG_FILTER_SQL, "Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.",
spell, dbc_node.spell);
found = true;
break;
@@ -1453,8 +1453,8 @@ void SpellMgr::LoadSpellLearnSpells()
}
}
- sLog->outString(">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellTargetPositions()
@@ -1467,8 +1467,8 @@ void SpellMgr::LoadSpellTargetPositions()
QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position");
if (!result)
{
- sLog->outString(">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
+
return;
}
@@ -1490,20 +1490,20 @@ void SpellMgr::LoadSpellTargetPositions()
MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId);
if (!mapEntry)
{
- sLog->outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Spell_ID, st.target_mapId);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Spell_ID, st.target_mapId);
continue;
}
if (st.target_X==0 && st.target_Y==0 && st.target_Z==0)
{
- sLog->outErrorDb("Spell (ID:%u) target coordinates not provided.", Spell_ID);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID:%u) target coordinates not provided.", Spell_ID);
continue;
}
SpellInfo const* spellInfo = GetSpellInfo(Spell_ID);
if (!spellInfo)
{
- sLog->outErrorDb("Spell (ID:%u) listed in `spell_target_position` does not exist.", Spell_ID);
+ sLog->outError(LOG_FILTER_SQL, "Spell (ID:%u) listed in `spell_target_position` does not exist.", Spell_ID);
continue;
}
@@ -1518,7 +1518,7 @@ void SpellMgr::LoadSpellTargetPositions()
uint32 area_id = sMapMgr->GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z);
if (area_id != uint32(spellInfo->Effects[i].MiscValue))
{
- sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.", Spell_ID, spellInfo->Effects[i].MiscValue, area_id);
+ sLog->outError(LOG_FILTER_SQL, "Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.", Spell_ID, spellInfo->Effects[i].MiscValue, area_id);
break;
}
}
@@ -1529,7 +1529,7 @@ void SpellMgr::LoadSpellTargetPositions()
}
if (!found)
{
- sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", Spell_ID);
+ sLog->outError(LOG_FILTER_SQL, "Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", Spell_ID);
continue;
}
@@ -1573,8 +1573,8 @@ void SpellMgr::LoadSpellTargetPositions()
}
}*/
- sLog->outString(">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellGroups()
@@ -1588,8 +1588,8 @@ void SpellMgr::LoadSpellGroups()
QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
if (!result)
{
- sLog->outString(">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
+
return;
}
@@ -1602,7 +1602,7 @@ void SpellMgr::LoadSpellGroups()
uint32 group_id = fields[0].GetUInt32();
if (group_id <= SPELL_GROUP_DB_RANGE_MIN && group_id >= SPELL_GROUP_CORE_RANGE_MAX)
{
- sLog->outErrorDb("SpellGroup id %u listed in `spell_group` is in core range, but is not defined in core!", group_id);
+ sLog->outError(LOG_FILTER_SQL, "SpellGroup id %u listed in `spell_group` is in core range, but is not defined in core!", group_id);
continue;
}
int32 spell_id = fields[1].GetInt32();
@@ -1618,7 +1618,7 @@ void SpellMgr::LoadSpellGroups()
{
if (groups.find(abs(itr->second)) == groups.end())
{
- sLog->outErrorDb("SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second));
+ sLog->outError(LOG_FILTER_SQL, "SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second));
mSpellGroupSpell.erase(itr++);
}
else
@@ -1630,12 +1630,12 @@ void SpellMgr::LoadSpellGroups()
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_group` does not exist", itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_group` does not exist", itr->second);
mSpellGroupSpell.erase(itr++);
}
else if (spellInfo->GetRank() > 1)
{
- sLog->outErrorDb("Spell %u listed in `spell_group` is not first rank of spell", itr->second);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_group` is not first rank of spell", itr->second);
mSpellGroupSpell.erase(itr++);
}
else
@@ -1655,8 +1655,8 @@ void SpellMgr::LoadSpellGroups()
}
}
- sLog->outString(">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellGroupStackRules()
@@ -1669,8 +1669,8 @@ void SpellMgr::LoadSpellGroupStackRules()
QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
if (!result)
{
- sLog->outString(">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
+
return;
}
@@ -1683,7 +1683,7 @@ void SpellMgr::LoadSpellGroupStackRules()
uint8 stack_rule = fields[1].GetInt8();
if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX)
{
- sLog->outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
+ sLog->outError(LOG_FILTER_SQL, "SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
continue;
}
@@ -1691,7 +1691,7 @@ void SpellMgr::LoadSpellGroupStackRules()
if (spellGroup.first == spellGroup.second)
{
- sLog->outErrorDb("SpellGroup id %u listed in `spell_group_stack_rules` does not exist", group_id);
+ sLog->outError(LOG_FILTER_SQL, "SpellGroup id %u listed in `spell_group_stack_rules` does not exist", group_id);
continue;
}
@@ -1700,8 +1700,8 @@ void SpellMgr::LoadSpellGroupStackRules()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellProcEvents()
@@ -1714,8 +1714,8 @@ void SpellMgr::LoadSpellProcEvents()
QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
if (!result)
{
- sLog->outString(">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
+
return;
}
@@ -1730,7 +1730,7 @@ void SpellMgr::LoadSpellProcEvents()
SpellInfo const* spell = GetSpellInfo(entry);
if (!spell)
{
- sLog->outErrorDb("Spell %u listed in `spell_proc_event` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` does not exist", entry);
continue;
}
@@ -1753,7 +1753,7 @@ void SpellMgr::LoadSpellProcEvents()
{
if (spe.procFlags == 0)
{
- sLog->outErrorDb("Spell %u listed in `spell_proc_event` probally not triggered spell", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` probally not triggered spell", entry);
continue;
}
customProc++;
@@ -1762,10 +1762,10 @@ void SpellMgr::LoadSpellProcEvents()
} while (result->NextRow());
if (customProc)
- sLog->outString(">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime));
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime));
else
- sLog->outString(">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellProcs()
@@ -1778,8 +1778,8 @@ void SpellMgr::LoadSpellProcs()
QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
if (!result)
{
- sLog->outString(">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
+
return;
}
@@ -1800,7 +1800,7 @@ void SpellMgr::LoadSpellProcs()
SpellInfo const* spellEntry = GetSpellInfo(spellId);
if (!spellEntry)
{
- sLog->outErrorDb("Spell %u listed in `spell_proc` does not exist", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` does not exist", spellId);
continue;
}
@@ -1808,7 +1808,7 @@ void SpellMgr::LoadSpellProcs()
{
if (GetFirstSpellInChain(spellId) != uint32(spellId))
{
- sLog->outErrorDb("Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32());
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32());
continue;
}
}
@@ -1835,7 +1835,7 @@ void SpellMgr::LoadSpellProcs()
{
if (mSpellProcMap.find(spellId) != mSpellProcMap.end())
{
- sLog->outErrorDb("Spell %u listed in `spell_proc` has duplicate entry in the table", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellId);
break;
}
SpellProcEntry procEntry = SpellProcEntry(baseProcEntry);
@@ -1850,47 +1850,47 @@ void SpellMgr::LoadSpellProcs()
// validate data
if (procEntry.schoolMask & ~SPELL_SCHOOL_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask);
if (procEntry.spellFamilyName && (procEntry.spellFamilyName < 3 || procEntry.spellFamilyName > 17 || procEntry.spellFamilyName == 14 || procEntry.spellFamilyName == 16))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName);
if (procEntry.chance < 0)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId);
procEntry.chance = 0;
}
if (procEntry.ratePerMinute < 0)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId);
procEntry.ratePerMinute = 0;
}
if (cooldown < 0)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId);
procEntry.cooldown = 0;
}
if (procEntry.chance == 0 && procEntry.ratePerMinute == 0)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId);
if (procEntry.charges > 99)
{
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId);
procEntry.charges = 99;
}
if (!procEntry.typeMask)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId);
if (procEntry.spellTypeMask & ~PROC_SPELL_PHASE_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask);
if (procEntry.spellTypeMask && !(procEntry.typeMask & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK)))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId);
if (!procEntry.spellPhaseMask && procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId);
if (procEntry.spellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask);
if (procEntry.spellPhaseMask && !(procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId);
if (procEntry.hitMask & ~PROC_HIT_MASK_ALL)
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask);
if (procEntry.hitMask && !(procEntry.typeMask & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.typeMask & DONE_HIT_PROC_FLAG_MASK && (!procEntry.spellPhaseMask || procEntry.spellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH)))))
- sLog->outErrorDb("`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId);
mSpellProcMap[spellId] = procEntry;
@@ -1905,8 +1905,8 @@ void SpellMgr::LoadSpellProcs()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellBonusess()
@@ -1919,8 +1919,8 @@ void SpellMgr::LoadSpellBonusess()
QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
if (!result)
{
- sLog->outString(">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
+
return;
}
@@ -1933,7 +1933,7 @@ void SpellMgr::LoadSpellBonusess()
SpellInfo const* spell = GetSpellInfo(entry);
if (!spell)
{
- sLog->outErrorDb("Spell %u listed in `spell_bonus_data` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_bonus_data` does not exist", entry);
continue;
}
@@ -1946,8 +1946,8 @@ void SpellMgr::LoadSpellBonusess()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellThreats()
@@ -1960,8 +1960,8 @@ void SpellMgr::LoadSpellThreats()
QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat");
if (!result)
{
- sLog->outString(">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
+
return;
}
@@ -1974,7 +1974,7 @@ void SpellMgr::LoadSpellThreats()
if (!GetSpellInfo(entry))
{
- sLog->outErrorDb("Spell %u listed in `spell_threat` does not exist", entry);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_threat` does not exist", entry);
continue;
}
@@ -1987,8 +1987,8 @@ void SpellMgr::LoadSpellThreats()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSkillLineAbilityMap()
@@ -2009,8 +2009,8 @@ void SpellMgr::LoadSkillLineAbilityMap()
++count;
}
- sLog->outString(">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellPetAuras()
@@ -2023,8 +2023,8 @@ void SpellMgr::LoadSpellPetAuras()
QueryResult result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
if (!result)
{
- sLog->outString(">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
+
return;
}
@@ -2046,21 +2046,21 @@ void SpellMgr::LoadSpellPetAuras()
SpellInfo const* spellInfo = GetSpellInfo(spell);
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_pet_auras` does not exist", spell);
continue;
}
if (spellInfo->Effects[eff].Effect != SPELL_EFFECT_DUMMY &&
(spellInfo->Effects[eff].Effect != SPELL_EFFECT_APPLY_AURA ||
spellInfo->Effects[eff].ApplyAuraName != SPELL_AURA_DUMMY))
{
- sLog->outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
+ sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
continue;
}
SpellInfo const* spellInfo2 = GetSpellInfo(aura);
if (!spellInfo2)
{
- sLog->outErrorDb("Aura %u listed in `spell_pet_auras` does not exist", aura);
+ sLog->outError(LOG_FILTER_SQL, "Aura %u listed in `spell_pet_auras` does not exist", aura);
continue;
}
@@ -2071,8 +2071,8 @@ void SpellMgr::LoadSpellPetAuras()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
// Fill custom data about enchancments
@@ -2112,8 +2112,8 @@ void SpellMgr::LoadEnchantCustomAttr()
}
}
- sLog->outString(">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellEnchantProcData()
@@ -2126,8 +2126,8 @@ void SpellMgr::LoadSpellEnchantProcData()
QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
if (!result)
{
- sLog->outString(">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
+
return;
}
@@ -2141,7 +2141,7 @@ void SpellMgr::LoadSpellEnchantProcData()
SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchantId);
if (!ench)
{
- sLog->outErrorDb("Enchancment %u listed in `spell_enchant_proc_data` does not exist", enchantId);
+ sLog->outError(LOG_FILTER_SQL, "Enchancment %u listed in `spell_enchant_proc_data` does not exist", enchantId);
continue;
}
@@ -2156,8 +2156,8 @@ void SpellMgr::LoadSpellEnchantProcData()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellLinked()
@@ -2170,8 +2170,8 @@ void SpellMgr::LoadSpellLinked()
QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
if (!result)
{
- sLog->outString(">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
+
return;
}
@@ -2187,13 +2187,13 @@ void SpellMgr::LoadSpellLinked()
SpellInfo const* spellInfo = GetSpellInfo(abs(trigger));
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(trigger));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_linked_spell` does not exist", abs(trigger));
continue;
}
spellInfo = GetSpellInfo(abs(effect));
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(effect));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_linked_spell` does not exist", abs(effect));
continue;
}
@@ -2209,8 +2209,8 @@ void SpellMgr::LoadSpellLinked()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadPetLevelupSpellMap()
@@ -2266,8 +2266,8 @@ void SpellMgr::LoadPetLevelupSpellMap()
}
}
- sLog->outString(">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime));
+
}
bool LoadPetDefaultSpells_helper(CreatureTemplate const* cInfo, PetDefaultSpellsEntry& petDefSpells)
@@ -2351,10 +2351,10 @@ void SpellMgr::LoadPetDefaultSpells()
}
}
- sLog->outString(">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime));
+
- sLog->outString("Loading summonable creature templates...");
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Loading summonable creature templates...");
oldMSTime = getMSTime();
// different summon spells
@@ -2395,8 +2395,8 @@ void SpellMgr::LoadPetDefaultSpells()
}
}
- sLog->outString(">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellAreas()
@@ -2414,8 +2414,8 @@ void SpellMgr::LoadSpellAreas()
if (!result)
{
- sLog->outString(">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
+
return;
}
@@ -2443,7 +2443,7 @@ void SpellMgr::LoadSpellAreas()
}
else
{
- sLog->outErrorDb("Spell %u listed in `spell_area` does not exist", spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` does not exist", spell);
continue;
}
@@ -2472,20 +2472,20 @@ void SpellMgr::LoadSpellAreas()
if (!ok)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` already listed with similar requirements.", spell);
continue;
}
}
if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId))
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.areaId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.areaId);
continue;
}
if (spellArea.questStart && !sObjectMgr->GetQuestTemplate(spellArea.questStart))
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell, spellArea.questStart);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell, spellArea.questStart);
continue;
}
@@ -2493,13 +2493,13 @@ void SpellMgr::LoadSpellAreas()
{
if (!sObjectMgr->GetQuestTemplate(spellArea.questEnd))
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd);
continue;
}
if (spellArea.questEnd == spellArea.questStart && !spellArea.questStartCanActive)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell, spellArea.questEnd);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell, spellArea.questEnd);
continue;
}
}
@@ -2509,13 +2509,13 @@ void SpellMgr::LoadSpellAreas()
SpellInfo const* spellInfo = GetSpellInfo(abs(spellArea.auraSpell));
if (!spellInfo)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell, abs(spellArea.auraSpell));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell, abs(spellArea.auraSpell));
continue;
}
if (uint32(abs(spellArea.auraSpell)) == spellArea.spellId)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell));
continue;
}
@@ -2535,7 +2535,7 @@ void SpellMgr::LoadSpellAreas()
if (chain)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
continue;
}
@@ -2551,7 +2551,7 @@ void SpellMgr::LoadSpellAreas()
if (chain)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell);
continue;
}
}
@@ -2559,13 +2559,13 @@ void SpellMgr::LoadSpellAreas()
if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE) == 0)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell, spellArea.raceMask);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell, spellArea.raceMask);
continue;
}
if (spellArea.gender != GENDER_NONE && spellArea.gender != GENDER_FEMALE && spellArea.gender != GENDER_MALE)
{
- sLog->outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.gender);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.gender);
continue;
}
@@ -2595,8 +2595,8 @@ void SpellMgr::LoadSpellAreas()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadSpellInfoStore()
@@ -2612,8 +2612,8 @@ void SpellMgr::LoadSpellInfoStore()
mSpellInfoMap[i] = new SpellInfo(spellEntry);
}
- sLog->outString(">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::UnloadSpellInfoStore()
@@ -2925,8 +2925,8 @@ void SpellMgr::LoadSpellCustomAttr()
CreatureAI::FillAISpellInfo();
- sLog->outString(">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void SpellMgr::LoadDbcDataCorrections()
@@ -3241,10 +3241,6 @@ void SpellMgr::LoadDbcDataCorrections()
// this needs research on modifier applying rules, does not seem to be in Attributes fields
spellInfo->EffectSpellClassMask[0] = flag96(0x00000040, 0x00000000, 0x00000000);
break;
- case 63163: // Apply Enchanted Bridle (Argent Tournament)
- spellInfo->EffectDieSides[0] = 0; // was 1, that should probably mean seat 0, but instead it's treated as spell 1
- spellInfo->EffectBasePoints[0] = 52391; // Ride Vehicle (forces seat 0)
- break;
case 45602: // Ride Carpet
spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)"
break;
@@ -3569,6 +3565,5 @@ void SpellMgr::LoadDbcDataCorrections()
properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647)); // 52893
properties->Type = SUMMON_TYPE_TOTEM;
*/
- sLog->outString(">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index d0ae6fe3098..1399934efeb 100755
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -25,7 +25,7 @@ bool _SpellScript::_Validate(SpellInfo const* entry)
{
if (!Validate(entry))
{
- sLog->outError("TSCR: Spell `%u` did not pass Validate() function of script `%s` - script will be not added to the spell", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` did not pass Validate() function of script `%s` - script will be not added to the spell", entry->Id, m_scriptName->c_str());
return false;
}
return true;
@@ -247,10 +247,14 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff
return !area;
case TARGET_REFERENCE_TYPE_TARGET: // BOTH
return true;
+ default:
+ break;
}
break;
}
break;
+ default:
+ break;
}
return false;
@@ -282,27 +286,27 @@ bool SpellScript::_Validate(SpellInfo const* entry)
{
for (std::list<EffectHandler>::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectHandler>::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectHandler>::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectHandler>::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<ObjectAreaTargetSelectHandler>::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<ObjectTargetSelectHandler>::iterator itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
return _SpellScript::_Validate(entry);
}
@@ -410,7 +414,7 @@ Unit* SpellScript::GetHitUnit()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->unitTarget;
@@ -420,7 +424,7 @@ Creature* SpellScript::GetHitCreature()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
if (m_spell->unitTarget)
@@ -433,7 +437,7 @@ Player* SpellScript::GetHitPlayer()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
if (m_spell->unitTarget)
@@ -446,7 +450,7 @@ Item* SpellScript::GetHitItem()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->itemTarget;
@@ -456,7 +460,7 @@ GameObject* SpellScript::GetHitGObj()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->gameObjTarget;
@@ -466,7 +470,7 @@ WorldLocation* SpellScript::GetHitDest()
{
if (!IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
return m_spell->destTarget;
@@ -476,7 +480,7 @@ int32 SpellScript::GetHitDamage()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return 0;
}
return m_spell->m_damage;
@@ -486,7 +490,7 @@ void SpellScript::SetHitDamage(int32 damage)
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_spell->m_damage = damage;
@@ -496,7 +500,7 @@ int32 SpellScript::GetHitHeal()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return 0;
}
return m_spell->m_healing;
@@ -506,7 +510,7 @@ void SpellScript::SetHitHeal(int32 heal)
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_spell->m_healing = heal;
@@ -516,7 +520,7 @@ Aura* SpellScript::GetHitAura()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return NULL;
}
if (!m_spell->m_spellAura)
@@ -530,7 +534,7 @@ void SpellScript::PreventHitAura()
{
if (!IsInTargetHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
if (m_spell->m_spellAura)
@@ -541,7 +545,7 @@ void SpellScript::PreventHitEffect(SpellEffIndex effIndex)
{
if (!IsInHitPhase() && !IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_hitPreventEffectMask |= 1 << effIndex;
@@ -552,7 +556,7 @@ void SpellScript::PreventHitDefaultEffect(SpellEffIndex effIndex)
{
if (!IsInHitPhase() && !IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
m_hitPreventDefaultEffectMask |= 1 << effIndex;
@@ -562,7 +566,7 @@ int32 SpellScript::GetEffectValue()
{
if (!IsInEffectHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId);
return 0;
}
return m_spell->damage;
@@ -593,7 +597,7 @@ void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result)
{
if (!IsInCheckCastHook())
{
- sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId);
return;
}
@@ -609,67 +613,67 @@ bool AuraScript::_Validate(SpellInfo const* entry)
{
for (std::list<CheckAreaTargetHandler>::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr)
if (!entry->HasAreaAuraEffect())
- sLog->outError("TSCR: Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
for (std::list<AuraDispelHandler>::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
- sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
for (std::list<AuraDispelHandler>::iterator itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
- sLog->outError("TSCR: Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectApplyHandler>::iterator itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectPeriodicHandler>::iterator itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectUpdatePeriodicHandler>::iterator itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectCalcAmountHandler>::iterator itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectCalcPeriodicHandler>::iterator itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectCalcSpellModHandler>::iterator itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectAbsorbHandler>::iterator itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectAbsorbHandler>::iterator itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectManaShieldHandler>::iterator itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
for (std::list<EffectManaShieldHandler>::iterator itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
- sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
+ sLog->outError(LOG_FILTER_TSCR, "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
return _SpellScript::_Validate(entry);
}
@@ -851,7 +855,7 @@ void AuraScript::PreventDefaultAction()
m_defaultActionPrevented = true;
break;
default:
- sLog->outError("TSCR: Script: `%s` Spell: `%u` AuraScript::PreventDefaultAction called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u` AuraScript::PreventDefaultAction called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
break;
}
}
@@ -1031,7 +1035,7 @@ Unit* AuraScript::GetTarget() const
case AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD:
return m_auraApplication->GetTarget();
default:
- sLog->outError("TSCR: Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
+ sLog->outError(LOG_FILTER_TSCR, "Script: `%s` Spell: `%u` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId);
}
return NULL;
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 2f79eaff06a..f64043b7038 100755
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -77,8 +77,8 @@ void CreatureTextMgr::LoadCreatureTexts()
if (!result)
{
- sLog->outString(">> Loaded 0 ceature texts. DB table `creature_texts` is empty.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 ceature texts. DB table `creature_texts` is empty.");
+
return;
}
@@ -104,25 +104,25 @@ void CreatureTextMgr::LoadCreatureTexts()
if (temp.sound)
{
if (!sSoundEntriesStore.LookupEntry(temp.sound)){
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound);
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound);
temp.sound = 0;
}
}
if (!GetLanguageDescByID(temp.lang))
{
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang));
temp.lang = LANG_UNIVERSAL;
}
if (temp.type >= MAX_CHAT_MSG_TYPE)
{
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type));
temp.type = CHAT_MSG_SAY;
}
if (temp.emote)
{
if (!sEmotesStore.LookupEntry(temp.emote))
{
- sLog->outErrorDb("CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote));
temp.emote = EMOTE_ONESHOT_NONE;
}
}
@@ -136,8 +136,8 @@ void CreatureTextMgr::LoadCreatureTexts()
++textCount;
} while (result->NextRow());
- sLog->outString(">> Loaded %u creature texts for %u creatures in %u ms", textCount, creatureCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature texts for %u creatures in %u ms", textCount, creatureCount, GetMSTimeDiffToNow(oldMSTime));
+
}
void CreatureTextMgr::LoadCreatureTextLocales()
@@ -166,8 +166,8 @@ void CreatureTextMgr::LoadCreatureTextLocales()
++textCount;
} while (result->NextRow());
- sLog->outString(">> Loaded %u creature localized texts in %u ms", textCount, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u creature localized texts in %u ms", textCount, GetMSTimeDiffToNow(oldMSTime));
+
}
uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid /*= 0*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, TextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/)
@@ -178,7 +178,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp
CreatureTextMap::const_iterator sList = mTextMap.find(source->GetEntry());
if (sList == mTextMap.end())
{
- sLog->outErrorDb("CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry());
return 0;
}
@@ -186,7 +186,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp
CreatureTextHolder::const_iterator itr = textHolder.find(textGroup);
if (itr == textHolder.end())
{
- sLog->outErrorDb("CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry());
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry());
return 0;
}
@@ -383,7 +383,7 @@ void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id)
if (std::find(repeats.begin(), repeats.end(), id) == repeats.end())
repeats.push_back(id);
else
- sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id));
+ sLog->outError(LOG_FILTER_SQL, "CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id));
}
CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup)
diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp
index d68bb18b9eb..fc64a4b8b52 100755
--- a/src/server/game/Tickets/TicketMgr.cpp
+++ b/src/server/game/Tickets/TicketMgr.cpp
@@ -263,8 +263,8 @@ void TicketMgr::LoadTickets()
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
- sLog->outString(">> Loaded 0 GM tickets. DB table `gm_tickets` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 GM tickets. DB table `gm_tickets` is empty!");
+
return;
}
@@ -290,8 +290,8 @@ void TicketMgr::LoadTickets()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u GM tickets in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u GM tickets in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void TicketMgr::LoadSurveys()
@@ -303,8 +303,8 @@ void TicketMgr::LoadSurveys()
if (QueryResult result = CharacterDatabase.Query("SELECT MAX(surveyId) FROM gm_surveys"))
_lastSurveyId = (*result)[0].GetUInt32();
- sLog->outString(">> Loaded GM Survey count from database in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded GM Survey count from database in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void TicketMgr::AddTicket(GmTicket* ticket)
diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
index b734d90b040..2bd9a157e73 100644
--- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp
+++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp
@@ -29,7 +29,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
if (!sWorld->getBoolConfig(CONFIG_CLEAN_CHARACTER_DB))
return;
- sLog->outString("Cleaning character database...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Cleaning character database...");
uint32 oldMSTime = getMSTime();
@@ -63,8 +63,8 @@ void CharacterDatabaseCleaner::CleanDatabase()
sWorld->SetCleaningFlags(flags);
- sLog->outString(">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
}
void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table, bool (*check)(uint32))
@@ -72,7 +72,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table
QueryResult result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table);
if (!result)
{
- sLog->outString("Table %s is empty.", table);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Table %s is empty.", table);
return;
}
diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp
index 476a19b6885..f6d0de28d28 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -320,7 +320,7 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl
case DTT_CHARACTER:
{
if (result->GetFieldCount() <= 68) // avoid crashes on next check
- sLog->outCrash("PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table.");
+ sLog->outFatal(LOG_FILTER_GENERAL, "PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table.");
if (result->Fetch()[68].GetUInt32()) // characters.deleteInfos_Account - if filled error
return false;
@@ -496,7 +496,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
std::string tn = gettablename(line);
if (tn.empty())
{
- sLog->outError("LoadPlayerDump: Can't extract table name from line: '%s'!", line.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "LoadPlayerDump: Can't extract table name from line: '%s'!", line.c_str());
ROLLBACK(DUMP_FILE_BROKEN);
}
@@ -513,7 +513,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
if (i == DUMP_TABLE_COUNT)
{
- sLog->outError("LoadPlayerDump: Unknown table: '%s'!", tn.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "LoadPlayerDump: Unknown table: '%s'!", tn.c_str());
ROLLBACK(DUMP_FILE_BROKEN);
}
@@ -662,7 +662,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
break;
}
default:
- sLog->outError("Unknown dump table type: %u", type);
+ sLog->outError(LOG_FILTER_GENERAL, "Unknown dump table type: %u", type);
break;
}
diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp
index 54e56174b1a..06f11cfaa2c 100644
--- a/src/server/game/Warden/Warden.cpp
+++ b/src/server/game/Warden/Warden.cpp
@@ -105,7 +105,7 @@ void Warden::Update()
// Kick player if client response delays more than set in config
if (_clientResponseTimer > maxClientResponseDelay * IN_MILLISECONDS)
{
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u, latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client",
+ sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u, latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client",
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), _session->GetLatency(), _session->GetRemoteAddress().c_str(),
secsToTimeString(maxClientResponseDelay, true).c_str());
_session->KickPlayer();
diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp
index 0677758439f..f6daba76c1a 100644
--- a/src/server/game/Warden/WardenCheckMgr.cpp
+++ b/src/server/game/Warden/WardenCheckMgr.cpp
@@ -43,8 +43,8 @@ void WardenCheckMgr::LoadWardenChecks()
// Check if Warden is enabled by config before loading anything
if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED))
{
- sLog->outString(">> Warden disabled, loading checks skipped.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Warden disabled, loading checks skipped.");
+
return;
}
@@ -52,8 +52,8 @@ void WardenCheckMgr::LoadWardenChecks()
if (!result)
{
- sLog->outString(">> Loaded 0 Warden checks. DB table `warden_checks` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!");
+
return;
}
@@ -145,8 +145,8 @@ void WardenCheckMgr::LoadWardenChecks()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u warden checks.", count);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded %u warden checks.", count);
+
}
void WardenCheckMgr::LoadWardenOverrides()
@@ -154,8 +154,8 @@ void WardenCheckMgr::LoadWardenOverrides()
// Check if Warden is enabled by config before loading anything
if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED))
{
- sLog->outString(">> Warden disabled, loading check overrides skipped.");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Warden disabled, loading check overrides skipped.");
+
return;
}
@@ -164,8 +164,8 @@ void WardenCheckMgr::LoadWardenOverrides()
if (!result)
{
- sLog->outString(">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!");
+
return;
}
@@ -182,10 +182,10 @@ void WardenCheckMgr::LoadWardenOverrides()
// Check if action value is in range (0-2, see WardenActions enum)
if (action > WARDEN_ACTION_BAN)
- sLog->outError("Warden check override action out of range (ID: %u, action: %u)", checkId, action);
+ sLog->outError(LOG_FILTER_WARDEN, "Warden check override action out of range (ID: %u, action: %u)", checkId, action);
// Check if check actually exists before accessing the CheckStore vector
else if (checkId > CheckStore.size())
- sLog->outError("Warden check action override for non-existing check (ID: %u, action: %u), skipped", checkId, action);
+ sLog->outError(LOG_FILTER_WARDEN, "Warden check action override for non-existing check (ID: %u, action: %u), skipped", checkId, action);
else
{
CheckStore[checkId]->Action = WardenActions(action);
@@ -194,8 +194,8 @@ void WardenCheckMgr::LoadWardenOverrides()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u warden action overrides.", count);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded %u warden action overrides.", count);
+
}
WardenCheck* WardenCheckMgr::GetWardenDataById(uint16 Id)
diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp
index 3cc95b9f3f7..96b71912421 100644
--- a/src/server/game/Warden/WardenMac.cpp
+++ b/src/server/game/Warden/WardenMac.cpp
@@ -153,7 +153,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff)
if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0)
{
sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
+ sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
return;
}
diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp
index 9aa439ec8c0..7aea6794e01 100644
--- a/src/server/game/Warden/WardenWin.cpp
+++ b/src/server/game/Warden/WardenWin.cpp
@@ -157,7 +157,7 @@ void WardenWin::HandleHashResult(ByteBuffer &buff)
if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0)
{
sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
+ sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s",
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
return;
}
@@ -344,7 +344,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
{
buff.rpos(buff.wpos());
sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed checksum. Action: %s",
+ sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed checksum. Action: %s",
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
return;
}
@@ -357,7 +357,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
if (result == 0x00)
{
sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00");
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed timing check. Action: %s",
+ sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed timing check. Action: %s",
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str());
return;
}
@@ -501,7 +501,7 @@ void WardenWin::HandleData(ByteBuffer &buff)
{
WardenCheck* check = sWardenCheckMgr->GetWardenDataById(checkFailed);
- sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed Warden check %u. Action: %s",
+ sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed Warden check %u. Action: %s",
_session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), checkFailed, Penalty(check).c_str());
}
diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp
index 965e6bf3805..896e7161606 100755
--- a/src/server/game/Weather/Weather.cpp
+++ b/src/server/game/Weather/Weather.cpp
@@ -37,7 +37,7 @@ Weather::Weather(uint32 zone, WeatherData const* weatherChances)
m_type = WEATHER_TYPE_FINE;
m_grade = 0;
- sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
+ sLog->outInfo(LOG_FILTER_GENERAL, "WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
}
/// Launch a weather update
@@ -97,7 +97,7 @@ bool Weather::ReGenerate()
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
- sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
if ((u < 60) && (m_grade < 0.33333334f)) // Get fair
{
@@ -258,7 +258,7 @@ bool Weather::UpdateWeather()
wthstr = "fine";
break;
}
- sLog->outDetail("Change the weather of zone %u to %s.", m_zone, wthstr);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Change the weather of zone %u to %s.", m_zone, wthstr);
sScriptMgr->OnWeatherChange(this, state, m_grade);
return true;
diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp
index bb8fadf08bc..0e7f1c87b26 100755
--- a/src/server/game/Weather/WeatherMgr.cpp
+++ b/src/server/game/Weather/WeatherMgr.cpp
@@ -93,8 +93,8 @@ void LoadWeatherData()
if (!result)
{
- sLog->outErrorDb(">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
- sLog->outString();
+ sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
+
return;
}
@@ -115,19 +115,19 @@ void LoadWeatherData()
if (wzc.data[season].rainChance > 100)
{
wzc.data[season].rainChance = 25;
- sLog->outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%%", zone_id, season);
+ sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong rain chance > 100%%", zone_id, season);
}
if (wzc.data[season].snowChance > 100)
{
wzc.data[season].snowChance = 25;
- sLog->outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%%", zone_id, season);
+ sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong snow chance > 100%%", zone_id, season);
}
if (wzc.data[season].stormChance > 100)
{
wzc.data[season].stormChance = 25;
- sLog->outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%%", zone_id, season);
+ sLog->outError(LOG_FILTER_SQL, "Weather for zone %u season %u has wrong storm chance > 100%%", zone_id, season);
}
}
@@ -137,8 +137,8 @@ void LoadWeatherData()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
void SendFineWeatherUpdateToPlayer(Player* player)
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 91faff774e2..f8a08200c42 100755..100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -268,7 +268,7 @@ void World::AddSession_(WorldSession* s)
{
AddQueuedPlayer (s);
UpdateMaxSessionCounters();
- sLog->outDetail("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize);
+ sLog->outInfo(LOG_FILTER_GENERAL, "PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize);
return;
}
@@ -285,7 +285,7 @@ void World::AddSession_(WorldSession* s)
float popu = (float)GetActiveSessionCount(); // updated number of users on the server
popu /= pLimit;
popu *= 2;
- sLog->outDetail("Server Population (%f).", popu);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Server Population (%f).", popu);
}
}
@@ -396,11 +396,10 @@ void World::LoadConfigSettings(bool reload)
{
if (!ConfigMgr::Load())
{
- sLog->outError("World settings reload fail: can't read settings from %s.", ConfigMgr::GetFilename().c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "World settings reload fail: can't read settings from %s.", ConfigMgr::GetFilename().c_str());
return;
}
-
- sLog->ReloadConfig(); // Reload log levels and filters
+ sLog->LoadFromConfig();
}
///- Read the player limit and the Message of the day from the config file
@@ -420,27 +419,27 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_HEALTH] = ConfigMgr::GetFloatDefault("Rate.Health", 1);
if (rate_values[RATE_HEALTH] < 0)
{
- sLog->outError("Rate.Health (%f) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]);
+ sLog->outError(LOG_FILTER_GENERAL, "Rate.Health (%f) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]);
rate_values[RATE_HEALTH] = 1;
}
rate_values[RATE_POWER_MANA] = ConfigMgr::GetFloatDefault("Rate.Mana", 1);
if (rate_values[RATE_POWER_MANA] < 0)
{
- sLog->outError("Rate.Mana (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]);
+ sLog->outError(LOG_FILTER_GENERAL, "Rate.Mana (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]);
rate_values[RATE_POWER_MANA] = 1;
}
rate_values[RATE_POWER_RAGE_INCOME] = ConfigMgr::GetFloatDefault("Rate.Rage.Income", 1);
rate_values[RATE_POWER_RAGE_LOSS] = ConfigMgr::GetFloatDefault("Rate.Rage.Loss", 1);
if (rate_values[RATE_POWER_RAGE_LOSS] < 0)
{
- sLog->outError("Rate.Rage.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]);
+ sLog->outError(LOG_FILTER_GENERAL, "Rate.Rage.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]);
rate_values[RATE_POWER_RAGE_LOSS] = 1;
}
rate_values[RATE_POWER_RUNICPOWER_INCOME] = ConfigMgr::GetFloatDefault("Rate.RunicPower.Income", 1);
rate_values[RATE_POWER_RUNICPOWER_LOSS] = ConfigMgr::GetFloatDefault("Rate.RunicPower.Loss", 1);
if (rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0)
{
- sLog->outError("Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]);
+ sLog->outError(LOG_FILTER_GENERAL, "Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]);
rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1;
}
rate_values[RATE_POWER_FOCUS] = ConfigMgr::GetFloatDefault("Rate.Focus", 1.0f);
@@ -464,7 +463,7 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_REPAIRCOST] = ConfigMgr::GetFloatDefault("Rate.RepairCost", 1.0f);
if (rate_values[RATE_REPAIRCOST] < 0.0f)
{
- sLog->outError("Rate.RepairCost (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_REPAIRCOST]);
+ sLog->outError(LOG_FILTER_GENERAL, "Rate.RepairCost (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_REPAIRCOST]);
rate_values[RATE_REPAIRCOST] = 0.0f;
}
rate_values[RATE_REPUTATION_GAIN] = ConfigMgr::GetFloatDefault("Rate.Reputation.Gain", 1.0f);
@@ -501,13 +500,13 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_TALENT] = ConfigMgr::GetFloatDefault("Rate.Talent", 1.0f);
if (rate_values[RATE_TALENT] < 0.0f)
{
- sLog->outError("Rate.Talent (%f) must be > 0. Using 1 instead.", rate_values[RATE_TALENT]);
+ sLog->outError(LOG_FILTER_GENERAL, "Rate.Talent (%f) must be > 0. Using 1 instead.", rate_values[RATE_TALENT]);
rate_values[RATE_TALENT] = 1.0f;
}
rate_values[RATE_MOVESPEED] = ConfigMgr::GetFloatDefault("Rate.MoveSpeed", 1.0f);
if (rate_values[RATE_MOVESPEED] < 0)
{
- sLog->outError("Rate.MoveSpeed (%f) must be > 0. Using 1 instead.", rate_values[RATE_MOVESPEED]);
+ sLog->outError(LOG_FILTER_GENERAL, "Rate.MoveSpeed (%f) must be > 0. Using 1 instead.", rate_values[RATE_MOVESPEED]);
rate_values[RATE_MOVESPEED] = 1.0f;
}
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED];
@@ -516,12 +515,12 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = ConfigMgr::GetFloatDefault("TargetPosRecalculateRange", 1.5f);
if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE)
{
- sLog->outError("TargetPosRecalculateRange (%f) must be >= %f. Using %f instead.", rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE);
+ sLog->outError(LOG_FILTER_GENERAL, "TargetPosRecalculateRange (%f) must be >= %f. Using %f instead.", rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE);
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = CONTACT_DISTANCE;
}
else if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] > NOMINAL_MELEE_RANGE)
{
- sLog->outError("TargetPosRecalculateRange (%f) must be <= %f. Using %f instead.",
+ sLog->outError(LOG_FILTER_GENERAL, "TargetPosRecalculateRange (%f) must be <= %f. Using %f instead.",
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE);
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = NOMINAL_MELEE_RANGE;
}
@@ -529,12 +528,12 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = ConfigMgr::GetFloatDefault("DurabilityLoss.OnDeath", 10.0f);
if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f)
{
- sLog->outError("DurabilityLoss.OnDeath (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
+ sLog->outError(LOG_FILTER_GENERAL, "DurabilityLoss.OnDeath (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f;
}
if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] > 100.0f)
{
- sLog->outError("DurabilityLoss.OnDeath (%f) must be <= 100. Using 100.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
+ sLog->outError(LOG_FILTER_GENERAL, "DurabilityLoss.OnDeath (%f) must be <= 100. Using 100.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = rate_values[RATE_DURABILITY_LOSS_ON_DEATH] / 100.0f;
@@ -542,25 +541,25 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_DURABILITY_LOSS_DAMAGE] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Damage", 0.5f);
if (rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Damage (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_DAMAGE]);
+ sLog->outError(LOG_FILTER_GENERAL, "DurabilityLossChance.Damage (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_DAMAGE]);
rate_values[RATE_DURABILITY_LOSS_DAMAGE] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_ABSORB] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Absorb", 0.5f);
if (rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Absorb (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ABSORB]);
+ sLog->outError(LOG_FILTER_GENERAL, "DurabilityLossChance.Absorb (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ABSORB]);
rate_values[RATE_DURABILITY_LOSS_ABSORB] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_PARRY] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Parry", 0.05f);
if (rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Parry (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_PARRY]);
+ sLog->outError(LOG_FILTER_GENERAL, "DurabilityLossChance.Parry (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_PARRY]);
rate_values[RATE_DURABILITY_LOSS_PARRY] = 0.0f;
}
rate_values[RATE_DURABILITY_LOSS_BLOCK] = ConfigMgr::GetFloatDefault("DurabilityLossChance.Block", 0.05f);
if (rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f)
{
- sLog->outError("DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]);
+ sLog->outError(LOG_FILTER_GENERAL, "DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]);
rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f;
}
///- Read other configuration items from the config file
@@ -570,7 +569,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_COMPRESSION] = ConfigMgr::GetIntDefault("Compression", 1);
if (m_int_configs[CONFIG_COMPRESSION] < 1 || m_int_configs[CONFIG_COMPRESSION] > 9)
{
- sLog->outError("Compression level (%i) must be in range 1..9. Using default compression level (1).", m_int_configs[CONFIG_COMPRESSION]);
+ sLog->outError(LOG_FILTER_GENERAL, "Compression level (%i) must be in range 1..9. Using default compression level (1).", m_int_configs[CONFIG_COMPRESSION]);
m_int_configs[CONFIG_COMPRESSION] = 1;
}
m_bool_configs[CONFIG_ADDON_CHANNEL] = ConfigMgr::GetBoolDefault("AddonChannel", true);
@@ -594,14 +593,14 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = ConfigMgr::GetIntDefault("PlayerSave.Stats.MinLevel", 0);
if (m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] > MAX_LEVEL)
{
- sLog->outError("PlayerSave.Stats.MinLevel (%i) must be in range 0..80. Using default, do not save character stats (0).", m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]);
+ sLog->outError(LOG_FILTER_GENERAL, "PlayerSave.Stats.MinLevel (%i) must be in range 0..80. Using default, do not save character stats (0).", m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]);
m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = 0;
}
m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = ConfigMgr::GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILLISECONDS);
if (m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY)
{
- sLog->outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_GRIDCLEAN], MIN_GRID_DELAY);
+ sLog->outError(LOG_FILTER_GENERAL, "GridCleanUpDelay (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_GRIDCLEAN], MIN_GRID_DELAY);
m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY;
}
if (reload)
@@ -610,7 +609,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = ConfigMgr::GetIntDefault("MapUpdateInterval", 100);
if (m_int_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY)
{
- sLog->outError("MapUpdateInterval (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY);
+ sLog->outError(LOG_FILTER_GENERAL, "MapUpdateInterval (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY);
m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY;
}
if (reload)
@@ -622,7 +621,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("WorldServerPort", 8085);
if (val != m_int_configs[CONFIG_PORT_WORLD])
- sLog->outError("WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_PORT_WORLD]);
+ sLog->outError(LOG_FILTER_GENERAL, "WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_PORT_WORLD]);
}
else
m_int_configs[CONFIG_PORT_WORLD] = ConfigMgr::GetIntDefault("WorldServerPort", 8085);
@@ -641,7 +640,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("GameType", 0);
if (val != m_int_configs[CONFIG_GAME_TYPE])
- sLog->outError("GameType option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_GAME_TYPE]);
+ sLog->outError(LOG_FILTER_GENERAL, "GameType option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_GAME_TYPE]);
}
else
m_int_configs[CONFIG_GAME_TYPE] = ConfigMgr::GetIntDefault("GameType", 0);
@@ -650,7 +649,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
if (val != m_int_configs[CONFIG_REALM_ZONE])
- sLog->outError("RealmZone option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_REALM_ZONE]);
+ sLog->outError(LOG_FILTER_GENERAL, "RealmZone option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_REALM_ZONE]);
}
else
m_int_configs[CONFIG_REALM_ZONE] = ConfigMgr::GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
@@ -672,21 +671,21 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MIN_PLAYER_NAME] = ConfigMgr::GetIntDefault ("MinPlayerName", 2);
if (m_int_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_int_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME)
{
- sLog->outError("MinPlayerName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME);
+ sLog->outError(LOG_FILTER_GENERAL, "MinPlayerName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME);
m_int_configs[CONFIG_MIN_PLAYER_NAME] = 2;
}
m_int_configs[CONFIG_MIN_CHARTER_NAME] = ConfigMgr::GetIntDefault ("MinCharterName", 2);
if (m_int_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_int_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME)
{
- sLog->outError("MinCharterName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME);
+ sLog->outError(LOG_FILTER_GENERAL, "MinCharterName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME);
m_int_configs[CONFIG_MIN_CHARTER_NAME] = 2;
}
m_int_configs[CONFIG_MIN_PET_NAME] = ConfigMgr::GetIntDefault ("MinPetName", 2);
if (m_int_configs[CONFIG_MIN_PET_NAME] < 1 || m_int_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME)
{
- sLog->outError("MinPetName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME);
+ sLog->outError(LOG_FILTER_GENERAL, "MinPetName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME);
m_int_configs[CONFIG_MIN_PET_NAME] = 2;
}
@@ -697,7 +696,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_CHARACTERS_PER_REALM] = ConfigMgr::GetIntDefault("CharactersPerRealm", 10);
if (m_int_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_int_configs[CONFIG_CHARACTERS_PER_REALM] > 10)
{
- sLog->outError("CharactersPerRealm (%i) must be in range 1..10. Set to 10.", m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
+ sLog->outError(LOG_FILTER_GENERAL, "CharactersPerRealm (%i) must be in range 1..10. Set to 10.", m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
m_int_configs[CONFIG_CHARACTERS_PER_REALM] = 10;
}
@@ -705,14 +704,14 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = ConfigMgr::GetIntDefault("CharactersPerAccount", 50);
if (m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_int_configs[CONFIG_CHARACTERS_PER_REALM])
{
- sLog->outError("CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
+ sLog->outError(LOG_FILTER_GENERAL, "CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]);
m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = m_int_configs[CONFIG_CHARACTERS_PER_REALM];
}
m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = ConfigMgr::GetIntDefault("HeroicCharactersPerRealm", 1);
if (int32(m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10)
{
- sLog->outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.", m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
+ sLog->outError(LOG_FILTER_GENERAL, "HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.", m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1;
}
@@ -721,7 +720,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_SKIP_CINEMATICS] = ConfigMgr::GetIntDefault("SkipCinematics", 0);
if (int32(m_int_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_int_configs[CONFIG_SKIP_CINEMATICS] > 2)
{
- sLog->outError("SkipCinematics (%i) must be in range 0..2. Set to 0.", m_int_configs[CONFIG_SKIP_CINEMATICS]);
+ sLog->outError(LOG_FILTER_GENERAL, "SkipCinematics (%i) must be in range 0..2. Set to 0.", m_int_configs[CONFIG_SKIP_CINEMATICS]);
m_int_configs[CONFIG_SKIP_CINEMATICS] = 0;
}
@@ -729,14 +728,14 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL);
if (val != m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
- sLog->outError("MaxPlayerLevel option can't be changed at config reload, using current value (%u).", m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ sLog->outError(LOG_FILTER_GENERAL, "MaxPlayerLevel option can't be changed at config reload, using current value (%u).", m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
}
else
m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL);
if (m_int_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL)
{
- sLog->outError("MaxPlayerLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL);
+ sLog->outError(LOG_FILTER_GENERAL, "MaxPlayerLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL);
m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = MAX_LEVEL;
}
@@ -745,25 +744,25 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_START_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("StartPlayerLevel", 1);
if (m_int_configs[CONFIG_START_PLAYER_LEVEL] < 1)
{
- sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ sLog->outError(LOG_FILTER_GENERAL, "StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_PLAYER_LEVEL] = 1;
}
else if (m_int_configs[CONFIG_START_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
{
- sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
+ sLog->outError(LOG_FILTER_GENERAL, "StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL];
}
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("StartHeroicPlayerLevel", 55);
if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1)
{
- sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.",
+ sLog->outError(LOG_FILTER_GENERAL, "StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.",
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55;
}
else if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
{
- sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL];
}
@@ -771,12 +770,12 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_START_PLAYER_MONEY] = ConfigMgr::GetIntDefault("StartPlayerMoney", 0);
if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0)
{
- sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
+ sLog->outError(LOG_FILTER_GENERAL, "StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
m_int_configs[CONFIG_START_PLAYER_MONEY] = 0;
}
else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > 0x7FFFFFFF-1) // TODO: (See MAX_MONEY_AMOUNT)
{
- sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",
m_int_configs[CONFIG_START_PLAYER_MONEY], 0x7FFFFFFF-1, 0x7FFFFFFF-1);
m_int_configs[CONFIG_START_PLAYER_MONEY] = 0x7FFFFFFF-1;
}
@@ -784,20 +783,20 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("MaxHonorPoints", 75000);
if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0)
{
- sLog->outError("MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]);
+ sLog->outError(LOG_FILTER_GENERAL, "MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]);
m_int_configs[CONFIG_MAX_HONOR_POINTS] = 0;
}
m_int_configs[CONFIG_START_HONOR_POINTS] = ConfigMgr::GetIntDefault("StartHonorPoints", 0);
if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0)
{
- sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], 0);
m_int_configs[CONFIG_START_HONOR_POINTS] = 0;
}
else if (m_int_configs[CONFIG_START_HONOR_POINTS] > m_int_configs[CONFIG_MAX_HONOR_POINTS])
{
- sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS]);
m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS];
}
@@ -805,20 +804,20 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_ARENA_POINTS] = ConfigMgr::GetIntDefault("MaxArenaPoints", 10000);
if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0)
{
- sLog->outError("MaxArenaPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]);
+ sLog->outError(LOG_FILTER_GENERAL, "MaxArenaPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]);
m_int_configs[CONFIG_MAX_ARENA_POINTS] = 0;
}
m_int_configs[CONFIG_START_ARENA_POINTS] = ConfigMgr::GetIntDefault("StartArenaPoints", 0);
if (int32(m_int_configs[CONFIG_START_ARENA_POINTS]) < 0)
{
- sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], 0);
m_int_configs[CONFIG_START_ARENA_POINTS] = 0;
}
else if (m_int_configs[CONFIG_START_ARENA_POINTS] > m_int_configs[CONFIG_MAX_ARENA_POINTS])
{
- sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS]);
m_int_configs[CONFIG_START_ARENA_POINTS] = m_int_configs[CONFIG_MAX_ARENA_POINTS];
}
@@ -826,7 +825,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("RecruitAFriend.MaxLevel", 60);
if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
{
- sLog->outError("RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.",
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], 60);
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60;
}
@@ -846,7 +845,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MIN_PETITION_SIGNS] = ConfigMgr::GetIntDefault("MinPetitionSigns", 9);
if (m_int_configs[CONFIG_MIN_PETITION_SIGNS] > 9)
{
- sLog->outError("MinPetitionSigns (%i) must be in range 0..9. Set to 9.", m_int_configs[CONFIG_MIN_PETITION_SIGNS]);
+ sLog->outError(LOG_FILTER_GENERAL, "MinPetitionSigns (%i) must be in range 0..9. Set to 9.", m_int_configs[CONFIG_MIN_PETITION_SIGNS]);
m_int_configs[CONFIG_MIN_PETITION_SIGNS] = 9;
}
@@ -861,13 +860,13 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_START_GM_LEVEL] = ConfigMgr::GetIntDefault("GM.StartLevel", 1);
if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL])
{
- sLog->outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
+ sLog->outError(LOG_FILTER_GENERAL, "GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
m_int_configs[CONFIG_START_GM_LEVEL], m_int_configs[CONFIG_START_PLAYER_LEVEL], MAX_LEVEL, m_int_configs[CONFIG_START_PLAYER_LEVEL]);
m_int_configs[CONFIG_START_GM_LEVEL] = m_int_configs[CONFIG_START_PLAYER_LEVEL];
}
else if (m_int_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL)
{
- sLog->outError("GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
+ sLog->outError(LOG_FILTER_GENERAL, "GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
m_int_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL;
}
m_bool_configs[CONFIG_ALLOW_GM_GROUP] = ConfigMgr::GetBoolDefault("GM.AllowInvite", false);
@@ -882,7 +881,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_UPTIME_UPDATE] = ConfigMgr::GetIntDefault("UpdateUptimeInterval", 10);
if (int32(m_int_configs[CONFIG_UPTIME_UPDATE]) <= 0)
{
- sLog->outError("UpdateUptimeInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_UPTIME_UPDATE]);
+ sLog->outError(LOG_FILTER_GENERAL, "UpdateUptimeInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_UPTIME_UPDATE]);
m_int_configs[CONFIG_UPTIME_UPDATE] = 10;
}
if (reload)
@@ -895,7 +894,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = ConfigMgr::GetIntDefault("LogDB.Opt.ClearInterval", 10);
if (int32(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0)
{
- sLog->outError("LogDB.Opt.ClearInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
+ sLog->outError(LOG_FILTER_GENERAL, "LogDB.Opt.ClearInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = 10;
}
if (reload)
@@ -904,7 +903,7 @@ void World::LoadConfigSettings(bool reload)
m_timers[WUPDATE_CLEANDB].Reset();
}
m_int_configs[CONFIG_LOGDB_CLEARTIME] = ConfigMgr::GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default
- sLog->outString("Will clear `logs` table of entries older than %i seconds every %u minutes.",
+ sLog->outInfo(LOG_FILTER_GENERAL, "Will clear `logs` table of entries older than %i seconds every %u minutes.",
m_int_configs[CONFIG_LOGDB_CLEARTIME], m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = ConfigMgr::GetIntDefault("SkillChance.Orange", 100);
@@ -929,7 +928,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = ConfigMgr::GetIntDefault("MaxOverspeedPings", 2);
if (m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2)
{
- sLog->outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]);
+ sLog->outError(LOG_FILTER_GENERAL, "MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]);
m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2;
}
@@ -944,7 +943,7 @@ void World::LoadConfigSettings(bool reload)
{
uint32 val = ConfigMgr::GetIntDefault("Expansion", 1);
if (val != m_int_configs[CONFIG_EXPANSION])
- sLog->outError("Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]);
+ sLog->outError(LOG_FILTER_GENERAL, "Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]);
}
else
m_int_configs[CONFIG_EXPANSION] = ConfigMgr::GetIntDefault("Expansion", 1);
@@ -976,7 +975,7 @@ void World::LoadConfigSettings(bool reload)
m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = ConfigMgr::GetIntDefault("Battleground.Random.ResetHour", 6);
if (m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] > 23)
{
- sLog->outError("Battleground.Random.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR]);
+ sLog->outError(LOG_FILTER_GENERAL, "Battleground.Random.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR]);
m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = 6;
}
@@ -1043,10 +1042,10 @@ void World::LoadConfigSettings(bool reload)
if (clientCacheId > 0)
{
m_int_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId;
- sLog->outString("Client cache version set to: %u", clientCacheId);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Client cache version set to: %u", clientCacheId);
}
else
- sLog->outError("ClientCacheVersion can't be negative %d, ignored.", clientCacheId);
+ sLog->outError(LOG_FILTER_GENERAL, "ClientCacheVersion can't be negative %d, ignored.", clientCacheId);
}
m_int_configs[CONFIG_INSTANT_LOGOUT] = ConfigMgr::GetIntDefault("InstantLogout", SEC_MODERATOR);
@@ -1062,12 +1061,12 @@ void World::LoadConfigSettings(bool reload)
m_MaxVisibleDistanceOnContinents = ConfigMgr::GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
if (m_MaxVisibleDistanceOnContinents < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
{
- sLog->outError("Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
+ sLog->outError(LOG_FILTER_GENERAL, "Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceOnContinents = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
}
else if (m_MaxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Visibility.Distance.Continents can't be greater %f", MAX_VISIBILITY_DISTANCE);
+ sLog->outError(LOG_FILTER_GENERAL, "Visibility.Distance.Continents can't be greater %f", MAX_VISIBILITY_DISTANCE);
m_MaxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE;
}
@@ -1075,12 +1074,12 @@ void World::LoadConfigSettings(bool reload)
m_MaxVisibleDistanceInInstances = ConfigMgr::GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
if (m_MaxVisibleDistanceInInstances < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
{
- sLog->outError("Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
+ sLog->outError(LOG_FILTER_GENERAL, "Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInInstances = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
}
else if (m_MaxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Visibility.Distance.Instances can't be greater %f", MAX_VISIBILITY_DISTANCE);
+ sLog->outError(LOG_FILTER_GENERAL, "Visibility.Distance.Instances can't be greater %f", MAX_VISIBILITY_DISTANCE);
m_MaxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE;
}
@@ -1088,12 +1087,12 @@ void World::LoadConfigSettings(bool reload)
m_MaxVisibleDistanceInBGArenas = ConfigMgr::GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
if (m_MaxVisibleDistanceInBGArenas < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
{
- sLog->outError("Visibility.Distance.BGArenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
+ sLog->outError(LOG_FILTER_GENERAL, "Visibility.Distance.BGArenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceInBGArenas = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
}
else if (m_MaxVisibleDistanceInBGArenas > MAX_VISIBILITY_DISTANCE)
{
- sLog->outError("Visibility.Distance.BGArenas can't be greater %f", MAX_VISIBILITY_DISTANCE);
+ sLog->outError(LOG_FILTER_GENERAL, "Visibility.Distance.BGArenas can't be greater %f", MAX_VISIBILITY_DISTANCE);
m_MaxVisibleDistanceInBGArenas = MAX_VISIBILITY_DISTANCE;
}
@@ -1114,12 +1113,12 @@ void World::LoadConfigSettings(bool reload)
if (reload)
{
if (dataPath != m_dataPath)
- sLog->outError("DataDir option can't be changed at worldserver.conf reload, using current value (%s).", m_dataPath.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "DataDir option can't be changed at worldserver.conf reload, using current value (%s).", m_dataPath.c_str());
}
else
{
m_dataPath = dataPath;
- sLog->outString("Using DataDir %s", m_dataPath.c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "Using DataDir %s", m_dataPath.c_str());
}
m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", 0);
@@ -1130,19 +1129,19 @@ void World::LoadConfigSettings(bool reload)
std::string ignoreSpellIds = ConfigMgr::GetStringDefault("vmap.ignoreSpellIds", "");
if (!enableHeight)
- sLog->outError("VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
+ sLog->outError(LOG_FILTER_GENERAL, "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
VMAP::VMapFactory::createOrGetVMapManager()->setEnableLineOfSightCalc(enableLOS);
VMAP::VMapFactory::createOrGetVMapManager()->setEnableHeightCalc(enableHeight);
VMAP::VMapFactory::preventSpellsFromBeingTestedForLoS(ignoreSpellIds.c_str());
- sLog->outString("WORLD: VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS);
- sLog->outString("WORLD: VMap data directory is: %svmaps", m_dataPath.c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "WORLD: VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS);
+ sLog->outInfo(LOG_FILTER_GENERAL, "WORLD: VMap data directory is: %svmaps", m_dataPath.c_str());
m_int_configs[CONFIG_MAX_WHO] = ConfigMgr::GetIntDefault("MaxWhoListReturns", 49);
m_bool_configs[CONFIG_PET_LOS] = ConfigMgr::GetBoolDefault("vmap.petLOS", true);
m_bool_configs[CONFIG_START_ALL_SPELLS] = ConfigMgr::GetBoolDefault("PlayerStart.AllSpells", false);
if (m_bool_configs[CONFIG_START_ALL_SPELLS])
- sLog->outString("WORLD: WARNING: PlayerStart.AllSpells enabled - may not function as intended!");
+ sLog->outInfo(LOG_FILTER_GENERAL, "WORLD: WARNING: PlayerStart.AllSpells enabled - may not function as intended!");
m_int_configs[CONFIG_HONOR_AFTER_DUEL] = ConfigMgr::GetIntDefault("HonorPointsAfterDuel", 0);
m_bool_configs[CONFIG_START_ALL_EXPLORED] = ConfigMgr::GetBoolDefault("PlayerStart.MapsExplored", false);
m_bool_configs[CONFIG_START_ALL_REP] = ConfigMgr::GetBoolDefault("PlayerStart.AllReputation", false);
@@ -1238,7 +1237,7 @@ void World::SetInitialWorldSettings()
!MapManager::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
!MapManager::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
{
- sLog->outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.", m_dataPath.c_str(), m_dataPath.c_str());
+ sLog->outError(LOG_FILTER_GENERAL, "Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.", m_dataPath.c_str(), m_dataPath.c_str());
exit(1);
}
@@ -1249,8 +1248,8 @@ void World::SetInitialWorldSettings()
sGameEventMgr->Initialize();
///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
- sLog->outString();
- sLog->outString("Loading Trinity strings...");
+
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Trinity strings...");
if (!sObjectMgr->LoadTrinityStrings())
exit(1); // Error message displayed in function already
@@ -1269,37 +1268,37 @@ void World::SetInitialWorldSettings()
CharacterDatabase.Execute(stmt);
///- Load the DBC files
- sLog->outString("Initialize data stores...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Initialize data stores...");
LoadDBCStores(m_dataPath);
LoadDB2Stores(m_dataPath);
DetectDBCLang();
- sLog->outString("Loading spell dbc data corrections...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading spell dbc data corrections...");
sSpellMgr->LoadDbcDataCorrections();
- sLog->outString("Loading SpellInfo store...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading SpellInfo store...");
sSpellMgr->LoadSpellInfoStore();
- sLog->outString("Loading SkillLineAbilityMultiMap Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading SkillLineAbilityMultiMap Data...");
sSpellMgr->LoadSkillLineAbilityMap();
- sLog->outString("Loading spell custom attributes...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading spell custom attributes...");
sSpellMgr->LoadSpellCustomAttr();
- sLog->outString("Loading GameObject models...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading GameObject models...");
LoadGameObjectModelList();
- sLog->outString("Loading Script Names...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Script Names...");
sObjectMgr->LoadScriptNames();
- sLog->outString("Loading Instance Template...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Instance Template...");
sObjectMgr->LoadInstanceTemplate();
// Must be called before `creature_respawn`/`gameobject_respawn` tables
- sLog->outString("Loading instances...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading instances...");
sInstanceSaveMgr->LoadInstances();
- sLog->outString("Loading Localization strings...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Localization strings...");
uint32 oldMSTime = getMSTime();
sObjectMgr->LoadCreatureLocales();
sObjectMgr->LoadGameObjectLocales();
@@ -1311,311 +1310,311 @@ void World::SetInitialWorldSettings()
sObjectMgr->LoadPointOfInterestLocales();
sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
- sLog->outString(">> Localization strings loaded in %u ms", GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Localization strings loaded in %u ms", GetMSTimeDiffToNow(oldMSTime));
+
- sLog->outString("Loading Page Texts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Page Texts...");
sObjectMgr->LoadPageTexts();
- sLog->outString("Loading Game Object Templates..."); // must be after LoadPageTexts
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Game Object Templates..."); // must be after LoadPageTexts
sObjectMgr->LoadGameObjectTemplate();
- sLog->outString("Loading Spell Rank Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Rank Data...");
sSpellMgr->LoadSpellRanks();
- sLog->outString("Loading Spell Required Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Required Data...");
sSpellMgr->LoadSpellRequired();
- sLog->outString("Loading Spell Group types...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Group types...");
sSpellMgr->LoadSpellGroups();
- sLog->outString("Loading Spell Learn Skills...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Learn Skills...");
sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks
- sLog->outString("Loading Spell Learn Spells...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Learn Spells...");
sSpellMgr->LoadSpellLearnSpells();
- sLog->outString("Loading Spell Proc Event conditions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Proc Event conditions...");
sSpellMgr->LoadSpellProcEvents();
- sLog->outString("Loading Spell Proc conditions and data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Proc conditions and data...");
sSpellMgr->LoadSpellProcs();
- sLog->outString("Loading Spell Bonus Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Bonus Data...");
sSpellMgr->LoadSpellBonusess();
- sLog->outString("Loading Aggro Spells Definitions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Aggro Spells Definitions...");
sSpellMgr->LoadSpellThreats();
- sLog->outString("Loading Spell Group Stack Rules...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell Group Stack Rules...");
sSpellMgr->LoadSpellGroupStackRules();
- sLog->outString("Loading NPC Texts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading NPC Texts...");
sObjectMgr->LoadGossipText();
- sLog->outString("Loading Enchant Spells Proc datas...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Enchant Spells Proc datas...");
sSpellMgr->LoadSpellEnchantProcData();
- sLog->outString("Loading Item Random Enchantments Table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Item Random Enchantments Table...");
LoadRandomEnchantmentsTable();
- sLog->outString("Loading Disables...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Disables...");
DisableMgr::LoadDisables(); // must be before loading quests and items
- sLog->outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
sObjectMgr->LoadItemTemplates();
- sLog->outString("Loading Item Extra Data..."); // must be after LoadItemPrototypes
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Item Extra Data..."); // must be after LoadItemPrototypes
sObjectMgr->LoadItemTemplateAddon();
- sLog->outString("Loading Item Scripts..."); // must be after LoadItemPrototypes
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Item Scripts..."); // must be after LoadItemPrototypes
sObjectMgr->LoadItemScriptNames();
- sLog->outString("Loading Creature Model Based Info Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Model Based Info Data...");
sObjectMgr->LoadCreatureModelInfo();
- sLog->outString("Loading Equipment templates...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Equipment templates...");
sObjectMgr->LoadEquipmentTemplates();
- sLog->outString("Loading Creature templates...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature templates...");
sObjectMgr->LoadCreatureTemplates();
- sLog->outString("Loading Creature template addons...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature template addons...");
sObjectMgr->LoadCreatureTemplateAddons();
- sLog->outString("Loading Reputation Reward Rates...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Reputation Reward Rates...");
sObjectMgr->LoadReputationRewardRate();
- sLog->outString("Loading Creature Reputation OnKill Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Reputation OnKill Data...");
sObjectMgr->LoadReputationOnKill();
- sLog->outString("Loading Reputation Spillover Data..." );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Reputation Spillover Data...");
sObjectMgr->LoadReputationSpilloverTemplate();
- sLog->outString("Loading Points Of Interest Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Points Of Interest Data...");
sObjectMgr->LoadPointsOfInterest();
- sLog->outString("Loading Creature Base Stats...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Base Stats...");
sObjectMgr->LoadCreatureClassLevelStats();
- sLog->outString("Loading Creature Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Data...");
sObjectMgr->LoadCreatures();
- sLog->outString("Loading pet levelup spells...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading pet levelup spells...");
sSpellMgr->LoadPetLevelupSpellMap();
- sLog->outString("Loading pet default spells additional to levelup spells...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading pet default spells additional to levelup spells...");
sSpellMgr->LoadPetDefaultSpells();
- sLog->outString("Loading Creature Addon Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Addon Data...");
sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
- sLog->outString("Loading Gameobject Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Gameobject Data...");
sObjectMgr->LoadGameobjects();
- sLog->outString("Loading Creature Linked Respawn...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Linked Respawn...");
sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
- sLog->outString("Loading Weather Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Weather Data...");
WeatherMgr::LoadWeatherData();
- sLog->outString("Loading Quests...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quests...");
sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
- sLog->outString("Checking Quest Disables");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Checking Quest Disables");
DisableMgr::CheckQuestDisables(); // must be after loading quests
- sLog->outString("Loading Quest POI");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quest POI");
sObjectMgr->LoadQuestPOI();
- sLog->outString("Loading Quests Relations...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quests Relations...");
sObjectMgr->LoadQuestRelations(); // must be after quest load
- sLog->outString("Loading Objects Pooling Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Objects Pooling Data...");
sPoolMgr->LoadFromDB();
- sLog->outString("Loading Game Event Data..."); // must be after loading pools fully
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Game Event Data..."); // must be after loading pools fully
sGameEventMgr->LoadFromDB();
- sLog->outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
sObjectMgr->LoadNPCSpellClickSpells();
- sLog->outString("Loading Vehicle Template Accessories...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Vehicle Template Accessories...");
sObjectMgr->LoadVehicleTemplateAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
- sLog->outString("Loading Vehicle Accessories...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Vehicle Accessories...");
sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
- sLog->outString("Loading Dungeon boss data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Dungeon boss data...");
sObjectMgr->LoadInstanceEncounters();
- sLog->outString("Loading LFG rewards...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading LFG rewards...");
sLFGMgr->LoadRewards();
- sLog->outString("Loading SpellArea Data..."); // must be after quest load
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading SpellArea Data..."); // must be after quest load
sSpellMgr->LoadSpellAreas();
- sLog->outString("Loading AreaTrigger definitions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading AreaTrigger definitions...");
sObjectMgr->LoadAreaTriggerTeleports();
- sLog->outString("Loading Access Requirements...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Access Requirements...");
sObjectMgr->LoadAccessRequirements(); // must be after item template load
- sLog->outString("Loading Quest Area Triggers...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Quest Area Triggers...");
sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests
- sLog->outString("Loading Tavern Area Triggers...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Tavern Area Triggers...");
sObjectMgr->LoadTavernAreaTriggers();
- sLog->outString("Loading AreaTrigger script names...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading AreaTrigger script names...");
sObjectMgr->LoadAreaTriggerScripts();
- sLog->outString("Loading Graveyard-zone links...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Graveyard-zone links...");
sObjectMgr->LoadGraveyardZones();
- sLog->outString("Loading spell pet auras...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading spell pet auras...");
sSpellMgr->LoadSpellPetAuras();
- sLog->outString("Loading Spell target coordinates...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Spell target coordinates...");
sSpellMgr->LoadSpellTargetPositions();
- sLog->outString("Loading enchant custom attributes...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading enchant custom attributes...");
sSpellMgr->LoadEnchantCustomAttr();
- sLog->outString("Loading linked spells...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading linked spells...");
sSpellMgr->LoadSpellLinked();
- sLog->outString("Loading Player Create Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Data...");
sObjectMgr->LoadPlayerInfo();
- sLog->outString("Loading Exploration BaseXP Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Exploration BaseXP Data...");
sObjectMgr->LoadExplorationBaseXP();
- sLog->outString("Loading Pet Name Parts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Pet Name Parts...");
sObjectMgr->LoadPetNames();
CharacterDatabaseCleaner::CleanDatabase();
- sLog->outString("Loading the max pet number...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading the max pet number...");
sObjectMgr->LoadPetNumber();
- sLog->outString("Loading pet level stats...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading pet level stats...");
sObjectMgr->LoadPetLevelInfo();
- sLog->outString("Loading Player Corpses...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Corpses...");
sObjectMgr->LoadCorpses();
- sLog->outString("Loading Player level dependent mail rewards...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player level dependent mail rewards...");
sObjectMgr->LoadMailLevelRewards();
// Loot tables
LoadLootTables();
- sLog->outString("Loading Skill Discovery Table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Skill Discovery Table...");
LoadSkillDiscoveryTable();
- sLog->outString("Loading Skill Extra Item Table...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Skill Extra Item Table...");
LoadSkillExtraItemTable();
- sLog->outString("Loading Skill Fishing base level requirements...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Skill Fishing base level requirements...");
sObjectMgr->LoadFishingBaseSkillLevel();
- sLog->outString("Loading Achievements...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Achievements...");
sAchievementMgr->LoadAchievementReferenceList();
- sLog->outString("Loading Achievement Criteria Lists...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Achievement Criteria Lists...");
sAchievementMgr->LoadAchievementCriteriaList();
- sLog->outString("Loading Achievement Criteria Data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Achievement Criteria Data...");
sAchievementMgr->LoadAchievementCriteriaData();
- sLog->outString("Loading Achievement Rewards...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Achievement Rewards...");
sAchievementMgr->LoadRewards();
- sLog->outString("Loading Achievement Reward Locales...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Achievement Reward Locales...");
sAchievementMgr->LoadRewardLocales();
- sLog->outString("Loading Completed Achievements...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Completed Achievements...");
sAchievementMgr->LoadCompletedAchievements();
// Delete expired auctions before loading
- sLog->outString("Deleting expired auctions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Deleting expired auctions...");
sAuctionMgr->DeleteExpiredAuctionsAtStartup();
///- Load dynamic data tables from the database
- sLog->outString("Loading Item Auctions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Item Auctions...");
sAuctionMgr->LoadAuctionItems();
- sLog->outString("Loading Auctions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Auctions...");
sAuctionMgr->LoadAuctions();
sGuildMgr->LoadGuilds();
- sLog->outString("Loading ArenaTeams...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading ArenaTeams...");
sArenaTeamMgr->LoadArenaTeams();
- sLog->outString("Loading Groups...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Groups...");
sGroupMgr->LoadGroups();
- sLog->outString("Loading ReservedNames...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading ReservedNames...");
sObjectMgr->LoadReservedPlayersNames();
- sLog->outString("Loading GameObjects for quests...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading GameObjects for quests...");
sObjectMgr->LoadGameObjectForQuests();
- sLog->outString("Loading BattleMasters...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading BattleMasters...");
sBattlegroundMgr->LoadBattleMastersEntry();
- sLog->outString("Loading GameTeleports...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading GameTeleports...");
sObjectMgr->LoadGameTele();
- sLog->outString("Loading Gossip menu...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Gossip menu...");
sObjectMgr->LoadGossipMenu();
- sLog->outString("Loading Gossip menu options...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Gossip menu options...");
sObjectMgr->LoadGossipMenuItems();
- sLog->outString("Loading Vendors...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Vendors...");
sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
- sLog->outString("Loading Trainers...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Trainers...");
sObjectMgr->LoadTrainerSpell(); // must be after load CreatureTemplate
- sLog->outString("Loading Waypoints...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Waypoints...");
sWaypointMgr->Load();
- sLog->outString("Loading SmartAI Waypoints...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading SmartAI Waypoints...");
sSmartWaypointMgr->LoadFromDB();
- sLog->outString("Loading Creature Formations...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Formations...");
sFormationMgr->LoadCreatureFormations();
- sLog->outString("Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions
LoadWorldStates();
- sLog->outString("Loading Conditions...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Conditions...");
sConditionMgr->LoadConditions();
- sLog->outString("Loading faction change achievement pairs...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading faction change achievement pairs...");
sObjectMgr->LoadFactionChangeAchievements();
- sLog->outString("Loading faction change spell pairs...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading faction change spell pairs...");
sObjectMgr->LoadFactionChangeSpells();
- sLog->outString("Loading faction change item pairs...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading faction change item pairs...");
sObjectMgr->LoadFactionChangeItems();
- sLog->outString("Loading faction change reputation pairs...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading faction change reputation pairs...");
sObjectMgr->LoadFactionChangeReputations();
- sLog->outString("Loading GM tickets...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading GM tickets...");
sTicketMgr->LoadTickets();
- sLog->outString("Loading GM surveys...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading GM surveys...");
sTicketMgr->LoadSurveys();
- sLog->outString("Loading client addons...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading client addons...");
AddonMgr::LoadFromDB();
///- Handle outdated emails (delete/return)
- sLog->outString("Returning old mails...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Returning old mails...");
sObjectMgr->ReturnOrDeleteOldMails(false);
- sLog->outString("Loading Autobroadcasts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Autobroadcasts...");
LoadAutobroadcasts();
///- Load and initialize scripts
@@ -1626,42 +1625,42 @@ void World::SetInitialWorldSettings()
sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadWaypointScripts();
- sLog->outString("Loading Scripts text locales..."); // must be after Load*Scripts calls
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Scripts text locales..."); // must be after Load*Scripts calls
sObjectMgr->LoadDbScriptStrings();
- sLog->outString("Loading CreatureEventAI Texts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading CreatureEventAI Texts...");
sEventAIMgr->LoadCreatureEventAI_Texts();
- sLog->outString("Loading CreatureEventAI Summons...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading CreatureEventAI Summons...");
sEventAIMgr->LoadCreatureEventAI_Summons();
- sLog->outString("Loading CreatureEventAI Scripts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading CreatureEventAI Scripts...");
sEventAIMgr->LoadCreatureEventAI_Scripts();
- sLog->outString("Loading spell script names...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading spell script names...");
sObjectMgr->LoadSpellScriptNames();
- sLog->outString("Loading Creature Texts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Texts...");
sCreatureTextMgr->LoadCreatureTexts();
- sLog->outString("Loading Creature Text Locales...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Text Locales...");
sCreatureTextMgr->LoadCreatureTextLocales();
- sLog->outString("Initializing Scripts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Initializing Scripts...");
sScriptMgr->Initialize();
sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized
- sLog->outString("Validating spell scripts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Validating spell scripts...");
sObjectMgr->ValidateSpellScripts();
- sLog->outString("Loading SmartAI scripts...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading SmartAI scripts...");
sSmartScriptMgr->LoadSmartAIFromDB();
- sLog->outString("Loading Calendar data...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Calendar data...");
sCalendarMgr->LoadFromDB();
///- Initialize game time and timers
- sLog->outString("Initialize game time and timers");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Initialize game time and timers");
m_gameTime = time(NULL);
m_startTime = m_gameTime;
@@ -1688,16 +1687,16 @@ void World::SetInitialWorldSettings()
mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
//1440
mail_timer_expires = ((DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
- sLog->outDetail("Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires));
+ sLog->outInfo(LOG_FILTER_GENERAL, "Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires));
///- Initilize static helper structures
AIRegistry::Initialize();
///- Initialize MapManager
- sLog->outString("Starting Map System");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Starting Map System");
sMapMgr->Initialize();
- sLog->outString("Starting Game Event system...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Starting Game Event system...");
uint32 nextGameEvent = sGameEventMgr->StartSystem();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
@@ -1707,67 +1706,57 @@ void World::SetInitialWorldSettings()
// Delete all custom channels which haven't been used for PreserveCustomChannelDuration days.
Channel::CleanOldChannelsInDB();
- sLog->outString("Starting Arena Season...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Starting Arena Season...");
sGameEventMgr->StartArenaSeason();
sTicketMgr->Initialize();
///- Initialize Battlegrounds
- sLog->outString("Starting Battleground System");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Starting Battleground System");
sBattlegroundMgr->CreateInitialBattlegrounds();
sBattlegroundMgr->InitAutomaticArenaPointDistribution();
///- Initialize outdoor pvp
- sLog->outString("Starting Outdoor PvP System");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Starting Outdoor PvP System");
sOutdoorPvPMgr->InitOutdoorPvP();
- sLog->outString("Loading Transports...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Transports...");
sMapMgr->LoadTransports();
- sLog->outString("Loading Transport NPCs...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Transport NPCs...");
sMapMgr->LoadTransportNPCs();
///- Initialize Warden
- sLog->outString("Loading Warden Checks..." );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Warden Checks...");
sWardenCheckMgr->LoadWardenChecks();
- sLog->outString("Loading Warden Action Overrides..." );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading Warden Action Overrides...");
sWardenCheckMgr->LoadWardenOverrides();
- sLog->outString("Deleting expired bans...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Deleting expired bans...");
LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query
- sLog->outString("Calculate next daily quest reset time...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Calculate next daily quest reset time...");
InitDailyQuestResetTime();
- sLog->outString("Calculate next weekly quest reset time..." );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Calculate next weekly quest reset time...");
InitWeeklyQuestResetTime();
- sLog->outString("Calculate random battleground reset time..." );
+ sLog->outInfo(LOG_FILTER_GENERAL, "Calculate random battleground reset time...");
InitRandomBGResetTime();
LoadCharacterNameData();
- // possibly enable db logging; avoid massive startup spam by doing it here.
- if (sLog->GetLogDBLater())
- {
- sLog->outString("Enabling database logging...");
- sLog->SetLogDBLater(false);
- sLog->SetLogDB(true);
- }
- else
- sLog->SetLogDB(false);
-
- sLog->outString("Initializing Opcodes...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Initializing Opcodes...");
InitOpcodes();
- sLog->outString("Loading hotfix info...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading hotfix info...");
sObjectMgr->LoadHotfixData();
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
- sLog->outString();
- sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
- sLog->outString();
+
+ sLog->outInfo(LOG_FILTER_GENERAL, "WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
+ sLog->EnableDBAppenders();
}
void World::DetectDBCLang()
@@ -1776,7 +1765,7 @@ void World::DetectDBCLang()
if (m_lang_confid >= TOTAL_LOCALES)
{
- sLog->outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES);
+ sLog->outError(LOG_FILTER_GENERAL, "Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES);
m_lang_confid = LOCALE_enUS;
}
@@ -1804,14 +1793,13 @@ void World::DetectDBCLang()
if (default_locale >= TOTAL_LOCALES)
{
- sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)");
+ sLog->outError(LOG_FILTER_GENERAL, "Unable to determine your DBC Locale! (corrupt DBC?)");
exit(1);
}*/
m_defaultDbcLocale = LocaleConstant(m_lang_confid);
- sLog->outString("Using %s DBC Locale", localeNames[m_defaultDbcLocale]);
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, "Using %s DBC Locale", localeNames[m_defaultDbcLocale]);
}
void World::RecordTimeDiff(const char *text, ...)
@@ -1834,7 +1822,7 @@ void World::RecordTimeDiff(const char *text, ...)
va_start(ap, text);
vsnprintf(str, 256, text, ap);
va_end(ap);
- sLog->outDetail("Difftime %s: %u.", str, diff);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Difftime %s: %u.", str, diff);
}
m_currentTime = thisTime;
@@ -1850,8 +1838,8 @@ void World::LoadAutobroadcasts()
if (!result)
{
- sLog->outString(">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty!");
+
return;
}
@@ -1868,8 +1856,8 @@ void World::LoadAutobroadcasts()
++count;
} while (result->NextRow());
- sLog->outString(">> Loaded %u autobroadcasts definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u autobroadcasts definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
/// Update the World !
@@ -1881,7 +1869,7 @@ void World::Update(uint32 diff)
{
if (m_updateTimeSum > m_int_configs[CONFIG_INTERVAL_LOG_UPDATE])
{
- sLog->outBasic("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
m_updateTimeSum = m_updateTime;
m_updateTimeCount = 1;
}
@@ -2035,7 +2023,7 @@ void World::Update(uint32 diff)
if (m_timers[WUPDATE_PINGDB].Passed())
{
m_timers[WUPDATE_PINGDB].Reset();
- sLog->outDetail("Ping MySQL to keep connection alive");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Ping MySQL to keep connection alive");
CharacterDatabase.KeepAlive();
LoginDatabase.KeepAlive();
WorldDatabase.KeepAlive();
@@ -2509,7 +2497,7 @@ void World::ShutdownMsg(bool show, Player* player)
ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME;
SendServerMessage(msgid, str.c_str(), player);
- sLog->outStaticDebug("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str());
+ sLog->outDebug(LOG_FILTER_GENERAL, "Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str());
}
}
@@ -2527,7 +2515,7 @@ void World::ShutdownCancel()
m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value
SendServerMessage(msgid);
- sLog->outStaticDebug("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
+ sLog->outDebug(LOG_FILTER_GENERAL, "Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
sScriptMgr->OnShutdownCancel();
}
@@ -2583,7 +2571,7 @@ void World::ProcessCliCommands()
CliCommandHolder* command = NULL;
while (cliCmdQueue.next(command))
{
- sLog->outDetail("CLI command under processing...");
+ sLog->outInfo(LOG_FILTER_GENERAL, "CLI command under processing...");
zprint = command->m_print;
callbackArg = command->m_callbackArg;
CliHandler handler(callbackArg, zprint);
@@ -2628,7 +2616,7 @@ void World::SendAutoBroadcast()
sWorld->SendGlobalMessage(&data);
}
- sLog->outDetail("AutoBroadcast: '%s'", msg.c_str());
+ sLog->outInfo(LOG_FILTER_GENERAL, "AutoBroadcast: '%s'", msg.c_str());
}
void World::UpdateRealmCharCount(uint32 accountId)
@@ -2730,7 +2718,7 @@ void World::InitRandomBGResetTime()
void World::ResetDailyQuests()
{
- sLog->outDetail("Daily quests reset for all characters.");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Daily quests reset for all characters.");
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_DAILY);
CharacterDatabase.Execute(stmt);
@@ -2791,7 +2779,7 @@ void World::ResetEventSeasonalQuests(uint16 event_id)
void World::ResetRandomBG()
{
- sLog->outDetail("Random BG status reset for all characters.");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Random BG status reset for all characters.");
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BATTLEGROUND_RANDOM);
CharacterDatabase.Execute(stmt);
@@ -2855,8 +2843,8 @@ void World::LoadWorldStates()
if (!result)
{
- sLog->outString(">> Loaded 0 world states. DB table `worldstates` is empty!");
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 world states. DB table `worldstates` is empty!");
+
return;
}
@@ -2870,8 +2858,8 @@ void World::LoadWorldStates()
}
while (result->NextRow());
- sLog->outString(">> Loaded %u world states in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
- sLog->outString();
+ sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u world states in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
+
}
// Setting a worldstate will save it to DB
@@ -2927,12 +2915,12 @@ void World::ProcessQueryCallbacks()
void World::LoadCharacterNameData()
{
- sLog->outString("Loading character name data");
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loading character name data");
QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class FROM characters WHERE deleteDate IS NULL");
if (!result)
{
- sLog->outError("No character name data loaded, empty query");
+ sLog->outError(LOG_FILTER_GENERAL, "No character name data loaded, empty query");
return;
}
@@ -2946,7 +2934,7 @@ void World::LoadCharacterNameData()
++count;
} while (result->NextRow());
- sLog->outString("Loaded name data for %u characters", count);
+ sLog->outInfo(LOG_FILTER_GENERAL, "Loaded name data for %u characters", count);
}
void World::AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass)