From 928443d8993869dfbf3adceabe4ba0b3cfe0edef Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Dec 2010 23:25:44 +0100 Subject: Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming) --HG-- branch : trunk --- src/server/authserver/Main.cpp | 102 +- src/server/authserver/Realms/RealmList.cpp | 4 +- src/server/authserver/Realms/RealmList.h | 5 +- src/server/authserver/Server/AuthSocket.cpp | 88 +- src/server/authserver/Server/RealmSocket.cpp | 2 +- src/server/collision/Management/VMapManager2.cpp | 8 +- src/server/collision/Maps/MapTree.cpp | 26 +- src/server/game/AI/CoreAI/CombatAI.cpp | 8 +- src/server/game/AI/CoreAI/GuardAI.cpp | 14 +- src/server/game/AI/CoreAI/PetAI.cpp | 4 +- src/server/game/AI/CoreAI/UnitAI.cpp | 2 +- src/server/game/AI/CreatureAI.cpp | 8 +- src/server/game/AI/CreatureAISelector.cpp | 4 +- src/server/game/AI/EventAI/CreatureEventAI.cpp | 52 +- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 250 +-- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 8 +- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 36 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 20 +- src/server/game/AI/SmartScripts/SmartAI.cpp | 10 +- src/server/game/AI/SmartScripts/SmartScript.cpp | 44 +- src/server/game/AI/SmartScripts/SmartScript.h | 4 +- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 104 +- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 28 +- src/server/game/Achievements/AchievementMgr.cpp | 164 +- src/server/game/Addons/AddonMgr.cpp | 8 +- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 58 +- src/server/game/Battlegrounds/ArenaTeam.cpp | 48 +- src/server/game/Battlegrounds/Battleground.cpp | 72 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 98 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 50 +- .../game/Battlegrounds/Zones/BattlegroundAB.cpp | 10 +- .../game/Battlegrounds/Zones/BattlegroundAV.cpp | 114 +- .../game/Battlegrounds/Zones/BattlegroundBE.cpp | 6 +- .../game/Battlegrounds/Zones/BattlegroundDS.cpp | 6 +- .../game/Battlegrounds/Zones/BattlegroundEY.cpp | 24 +- .../game/Battlegrounds/Zones/BattlegroundNA.cpp | 6 +- .../game/Battlegrounds/Zones/BattlegroundRL.cpp | 6 +- .../game/Battlegrounds/Zones/BattlegroundRV.cpp | 6 +- .../game/Battlegrounds/Zones/BattlegroundSA.cpp | 4 +- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 20 +- src/server/game/Chat/Channels/Channel.cpp | 30 +- src/server/game/Chat/Channels/ChannelMgr.cpp | 2 +- src/server/game/Chat/Chat.cpp | 56 +- src/server/game/Chat/Commands/Level0.cpp | 20 +- src/server/game/Chat/Commands/Level1.cpp | 28 +- src/server/game/Chat/Commands/Level2.cpp | 18 +- src/server/game/Chat/Commands/Level3.cpp | 96 +- src/server/game/Conditions/ConditionMgr.cpp | 226 +-- src/server/game/Conditions/DisableMgr.cpp | 44 +- src/server/game/DataStores/DBCStores.cpp | 14 +- src/server/game/DungeonFinding/LFGMgr.cpp | 150 +- src/server/game/DungeonFinding/LFGScripts.cpp | 10 +- src/server/game/Entities/Corpse/Corpse.cpp | 12 +- src/server/game/Entities/Creature/Creature.cpp | 138 +- .../game/Entities/Creature/CreatureGroups.cpp | 28 +- src/server/game/Entities/Creature/CreatureGroups.h | 4 +- src/server/game/Entities/Creature/GossipDef.cpp | 26 +- .../game/Entities/Creature/TemporarySummon.cpp | 4 +- .../game/Entities/DynamicObject/DynamicObject.cpp | 8 +- src/server/game/Entities/GameObject/GameObject.cpp | 34 +- src/server/game/Entities/Item/Container/Bag.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 18 +- .../game/Entities/Item/ItemEnchantmentMgr.cpp | 10 +- src/server/game/Entities/Object/Object.cpp | 114 +- .../game/Entities/Object/Updates/UpdateData.cpp | 12 +- src/server/game/Entities/Pet/Pet.cpp | 44 +- src/server/game/Entities/Player/Player.cpp | 846 +++++------ src/server/game/Entities/Player/SocialMgr.cpp | 10 +- src/server/game/Entities/Transport/Transport.cpp | 58 +- src/server/game/Entities/Unit/Unit.cpp | 298 ++-- src/server/game/Entities/Vehicle/Vehicle.cpp | 18 +- src/server/game/Events/GameEventMgr.cpp | 262 ++-- src/server/game/Globals/ObjectAccessor.cpp | 6 +- src/server/game/Globals/ObjectAccessor.h | 6 +- src/server/game/Globals/ObjectMgr.cpp | 1590 ++++++++++---------- src/server/game/Globals/ObjectMgr.h | 10 +- src/server/game/Grids/GridStates.cpp | 6 +- src/server/game/Grids/GridStates.h | 2 +- src/server/game/Grids/ObjectGridLoader.cpp | 8 +- src/server/game/Groups/Group.cpp | 26 +- src/server/game/Guilds/Guild.cpp | 90 +- src/server/game/Instances/InstanceSaveMgr.cpp | 28 +- src/server/game/Instances/InstanceScript.cpp | 18 +- src/server/game/Instances/InstanceScript.h | 12 +- src/server/game/Loot/LootMgr.cpp | 136 +- src/server/game/Mails/Mail.cpp | 6 +- src/server/game/Maps/Map.cpp | 186 +-- src/server/game/Maps/MapInstanced.cpp | 10 +- src/server/game/Maps/MapManager.cpp | 22 +- src/server/game/Miscellaneous/Formulas.h | 4 +- src/server/game/Movement/MotionMaster.cpp | 56 +- .../MovementGenerators/HomeMovementGenerator.cpp | 2 +- .../MovementGenerators/PointMovementGenerator.cpp | 2 +- .../WaypointMovementGenerator.cpp | 8 +- .../game/Movement/Waypoints/WaypointManager.cpp | 8 +- src/server/game/OutdoorPvP/OutdoorPvP.cpp | 14 +- src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp | 24 +- src/server/game/Pools/PoolMgr.cpp | 108 +- src/server/game/Quests/QuestDef.cpp | 4 +- src/server/game/Reputation/ReputationMgr.cpp | 4 +- src/server/game/Scripting/MapScripts.cpp | 114 +- src/server/game/Scripting/ScriptMgr.cpp | 28 +- src/server/game/Scripting/ScriptMgr.h | 8 +- src/server/game/Scripting/ScriptSystem.cpp | 66 +- .../game/Server/Protocol/Handlers/AddonHandler.cpp | 6 +- .../Server/Protocol/Handlers/ArenaTeamHandler.cpp | 34 +- .../Protocol/Handlers/AuctionHouseHandler.cpp | 48 +- .../Protocol/Handlers/BattleGroundHandler.cpp | 74 +- .../Server/Protocol/Handlers/CalendarHandler.cpp | 32 +- .../Server/Protocol/Handlers/ChannelHandler.cpp | 34 +- .../Server/Protocol/Handlers/CharacterHandler.cpp | 122 +- .../game/Server/Protocol/Handlers/ChatHandler.cpp | 48 +- .../Server/Protocol/Handlers/CombatHandler.cpp | 12 +- .../game/Server/Protocol/Handlers/DuelHandler.cpp | 8 +- .../game/Server/Protocol/Handlers/GroupHandler.cpp | 26 +- .../game/Server/Protocol/Handlers/GuildHandler.cpp | 70 +- .../game/Server/Protocol/Handlers/ItemHandler.cpp | 98 +- .../game/Server/Protocol/Handlers/LFGHandler.cpp | 60 +- .../game/Server/Protocol/Handlers/LootHandler.cpp | 18 +- .../game/Server/Protocol/Handlers/MailHandler.cpp | 30 +- .../game/Server/Protocol/Handlers/MiscHandler.cpp | 234 +-- .../Server/Protocol/Handlers/MovementHandler.cpp | 40 +- .../game/Server/Protocol/Handlers/NPCHandler.cpp | 58 +- .../game/Server/Protocol/Handlers/PetHandler.cpp | 62 +- .../Server/Protocol/Handlers/PetitionsHandler.cpp | 78 +- .../game/Server/Protocol/Handlers/QueryHandler.cpp | 34 +- .../game/Server/Protocol/Handlers/QuestHandler.cpp | 48 +- .../game/Server/Protocol/Handlers/SkillHandler.cpp | 6 +- .../game/Server/Protocol/Handlers/SpellHandler.cpp | 30 +- .../game/Server/Protocol/Handlers/TaxiHandler.cpp | 32 +- .../Server/Protocol/Handlers/TicketHandler.cpp | 12 +- .../game/Server/Protocol/Handlers/TradeHandler.cpp | 44 +- .../Server/Protocol/Handlers/VoiceChatHandler.cpp | 6 +- src/server/game/Server/Protocol/WorldLog.cpp | 14 +- src/server/game/Server/Protocol/WorldLog.h | 2 +- src/server/game/Server/WorldSession.cpp | 68 +- src/server/game/Server/WorldSession.h | 2 +- src/server/game/Server/WorldSocket.cpp | 94 +- src/server/game/Server/WorldSocketMgr.cpp | 26 +- src/server/game/Skills/SkillDiscovery.cpp | 24 +- src/server/game/Skills/SkillExtraItems.cpp | 16 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 36 +- src/server/game/Spells/Auras/SpellAuras.cpp | 18 +- src/server/game/Spells/Spell.cpp | 110 +- src/server/game/Spells/SpellEffects.cpp | 124 +- src/server/game/Spells/SpellMgr.cpp | 250 +-- src/server/game/Spells/SpellMgr.h | 12 +- src/server/game/Spells/SpellScript.cpp | 48 +- src/server/game/Texts/CreatureTextMgr.cpp | 40 +- src/server/game/Tickets/TicketMgr.cpp | 12 +- src/server/game/Tickets/TicketMgr.h | 2 +- src/server/game/Tools/CharacterDatabaseCleaner.cpp | 10 +- src/server/game/Tools/PlayerDump.cpp | 6 +- src/server/game/Weather/Weather.cpp | 12 +- src/server/game/Weather/WeatherMgr.cpp | 14 +- src/server/game/World/World.cpp | 1120 +++++++------- src/server/game/World/World.h | 2 +- src/server/scripts/Commands/cs_account.cpp | 4 +- src/server/scripts/Commands/cs_debug.cpp | 18 +- src/server/scripts/Commands/cs_gm.cpp | 4 +- src/server/scripts/Commands/cs_go.cpp | 8 +- src/server/scripts/Commands/cs_gobject.cpp | 6 +- src/server/scripts/Commands/cs_modify.cpp | 6 +- src/server/scripts/Commands/cs_npc.cpp | 16 +- src/server/scripts/Commands/cs_reload.cpp | 206 +-- src/server/scripts/Commands/cs_wp.cpp | 34 +- .../BlackrockDepths/blackrock_depths.cpp | 2 +- .../BlackrockDepths/instance_blackrock_depths.cpp | 4 +- .../BlackwingLair/boss_victor_nefarius.cpp | 2 +- .../Karazhan/boss_shade_of_aran.cpp | 2 +- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 6 +- .../scripts/EasternKingdoms/Karazhan/karazhan.cpp | 8 +- .../scripts/EasternKingdoms/Karazhan/karazhan.h | 2 +- .../MagistersTerrace/boss_selin_fireheart.cpp | 8 +- .../instance_magisters_terrace.cpp | 2 +- .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 12 +- .../Stratholme/instance_stratholme.cpp | 14 +- .../SunwellPlateau/boss_brutallus.cpp | 6 +- .../SunwellPlateau/boss_kalecgos.cpp | 2 +- .../SunwellPlateau/boss_kiljaeden.cpp | 4 +- .../SunwellPlateau/instance_sunwell_plateau.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 4 +- .../EasternKingdoms/ZulAman/instance_zulaman.cpp | 8 +- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 2 +- .../scripts/EasternKingdoms/silverpine_forest.cpp | 2 +- src/server/scripts/Examples/example_spell.cpp | 22 +- .../CavernsOfTime/BattleForMountHyjal/hyjal.cpp | 4 +- .../CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp | 8 +- .../BattleForMountHyjal/instance_hyjal.cpp | 2 +- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 4 +- .../DarkPortal/instance_dark_portal.cpp | 10 +- .../instance_old_hillsbrad.cpp | 20 +- .../RazorfenKraul/instance_razorfen_kraul.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 4 +- src/server/scripts/Kalimdor/azshara.cpp | 2 +- src/server/scripts/Kalimdor/azuremyst_isle.cpp | 2 +- .../instance_trial_of_the_crusader.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_gothik.cpp | 2 +- .../UtgardeKeep/instance_utgarde_keep.cpp | 2 +- src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp | 32 +- src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp | 8 +- src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp | 8 +- src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp | 4 +- src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp | 8 +- src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp | 16 +- .../ShadowLabyrinth/instance_shadow_labyrinth.cpp | 8 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 2 +- .../Outland/BlackTemple/boss_shade_of_akama.cpp | 16 +- .../Outland/BlackTemple/illidari_council.cpp | 6 +- .../Outland/BlackTemple/instance_black_temple.cpp | 2 +- .../SteamVault/instance_steam_vault.cpp | 4 +- .../instance_hellfire_ramparts.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 6 +- src/server/scripts/Outland/hellfire_peninsula.cpp | 2 +- src/server/scripts/Outland/netherstorm.cpp | 2 +- src/server/scripts/Spells/spell_warlock.cpp | 2 +- src/server/scripts/World/chat_log.cpp | 68 +- src/server/scripts/World/go_scripts.cpp | 2 +- src/server/scripts/World/item_scripts.cpp | 2 +- src/server/scripts/World/npc_professions.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 12 +- src/server/shared/Configuration/Config.cpp | 2 +- src/server/shared/Configuration/Config.h | 2 +- src/server/shared/DataStores/DBCStore.h | 10 +- src/server/shared/Database/DatabaseWorkerPool.h | 18 +- src/server/shared/Database/Field.h | 24 +- src/server/shared/Database/MySQLConnection.cpp | 72 +- src/server/shared/Database/PreparedStatement.cpp | 4 +- src/server/shared/Database/QueryHolder.cpp | 8 +- src/server/shared/Database/QueryResult.cpp | 4 +- src/server/shared/Database/SQLStorageImpl.h | 6 +- src/server/shared/Database/Transaction.cpp | 4 +- src/server/shared/Debugging/Errors.h | 6 +- src/server/shared/Logging/Log.cpp | 44 +- src/server/shared/Logging/Log.h | 2 +- src/server/shared/Packets/ByteBuffer.h | 40 +- src/server/shared/Utilities/ServiceWin32.cpp | 2 +- src/server/worldserver/CommandLine/CliRunnable.cpp | 18 +- src/server/worldserver/Main.cpp | 26 +- src/server/worldserver/Master.cpp | 136 +- src/server/worldserver/Master.h | 2 +- src/server/worldserver/RemoteAccess/RARunnable.cpp | 12 +- src/server/worldserver/RemoteAccess/RASocket.cpp | 32 +- src/server/worldserver/TCSoap/TCSoap.cpp | 20 +- .../worldserver/WorldThread/WorldRunnable.cpp | 6 +- 245 files changed, 5720 insertions(+), 5723 deletions(-) (limited to 'src') diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index 7f7d2e39561..9d9dbf1b450 100755 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -88,7 +88,7 @@ class RealmdSignalHandler : public Trinity::SignalHandler /// Print out the usage string for this program on the console. void usage(const char *prog) { - sLog.outString("Usage: \n %s []\n" + sLog->outString("Usage: \n %s []\n" " -c config_file use config_file as configuration file\n\r" #ifdef _WIN32 " Running as service functions:\n\r" @@ -102,7 +102,7 @@ void usage(const char *prog) /// Launch the realm server extern int main(int argc, char **argv) { - sLog.SetLogDB(false); + sLog->SetLogDB(false); ///- Command line parsing to get the configuration file name char const* cfg_file = _TRINITY_REALM_CONFIG; int c=1; @@ -112,7 +112,7 @@ extern int main(int argc, char **argv) { if (++c >= argc) { - sLog.outError("Runtime-Error: -c option requires an input argument"); + sLog->outError("Runtime-Error: -c option requires an input argument"); usage(argv[0]); return 1; } @@ -128,25 +128,25 @@ extern int main(int argc, char **argv) { if (++c >= argc) { - sLog.outError("Runtime-Error: -s option requires an input argument"); + sLog->outError("Runtime-Error: -s option requires an input argument"); usage(argv[0]); return 1; } if (strcmp(argv[c],"install") == 0) { if (WinServiceInstall()) - sLog.outString("Installing service"); + sLog->outString("Installing service"); return 1; } else if (strcmp(argv[c],"uninstall") == 0) { if (WinServiceUninstall()) - sLog.outString("Uninstalling service"); + sLog->outString("Uninstalling service"); return 1; } else { - sLog.outError("Runtime-Error: unsupported option %s",argv[c]); + sLog->outError("Runtime-Error: unsupported option %s",argv[c]); usage(argv[0]); return 1; } @@ -160,19 +160,19 @@ extern int main(int argc, char **argv) ++c; } - if (!sConfig.SetSource(cfg_file)) + if (!sConfig->SetSource(cfg_file)) { - sLog.outError("Invalid or missing configuration file : %s", cfg_file); - sLog.outError("Verify that the file exists and has \'[authserver]\' written in the top of the file!"); + sLog->outError("Invalid or missing configuration file : %s", cfg_file); + sLog->outError("Verify that the file exists and has \'[authserver]\' written in the top of the file!"); return 1; } - sLog.Initialize(); + sLog->Initialize(); - sLog.outString("%s (realm-daemon)", _FULLVERSION); - sLog.outString(" to stop.\n"); - sLog.outString("Using configuration file %s.", cfg_file); + sLog->outString("%s (realm-daemon)", _FULLVERSION); + sLog->outString(" to stop.\n"); + sLog->outString("Using configuration file %s.", cfg_file); - sLog.outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + sLog->outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); #if defined (ACE_HAS_EVENT_POLL) || defined (ACE_HAS_DEV_POLL) ACE_Reactor::instance(new ACE_Reactor(new ACE_Dev_Poll_Reactor(ACE::max_handles(), 1), 1), true); @@ -180,20 +180,20 @@ extern int main(int argc, char **argv) ACE_Reactor::instance(new ACE_Reactor(new ACE_TP_Reactor(), true), true); #endif - sLog.outBasic("Max allowed open files is %d", ACE::max_handles()); + sLog->outBasic("Max allowed open files is %d", ACE::max_handles()); /// realmd PID file creation - std::string pidfile = sConfig.GetStringDefault("PidFile", ""); + std::string pidfile = sConfig->GetStringDefault("PidFile", ""); if (!pidfile.empty()) { uint32 pid = CreatePIDFile(pidfile); if (!pid) { - sLog.outError("Cannot create PID file %s.\n", pidfile.c_str()); + sLog->outError("Cannot create PID file %s.\n", pidfile.c_str()); return 1; } - sLog.outString("Daemon PID: %u\n", pid); + sLog->outString("Daemon PID: %u\n", pid); } ///- Initialize the database connection @@ -201,29 +201,29 @@ extern int main(int argc, char **argv) return 1; ///- Initialize the log database - sLog.SetLogDBLater(sConfig.GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished. - sLog.SetLogDB(false); - sLog.SetRealmID(0); // ensure we've set realm to 0 (realmd realmid) + sLog->SetLogDBLater(sConfig->GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished. + sLog->SetLogDB(false); + sLog->SetRealmID(0); // ensure we've set realm to 0 (realmd realmid) ///- Get the list of realms for the server - sRealmList->Initialize(sConfig.GetIntDefault("RealmsStateUpdateDelay", 20)); + sRealmList->Initialize(sConfig->GetIntDefault("RealmsStateUpdateDelay", 20)); if (sRealmList->size() == 0) { - sLog.outError("No valid realms specified."); + sLog->outError("No valid realms specified."); return 1; } ///- Launch the listening network socket RealmAcceptor acceptor; - uint16 rmport = sConfig.GetIntDefault("RealmServerPort", 3724); - std::string bind_ip = sConfig.GetStringDefault("BindIP", "0.0.0.0"); + uint16 rmport = sConfig->GetIntDefault("RealmServerPort", 3724); + std::string bind_ip = sConfig->GetStringDefault("BindIP", "0.0.0.0"); ACE_INET_Addr bind_addr(rmport, bind_ip.c_str()); if (acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1) { - sLog.outError("Trinity realm can not bind to %s:%d", bind_ip.c_str(), rmport); + sLog->outError("Trinity realm can not bind to %s:%d", bind_ip.c_str(), rmport); return 1; } @@ -246,7 +246,7 @@ extern int main(int argc, char **argv) { HANDLE hProcess = GetCurrentProcess(); - uint32 Aff = sConfig.GetIntDefault("UseProcessors", 0); + uint32 Aff = sConfig->GetIntDefault("UseProcessors", 0); if (Aff > 0) { ULONG_PTR appAff; @@ -258,46 +258,46 @@ extern int main(int argc, char **argv) if (!curAff) { - sLog.outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for realmd. Accessible processors bitmask (hex): %x",Aff,appAff); + sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for realmd. Accessible processors bitmask (hex): %x",Aff,appAff); } else { if (SetProcessAffinityMask(hProcess,curAff)) - sLog.outString("Using processors (bitmask, hex): %x", curAff); + sLog->outString("Using processors (bitmask, hex): %x", curAff); else - sLog.outError("Can't set used processors (hex): %x", curAff); + sLog->outError("Can't set used processors (hex): %x", curAff); } } - sLog.outString(); + sLog->outString(); } - bool Prio = sConfig.GetBoolDefault("ProcessPriority", false); + bool Prio = sConfig->GetBoolDefault("ProcessPriority", false); if (Prio) { if (SetPriorityClass(hProcess,HIGH_PRIORITY_CLASS)) - sLog.outString("TrinityRealm process priority class set to HIGH"); + sLog->outString("TrinityRealm process priority class set to HIGH"); else - sLog.outError("Can't set realmd process priority class."); - sLog.outString(); + sLog->outError("Can't set realmd process priority class."); + sLog->outString(); } } #endif // maximum counter for next ping - uint32 numLoops = (sConfig.GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000)); + uint32 numLoops = (sConfig->GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000)); uint32 loopCounter = 0; // possibly enable db logging; avoid massive startup spam by doing it here. - if (sLog.GetLogDBLater()) + if (sLog->GetLogDBLater()) { - sLog.outString("Enabling database logging..."); - sLog.SetLogDBLater(false); + sLog->outString("Enabling database logging..."); + sLog->SetLogDBLater(false); // login db needs thread for logging - sLog.SetLogDB(true); + sLog->SetLogDB(true); } else - sLog.SetLogDB(false); + sLog->SetLogDB(false); ///- Wait for termination signal while (!stopEvent) @@ -311,7 +311,7 @@ extern int main(int argc, char **argv) if ((++loopCounter) == numLoops) { loopCounter = 0; - sLog.outDetail("Ping MySQL to keep connection alive"); + sLog->outDetail("Ping MySQL to keep connection alive"); LoginDatabase.KeepAlive(); } #ifdef _WIN32 @@ -323,38 +323,38 @@ extern int main(int argc, char **argv) ///- Close the Database Pool LoginDatabase.Close(); - sLog.outString("Halting process..."); + sLog->outString("Halting process..."); return 0; } /// Initialize connection to the database bool StartDB() { - std::string dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", ""); + std::string dbstring = sConfig->GetStringDefault("LoginDatabaseInfo", ""); if (dbstring.empty()) { - sLog.outError("Database not specified"); + sLog->outError("Database not specified"); return false; } - uint8 worker_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1); + uint8 worker_threads = sConfig->GetIntDefault("LoginDatabase.WorkerThreads", 1); if (worker_threads < 1 || worker_threads > 32) { - sLog.outError("Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); + sLog->outError("Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); worker_threads = 1; } - uint8 synch_threads = sConfig.GetIntDefault("LoginDatabase.SynchThreads", 1); + uint8 synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1); if (synch_threads < 1 || synch_threads > 32) { - sLog.outError("Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); + sLog->outError("Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); synch_threads = 1; } /// NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever. if (!LoginDatabase.Open(dbstring.c_str(), worker_threads, synch_threads)) { - sLog.outError("Cannot connect to database"); + sLog->outError("Cannot connect to database"); return false; } diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 66abaf17aa8..608657c844e 100755 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -74,7 +74,7 @@ void RealmList::UpdateIfNeed() void RealmList::UpdateRealms(bool init) { - sLog.outDetail("Updating Realm List..."); + sLog->outDetail("Updating Realm List..."); PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_REALMLIST); PreparedQueryResult result = LoginDatabase.Query(stmt); @@ -99,7 +99,7 @@ void RealmList::UpdateRealms(bool init) UpdateRealm(realmId, name, address, port, icon, color, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); if (init) - sLog.outString("Added realm \"%s\".", fields[1].GetCString()); + sLog->outString("Added realm \"%s\".", fields[1].GetCString()); } while (result->NextRow()); } diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index aa9e47e4877..c5877aa9d61 100755 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -45,9 +45,6 @@ struct Realm class RealmList { public: - // Null_Mutex is safe because the singleton initialized before the acceptor initialized(another place where the singleton called) - static RealmList* instance() { return ACE_Singleton::instance(); } - typedef std::map RealmMap; RealmList(); @@ -71,7 +68,7 @@ class RealmList time_t m_NextUpdateTime; }; -#define sRealmList RealmList::instance() +#define sRealmList ACE_Singleton::instance() #endif /// @} diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index e57424a4ee5..55dd9007480 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -211,12 +211,12 @@ AuthSocket::~AuthSocket(void) {} // Accept the connection and set the s random value for SRP6 void AuthSocket::OnAccept(void) { - sLog.outBasic("Accepting connection from '%s'", socket().get_remote_address().c_str()); + sLog->outBasic("Accepting connection from '%s'", socket().get_remote_address().c_str()); } void AuthSocket::OnClose(void) { - sLog.outDebug("AuthSocket::OnClose"); + sLog->outDebug("AuthSocket::OnClose"); } // Read the packet from the client @@ -237,11 +237,11 @@ void AuthSocket::OnRead() (table[i].status == STATUS_CONNECTED || (_authed && table[i].status == STATUS_AUTHED))) { - sLog.outStaticDebug("[Auth] got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); + sLog->outStaticDebug("[Auth] got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); if (!(*this.*table[i].handler)()) { - sLog.outStaticDebug("Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); + sLog->outStaticDebug("Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); return; } break; @@ -251,7 +251,7 @@ void AuthSocket::OnRead() // Report unknown packets in the error log if (i == AUTH_TOTAL_COMMANDS) { - sLog.outError("[Auth] got unknown packet from '%s'", socket().get_remote_address().c_str()); + sLog->outError("[Auth] got unknown packet from '%s'", socket().get_remote_address().c_str()); socket().shutdown(); return; } @@ -299,7 +299,7 @@ void AuthSocket::_SetVSFields(const std::string& rI) // Logon Challenge command handler bool AuthSocket::_HandleLogonChallenge() { - sLog.outStaticDebug("Entering _HandleLogonChallenge"); + sLog->outStaticDebug("Entering _HandleLogonChallenge"); if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) return false; @@ -314,7 +314,7 @@ bool AuthSocket::_HandleLogonChallenge() #endif uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; - sLog.outStaticDebug("[AuthChallenge] got header, body is %#04x bytes", remaining); + sLog->outStaticDebug("[AuthChallenge] got header, body is %#04x bytes", remaining); if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining)) return false; @@ -326,8 +326,8 @@ bool AuthSocket::_HandleLogonChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); - sLog.outStaticDebug("[AuthChallenge] got full packet, %#04x bytes", ch->size); - sLog.outStaticDebug("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); + sLog->outStaticDebug("[AuthChallenge] got full packet, %#04x bytes", ch->size); + sLog->outStaticDebug("[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); // BigEndian code, nop in little endian case // size already converted @@ -360,7 +360,7 @@ bool AuthSocket::_HandleLogonChallenge() if (result) { pkt << (uint8)WOW_FAIL_BANNED; - sLog.outBasic("[AuthChallenge] Banned ip %s tried to login!", ip_address.c_str()); + sLog->outBasic("[AuthChallenge] Banned ip %s tried to login!", ip_address.c_str()); } else { @@ -378,20 +378,20 @@ bool AuthSocket::_HandleLogonChallenge() bool locked = false; if (fields[2].GetUInt8() == 1) // if ip is locked { - sLog.outStaticDebug("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); - sLog.outStaticDebug("[AuthChallenge] Player address is '%s'", ip_address.c_str()); + sLog->outStaticDebug("[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); + sLog->outStaticDebug("[AuthChallenge] Player address is '%s'", ip_address.c_str()); if (strcmp(fields[3].GetCString(), ip_address.c_str())) { - sLog.outStaticDebug("[AuthChallenge] Account IP differs"); + sLog->outStaticDebug("[AuthChallenge] Account IP differs"); pkt << (uint8) WOW_FAIL_SUSPENDED; locked = true; } else - sLog.outStaticDebug("[AuthChallenge] Account IP matches"); + sLog->outStaticDebug("[AuthChallenge] Account IP matches"); } else - sLog.outStaticDebug("[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); + sLog->outStaticDebug("[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); if (!locked) { @@ -407,12 +407,12 @@ bool AuthSocket::_HandleLogonChallenge() if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64()) { pkt << (uint8)WOW_FAIL_BANNED; - sLog.outBasic("[AuthChallenge] Banned account %s tried to login!", _login.c_str()); + sLog->outBasic("[AuthChallenge] Banned account %s tried to login!", _login.c_str()); } else { pkt << (uint8)WOW_FAIL_SUSPENDED; - sLog.outBasic("[AuthChallenge] Temporarily banned account %s tried to login!", _login.c_str()); + sLog->outBasic("[AuthChallenge] Temporarily banned account %s tried to login!", _login.c_str()); } } else @@ -424,7 +424,7 @@ bool AuthSocket::_HandleLogonChallenge() std::string databaseV = fields[5].GetString(); std::string databaseS = fields[6].GetString(); - sLog.outDebug("database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); + sLog->outDebug("database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); // multiply with 2 since bytes are stored as hexstring if (databaseV.size() != s_BYTE_SIZE * 2 || databaseS.size() != s_BYTE_SIZE * 2) @@ -483,7 +483,7 @@ bool AuthSocket::_HandleLogonChallenge() for (int i = 0; i < 4; ++i) _localizationName[i] = ch->country[4-i-1]; - sLog.outBasic("[AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", + sLog->outBasic("[AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) ); } @@ -500,7 +500,7 @@ bool AuthSocket::_HandleLogonChallenge() // Logon Proof command handler bool AuthSocket::_HandleLogonProof() { - sLog.outStaticDebug("Entering _HandleLogonProof"); + sLog->outStaticDebug("Entering _HandleLogonProof"); // Read the packet sAuthLogonProof_C lp; @@ -511,7 +511,7 @@ bool AuthSocket::_HandleLogonProof() if (_expversion == NO_VALID_EXP_FLAG) { // Check if we have the appropriate patch on the disk - sLog.outDebug("Client with invalid version, patching is not implemented"); + sLog->outDebug("Client with invalid version, patching is not implemented"); socket().shutdown(); return true; } @@ -595,7 +595,7 @@ bool AuthSocket::_HandleLogonProof() // Check if SRP6 results match (password is correct), else send an error if (!memcmp(M.AsByteArray(), lp.M1, 20)) { - sLog.outBasic("User '%s' successfully authenticated", _login.c_str()); + sLog->outBasic("User '%s' successfully authenticated", _login.c_str()); // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account // No SQL injection (escaped user name) and IP address as received by socket @@ -643,9 +643,9 @@ bool AuthSocket::_HandleLogonProof() char data[4]= { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0}; socket().send(data, sizeof(data)); - sLog.outBasic("[AuthChallenge] account %s tried to login with wrong password!",_login.c_str ()); + sLog->outBasic("[AuthChallenge] account %s tried to login with wrong password!",_login.c_str ()); - uint32 MaxWrongPassCount = sConfig.GetIntDefault("WrongPass.MaxCount", 0); + uint32 MaxWrongPassCount = sConfig->GetIntDefault("WrongPass.MaxCount", 0); if (MaxWrongPassCount > 0) { //Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP @@ -662,8 +662,8 @@ bool AuthSocket::_HandleLogonProof() if (failed_logins >= MaxWrongPassCount) { - uint32 WrongPassBanTime = sConfig.GetIntDefault("WrongPass.BanTime", 600); - bool WrongPassBanType = sConfig.GetBoolDefault("WrongPass.BanType", false); + uint32 WrongPassBanTime = sConfig->GetIntDefault("WrongPass.BanTime", 600); + bool WrongPassBanType = sConfig->GetBoolDefault("WrongPass.BanType", false); if (WrongPassBanType) { @@ -673,7 +673,7 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - sLog.outBasic("[AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", + sLog->outBasic("[AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", _login.c_str(), WrongPassBanTime, failed_logins); } else @@ -683,7 +683,7 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - sLog.outBasic("[AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", + sLog->outBasic("[AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", socket().get_remote_address().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); } } @@ -697,7 +697,7 @@ bool AuthSocket::_HandleLogonProof() // Reconnect Challenge command handler bool AuthSocket::_HandleReconnectChallenge() { - sLog.outStaticDebug("Entering _HandleReconnectChallenge"); + sLog->outStaticDebug("Entering _HandleReconnectChallenge"); if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) return false; @@ -712,7 +712,7 @@ bool AuthSocket::_HandleReconnectChallenge() #endif uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; - sLog.outStaticDebug("[ReconnectChallenge] got header, body is %#04x bytes", remaining); + sLog->outStaticDebug("[ReconnectChallenge] got header, body is %#04x bytes", remaining); if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining)) return false; @@ -724,8 +724,8 @@ bool AuthSocket::_HandleReconnectChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); - sLog.outStaticDebug("[ReconnectChallenge] got full packet, %#04x bytes", ch->size); - sLog.outStaticDebug("[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); + sLog->outStaticDebug("[ReconnectChallenge] got full packet, %#04x bytes", ch->size); + sLog->outStaticDebug("[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); _login = (const char*)ch->I; @@ -736,7 +736,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Stop if the account is not found if (!result) { - sLog.outError("[ERROR] user %s tried to login and we cannot find his session key in the database.", _login.c_str()); + sLog->outError("[ERROR] user %s tried to login and we cannot find his session key in the database.", _login.c_str()); socket().shutdown(); return false; } @@ -765,7 +765,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Reconnect Proof command handler bool AuthSocket::_HandleReconnectProof() { - sLog.outStaticDebug("Entering _HandleReconnectProof"); + sLog->outStaticDebug("Entering _HandleReconnectProof"); // Read the packet sAuthReconnectProof_C lp; if (!socket().recv((char *)&lp, sizeof(sAuthReconnectProof_C))) @@ -796,7 +796,7 @@ bool AuthSocket::_HandleReconnectProof() } else { - sLog.outError("[ERROR] user %s tried to login, but session invalid.", _login.c_str()); + sLog->outError("[ERROR] user %s tried to login, but session invalid.", _login.c_str()); socket().shutdown(); return false; } @@ -805,7 +805,7 @@ bool AuthSocket::_HandleReconnectProof() // Realm List command handler bool AuthSocket::_HandleRealmList() { - sLog.outStaticDebug("Entering _HandleRealmList"); + sLog->outStaticDebug("Entering _HandleRealmList"); if (socket().recv_len() < 5) return false; @@ -818,7 +818,7 @@ bool AuthSocket::_HandleRealmList() PreparedQueryResult result = LoginDatabase.Query(stmt); if (!result) { - sLog.outError("[ERROR] user %s tried to login and we cannot find him in the database.", _login.c_str()); + sLog->outError("[ERROR] user %s tried to login and we cannot find him in the database.", _login.c_str()); socket().shutdown(); return false; } @@ -905,11 +905,11 @@ bool AuthSocket::_HandleRealmList() // Resume patch transfer bool AuthSocket::_HandleXferResume() { - sLog.outStaticDebug("Entering _HandleXferResume"); + sLog->outStaticDebug("Entering _HandleXferResume"); // Check packet length and patch existence if (socket().recv_len() < 9 || !pPatch) { - sLog.outError("Error while resuming patch transfer (wrong packet)"); + sLog->outError("Error while resuming patch transfer (wrong packet)"); return false; } @@ -926,7 +926,7 @@ bool AuthSocket::_HandleXferResume() // Cancel patch transfer bool AuthSocket::_HandleXferCancel() { - sLog.outStaticDebug("Entering _HandleXferCancel"); + sLog->outStaticDebug("Entering _HandleXferCancel"); // Close and delete the socket socket().recv_skip(1); //clear input buffer @@ -938,12 +938,12 @@ bool AuthSocket::_HandleXferCancel() // Accept patch transfer bool AuthSocket::_HandleXferAccept() { - sLog.outStaticDebug("Entering _HandleXferAccept"); + sLog->outStaticDebug("Entering _HandleXferAccept"); // Check packet length and patch existence if (!pPatch) { - sLog.outError("Error while accepting patch transfer (wrong packet)"); + sLog->outError("Error while accepting patch transfer (wrong packet)"); return false; } @@ -1026,11 +1026,11 @@ void Patcher::LoadPatchMD5(char *szFileName) std::string path = "./patches/"; path += szFileName; FILE *pPatch = fopen(path.c_str(), "rb"); - sLog.outDebug("Loading patch info from %s\n", path.c_str()); + sLog->outDebug("Loading patch info from %s\n", path.c_str()); if (!pPatch) { - sLog.outError("Error loading patch %s\n", path.c_str()); + sLog->outError("Error loading patch %s\n", path.c_str()); return; } diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index 6e32960261f..aad52643392 100755 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -73,7 +73,7 @@ int RealmSocket::open(void * arg) if (peer ().get_remote_addr (addr) == -1) { - sLog.outError ("RealmSocket::open: peer ().get_remote_addr errno = %s", ACE_OS::strerror (errno)); + sLog->outError ("RealmSocket::open: peer ().get_remote_addr errno = %s", ACE_OS::strerror (errno)); return -1; } diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index c2cebaa1292..34d87b7816d 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -270,11 +270,11 @@ namespace VMAP WorldModel *worldmodel = new WorldModel(); if (!worldmodel->readFile(basepath + filename + ".vmo")) { - sLog.outError("VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str()); + sLog->outError("VMapManager2: could not load '%s%s.vmo'", basepath.c_str(), filename.c_str()); delete worldmodel; return NULL; } - sLog.outDebug("VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); + sLog->outDebug("VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -287,12 +287,12 @@ namespace VMAP ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { - sLog.outError("VMapManager2: trying to unload non-loaded file '%s'", filename.c_str()); + sLog->outError("VMapManager2: trying to unload non-loaded file '%s'", filename.c_str()); return; } if( model->second.decRefCount() == 0) { - sLog.outDebug("VMapManager2: unloading file '%s'", filename.c_str()); + sLog->outDebug("VMapManager2: unloading file '%s'", filename.c_str()); delete model->second.getModel(); iLoadedModelFiles.erase(model); } diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index c59f78d1f6b..be5954b381a 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -62,7 +62,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - sLog.outDebug("AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); + sLog->outDebug("AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif prims[entry].intersectPoint(point, aInfo); } @@ -78,7 +78,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - sLog.outDebug("LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); + sLog->outDebug("LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif if (prims[entry].GetLocationInfo(point, locInfo)) result = true; @@ -278,7 +278,7 @@ namespace VMAP bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm) { - sLog.outDebug("StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); + sLog->outDebug("StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); bool success = true; std::string fullname = iBasePath + fname; FILE *rf = fopen(fullname.c_str(), "rb"); @@ -306,12 +306,12 @@ namespace VMAP // only non-tiled maps have them, and if so exactly one (so far at least...) ModelSpawn spawn; #ifdef VMAP_DEBUG - sLog.outDebug("StaticMapTree::InitMap() : map isTiled: %u", static_cast(iIsTiled)); + sLog->outDebug("StaticMapTree::InitMap() : map isTiled: %u", static_cast(iIsTiled)); #endif if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) { WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); - sLog.outDebug("StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); + sLog->outDebug("StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); if (model) { // assume that global model always is the first and only tree value (could be improved...) @@ -321,7 +321,7 @@ namespace VMAP else { success = false; - sLog.outError("StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str()); + sLog->outError("StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str()); } } @@ -357,7 +357,7 @@ namespace VMAP } if (!iTreeValues) { - sLog.outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u,%u]", tileX, tileY); + sLog->outError("StaticMapTree::LoadMapTile() : tree has not been initialized [%u,%u]", tileX, tileY); return false; } bool result = true; @@ -383,7 +383,7 @@ namespace VMAP // acquire model instance WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); if (!model) - sLog.outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u,%u]", tileX, tileY); + sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u,%u]", tileX, tileY); // update tree uint32 referencedVal; @@ -395,7 +395,7 @@ namespace VMAP #ifdef VMAP_DEBUG if (referencedVal > iNTreeValues) { - sLog.outDebug("StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); + sLog->outDebug("StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); continue; } #endif @@ -407,9 +407,9 @@ namespace VMAP ++iLoadedSpawns[referencedVal]; #ifdef VMAP_DEBUG if (iTreeValues[referencedVal].ID != spawn.ID) - sLog.outDebug("StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); + sLog->outDebug("StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); else if (iTreeValues[referencedVal].name != spawn.name) - sLog.outDebug("StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); + sLog->outDebug("StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); #endif } } @@ -433,7 +433,7 @@ namespace VMAP loadedTileMap::iterator tile = iLoadedTiles.find(tileID); if (tile == iLoadedTiles.end()) { - sLog.outError("StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY); + sLog->outError("StaticMapTree::UnloadMapTile() : trying to unload non-loaded tile - Map:%u X:%u Y:%u", iMapID, tileX, tileY); return; } if (tile->second) // file associated with tile @@ -467,7 +467,7 @@ namespace VMAP else { if (!iLoadedSpawns.count(referencedNode)) - sLog.outError("StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID); + sLog->outError("StaticMapTree::UnloadMapTile() : trying to unload non-referenced model '%s' (ID:%u)", spawn.name.c_str(), spawn.ID); else if (--iLoadedSpawns[referencedNode] == 0) { iTreeValues[referencedNode].setUnloaded(); diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index 0679fda5379..d33e9c006e3 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -179,7 +179,7 @@ void CasterAI::UpdateAI(const uint32 diff) ArchorAI::ArchorAI(Creature *c) : CreatureAI(c) { if (!me->m_spells[0]) - sLog.outError("ArchorAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry()); + sLog->outError("ArchorAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry()); m_minRange = GetSpellMinRange(me->m_spells[0], false); if (!m_minRange) @@ -226,7 +226,7 @@ void ArchorAI::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("TurretAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry()); m_minRange = GetSpellMinRange(me->m_spells[0], false); me->m_CombatDistance = GetSpellMaxRange(me->m_spells[0], false); @@ -263,7 +263,7 @@ void TurretAI::UpdateAI(const uint32 /*diff*/) AOEAI::AOEAI(Creature *c) : CreatureAI(c) { if (!me->m_spells[0]) - sLog.outError("AOEAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry()); + sLog->outError("AOEAI set for creature (entry = %u) with spell1=0. AI will do nothing", me->GetEntry()); me->SetVisible(true);//visible to see all spell anims me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//can't be targeted @@ -340,7 +340,7 @@ void VehicleAI::LoadConditions() conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, me->GetEntry()); if (!conditions.empty()) { - sLog.outDebug("VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); + sLog->outDebug("VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); } } diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index b16d23b04f1..98d83ea2b1a 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -59,7 +59,7 @@ void GuardAI::EnterEvadeMode() { if (!me->isAlive()) { - sLog.outStaticDebug("Creature stopped attacking because he is dead [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Creature stopped attacking because he is dead [guid=%u]", me->GetGUIDLow()); me->GetMotionMaster()->MoveIdle(); i_state = STATE_NORMAL; @@ -74,23 +74,23 @@ void GuardAI::EnterEvadeMode() if (!victim) { - sLog.outStaticDebug("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow()); } else if (!victim ->isAlive()) { - sLog.outStaticDebug("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow()); } else if (victim ->HasStealthAura()) { - sLog.outStaticDebug("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow()); } else if (victim ->isInFlight()) { - sLog.outStaticDebug("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow()); } else { - sLog.outStaticDebug("Creature stopped attacking because victim outran him [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Creature stopped attacking because victim outran him [guid=%u]", me->GetGUIDLow()); } me->RemoveAllAuras(); @@ -124,7 +124,7 @@ void GuardAI::UpdateAI(const uint32 /*diff*/) bool GuardAI::IsVisible(Unit *pl) const { - return me->IsWithinDist(pl,sWorld.getFloatConfig(CONFIG_SIGHT_GUARDER)) + return me->IsWithinDist(pl,sWorld->getFloatConfig(CONFIG_SIGHT_GUARDER)) && me->canSeeOrDetect(pl); } diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 6a067271e04..d1060878d63 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -64,7 +64,7 @@ void PetAI::_stopAttack() { if (!me->isAlive()) { - sLog.outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow()); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); me->CombatStop(); @@ -96,7 +96,7 @@ void PetAI::UpdateAI(const uint32 diff) { if (_needToStop()) { - sLog.outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow()); + sLog->outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow()); _stopAttack(); return; } diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 0018f6dcb27..174c310bb9a 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -156,7 +156,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("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 019f0b23ce4..fa7dbe53f9d 100755 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -51,7 +51,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature) 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("DoZoneInCombat call for map that isn't an instance (creature entry = %d)", creature->GetTypeId() == TYPEID_UNIT ? creature->ToCreature()->GetEntry() : 0); return; } @@ -74,7 +74,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature) 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("DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry()); return; } @@ -130,7 +130,7 @@ void CreatureAI::MoveInLineOfSight(Unit *who) if (me->canStartAttack(who, false)) AttackStart(who); //else if (who->getVictim() && me->IsFriendlyTo(who) - // && me->IsWithinDistInMap(who, sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)) + // && me->IsWithinDistInMap(who, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)) // && me->canStartAttack(who->getVictim(), true)) // TODO: if we use true, it will not attack it when it arrives // me->GetMotionMaster()->MoveChase(who->getVictim()); } @@ -140,7 +140,7 @@ void CreatureAI::EnterEvadeMode() if (!_EnterEvadeMode()) return; - sLog.outDebug("Creature %u enters evade mode.", me->GetEntry()); + sLog->outDebug("Creature %u enters evade mode.", me->GetEntry()); if (!me->GetVehicle()) // otherwise me will be in evade mode forever { diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index ab6f4288b93..df28aafa323 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -95,7 +95,7 @@ namespace FactorySelector // select NullCreatureAI if not another cases ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key(); - sLog.outStaticDebug("Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str()); + sLog->outStaticDebug("Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str()); return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature)); } @@ -139,7 +139,7 @@ namespace FactorySelector std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); - sLog.outStaticDebug("GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); + sLog->outStaticDebug("GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); return (ai_factory == NULL ? new NullGameObjectAI(go) : ai_factory->Create(go)); } diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index d6bca8b87b6..ec1330fbe56 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->outErrorDb("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; } @@ -83,10 +83,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("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("CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", me->GetEntry()); m_bEmptyList = m_CreatureEventAIList.empty(); m_Phase = 0; @@ -319,7 +319,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction break; } default: - sLog.outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type); + sLog->outErrorDb("CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), pHolder.Event.event_id, pHolder.Event.event_type); break; } @@ -498,7 +498,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 } else - sLog.outErrorDb("CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", EventId, me->GetEntry(), action.cast.spellId); + sLog->outErrorDb("CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", EventId, me->GetEntry(), action.cast.spellId); } break; } @@ -514,7 +514,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 pCreature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); if (!pCreature) - sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, EventId, me->GetEntry()); + sLog->outErrorDb("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) pCreature->AI()->AttackStart(target); break; @@ -610,12 +610,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->outErrorDb("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->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()); m_Phase = MAX_PHASE-1; } else @@ -666,7 +666,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->outErrorDb("CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", EventId, me->GetEntry()); break; case ACTION_T_SUMMON_ID: { @@ -675,7 +675,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->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()); return; } @@ -686,7 +686,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 pCreature = 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 (!pCreature) - sLog.outErrorDb("CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, EventId, me->GetEntry()); + sLog->outErrorDb("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) pCreature->AI()->AttackStart(target); @@ -709,7 +709,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 InstanceScript* pInst = (InstanceScript*)me->GetInstanceScript(); if (!pInst) { - sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, me->GetEntry()); + sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", EventId, me->GetEntry()); return; } @@ -721,14 +721,14 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 Unit* target = GetTargetByType(action.set_inst_data64.target, pActionInvoker); if (!target) { - sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, me->GetEntry()); + sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", EventId, me->GetEntry()); return; } InstanceScript* pInst = (InstanceScript*)me->GetInstanceScript(); if (!pInst) { - sLog.outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, me->GetEntry()); + sLog->outErrorDb("CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", EventId, me->GetEntry()); return; } @@ -739,7 +739,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 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->outErrorDb("CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", EventId, me->GetEntry()); return; } @@ -749,7 +749,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 if (me->isDead()) { - sLog.outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, me->GetEntry()); + sLog->outErrorDb("CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", EventId, me->GetEntry()); return; } me->Kill(me); @@ -801,7 +801,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 pObject = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2); if (!pObject) { - sLog.outErrorDb("TSCR: EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, EventId, me->GetEntry()); + sLog->outErrorDb("TSCR: EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, EventId, me->GetEntry()); } break; } @@ -1238,13 +1238,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* { if (!pSource) { - sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.",textEntry); + sLog->outErrorDb("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.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); + sLog->outErrorDb("CreatureEventAI: 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(),textEntry); return; } @@ -1252,18 +1252,18 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* if (i == sEventAIMgr->GetCreatureEventAITextMap().end()) { - sLog.outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); + sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); return; } - sLog.outDebug("CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote); + sLog->outDebug("CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote); if ((*i).second.SoundId) { if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId)) pSource->PlayDirectSound((*i).second.SoundId); else - sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId); + sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId); } if ((*i).second.Emote) @@ -1273,7 +1273,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* ((Unit*)pSource)->HandleEmoteCommand((*i).second.Emote); } else - sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId()); + sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId()); } switch((*i).second.Type) @@ -1294,13 +1294,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* { if (target && target->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(textEntry, target->GetGUID()); - else sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); + else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); }break; case CHAT_TYPE_BOSS_WHISPER: { if (target && target->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(textEntry, target->GetGUID(), true); - else sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); + else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); }break; case CHAT_TYPE_ZONE_YELL: pSource->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); @@ -1356,7 +1356,7 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote) if (cond.Meets(pPlayer)) { - sLog.outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing"); + sLog->outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing"); ProcessEvent(*itr, pPlayer); } } diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index b63ead9574a..5c41c05d94d 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -42,8 +42,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() if (!result) { - sLog.outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty."); + sLog->outString(); return; } @@ -63,33 +63,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->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); continue; } // range negative (don't must be happen, loaded from same table) if (!sObjectMgr->GetTrinityStringLocale(i)) { - sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.",i,temp.Emote); } m_CreatureEventAI_TextMap[i] = temp; @@ -97,8 +97,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() } while (result->NextRow()); - sLog.outString(">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // ------------------- @@ -114,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->outString(">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty."); + sLog->outString(); return; } @@ -136,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->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); continue; } @@ -146,8 +146,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons() } while (result->NextRow()); - sLog.outString(">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // ------------------- @@ -168,8 +168,8 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() if (!result) { - sLog.outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty."); + sLog->outString(); return; } @@ -190,7 +190,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->outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i,e_type); continue; } temp.event_type = EventAI_Type(e_type); @@ -206,17 +206,17 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() //Creature does not exist in database if (!sCreatureStorage.LookupEntry(temp.creature_id)) { - sLog.outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id); + sLog->outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id); continue; } //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->outErrorDb("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->outErrorDb("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; } @@ -226,23 +226,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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->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); temp.event_flags &= ~EFLAG_REPEATABLE; } break; @@ -252,29 +252,29 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() SpellEntry const* pSpell = sSpellStore.LookupEntry(temp.spell_hit.spellId); if (!pSpell) { - sLog.outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i); + sLog->outErrorDb("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 & pSpell->SchoolMask) != pSpell->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->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); } 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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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) @@ -283,55 +283,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->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); 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->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); default: - sLog.outErrorDb("CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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: { SpellEntry const* pSpell = sSpellStore.LookupEntry(temp.spell_hit.spellId); if (!pSpell) { - sLog.outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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 (!sCreatureStorage.LookupEntry(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->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); 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->outErrorDb("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->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); continue; case EVENT_T_AGGRO: @@ -341,7 +341,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->outErrorDb("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; } @@ -352,7 +352,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->outErrorDb("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) @@ -363,14 +363,14 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() cond.mConditionValue2 = 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->outErrorDb("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->outErrorDb("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; } @@ -383,16 +383,16 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() SpellEntry const* pSpell = sSpellStore.LookupEntry(temp.buffed.spellId); if (!pSpell) { - sLog.outErrorDb("CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i); + sLog->outErrorDb("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->outErrorDb("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->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); break; } @@ -401,7 +401,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() uint16 action_type = fields[10+(j*4)].GetUInt16(); 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->outErrorDb("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; } @@ -423,30 +423,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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent FactionId %u.", i, j+1, action.set_faction.factionId); action.set_faction.factionId = 0; } break; @@ -455,7 +455,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { if (action.morph.creatureId && !sCreatureStorage.LookupEntry(action.morph.creatureId)) { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId); + sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId); action.morph.creatureId = 0; } @@ -463,12 +463,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->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); 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->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existant ModelId %u.", i, j+1, action.morph.modelId); action.morph.modelId = 0; } } @@ -476,33 +476,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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId3); break; case ACTION_T_CAST: { const SpellEntry *spell = sSpellStore.LookupEntry(action.cast.spellId); if (!spell) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast.spellId); + sLog->outErrorDb("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 { @@ -510,7 +510,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("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); } } */ @@ -520,143 +520,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->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); break; } case ACTION_T_SUMMON: if (!sCreatureStorage.LookupEntry(action.summon.creatureId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatureId); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->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); } else - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event.questId); + sLog->outErrorDb("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->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); break; case ACTION_T_CAST_EVENT: if (!sCreatureStorage.LookupEntry(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->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event.creatureId); if (!sSpellStore.LookupEntry(action.cast_event.spellId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event.spellId); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->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); 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->outErrorDb("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->outErrorDb("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->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); } else - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event_all.questId); + sLog->outErrorDb("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 (!sCreatureStorage.LookupEntry(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->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event_all.creatureId); if (!sSpellStore.LookupEntry(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->outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event_all.spellId); break; case ACTION_T_REMOVEAURASFROMSPELL: if (!sSpellStore.LookupEntry(action.remove_aura.spellId)) - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.remove_aura.spellId); + sLog->outErrorDb("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->outErrorDb("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->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); 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->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); 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->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); 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->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); 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->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); 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->outErrorDb("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 (!sCreatureStorage.LookupEntry(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->outErrorDb("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->outErrorDb("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->outErrorDb("CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId); break; case ACTION_T_KILLED_MONSTER: if (!sCreatureStorage.LookupEntry(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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); break; case ACTION_T_UPDATE_TEMPLATE: if (!sCreatureStorage.LookupEntry(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->outErrorDb("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->outErrorDb("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; @@ -665,7 +665,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->outErrorDb("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; } } @@ -675,7 +675,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { if (action.mount.creatureId && !sCreatureStorage.LookupEntry(action.mount.creatureId)) { - sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId); + sLog->outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId); action.morph.creatureId = 0; } @@ -683,12 +683,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->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); 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->outErrorDb("CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId); action.mount.modelId = 0; } } @@ -708,7 +708,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->outErrorDb("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: @@ -722,7 +722,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, temp.action[j].type); + sLog->outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, temp.action[j].type); break; } } @@ -735,23 +735,23 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { if (!cInfo->AIName || !cInfo->AIName[0]) { - //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but its AIName is empty. Set to EventAI as default.", cInfo->Entry); + //sLog->outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but its AIName is empty. Set to EventAI as default.", cInfo->Entry); size_t len = strlen("EventAI")+1; const_cast(cInfo)->AIName = new char[len]; strncpy(const_cast(cInfo->AIName), "EventAI", len); } if (strcmp(cInfo->AIName, "EventAI")) { - //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it has AIName %s. EventAI script will be overriden.", cInfo->Entry, cInfo->AIName); + //sLog->outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it has AIName %s. EventAI script will be overriden.", cInfo->Entry, cInfo->AIName); } if (cInfo->ScriptID) { - //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it also has C++ script. EventAI script will be overriden.", cInfo->Entry); + //sLog->outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it also has C++ script. EventAI script will be overriden.", cInfo->Entry); } } } while (result->NextRow()); - sLog.outString(">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 8bce6f39d66..bb21252efb0 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -153,7 +153,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId) if (!GetSoundEntriesStore()->LookupEntry(uiSoundId)) { - sLog.outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUIDLow()); + sLog->outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUIDLow()); return; } @@ -313,7 +313,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("TSCR: DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = %d)", me->GetEntry()); return; } @@ -356,7 +356,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, flo if (!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER) { if (pUnit) - 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(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO); + 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(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO); return; } @@ -493,7 +493,7 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff) return false; break; default: - sLog.outError("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", me->GetEntry()); + sLog->outError("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", me->GetEntry()); return false; } diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 948415c6fcd..330c13ba01e 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -178,7 +178,7 @@ void npc_escortAI::EnterEvadeMode() { AddEscortState(STATE_ESCORT_RETURNING); ReturnToLastPoint(); - sLog.outDebug("TSCR: EscortAI has left combat and is now returning to last point"); + sLog->outDebug("TSCR: EscortAI has left combat and is now returning to last point"); } else { @@ -225,7 +225,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (DespawnAtEnd) { - sLog.outDebug("TSCR: EscortAI reached end of waypoints"); + sLog->outDebug("TSCR: EscortAI reached end of waypoints"); if (m_bCanReturnToStart) { @@ -236,7 +236,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) m_uiWPWaitTimer = 0; - sLog.outDebug("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); + sLog->outDebug("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); return; } @@ -252,7 +252,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) } else { - sLog.outDebug("TSCR: EscortAI reached end of waypoints with Despawn off"); + sLog->outDebug("TSCR: EscortAI reached end of waypoints with Despawn off"); return; } @@ -261,7 +261,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) if (!HasEscortState(STATE_ESCORT_PAUSED)) { me->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - sLog.outDebug("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + sLog->outDebug("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); WaypointStart(CurrentWP->id); @@ -279,7 +279,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (DespawnAtFar && !IsPlayerOrGroupInRange()) { - sLog.outDebug("TSCR: EscortAI failed because player/group was to far away or not found"); + sLog->outDebug("TSCR: EscortAI failed because player/group was to far away or not found"); if (m_bCanInstantRespawn) { @@ -317,7 +317,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) //Combat start position reached, continue waypoint movement if (uiPointId == POINT_LAST_POINT) { - sLog.outDebug("TSCR: EscortAI has returned to original position before combat"); + sLog->outDebug("TSCR: EscortAI has returned to original position before combat"); if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); @@ -331,7 +331,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) } else if (uiPointId == POINT_HOME) { - sLog.outDebug("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); + sLog->outDebug("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); CurrentWP = WaypointList.begin(); m_uiWPWaitTimer = 1; @@ -341,11 +341,11 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) //Make sure that we are still on the right waypoint if (CurrentWP->id != uiPointId) { - sLog.outError("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", uiPointId, CurrentWP->id, me->GetEntry()); + sLog->outError("TSCR ERROR: EscortAI reached waypoint out of order %u, expected %u, creature entry %u", uiPointId, CurrentWP->id, me->GetEntry()); return; } - sLog.outDebug("TSCR: EscortAI Waypoint %u reached", CurrentWP->id); + sLog->outDebug("TSCR: EscortAI Waypoint %u reached", CurrentWP->id); //Call WP function WaypointReached(CurrentWP->id); @@ -416,14 +416,14 @@ void npc_escortAI::SetRun(bool bRun) if (!m_bIsRunning) me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); else - sLog.outDebug("TSCR: EscortAI attempt to set run mode, but is already running."); + sLog->outDebug("TSCR: EscortAI attempt to set run mode, but is already running."); } else { if (m_bIsRunning) me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); else - sLog.outDebug("TSCR: EscortAI attempt to set walk mode, but is already walking."); + sLog->outDebug("TSCR: EscortAI attempt to set walk mode, but is already walking."); } m_bIsRunning = bRun; } @@ -433,13 +433,13 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, { if (me->getVictim()) { - sLog.outError("TSCR ERROR: EscortAI attempt to Start while in combat. Scriptname: %s, creature entry: %u", me->GetScriptName().c_str(), me->GetEntry()); + sLog->outError("TSCR ERROR: EscortAI attempt to Start while in combat. Scriptname: %s, creature entry: %u", me->GetScriptName().c_str(), me->GetEntry()); return; } if (HasEscortState(STATE_ESCORT_ESCORTING)) { - sLog.outError("TSCR: EscortAI attempt to Start while already escorting."); + sLog->outError("TSCR: EscortAI attempt to Start while already escorting."); return; } @@ -455,7 +455,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, if (WaypointList.empty()) { - sLog.outErrorDb("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", pQuest ? pQuest->GetQuestId() : 0); + sLog->outErrorDb("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", pQuest ? pQuest->GetQuestId() : 0); return; } @@ -470,19 +470,19 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, m_bCanReturnToStart = bCanLoopPath; if (m_bCanReturnToStart && m_bCanInstantRespawn) - sLog.outDebug("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); + sLog->outDebug("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("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); + sLog->outDebug("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); } //disable npcflags me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - sLog.outDebug("TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); + sLog->outDebug("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/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 5dca322f8a0..415d4dcc07a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -165,7 +165,7 @@ void FollowerAI::EnterEvadeMode() if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { - sLog.outDebug("TSCR: FollowerAI left combat, returning to CombatStartPosition."); + sLog->outDebug("TSCR: FollowerAI left combat, returning to CombatStartPosition."); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) { @@ -191,7 +191,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT)) { - sLog.outDebug("TSCR: FollowerAI is set completed, despawns."); + sLog->outDebug("TSCR: FollowerAI is set completed, despawns."); me->ForcedDespawn(); return; } @@ -202,7 +202,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_RETURNING)) { - sLog.outDebug("TSCR: FollowerAI is returning to leader."); + sLog->outDebug("TSCR: FollowerAI is returning to leader."); RemoveFollowState(STATE_FOLLOW_RETURNING); me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); @@ -231,7 +231,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) if (bIsMaxRangeExceeded) { - sLog.outDebug("TSCR: FollowerAI failed because player/group was to far away or not found"); + sLog->outDebug("TSCR: FollowerAI failed because player/group was to far away or not found"); me->ForcedDespawn(); return; } @@ -274,13 +274,13 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const { if (me->getVictim()) { - sLog.outDebug("TSCR: FollowerAI attempt to StartFollow while in combat."); + sLog->outDebug("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("TSCR: FollowerAI attempt to StartFollow while already following."); return; } @@ -296,7 +296,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - sLog.outDebug("TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); + sLog->outDebug("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* pLeader, uint32 uiFactionForFollower, const me->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - sLog.outDebug("TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", pLeader->GetName(), m_uiLeaderGUID); + sLog->outDebug("TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", pLeader->GetName(), m_uiLeaderGUID); } Player* FollowerAI::GetLeaderForFollower() @@ -324,7 +324,7 @@ Player* FollowerAI::GetLeaderForFollower() if (pMember && pMember->isAlive() && me->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) { - sLog.outDebug("TSCR: FollowerAI GetLeader changed and returned new leader."); + sLog->outDebug("TSCR: FollowerAI GetLeader changed and returned new leader."); m_uiLeaderGUID = pMember->GetGUID(); return pMember; break; @@ -334,7 +334,7 @@ Player* FollowerAI::GetLeaderForFollower() } } - sLog.outDebug("TSCR: FollowerAI GetLeader can not find suitable leader."); + sLog->outDebug("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 b5e20902b7b..36b9ee2878d 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -107,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("SmartAI::GetNextWayPoint: Got not expected waypoint id %u, expected %u", mLastWP->id, mCurrentWPID); } return (*itr).second; } @@ -118,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("SmartAI::StartPath: Creature entry %u wanted to start waypoint movement while in combat, ignoring.", me->GetEntry()); return; } if (HasEscortState(SMART_ESCORT_ESCORTING)) @@ -163,7 +163,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("SmartAI::StartPath: Creature entry %u wanted to pause waypoint movement while already paused, ignoring.", me->GetEntry()); return; } mForcedPaused = forced; @@ -845,7 +845,7 @@ void SmartGameObjectAI::Reset() // Called when a player opens a gossip dialog with the gameobject. bool SmartGameObjectAI::GossipHello(Player* player) { - sLog.outDebug("SmartGameObjectAI::GossipHello"); + sLog->outDebug("SmartGameObjectAI::GossipHello"); GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0 ,0 , false, NULL, go); return false; } @@ -909,7 +909,7 @@ class SmartTrigger : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) { - sLog.outDebug("AreaTrigger %u is using SmartTrigger script", trigger->id); + sLog->outDebug("AreaTrigger %u is using SmartTrigger script", trigger->id); SmartScript script; script.OnInitialize(NULL, trigger); script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 543abcabf05..17ee4d6fa72 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -118,7 +118,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u { 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->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); } } @@ -554,7 +554,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u InstanceScript* pInst = (InstanceScript*)obj->GetInstanceScript(); if (!pInst) { - sLog.outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); + sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); return; } pInst->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); @@ -570,7 +570,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u InstanceScript* pInst = (InstanceScript*)obj->GetInstanceScript(); if (!pInst) { - sLog.outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); + sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); return; } ObjectList* targets = GetTargets(e, unit); @@ -948,7 +948,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->outErrorDb("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry); return; } npc->SetCurrentEquipmentId(e.action.equip.entry); @@ -1064,7 +1064,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->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()); return; } ObjectList* targets = GetTargets(e, unit); @@ -1157,7 +1157,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->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()); return; } ObjectList* targets = GetTargets(e, unit); @@ -1183,7 +1183,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->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()); return; } ObjectList* targets = GetTargets(e, unit); @@ -1228,7 +1228,7 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u break; } default: - sLog.outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); + sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); break; } } @@ -1239,7 +1239,7 @@ void SmartScript::InstallTemplate(SmartScriptHolder 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->outErrorDb("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; @@ -1478,7 +1478,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder e, Unit* invoker) { if (!trigger && !GetBaseObject()) { - sLog.outErrorDb("SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry"); + sLog->outErrorDb("SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry"); return NULL; } target = FindCreatureNear(trigger?trigger:GetBaseObject(), e.target.unitGUID.guid); @@ -1500,7 +1500,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder e, Unit* invoker) { if (!trigger && !GetBaseObject()) { - sLog.outErrorDb("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry"); + sLog->outErrorDb("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry"); return NULL; } target = FindGameObjectNear(trigger?trigger:GetBaseObject(), e.target.goGUID.guid); @@ -1950,7 +1950,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui } case SMART_EVENT_GOSSIP_SELECT: { - sLog.outString("SmartScript: Gossip Select: menu %u action %u", var0, var1);//little help for scripters + sLog->outString("SmartScript: Gossip Select: menu %u action %u", var0, var1);//little help for scripters if (e.event.gossip.sender != var0 || e.event.gossip.action != var1) return; ProcessAction(e, unit, var0, var1); @@ -1964,7 +1964,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui break; } default: - sLog.outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); + sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); break; } } @@ -2118,9 +2118,9 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (e.empty()) { if (obj) - sLog.outDebug("SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); + sLog->outDebug("SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); if (at) - sLog.outDebug("SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); + sLog->outDebug("SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); return; } for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i) @@ -2144,9 +2144,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->outErrorDb("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->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); } void SmartScript::GetScript() @@ -2182,26 +2182,26 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) case TYPEID_UNIT: mScriptType = SMART_SCRIPT_TYPE_CREATURE; me = obj->ToCreature(); - sLog.outDebug("SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); + sLog->outDebug("SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); break; case TYPEID_GAMEOBJECT: mScriptType = SMART_SCRIPT_TYPE_GAMEOBJECT; go = obj->ToGameObject(); - sLog.outDebug("SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); + sLog->outDebug("SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); break; default: - sLog.outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!"); + sLog->outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!"); return; } } else if (at) { mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER; trigger = at; - sLog.outDebug("SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); + sLog->outDebug("SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); } else { - sLog.outError("SmartScript::OnInitialize: !WARNING! Initialized objects are NULL."); + sLog->outError("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 334db9109e6..f36fb3aab78 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -111,7 +111,7 @@ class SmartScript if (c && c->GetAIName() != "SmartAI") smart = false; if (!me || me->GetAIName() != "SmartAI") 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->outErrorDb("SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c?c->GetEntry():(me?me->GetEntry():0)); return smart; } bool IsSmartGO(GameObject* g = NULL) @@ -120,7 +120,7 @@ class SmartScript if (g && g->GetAIName() != "SmartGameObjectAI") smart = false; 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->outErrorDb("SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g?g->GetEntry():(go?go->GetEntry():0)); return smart; } ObjectList* GetTargetList(uint32 id) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 5f518eced16..c535504a5e1 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -42,8 +42,8 @@ void SmartWaypointMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty."); + sLog->outString(); return; } @@ -73,7 +73,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->outErrorDb("SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id); } last_id++; (*path)[id] = wp; @@ -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->outString(">> Loaded %u SmartAI waypoint paths (total %u waypoints) in %u ms", count, total, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SmartAIMgr::LoadSmartAIFromDB() @@ -104,8 +104,8 @@ void SmartAIMgr::LoadSmartAIFromDB() if (!result) { - sLog.outString(">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty."); + sLog->outString(); return; } @@ -121,7 +121,7 @@ void SmartAIMgr::LoadSmartAIFromDB() SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt32(); if (source_type >= SMART_SCRIPT_TYPE_MAX) { - sLog.outErrorDb("SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type)); + sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type)); continue; } if (temp.entryOrGuid >= 0) @@ -132,7 +132,7 @@ void SmartAIMgr::LoadSmartAIFromDB() { if (!sCreatureStorage.LookupEntry((uint32)temp.entryOrGuid)) { - sLog.outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid)); + sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid)); continue; } break; @@ -141,7 +141,7 @@ void SmartAIMgr::LoadSmartAIFromDB() { if (!sGOStorage.LookupEntry((uint32)temp.entryOrGuid)) { - sLog.outErrorDb("SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid)); + sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: GameObject entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid)); continue; } break; @@ -150,7 +150,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->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid)); continue; } break; @@ -158,14 +158,14 @@ 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->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type %u", (uint32)source_type); continue; } }else { if (!sObjectMgr->GetCreatureData(uint32(abs(temp.entryOrGuid)))) { - sLog.outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid))); + sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.", uint32(abs(temp.entryOrGuid))); continue; } } @@ -220,8 +220,8 @@ void SmartAIMgr::LoadSmartAIFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u SmartAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool SmartAIMgr::IsTargetValid(SmartScriptHolder e) @@ -235,7 +235,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder e) { if (e.target.unitDistance.creature && !sCreatureStorage.LookupEntry(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->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); return false; } break; @@ -245,7 +245,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder e) { if (e.target.goDistance.entry && !sGOStorage.LookupEntry(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->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); return false; } break; @@ -279,7 +279,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder e) case SMART_TARGET_THREAT_LIST: 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->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()); return false; } return true; @@ -289,23 +289,23 @@ 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->outErrorDb("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->outErrorDb("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 >= 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->outErrorDb("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->outErrorDb("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.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) @@ -339,12 +339,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) SpellEntry const* pSpell = sSpellStore.LookupEntry(e.event.spellHit.spell); if (!pSpell) { - 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->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); return false; } if (e.event.spellHit.school && (e.event.spellHit.school & pSpell->SchoolMask) != pSpell->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->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); return false; } } @@ -357,12 +357,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->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); 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->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); return false; } break; @@ -420,7 +420,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->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); return false; } break; @@ -442,7 +442,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->outErrorDb("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; @@ -484,7 +484,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) case SMART_EVENT_FOLLOW_COMPLETED: 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->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()); return false; } } @@ -494,7 +494,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) case SMART_ACTION_SET_FACTION: if (e.action.faction.factionID && !sFactionStore.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->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); return false; } break; @@ -504,7 +504,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) { if (e.action.morphOrMount.creature > 0 && !sCreatureStorage.LookupEntry(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->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); return false; } @@ -512,12 +512,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->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()); 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->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); return false; } } @@ -527,7 +527,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) if (!IsSoundValid(e, e.action.sound.sound)) 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->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); return false; } break; @@ -543,7 +543,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->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); return false; } break; @@ -567,13 +567,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->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); 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->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); return false; } break; @@ -587,19 +587,19 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) 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->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); 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->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()); 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->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()); return false; } break; @@ -619,7 +619,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->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()); return false; } } @@ -629,7 +629,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->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()); return false; } if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax)) return false; @@ -639,7 +639,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) if (!IsCreatureValid(e, e.action.summonCreature.creature)) return false; if (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->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); return false; } break; @@ -652,7 +652,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->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); return false; } break; @@ -660,7 +660,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->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); return false; } break; @@ -676,14 +676,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->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); 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->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); return false; } break; @@ -694,13 +694,13 @@ 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->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); 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->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); return false; } break; @@ -768,7 +768,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) case SMART_ACTION_RANDOM_MOVE: 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->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); return false; } @@ -786,7 +786,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder 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->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); return false; } else @@ -796,7 +796,7 @@ bool SmartAIMgr::IsTextValid(SmartScriptHolder 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->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); return false; } return true; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 7e17eb23b3c..b09409d76fb 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1181,7 +1181,7 @@ class SmartAIMgr else { if(entry > 0)//first search is for guid (negative), do not drop error if not found - sLog.outDebug("SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type)); + sLog->outDebug("SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type)); return temp; } } @@ -1196,7 +1196,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->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); return false; } return true; @@ -1205,7 +1205,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->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); return false; } return true; @@ -1214,7 +1214,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->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); return false; } return true; @@ -1223,7 +1223,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->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()); return false; } return true; @@ -1232,7 +1232,7 @@ class SmartAIMgr { if (!sCreatureStorage.LookupEntry(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->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); return false; } return true; @@ -1241,7 +1241,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->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); return false; } return true; @@ -1250,7 +1250,7 @@ class SmartAIMgr { if (!sGOStorage.LookupEntry(uint32(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->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); return false; } return true; @@ -1259,7 +1259,7 @@ class SmartAIMgr { if (!sSpellStore.LookupEntry(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->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); return false; } return true; @@ -1268,7 +1268,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->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); return false; } return true; @@ -1288,7 +1288,7 @@ class SmartAIMgr } if (error) { - sLog.outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Condition, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Condition, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); return false; } return true; @@ -1297,7 +1297,7 @@ class SmartAIMgr { if (!sEmotesTextStore.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->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); return false; } return true; @@ -1306,7 +1306,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->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); return false; } return true; @@ -1315,7 +1315,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->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); return false; } return true; diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 863ae15d6ce..5e54fce96a1 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -74,7 +74,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->outErrorDb("Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID,dataType); return false; } @@ -100,7 +100,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: break; default: - sLog.outErrorDb("Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType); + sLog->outErrorDb("Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType); return false; } @@ -113,7 +113,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE: if (!creature.id || !ObjectMgr::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->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.", criteria->ID, criteria->requiredType,dataType,creature.id); return false; } @@ -121,19 +121,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_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.", + sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_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_CREATURE (%u) has non-existing class in value1 (%u), ignored.", + sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%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_CREATURE (%u) has non-existing race in value2 (%u), ignored.", + sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing race in value2 (%u), ignored.", criteria->ID, criteria->requiredType,dataType,classRace.race_id); return false; } @@ -141,7 +141,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->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.", criteria->ID, criteria->requiredType,dataType,health.percent); return false; } @@ -149,7 +149,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD: if (player_dead.own_team_flag > 1) { - sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).", + sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).", criteria->ID, criteria->requiredType,dataType,player_dead.own_team_flag); return false; } @@ -160,19 +160,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) SpellEntry const* spellEntry = sSpellStore.LookupEntry(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->outErrorDb("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->outErrorDb("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->EffectApplyAuraName[aura.effect_idx]) { - 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->outErrorDb("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; } @@ -181,7 +181,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA: if (!GetAreaEntryByAreaID(area.id)) { - sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.", + sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.", criteria->ID, criteria->requiredType,dataType,area.id); return false; } @@ -189,7 +189,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->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.", criteria->ID, criteria->requiredType,dataType,level.minlevel); return false; } @@ -197,7 +197,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->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.", criteria->ID, criteria->requiredType,dataType,gender.gender); return false; } @@ -205,7 +205,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->outErrorDb("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; } @@ -213,7 +213,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY: if (difficulty.difficulty >= MAX_DIFFICULTY) { - sLog.outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.", + sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.", criteria->ID, criteria->requiredType,dataType,difficulty.difficulty); return false; } @@ -221,7 +221,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->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.", criteria->ID, criteria->requiredType,dataType,map_players.maxcount); return false; } @@ -229,7 +229,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->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.", criteria->ID, criteria->requiredType,dataType,team.team); return false; } @@ -237,7 +237,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->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.", criteria->ID, criteria->requiredType,dataType,drunk.state); return false; } @@ -245,7 +245,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->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.", criteria->ID, criteria->requiredType,dataType,holiday.id); return false; } @@ -255,7 +255,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->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.", criteria->ID, criteria->requiredType,dataType,equipped_item.item_quality); return false; } @@ -263,13 +263,13 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID: if (!sMapStore.LookupEntry(map_id.mapId)) { - sLog.outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID (%u) has unknown map id in value1 (%u), ignored.", + sLog->outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID (%u) has unknown map id in value1 (%u), ignored.", criteria->ID, criteria->requiredType, dataType, map_id.mapId); 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->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType,dataType); return false; } } @@ -351,14 +351,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->outErrorDb("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->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", ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId()); return false; } @@ -423,10 +423,10 @@ void AchievementMgr::Reset() void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, bool evenIfCriteriaComplete) { - if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog.outDetail("AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2); + if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) + sLog->outDetail("AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2); - if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) + if (!sWorld->getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) return; AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type); @@ -600,7 +600,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ 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("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.",id); CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE criteria = %u",id); continue; } @@ -627,8 +627,8 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) return; #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog.outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID); + if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) + sLog->outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID); #endif if (Guild* guild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildId())) @@ -646,7 +646,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) data << uint64(GetPlayer()->GetGUID()); data << uint32(achievement->ID); data << uint32(0); // 1=link supplied string as player name, 0=display plain string - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); } // if player is in world he can tell his friends about new achievement else if (GetPlayer()->IsInWorld()) @@ -659,9 +659,9 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID); Trinity::LocalizedPacketDo say_do(say_builder); - Trinity::PlayerDistWorker > say_worker(GetPlayer(),sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do); + Trinity::PlayerDistWorker > say_worker(GetPlayer(),sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); + cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); } WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8); @@ -669,7 +669,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) data << uint32(achievement->ID); data << uint32(secsToTimeBitFields(time(NULL))); data << uint32(0); - GetPlayer()->SendMessageToSetInRange(&data, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); + GetPlayer()->SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); } void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) @@ -718,10 +718,10 @@ static const uint32 achievIdForDangeon[][4] = */ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time) { - if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog.outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time); + if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) + sLog->outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time); - if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) + if (!sWorld->getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) return; AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type); @@ -857,7 +857,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui } case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: { - time_t nextDailyResetTime = sWorld.GetNextDailyQuestsResetTime(); + time_t nextDailyResetTime = sWorld->GetNextDailyQuestsResetTime(); CriteriaProgress *progress = GetCriteriaProgress(achievementCriteria); if (!miscvalue1) // Login case. @@ -1817,8 +1817,8 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, if (entry->timeLimit && timedIter == m_timedAchievements.end()) return; - if ((sLog.getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog.outDetail("AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); + if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) + sLog->outDetail("AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); CriteriaProgress* progress = GetCriteriaProgress(entry); if (!progress) @@ -1960,9 +1960,9 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, bool ignoreGMAllowAchievementConfig) { - sLog.outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); + sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); - if (!sWorld.getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER && !ignoreGMAllowAchievementConfig) + if (!sWorld->getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER && !ignoreGMAllowAchievementConfig) return; if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement)) @@ -2098,8 +2098,8 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() if (sAchievementCriteriaStore.GetNumRows() == 0) { - sLog.outErrorDb(">> Loaded 0 achievement criteria."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 achievement criteria."); + sLog->outString(); return; } @@ -2117,8 +2117,8 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() m_AchievementCriteriasByTimedType[criteria->timedType].push_back(criteria); } - sLog.outString(">> Loaded %lu achievement criteria in %u ms",(unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu achievement criteria in %u ms",(unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AchievementGlobalMgr::LoadAchievementReferenceList() @@ -2127,8 +2127,8 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() if (sAchievementStore.GetNumRows() == 0) { - sLog.outString(">> Loaded 0 achievement references."); - sLog.outString(); + sLog->outString(">> Loaded 0 achievement references."); + sLog->outString(); return; } @@ -2145,8 +2145,8 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() ++count; } - sLog.outString(">> Loaded %u achievement references in %u ms",count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u achievement references in %u ms",count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AchievementGlobalMgr::LoadAchievementCriteriaData() @@ -2159,8 +2159,8 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() if (!result) { - sLog.outString(">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); + sLog->outString(); return; } @@ -2175,7 +2175,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() if (!criteria) { - sLog.outErrorDb("Table `achievement_criteria_data` has data for non-existing criteria (Entry: %u), ignore.", criteria_id); + sLog->outErrorDb("Table `achievement_criteria_data` has data for non-existing criteria (Entry: %u), ignore.", criteria_id); continue; } @@ -2185,7 +2185,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->outErrorDb("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); } @@ -2284,11 +2284,11 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() } if (!GetCriteriaDataSet(criteria) && !sDisableMgr->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->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.outString(">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AchievementGlobalMgr::LoadCompletedAchievements() @@ -2299,8 +2299,8 @@ void AchievementGlobalMgr::LoadCompletedAchievements() if (!result) { - sLog.outString(">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); + sLog->outString(); return; } @@ -2312,7 +2312,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() if (!sAchievementStore.LookupEntry(achievement_id)) { // we will remove not existed achievement for all characters - sLog.outError("Non-existing achievement %u data removed from table `character_achievement`.",achievement_id); + sLog->outError("Non-existing achievement %u data removed from table `character_achievement`.",achievement_id); CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE achievement = %u",achievement_id); continue; } @@ -2320,8 +2320,8 @@ void AchievementGlobalMgr::LoadCompletedAchievements() m_allCompletedAchievements.insert(achievement_id); } while (result->NextRow()); - sLog.outString(">> Loaded %lu completed achievements in %u ms",(unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu completed achievements in %u ms",(unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AchievementGlobalMgr::LoadRewards() @@ -2335,8 +2335,8 @@ void AchievementGlobalMgr::LoadRewards() if (!result) { - sLog.outErrorDb(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); + sLog->outString(); return; } @@ -2350,7 +2350,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->outErrorDb("Table `achievement_reward` has wrong achievement (Entry: %u), ignore", entry); continue; } @@ -2365,19 +2365,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->outErrorDb("Table `achievement_reward` (Entry: %u) not have title or item reward data, ignore.", entry); continue; } if (pAchievement->factionFlag == 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->outErrorDb("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->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_A`, set to 0", entry, reward.titleId[0]); reward.titleId[0] = 0; } } @@ -2387,7 +2387,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->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid title id (%u) in `title_H`, set to 0", entry, reward.titleId[1]); reward.titleId[1] = 0; } } @@ -2397,27 +2397,27 @@ void AchievementGlobalMgr::LoadRewards() { if (!ObjectMgr::GetCreatureTemplate(reward.sender)) { - sLog.outErrorDb("Table `achievement_reward` (Entry: %u) has invalid creature entry %u as sender, mail reward skipped.", entry, reward.sender); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Table `achievement_reward` (Entry: %u) does not have sender data but has mail text.", entry); } if (reward.itemId) { if (!ObjectMgr::GetItemPrototype(reward.itemId)) { - sLog.outErrorDb("Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId); + sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has invalid item id %u, reward mail will not contain item.", entry, reward.itemId); reward.itemId = 0; } } @@ -2428,8 +2428,8 @@ void AchievementGlobalMgr::LoadRewards() } while (result->NextRow()); - sLog.outString(">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AchievementGlobalMgr::LoadRewardLocales() @@ -2444,8 +2444,8 @@ void AchievementGlobalMgr::LoadRewardLocales() if (!result) { - sLog.outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty"); - sLog.outString(); + sLog->outString(">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty"); + sLog->outString(); return; } @@ -2458,7 +2458,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->outErrorDb("Table `locales_achievement_reward` (Entry: %u) has locale strings for non-existing achievement reward.", entry); continue; } @@ -2475,6 +2475,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->outString(">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } diff --git a/src/server/game/Addons/AddonMgr.cpp b/src/server/game/Addons/AddonMgr.cpp index e0484a65668..42e53ad1cf3 100755 --- a/src/server/game/Addons/AddonMgr.cpp +++ b/src/server/game/Addons/AddonMgr.cpp @@ -39,8 +39,8 @@ void AddonMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 known addons. DB table `addons` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 known addons. DB table `addons` is empty!"); + sLog->outString(); return; } @@ -60,8 +60,8 @@ void AddonMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u known addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u known addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AddonMgr::SaveAddon(AddonInfo const& addon) diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 01cf94089af..2fd31145957 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -50,7 +50,7 @@ AuctionHouseMgr::~AuctionHouseMgr() AuctionHouseObject * AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) { - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) return &mNeutralAuctions; // team have linked auction houses @@ -76,10 +76,10 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 uint32 timeHr = (((time / 60) / 60) / 12); uint32 deposit = uint32(multiplier * MSV * count / 3) * timeHr * 3; - sLog.outDebug("MSV: %u", MSV); - sLog.outDebug("Items: %u", count); - sLog.outDebug("Multiplier: %f", multiplier); - sLog.outDebug("Deposit: %u", deposit); + sLog->outDebug("MSV: %u", MSV); + sLog->outDebug("Items: %u", count); + sLog->outDebug("Multiplier: %f", multiplier); + sLog->outDebug("Deposit: %u", deposit); if (deposit < AH_MINIMUM_DEPOSIT) return AH_MINIMUM_DEPOSIT; @@ -98,7 +98,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); Player *bidder = sObjectMgr->GetPlayer(bidder_guid); // data for gm.log - if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { uint32 bidder_security = 0; std::string bidder_name; @@ -127,7 +127,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); - sLog.outCommand(bidder_accId,"GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", + sLog->outCommand(bidder_accId,"GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", bidder_name.c_str(),bidder_accId,pItem->GetProto()->Name1,pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid); } } @@ -142,7 +142,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& msgAuctionWonBody.width(16); msgAuctionWonBody << std::right << std::hex << auction->owner; msgAuctionWonBody << std::dec << ":" << auction->bid << ":" << auction->buyout; - sLog.outDebug("AuctionWon body string : %s", msgAuctionWonBody.str().c_str()); + sLog->outDebug("AuctionWon body string : %s", msgAuctionWonBody.str().c_str()); // set owner to bidder (to prevent delete item with sender char deleting) // owner in `data` will set at mail receive and item extracting @@ -178,7 +178,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran std::ostringstream msgAuctionSalePendingBody; uint32 auctionCut = auction->GetAuctionCut(); - time_t distrTime = time(NULL) + sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY); + time_t distrTime = time(NULL) + sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY); msgAuctionSalePendingBody.width(16); msgAuctionSalePendingBody << std::right << std::hex << auction->bidder; @@ -186,7 +186,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran msgAuctionSalePendingBody << ":" << auction->deposit << ":" << auctionCut << ":0:"; msgAuctionSalePendingBody << secsToTimeBitFields(distrTime); - sLog.outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); + sLog->outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); MailDraft(msgAuctionSalePendingSubject.str(), msgAuctionSalePendingBody.str()) .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED); @@ -213,7 +213,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans auctionSuccessfulBody << std::dec << ":" << auction->bid << ":" << auction->buyout; auctionSuccessfulBody << ":" << auction->deposit << ":" << auctionCut; - sLog.outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); + sLog->outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); uint32 profit = auction->bid + auction->deposit - auctionCut; @@ -227,7 +227,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans } MailDraft(msgAuctionSuccessfulSubject.str(), auctionSuccessfulBody.str()) .AddMoney(profit) - .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY)); + .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY)); } } @@ -315,8 +315,8 @@ void AuctionHouseMgr::LoadAuctionItems() if (!result) { - sLog.outString(">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!"); + sLog->outString(); return; } @@ -333,7 +333,7 @@ void AuctionHouseMgr::LoadAuctionItems() ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template); if (!proto) { - sLog.outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template); + sLog->outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template); continue; } @@ -349,8 +349,8 @@ void AuctionHouseMgr::LoadAuctionItems() } while (result->NextRow()); - sLog.outString(">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u auction items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AuctionHouseMgr::LoadAuctions() @@ -362,8 +362,8 @@ void AuctionHouseMgr::LoadAuctions() if (!result) { - sLog.outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 auctions. DB table `auctionhouse` is empty."); + sLog->outString(); return; } @@ -389,8 +389,8 @@ void AuctionHouseMgr::LoadAuctions() CharacterDatabase.CommitTransaction(trans); - sLog.outString(">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u auctions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void AuctionHouseMgr::AddAItem(Item* it) @@ -421,7 +421,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem { uint32 houseid = 7; // goblin auction house - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) { //FIXME: found way for proper auctionhouse selection by another way // AuctionHouse.dbc have faction field with _player_ factions associated with auction house races. @@ -478,7 +478,7 @@ bool AuctionHouseObject::RemoveAuction(AuctionEntry *auction, uint32 /*item_temp void AuctionHouseObject::Update() { - time_t curTime = sWorld.GetGameTime(); + time_t curTime = sWorld->GetGameTime(); ///- Handle expired auctions // If storage is empty, no need to update. next == NULL in this case. @@ -664,7 +664,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const Item *pItem = sAuctionMgr->GetAItem(item_guidlow); if (!pItem) { - sLog.outError("auction to item, that doesn't exist !!!!"); + sLog->outError("auction to item, that doesn't exist !!!!"); return false; } data << uint32(Id); @@ -695,7 +695,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const uint32 AuctionEntry::GetAuctionCut() const { - int32 cut = int32(CalculatePctU(sWorld.getRate(RATE_AUCTION_CUT), auctionHouseEntry->cutPercent)) * bid; + int32 cut = int32(CalculatePctU(sWorld->getRate(RATE_AUCTION_CUT), auctionHouseEntry->cutPercent)) * bid; return std::max(cut, 0); } @@ -746,14 +746,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("Auction %u has not a existing auctioneer (GUID : %u)", Id, auctioneer); return false; } CreatureInfo const* auctioneerInfo = ObjectMgr::GetCreatureTemplate(auctioneerData->id); if (!auctioneerInfo) { - sLog.outError("Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id); + sLog->outError("Auction %u has not a existing auctioneer (GUID : %u Entry: %u)", Id, auctioneer, auctioneerData->id); return false; } @@ -761,7 +761,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("Auction %u has auctioneer (GUID : %u Entry: %u) with wrong faction %u", Id, auctioneer, auctioneerData->id, factionTemplateId); return false; } @@ -769,7 +769,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("Auction %u has not a existing item : %u", Id, item_guidlow); return false; } return true; diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 01c03793061..9eda2688e89 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -55,7 +55,7 @@ ArenaTeam::ArenaTeam() m_stats.games_week = 0; m_stats.games_season = 0; m_stats.rank = 0; - m_stats.rating = sWorld.getIntConfig(CONFIG_ARENA_START_RATING); + m_stats.rating = sWorld->getIntConfig(CONFIG_ARENA_START_RATING); m_stats.wins_week = 0; m_stats.wins_season = 0; } @@ -72,7 +72,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam return false; uint32 captainLowGuid = GUID_LOPART(captainGuid); - sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), captainLowGuid); + sLog->outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), captainLowGuid); m_CaptainGuid = captainGuid; m_Name = ArenaTeamName; @@ -95,7 +95,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam CharacterDatabase.CommitTransaction(trans); AddMember(m_CaptainGuid); - sLog.outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid); + sLog->outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid); return true; } @@ -115,7 +115,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid) { if (pl->GetArenaTeamId(GetSlot())) { - sLog.outError("Arena::AddMember() : player already in this sized team"); + sLog->outError("Arena::AddMember() : player already in this sized team"); return false; } @@ -135,20 +135,20 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid) // check if player already in arenateam of that size if (Player::GetArenaTeamIdFromDB(PlayerGuid, GetType()) != 0) { - sLog.outError("Arena::AddMember() : player already in this sized team"); + sLog->outError("Arena::AddMember() : player already in this sized team"); return false; } } - plMMRating = sWorld.getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING); + plMMRating = sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING); plPRating = 0; - if (sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0) - plPRating = sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING); + if (sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0) + plPRating = sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING); else if (GetRating() >= 1000) plPRating = 1000; - sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING); + sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING); QueryResult result = CharacterDatabase.PQuery("SELECT matchmaker_rating FROM character_arena_stats WHERE guid='%u' AND slot='%u'", GUID_LOPART(PlayerGuid), GetSlot()); if (result) @@ -181,7 +181,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid) // hide promote/remove buttons if (m_CaptainGuid != PlayerGuid) pl->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1); - sLog.outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUIDLow(), GetType(), GetId()); + sLog->outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUIDLow(), GetType(), GetId()); } return true; } @@ -230,7 +230,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult) if (arenaTeamId < m_TeamId) { //there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error - sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId); + sLog->outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId); CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId); continue; } @@ -267,7 +267,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult) //check if member exists in characters table 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)); + 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); continue; } @@ -281,7 +281,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult) if (Empty() || !captainPresentInTeam) { // arena team is empty or captain is not in team, delete from db - sLog.outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", m_TeamId); + sLog->outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", m_TeamId); return false; } @@ -306,7 +306,7 @@ void ArenaTeam::SetCaptain(const uint64& guid) if (newcaptain) { newcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0); - sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUIDLow(), GetId(), GetType()); + sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUIDLow(), GetId(), GetType()); } } @@ -325,7 +325,7 @@ void ArenaTeam::DelMember(uint64 guid) // 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->outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId()); } CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid)); } @@ -343,7 +343,7 @@ void ArenaTeam::Disband(WorldSession *session) if (session) 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->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId()); SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM arena_team WHERE arenateamid = '%u'", m_TeamId); @@ -388,7 +388,7 @@ void ArenaTeam::Roster(WorldSession *session) } session->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); + sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); } void ArenaTeam::Query(WorldSession *session) @@ -403,7 +403,7 @@ void ArenaTeam::Query(WorldSession *session) data << uint32(m_BorderStyle); // border style data << uint32(m_BorderColor); // border color session->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE"); + sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE"); } void ArenaTeam::Stats(WorldSession *session) @@ -489,7 +489,7 @@ void ArenaTeam::SetStats(uint32 stat_type, uint32 value) CharacterDatabase.PExecute("UPDATE arena_team_stats SET rank = '%u' WHERE arenateamid = '%u'", value, GetId()); break; default: - sLog.outDebug("unknown stat type in ArenaTeam::SetStats() %u", stat_type); + sLog->outDebug("unknown stat type in ArenaTeam::SetStats() %u", stat_type); break; } } @@ -523,7 +523,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("Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount); return; } @@ -532,7 +532,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun BroadcastPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_EVENT"); + sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_EVENT"); } uint8 ArenaTeam::GetSlotByType(uint32 type) @@ -545,7 +545,7 @@ uint8 ArenaTeam::GetSlotByType(uint32 type) default: break; } - sLog.outError("FATAL: Unknown arena team type %u for some arena team", type); + sLog->outError("FATAL: Unknown arena team type %u for some arena team", type); return 0xFF; } @@ -567,7 +567,7 @@ uint32 ArenaTeam::GetPoints(uint32 MemberRating) if (rating <= 1500) { - if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) < 6) + if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) < 6) points = (float)rating * 0.22f + 14.0f; else points = 344; @@ -619,7 +619,7 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating) // returns the chance to win against a team with the given rating, used in the rating adjustment calculation // ELO system -/* if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6) +/* if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6) if (enemy_rating < 1000) enemy_rating = 1000;*/ return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f)); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 3105a026b84..966fc056f46 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -260,7 +260,7 @@ void Battleground::Update(uint32 diff) BattlegroundPlayerMap::iterator itr = m_Players.find(*(m_OfflineQueue.begin())); if (itr != m_Players.end()) { - if (itr->second.OfflineRemoveTime <= sWorld.GetGameTime()) + if (itr->second.OfflineRemoveTime <= sWorld->GetGameTime()) { RemovePlayerAtLeave(itr->first, true, true);// remove player from BG m_OfflineQueue.pop_front(); // remove from offline queue @@ -321,7 +321,7 @@ void Battleground::Update(uint32 diff) plr->ResurrectPlayer(1.0f); plr->CastSpell(plr, 6962, true); plr->CastSpell(plr, SPELL_SPIRIT_HEAL_MANA, true); - sObjectAccessor.ConvertCorpseForPlayer(*itr); + sObjectAccessor->ConvertCorpseForPlayer(*itr); } m_ResurrectQueue.clear(); } @@ -473,9 +473,9 @@ void Battleground::Update(uint32 diff) plr->ResetAllPowers(); } //Announce BG starting - if (sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) + if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) { - sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); + sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); } } } @@ -528,7 +528,7 @@ void Battleground::SendPacketToAll(WorldPacket *packet) if (plr) plr->GetSession()->SendPacket(packet); else - sLog.outError("Battleground:SendPacketToAll: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + sLog->outError("Battleground:SendPacketToAll: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); } } @@ -541,7 +541,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player * Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { - sLog.outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + sLog->outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); continue; } @@ -575,7 +575,7 @@ void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID) if (!plr) { - sLog.outError("Battleground:PlaySoundToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + sLog->outError("Battleground:PlaySoundToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); continue; } @@ -600,7 +600,7 @@ void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID) if (!plr) { - sLog.outError("Battleground:CastSpellOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + sLog->outError("Battleground:CastSpellOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); continue; } @@ -620,7 +620,7 @@ void Battleground::YellToAll(Creature* creature, const char* text, uint32 langua Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { - sLog.outError("Battleground: Player " UI64FMTD " not found!", itr->first); + sLog->outError("Battleground: Player " UI64FMTD " not found!", itr->first); continue; } creature->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,creature->GetName(),itr->first); @@ -638,7 +638,7 @@ void Battleground::RewardHonorToTeam(uint32 Honor, uint32 TeamID) if (!plr) { - sLog.outError("Battleground:RewardHonorToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + sLog->outError("Battleground:RewardHonorToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); continue; } @@ -665,7 +665,7 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation, if (!plr) { - sLog.outError("Battleground:RewardReputationToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + sLog->outError("Battleground:RewardReputationToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); continue; } @@ -746,15 +746,15 @@ void Battleground::EndBattleground(uint32 winner) winner_matchmaker_rating = GetArenaMatchmakerRating(winner); winner_change = winner_arena_team->WonAgainst(loser_matchmaker_rating); loser_change = loser_arena_team->LostAgainst(winner_matchmaker_rating); - sLog.outDebug("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Losser change: %u ---", winner_team_rating, loser_team_rating, + sLog->outDebug("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Losser change: %u ---", winner_team_rating, loser_team_rating, winner_matchmaker_rating, loser_matchmaker_rating, winner_change, loser_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); - if (sWorld.getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO)) + 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); + if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO)) for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); itr++) if (Player* player = sObjectMgr->GetPlayer(itr->first)) - sLog.outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", 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->outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", 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 @@ -791,7 +791,7 @@ void Battleground::EndBattleground(uint32 winner) Player *plr = sObjectMgr->GetPlayer(itr->first); if (!plr) { - sLog.outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first)); + sLog->outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first)); continue; } @@ -1039,7 +1039,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac if (Transport) plr->TeleportToBGEntryPoint(); - sLog.outDetail("BATTLEGROUND: Removed player %s from Battleground.", plr->GetName()); + sLog->outDetail("BATTLEGROUND: Removed player %s from Battleground.", plr->GetName()); plr->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_CONDITION_MAP, GetMapId(), true); } @@ -1060,7 +1060,7 @@ void Battleground::Reset() m_Events = 0; if (m_InvitedAlliance > 0 || m_InvitedHorde > 0) - sLog.outError("Battleground system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde); + sLog->outError("Battleground system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde); m_InvitedAlliance = 0; m_InvitedHorde = 0; @@ -1087,7 +1087,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->outArena("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 *plr) @@ -1169,7 +1169,7 @@ void Battleground::AddPlayer(Player *plr) AddOrSetPlayerToCorrectBgGroup(plr, guid, team); // Log - sLog.outDetail("BATTLEGROUND: Player %s joined the battle.", plr->GetName()); + sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", plr->GetName()); } /* this method adds player to his team's bg group, or sets his correct group if player is already in bg group */ @@ -1222,7 +1222,7 @@ void Battleground::EventPlayerLoggedOut(Player* player) { // player is correct pointer, it is checked in WorldSession::LogoutPlayer() m_OfflineQueue.push_back(player->GetGUID()); - m_Players[player->GetGUID()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME; + m_Players[player->GetGUID()].OfflineRemoveTime = sWorld->GetGameTime() + MAX_OFFLINE_TIME; if (GetStatus() == STATUS_IN_PROGRESS) { // drop flag and handle other cleanups @@ -1365,7 +1365,7 @@ void Battleground::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, itr->second->HealingDone += value; break; default: - sLog.outError("Battleground: Unknown player score type %u", type); + sLog->outError("Battleground: Unknown player score type %u", type); break; } } @@ -1415,8 +1415,8 @@ 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("Gameobject template %u not found in database! Battleground not created!", entry); - sLog.outError("Cannot create gameobject template %u! Battleground not created!", entry); + sLog->outErrorDb("Gameobject template %u not found in database! Battleground not created!", entry); + sLog->outError("Cannot create gameobject template %u! Battleground not created!", entry); delete go; return false; } @@ -1465,7 +1465,7 @@ void Battleground::DoorClose(uint32 type) } else { - sLog.outError("Battleground: Door object not found (cannot close doors)"); + sLog->outError("Battleground: Door object not found (cannot close doors)"); } } @@ -1480,7 +1480,7 @@ void Battleground::DoorOpen(uint32 type) } else { - sLog.outError("Battleground: Door object not found! - doors will be closed."); + sLog->outError("Battleground: Door object not found! - doors will be closed."); } } @@ -1488,7 +1488,7 @@ GameObject* Battleground::GetBGObject(uint32 type) { GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]); if (!obj) - sLog.outError("couldn't get gameobject %i",type); + sLog->outError("couldn't get gameobject %i",type); return obj; } @@ -1496,7 +1496,7 @@ Creature* Battleground::GetBGCreature(uint32 type) { Creature *creature = GetBgMap()->GetCreature(m_BgCreatures[type]); if (!creature) - sLog.outError("couldn't get creature %i",type); + sLog->outError("couldn't get creature %i",type); return creature; } @@ -1538,7 +1538,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f Creature* pCreature = new Creature; if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o)) { - sLog.outError("Can't create creature entry: %u",entry); + sLog->outError("Can't create creature entry: %u",entry); delete pCreature; return NULL; } @@ -1548,7 +1548,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(entry); if (!cinfo) { - sLog.outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry); + sLog->outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry); return NULL; } //force using DB speeds @@ -1601,7 +1601,7 @@ bool Battleground::DelCreature(uint32 type) Creature *cr = GetBgMap()->GetCreature(m_BgCreatures[type]); if (!cr) { - sLog.outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type])); + sLog->outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type])); return false; } cr->AddObjectToRemoveList(); @@ -1617,7 +1617,7 @@ bool Battleground::DelObject(uint32 type) GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]); if (!obj) { - sLog.outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type])); + sLog->outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type])); return false; } obj->SetRespawnTime(0); // not save respawn time @@ -1638,7 +1638,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float Creature* pCreature = AddCreature(entry,type,team,x,y,z,o); if (!pCreature) { - sLog.outError("Can't create Spirit guide. Battleground not created!"); + sLog->outError("Can't create Spirit guide. Battleground not created!"); EndNow(); return false; } @@ -1744,7 +1744,7 @@ void Battleground::HandleTriggerBuff(uint64 const& go_guid) index--; if (index < 0) { - sLog.outError("Battleground (Type: %u) has buff gameobject (Guid: %u Entry: %u Type:%u) but it hasn't that object in its internal data",GetTypeID(true),GUID_LOPART(go_guid),obj->GetEntry(),obj->GetGoType()); + sLog->outError("Battleground (Type: %u) has buff gameobject (Guid: %u Entry: %u Type:%u) but it hasn't that object in its internal data",GetTypeID(true),GUID_LOPART(go_guid),obj->GetEntry(),obj->GetGoType()); return; } @@ -1868,7 +1868,7 @@ int32 Battleground::GetObjectType(uint64 guid) for (uint32 i = 0; i < m_BgObjects.size(); ++i) if (m_BgObjects[i] == guid) return i; - sLog.outError("Battleground: cheating? a player used a gameobject which isnt supposed to be a usable object!"); + sLog->outError("Battleground: cheating? a player used a gameobject which isnt supposed to be a usable object!"); return -1; } @@ -1930,7 +1930,7 @@ void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry) void Battleground::RewardXPAtKill(Player* plr, Player* victim) { - if (!sWorld.getBoolConfig(CONFIG_BG_XP_FOR_KILL) || !plr || !victim) + if (!sWorld->getBoolConfig(CONFIG_BG_XP_FOR_KILL) || !plr || !victim) return; uint32 xp = 0; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index e3fb4c42f79..b7a208ac9fa 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -55,7 +55,7 @@ BattlegroundMgr::BattlegroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe { for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++) m_Battlegrounds[i].clear(); - m_NextRatingDiscardUpdate = sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); + m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); m_Testing=false; } @@ -138,33 +138,33 @@ void BattlegroundMgr::Update(uint32 diff) } // if rating difference counts, maybe force-update queues - if (sWorld.getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER)) + if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER)) { // it's time to force update if (m_NextRatingDiscardUpdate < diff) { // forced update for rated arenas (scan all, but skipped non rated) - sLog.outDebug("BattlegroundMgr: UPDATING ARENA QUEUES"); + sLog->outDebug("BattlegroundMgr: UPDATING ARENA QUEUES"); for (int qtype = BATTLEGROUND_QUEUE_2v2; qtype <= BATTLEGROUND_QUEUE_5v5; ++qtype) for (int bracket = BG_BRACKET_ID_FIRST; bracket < MAX_BATTLEGROUND_BRACKETS; ++bracket) m_BattlegroundQueues[qtype].Update( BATTLEGROUND_AA, BattlegroundBracketId(bracket), BattlegroundMgr::BGArenaType(BattlegroundQueueTypeId(qtype)), true, 0); - m_NextRatingDiscardUpdate = sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); + m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); } else m_NextRatingDiscardUpdate -= diff; } - if (sWorld.getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) + if (sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) { if (m_AutoDistributionTimeChecker < diff) { if (time(NULL) > m_NextAutoDistributionTime) { DistributeArenaPoints(); - m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); - sWorld.setWorldState(WS_ARENA_DISTRIBUTION_TIME, uint64(m_NextAutoDistributionTime)); + m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); + sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, uint64(m_NextAutoDistributionTime)); } m_AutoDistributionTimeChecker = 600000; // check 10 minutes } @@ -189,7 +189,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint32(QueueSlot); // queue id (0...1) - player can be in 2 queues in time // The following segment is read as uint64 in client but can be appended as their original type. *data << uint8(arenatype); - sLog.outDebug("BattlegroundMgr::BuildBattlegroundStatusPacket: arenatype = %u for bg instanceID %u, TypeID %u.", arenatype, bg->GetClientInstanceID(), bg->GetTypeID()); + sLog->outDebug("BattlegroundMgr::BuildBattlegroundStatusPacket: arenatype = %u for bg instanceID %u, TypeID %u.", arenatype, bg->GetClientInstanceID(), bg->GetTypeID()); *data << uint8(bg->isArena() ? 0xC : 0x2); *data << uint32(bg->GetTypeID()); *data << uint16(0x1F90); @@ -221,7 +221,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint8(uiFrame); break; default: - sLog.outError("Unknown BG status!"); + sLog->outError("Unknown BG status!"); break; } } @@ -245,7 +245,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg) *data << uint32(pointsLost); // Rating Lost *data << uint32(pointsGained); // Rating gained *data << uint32(MatchmakerRating); // Matchmaking Value - sLog.outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]); + sLog->outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]); } for (int8 i = 1; i >= 0; --i) { @@ -276,7 +276,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("Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true)); continue; } @@ -372,14 +372,14 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg) *data << uint32(0); break; default: - sLog.outDebug("Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID()); + sLog->outDebug("Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID()); *data << uint32(0); break; } // 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("Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers()); break; } } @@ -496,7 +496,7 @@ Battleground * BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeI if (!bg_template) { - sLog.outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId); + sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId); return NULL; } bool isRandom = false; @@ -538,7 +538,7 @@ Battleground * BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeI bg_template = GetBattlegroundTemplate(bgTypeId); if (!bg_template) { - sLog.outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId); + sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId); return NULL; } } @@ -676,8 +676,8 @@ void BattlegroundMgr::CreateInitialBattlegrounds() if (!result) { - sLog.outErrorDb(">> Loaded 0 battlegrounds. DB table `battleground_template` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 battlegrounds. DB table `battleground_template` is empty."); + sLog->outString(); return; } @@ -695,7 +695,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("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_); continue; } @@ -738,7 +738,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.", bgTypeID, start1); + sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", bgTypeID, start1); continue; } @@ -761,14 +761,14 @@ 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.", bgTypeID, start2); + sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", bgTypeID, start2); continue; } selectionWeight = fields[9].GetUInt8(); scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); - //sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl); - if (!CreateBattleground(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3], scriptId)) + //sLog->outDetail("Creating battleground %s, %u-%u", bl->name[sWorld->GetDBClang()], MinLvl, MaxLvl); + if (!CreateBattleground(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld->GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3], scriptId)) continue; if (IsArena) @@ -782,34 +782,34 @@ void BattlegroundMgr::CreateInitialBattlegrounds() } while (result->NextRow()); - sLog.outString(">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void BattlegroundMgr::InitAutomaticArenaPointDistribution() { - if (!sWorld.getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) + if (!sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) return; - time_t wstime = time_t(sWorld.getWorldState(WS_ARENA_DISTRIBUTION_TIME)); + time_t wstime = time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME)); time_t curtime = time(NULL); - sLog.outDebug("Initializing Automatic Arena Point Distribution"); + sLog->outDebug("Initializing Automatic Arena Point Distribution"); if (wstime < curtime) { m_NextAutoDistributionTime = curtime; // reset will be called in the next update - sLog.outDebug("Battleground: Next arena point distribution time in the past, reseting it now."); + sLog->outDebug("Battleground: Next arena point distribution time in the past, reseting it now."); } else m_NextAutoDistributionTime = wstime; - sLog.outDebug("Automatic Arena Point Distribution initialized."); + sLog->outDebug("Automatic Arena Point Distribution initialized."); } void BattlegroundMgr::DistributeArenaPoints() { // used to distribute arena points based on last week's stats - sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_START); + sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_START); - sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START); + sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START); //temporary structure for storing maximum points to add values for all players std::map PlayerPoints; @@ -833,9 +833,9 @@ void BattlegroundMgr::DistributeArenaPoints() PlayerPoints.clear(); - sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END); + sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END); - sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START); + sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START); for (ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr->GetArenaTeamMapBegin(); titr != sObjectMgr->GetArenaTeamMapEnd(); ++titr) { if (ArenaTeam * at = titr->second) @@ -846,9 +846,9 @@ void BattlegroundMgr::DistributeArenaPoints() } } - sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END); + sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END); - sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_END); + sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_END); } void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket *data, const uint64& guid, Player* plr, BattlegroundTypeId bgTypeId, uint8 fromWhere) @@ -927,12 +927,12 @@ void BattlegroundMgr::SendToBattleground(Player *pl, uint32 instanceId, Battlegr team = pl->GetTeam(); bg->GetTeamStartLoc(team, x, y, z, O); - sLog.outDetail("BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", pl->GetName(), mapid, x, y, z, O); + sLog->outDetail("BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", pl->GetName(), mapid, x, y, z, O); pl->TeleportTo(mapid, x, y, z, O); } else { - sLog.outError("player %u is trying to port to non-existent bg instance %u",pl->GetGUIDLow(), instanceId); + sLog->outError("player %u is trying to port to non-existent bg instance %u",pl->GetGUIDLow(), instanceId); } } @@ -1043,18 +1043,18 @@ void BattlegroundMgr::ToggleTesting() { m_Testing = !m_Testing; if (m_Testing) - sWorld.SendWorldText(LANG_DEBUG_BG_ON); + sWorld->SendWorldText(LANG_DEBUG_BG_ON); else - sWorld.SendWorldText(LANG_DEBUG_BG_OFF); + sWorld->SendWorldText(LANG_DEBUG_BG_OFF); } void BattlegroundMgr::ToggleArenaTesting() { m_ArenaTesting = !m_ArenaTesting; if (m_ArenaTesting) - sWorld.SendWorldText(LANG_DEBUG_ARENA_ON); + sWorld->SendWorldText(LANG_DEBUG_ARENA_ON); else - sWorld.SendWorldText(LANG_DEBUG_ARENA_OFF); + sWorld->SendWorldText(LANG_DEBUG_ARENA_OFF); } void BattlegroundMgr::SetHolidayWeekends(uint32 mask) @@ -1089,7 +1089,7 @@ void BattlegroundMgr::ScheduleQueueUpdate(uint32 arenaMatchmakerRating, uint8 ar uint32 BattlegroundMgr::GetMaxRatingDifference() const { // this is for stupid people who can't use brain and set max rating difference to 0 - uint32 diff = sWorld.getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE); + uint32 diff = sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE); if (diff == 0) diff = 5000; return diff; @@ -1097,12 +1097,12 @@ uint32 BattlegroundMgr::GetMaxRatingDifference() const uint32 BattlegroundMgr::GetRatingDiscardTimer() const { - return sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); + return sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER); } uint32 BattlegroundMgr::GetPrematureFinishTime() const { - return sWorld.getIntConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER); + return sWorld->getIntConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER); } void BattlegroundMgr::LoadBattleMastersEntry() @@ -1115,8 +1115,8 @@ void BattlegroundMgr::LoadBattleMastersEntry() if (!result) { - sLog.outString(">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); + sLog->outString(); return; } @@ -1132,7 +1132,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->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.",entry,bgTypeId); continue; } @@ -1141,8 +1141,8 @@ void BattlegroundMgr::LoadBattleMastersEntry() } while (result->NextRow()); - sLog.outString(">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId) diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 4e93eb45637..71146bb1775 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -151,16 +151,16 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg index += BG_TEAMS_COUNT; if (ginfo->Team == HORDE) index++; - sLog.outDebug("Adding Group to BattlegroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index); + sLog->outDebug("Adding Group to BattlegroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index); uint32 lastOnlineTime = getMSTime(); //announce world (this don't need mutex) - if (isRated && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)) + if (isRated && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)) { ArenaTeam *Team = sObjectMgr->GetArenaTeamById(arenateamid); if (Team) - sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating); + sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating); } //add players from group to ginfo @@ -192,7 +192,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg m_QueuedGroups[bracketId][index].push_back(ginfo); //announce to world, this code needs mutex - if (!isRated && !isPremade && sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) + if (!isRated && !isPremade && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) { if (Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(ginfo->BgTypeId)) { @@ -211,7 +211,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg qHorde += (*itr)->Players.size(); // Show queue status to player only (when joining queue) - if (sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) + if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) { ChatHandler(leader).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); @@ -219,7 +219,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg // System message else { - sWorld.SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level, + sWorld->SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } } @@ -291,7 +291,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou 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("BattlegroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid)); return; } @@ -324,10 +324,10 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou //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("BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid)); return; } - sLog.outDebug("BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id); + sLog->outDebug("BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id); // ALL variables are correctly set // We can ignore leveling up in queue - it should not cause crash @@ -351,11 +351,11 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou m_QueuedPlayers.erase(itr); // announce to world if arena team left queue for rated match, show only once - if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)) + if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE)) { ArenaTeam *Team = sObjectMgr->GetArenaTeamById(group->ArenaTeamId); if (Team) - sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating); + sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating); } //if player leaves queue and he is invited to rated arena match, then he have to lose @@ -364,7 +364,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou ArenaTeam * at = sObjectMgr->GetArenaTeamById(group->ArenaTeamId); if (at) { - sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating); + sLog->outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating); Player *plr = sObjectMgr->GetPlayer(guid); if (plr) at->MemberLost(plr, group->OpponentsMatchmakerRating); @@ -471,7 +471,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId); - sLog.outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID()); + sLog->outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID()); // send status packet sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); @@ -509,7 +509,7 @@ void BattlegroundQueue::FillPlayersToBG(Battleground* bg, BattlegroundBracketId ++Horde_itr; //if ofc like BG queue invitation is set in config, then we are happy - if (sWorld.getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0) + if (sWorld->getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0) return; /* @@ -605,7 +605,7 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint // this could be 2 cycles but i'm checking only first team in queue - it can cause problem - // if first is invited to BG and seconds timer expired, but we can ignore it, because players have only 80 seconds to click to enter bg // and when they click or after 80 seconds the queue info is removed from queue - uint32 time_before = getMSTime() - sWorld.getIntConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH); + uint32 time_before = getMSTime() - sWorld->getIntConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH); for (uint32 i = 0; i < BG_TEAMS_COUNT; i++) { if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty()) @@ -644,7 +644,7 @@ bool BattlegroundQueue::CheckNormalMatch(Battleground* bg_template, Battleground uint32 j = BG_TEAM_ALLIANCE; if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()) j = BG_TEAM_HORDE; - if (sWorld.getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0 + if (sWorld->getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0 && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers) { //we will try to invite more groups to team with less players indexed by j @@ -779,14 +779,14 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI Battleground * bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); if (!bg_template) { - sLog.outError("Battleground: Update: bg template not found for %u", bgTypeId); + sLog->outError("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("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id); return; } @@ -837,7 +837,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false); if (!bg2) { - sLog.outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId); + sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId); return; } //invite those selection pools @@ -863,7 +863,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false); if (!bg2) { - sLog.outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId); + sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId); return; } @@ -977,16 +977,16 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI 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("BattlegroundQueue::Update couldn't create arena instance for rated arena match!"); return; } (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamRating; (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaMatchmakerRating; - sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating); + sLog->outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating); (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamRating; (*(itr_team[BG_TEAM_HORDE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaMatchmakerRating; - sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating); + sLog->outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating); // now we must move team if we changed its faction to another faction queue, because then we will spam log by errors in Queue::RemovePlayer if ((*(itr_team[BG_TEAM_ALLIANCE]))->Team != ALLIANCE) { @@ -1008,7 +1008,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI InviteGroupToBG(*(itr_team[BG_TEAM_ALLIANCE]), arena, ALLIANCE); InviteGroupToBG(*(itr_team[BG_TEAM_HORDE]), arena, HORDE); - sLog.outDebug("Starting rated arena match!"); + sLog->outDebug("Starting rated arena match!"); arena->StartBattleground(); } @@ -1080,7 +1080,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[m_BgQueueTypeId]; if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime)) { - sLog.outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID); + sLog->outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID); plr->RemoveBattlegroundQueueId(m_BgQueueTypeId); bgQueue.RemovePlayer(m_PlayerGuid, true); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index e0bf2dd502f..f7ec28b296d 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -248,7 +248,7 @@ void BattlegroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger) case 4021: // Unk2 //break; default: - //sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + //sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); //Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -366,7 +366,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("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) @@ -571,7 +571,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->outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!"); return false; } } @@ -579,7 +579,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->outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!"); return false; } //buffs @@ -589,7 +589,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->outErrorDb("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 4c33c14d570..8b572ea10d7 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -58,7 +58,7 @@ void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer) void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer) { - sLog.outDebug("bg_av HandleKillUnit %i",unit->GetEntry()); + sLog->outDebug("bg_av HandleKillUnit %i",unit->GetEntry()); if (GetStatus() != STATUS_IN_PROGRESS) return; uint32 entry = unit->GetEntry(); @@ -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("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("Killed a Captain twice, please report this bug, if you haven't done \".respawn\""); return; } m_CaptainAlive[1]=false; @@ -139,7 +139,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) return;//maybe we should log this, cause this must be a cheater or a big bug uint8 team = GetTeamIndexByTeamId(player->GetTeam()); //TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor - sLog.outDebug("BG_AV Quest %i completed",questid); + sLog->outDebug("BG_AV Quest %i completed",questid); switch(questid) { case AV_QUEST_A_SCRAPS1: @@ -149,7 +149,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][0]+=20; if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25,50,75 turn ins { - sLog.outDebug("BG_AV Quest %i completed starting with unit upgrading..",questid); + sLog->outDebug("BG_AV Quest %i completed starting with unit upgrading..",questid); for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED) { @@ -164,21 +164,21 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][1]++; RewardReputationToTeam(team,1,player->GetTeam()); if (m_Team_QuestStatus[team][1] == 30) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_COMMANDER2: case AV_QUEST_H_COMMANDER2: m_Team_QuestStatus[team][2]++; RewardReputationToTeam(team,1,player->GetTeam()); if (m_Team_QuestStatus[team][2] == 60) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_COMMANDER3: case AV_QUEST_H_COMMANDER3: m_Team_QuestStatus[team][3]++; RewardReputationToTeam(team,1,player->GetTeam()); if (m_Team_QuestStatus[team][1] == 120) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_BOSS1: case AV_QUEST_H_BOSS1: @@ -187,16 +187,16 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) case AV_QUEST_H_BOSS2: m_Team_QuestStatus[team][4]++; if (m_Team_QuestStatus[team][4] >= 200) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_NEAR_MINE: case AV_QUEST_H_NEAR_MINE: m_Team_QuestStatus[team][5]++; if (m_Team_QuestStatus[team][5] == 28) { - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][6] == 7) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); } break; case AV_QUEST_A_OTHER_MINE: @@ -204,9 +204,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][6]++; if (m_Team_QuestStatus[team][6] == 7) { - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][5] == 20) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); } break; case AV_QUEST_A_RIDER_HIDE: @@ -214,9 +214,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][7]++; if (m_Team_QuestStatus[team][7] == 25) { - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][8] == 25) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); } break; case AV_QUEST_A_RIDER_TAME: @@ -224,13 +224,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][8]++; if (m_Team_QuestStatus[team][8] == 25) { - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][7] == 25) - sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); + sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); } break; default: - sLog.outDebug("BG_AV Quest %i completed but is not interesting at all",questid); + sLog->outDebug("BG_AV Quest %i completed but is not interesting at all",questid); return; //was no interesting quest at all break; } @@ -409,7 +409,7 @@ void BattlegroundAV::StartingEventCloseDoors() void BattlegroundAV::StartingEventOpenDoors() { - sLog.outDebug("BG_AV: start spawning mine stuff"); + sLog->outDebug("BG_AV: start spawning mine stuff"); for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++) SpawnBGObject(i,RESPAWN_IMMEDIATELY); for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++) @@ -479,7 +479,7 @@ void BattlegroundAV::RemovePlayer(Player* plr,uint64 /*guid*/) { if (!plr) { - sLog.outError("bg_AV no player at remove"); + sLog->outError("bg_AV no player at remove"); return; } //TODO search more buffs @@ -519,7 +519,7 @@ void BattlegroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger) //Source->Unmount(); break; default: - sLog.outDebug("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + sLog->outDebug("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); // Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -572,7 +572,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) { uint32 object = GetObjectThroughNode(node); - sLog.outDebug("bg_av: player destroyed point node %i object %i",node,object); + sLog->outDebug("bg_av: player destroyed point node %i object %i",node,object); //despawn banner SpawnBGObject(object, RESPAWN_ONE_DAY); @@ -587,7 +587,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) if (m_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("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); @@ -645,7 +645,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) if (!initial) { - sLog.outDebug("bg_av depopulating mine %i (0=north,1=south)",mine); + sLog->outDebug("bg_av depopulating mine %i (0=north,1=south)",mine); if (mine == AV_SOUTH_MINE) for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++) if (m_BgCreatures[i]) @@ -656,7 +656,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) } SendMineWorldStates(mine); - sLog.outDebug("bg_av populating mine %i (0=north,1=south)",mine); + sLog->outDebug("bg_av populating mine %i (0=north,1=south)",mine); uint16 miner; //also neutral team exists.. after a big time, the neutral team tries to conquer the mine if (mine == AV_NORTH_MINE) @@ -678,7 +678,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) else miner = AV_NPC_S_MINE_N_1; //vermin - sLog.outDebug("spawning vermin"); + sLog->outDebug("spawning vermin"); if (team == ALLIANCE) cinfo = AV_NPC_S_MINE_A_3; else if (team == HORDE) @@ -752,7 +752,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node) if (m_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("AV: couldn't spawn spiritguide at node %i",node); } for (uint8 i=0; i<4; i++) @@ -795,7 +795,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node) BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) { - sLog.outDebug("bg_AV getnodethroughobject %i",object); + sLog->outDebug("bg_AV getnodethroughobject %i",object); if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER) return BG_AV_Nodes(object); if (object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT) @@ -810,14 +810,14 @@ 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("BattlegroundAV: ERROR! GetPlace got a wrong object :("); ASSERT(false); return BG_AV_Nodes(0); } uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node) { //this function is the counterpart to GetNodeThroughObject() - sLog.outDebug("bg_AV GetObjectThroughNode %i",node); + sLog->outDebug("bg_AV GetObjectThroughNode %i",node); if (m_Nodes[node].Owner == ALLIANCE) { if (m_Nodes[node].State == POINT_ASSAULTED) @@ -848,7 +848,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("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i",node); ASSERT(false); return 0; } @@ -860,7 +860,7 @@ void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target if (GetStatus() != STATUS_IN_PROGRESS) return; int32 object = GetObjectType(target_obj->GetGUID()); - sLog.outDebug("BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object); + sLog->outDebug("BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object); if (object < 0) return; switch(target_obj->GetEntry()) @@ -899,10 +899,10 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) EventPlayerAssaultsPoint(player,object); return; } - sLog.outDebug("player defends point object: %i node: %i",object,node); + sLog->outDebug("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("BG_AV: player defends point which doesn't belong to his team %i",node); return; } @@ -961,7 +961,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) BG_AV_Nodes node = GetNodeThroughObject(object); uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner uint32 team = player->GetTeam(); - sLog.outDebug("bg_av: player assaults point object %i node %i",object,node); + sLog->outDebug("bg_av: player assaults point object %i node %i",object,node); if (owner == team || team == m_Nodes[node].TotalOwner) return; //surely a gm used this object @@ -1118,7 +1118,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("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 } @@ -1197,7 +1197,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->outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1"); return false; } @@ -1215,7 +1215,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("BatteGroundAV: Failed to spawn some object Battleground not created!2"); return false; } } @@ -1230,7 +1230,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("BatteGroundAV: Failed to spawn some object Battleground not created!3"); return false; } } @@ -1243,7 +1243,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("BatteGroundAV: Failed to spawn some object Battleground not created!4"); return false; } } @@ -1251,7 +1251,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("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i",i); return false; } } @@ -1265,7 +1265,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("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i",i); return false; } } @@ -1273,7 +1273,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("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i",i); return false; } } @@ -1283,7 +1283,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("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i",i); return false; } } @@ -1291,14 +1291,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("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("BatteGroundAV: Failed to spawn some object Battleground not created!8"); return false; } for (uint8 i = 0; i < 4; i++) @@ -1308,13 +1308,13 @@ 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("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i",i); return false; } } uint16 i; - sLog.outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ..."); + sLog->outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ..."); // Initial Nodes for (i = 0; i < BG_AV_OBJECT_MAX; i++) SpawnBGObject(i, RESPAWN_ONE_DAY); @@ -1345,22 +1345,22 @@ bool BattlegroundAV::SetupBattleground() SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE,RESPAWN_IMMEDIATELY); //creatures - sLog.outDebug("BG_AV start poputlating nodes"); + sLog->outDebug("BG_AV start poputlating nodes"); for (BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i) { if (m_Nodes[i].Owner) PopulateNode(i); } //all creatures which don't get despawned through the script are static - sLog.outDebug("BG_AV: start spawning static creatures"); + sLog->outDebug("BG_AV: start spawning static creatures"); for (i=0; i < AV_STATICCPLACE_MAX; i++) AddAVCreature(0,i+AV_CPLACE_MAX); //mainspiritguides: - sLog.outDebug("BG_AV: start spawning spiritguides creatures"); + sLog->outDebug("BG_AV: start spawning spiritguides creatures"); AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE); AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE); //spawn the marshals (those who get deleted, if a tower gets destroyed) - sLog.outDebug("BG_AV: start spawning marshal creatures"); + sLog->outDebug("BG_AV: start spawning marshal creatures"); for (i=AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++) AddAVCreature(i,AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH)); AddAVCreature(AV_NPC_HERALD,AV_CPLACE_HERALD); @@ -1387,7 +1387,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("tried to get name for node %u",node); break; } @@ -1398,22 +1398,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->outCrash("Assaulting team is TotalOwner of node"); ASSERT (false); } if (m_Nodes[node].Owner == team) { - sLog.outCrash("Assaulting team is owner of node"); + sLog->outCrash("Assaulting team is owner of node"); ASSERT (false); } if (m_Nodes[node].State == POINT_DESTROYED) { - sLog.outCrash("Destroyed node is being assaulted"); + sLog->outCrash("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->outCrash("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 60e00ec8dc8..61d5f17ef24 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -103,7 +103,7 @@ void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer) if (!killer) { - sLog.outError("Killer player not found"); + sLog->outError("Killer player not found"); return; } @@ -136,7 +136,7 @@ void BattlegroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger) //buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_2]; break; default: - sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -168,7 +168,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->outErrorDb("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 1b491fe8f9b..326e6e37cd6 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -126,7 +126,7 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer) if (!killer) { - sLog.outError("BattlegroundDS: Killer player not found"); + sLog->outError("BattlegroundDS: Killer player not found"); return; } @@ -147,7 +147,7 @@ void BattlegroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger) case 5348: break; default: - sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -184,7 +184,7 @@ bool BattlegroundDS::SetupBattleground() || !AddObject(BG_DS_OBJECT_BUFF_1, BG_DS_OBJECT_TYPE_BUFF_1, 1291.7f, 813.424f, 7.11472f, 4.64562f, 0, 0, 0.730314f, -0.683111f, 120) || !AddObject(BG_DS_OBJECT_BUFF_2, BG_DS_OBJECT_TYPE_BUFF_2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f, 120)) { - sLog.outErrorDb("BatteGroundDS: Failed to spawn some object!"); + sLog->outErrorDb("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 c9fb508773b..e8009538343 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -151,7 +151,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint() Player *plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]); if (!plr) { - sLog.outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j])); + sLog->outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j])); ++j; continue; } @@ -191,7 +191,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint() Player *plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[i][j]); if (!plr) { - sLog.outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j])); + sLog->outError("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); @@ -410,7 +410,7 @@ void BattlegroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger) case 5866: break; default: - sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -473,7 +473,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->outErrorDb("BatteGroundEY: Failed to spawn some object Battleground not created!"); return false; } @@ -483,28 +483,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("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("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->outErrorDb("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->outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!"); return false; } @@ -569,7 +569,7 @@ void BattlegroundEY::RespawnFlagAfterDrop() if (obj) obj->Delete(); else - sLog.outError("BattlegroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID())); + sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID())); SetDroppedFlagGUID(0); } @@ -741,7 +741,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("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u", Point, Team, m_CapturingPointTypes[Point].GraveYardId); // SpawnBGCreature(Point,RESPAWN_IMMEDIATELY); @@ -893,7 +893,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("BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!"); return NULL; } @@ -910,7 +910,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("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/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp index 7fbbe1b8c68..986ef815ff5 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp @@ -100,7 +100,7 @@ void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer) if (!killer) { - sLog.outError("BattlegroundNA: Killer player not found"); + sLog->outError("BattlegroundNA: Killer player not found"); return; } @@ -129,7 +129,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("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -161,7 +161,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->outErrorDb("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 ed530d64940..0ae258c648e 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp @@ -100,7 +100,7 @@ void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer) if (!killer) { - sLog.outError("Killer player not found"); + sLog->outError("Killer player not found"); return; } @@ -130,7 +130,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("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -160,7 +160,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->outErrorDb("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 a7eda8fdb19..fdb5f08fb67 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -149,7 +149,7 @@ void BattlegroundRV::HandleKillPlayer(Player *player, Player *killer) if (!killer) { - sLog.outError("BattlegroundRV: Killer player not found"); + sLog->outError("BattlegroundRV: Killer player not found"); return; } @@ -179,7 +179,7 @@ void BattlegroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger) case 5226: break; default: - sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -234,7 +234,7 @@ bool BattlegroundRV::SetupBattleground() */ ) { - sLog.outErrorDb("BatteGroundRV: Failed to spawn some object!"); + sLog->outErrorDb("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 84915870615..f3d3ba4f525 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -158,7 +158,7 @@ bool BattlegroundSA::ResetObjs() if (!sg) { - sLog.outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]); + sLog->outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]); return false; } @@ -171,7 +171,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("SOTA: couldn't spawn GY: %u",i); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 0bd7d9f731b..35ccda45976 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -217,12 +217,12 @@ void BattlegroundWS::RespawnFlag(uint32 Team, bool captured) { if (Team == ALLIANCE) { - sLog.outDebug("Respawn Alliance flag"); + sLog->outDebug("Respawn Alliance flag"); m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE; } else { - sLog.outDebug("Respawn Horde flag"); + sLog->outDebug("Respawn Horde flag"); m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE; } @@ -260,7 +260,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team) if (obj) obj->Delete(); else - sLog.outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team))); + sLog->outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team))); SetDroppedFlagGUID(0,team); m_BothFlagsKept = false; @@ -566,7 +566,7 @@ void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid) { if (!plr) { - sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!"); + sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!"); this->SetAllianceFlagPicker(0); this->RespawnFlag(ALLIANCE, false); } @@ -577,7 +577,7 @@ void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid) { if (!plr) { - sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!"); + sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!"); this->SetHordeFlagPicker(0); this->RespawnFlag(HORDE, false); } @@ -646,7 +646,7 @@ void BattlegroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger) case 4629: // unk4 break; default: - sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -681,25 +681,25 @@ 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->outErrorDb("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->outErrorDb("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->outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!"); return false; } - sLog.outDebug("BatteGroundWS: BG objects and spirit guides spawned"); + sLog->outDebug("BatteGroundWS: BG objects and spirit guides spawned"); return true; } diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 35541e82642..de028c3ad80 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -52,7 +52,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) m_flags |= CHANNEL_FLAG_CUSTOM; // If storing custom channels in the db is enabled either load or save the channel - if (sWorld.getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS)) + if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS)) { PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_CHANNEL); stmt->setString(0, name); @@ -76,7 +76,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) uint64 banned_guid = atol(*iter); if (banned_guid) { - sLog.outDebug("Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid); + sLog->outDebug("Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid); banned.insert(banned_guid); } } @@ -88,7 +88,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) stmt->setString(0, name); stmt->setUInt32(1, m_Team); CharacterDatabase.Execute(stmt); - sLog.outDebug("Channel(%s) saved in database", name.c_str()); + sLog->outDebug("Channel(%s) saved in database", name.c_str()); } m_IsSaved = true; @@ -116,7 +116,7 @@ void Channel::UpdateChannelInDB() const stmt->setUInt32(5, m_Team); CharacterDatabase.Execute(stmt); - sLog.outDebug("Channel(%s) updated in database", m_name.c_str()); + sLog->outDebug("Channel(%s) updated in database", m_name.c_str()); } } @@ -131,13 +131,13 @@ void Channel::UpdateChannelUseageInDB() const void Channel::CleanOldChannelsInDB() { - if (sWorld.getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) > 0) + if (sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) > 0) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_CHANNEL); - stmt->setUInt32(0, sWorld.getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION)*DAY); + stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION)*DAY); CharacterDatabase.Execute(stmt); - sLog.outDebug("Cleaned out unused custom chat channels."); + sLog->outDebug("Cleaned out unused custom chat channels."); } } @@ -174,7 +174,7 @@ void Channel::Join(uint64 p, const char *pass) if (plr) { if (HasFlag(CHANNEL_FLAG_LFG) && - sWorld.getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && plr->GetGroup()) + sWorld->getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && plr->GetGroup()) { MakeNotInLfg(&data); SendToOne(&data, p); @@ -184,7 +184,7 @@ void Channel::Join(uint64 p, const char *pass) plr->JoinedChannel(this); } - if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL))) + if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL))) { MakeJoined(&data, p); SendToAll(&data); @@ -246,7 +246,7 @@ void Channel::Leave(uint64 p, bool send) bool changeowner = players[p].IsOwner(); players.erase(p); - if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL))) + if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL))) { WorldPacket data; MakeLeft(&data, p); @@ -455,7 +455,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set) // allow make moderator from another team only if both is GMs // at this moment this only way to show channel post for GM from another team if ((plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || newp->GetSession()->GetSecurity() < SEC_GAMEMASTER) && - plr->GetTeam() != newp->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) + plr->GetTeam() != newp->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) { WorldPacket data; MakePlayerNotFound(&data, p2n); @@ -511,7 +511,7 @@ void Channel::SetOwner(uint64 p, const char *newname) return; } - if (newp->GetTeam() != plr->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) + if (newp->GetTeam() != plr->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) { WorldPacket data; MakePlayerNotFound(&data, newname); @@ -559,7 +559,7 @@ void Channel::List(Player* player) size_t pos = data.wpos(); data << uint32(0); // size of list, placeholder - uint32 gmLevelInWhoList = sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); + uint32 gmLevelInWhoList = sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); uint32 count = 0; for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) @@ -621,7 +621,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang) { if (!what) return; - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) lang = LANG_UNIVERSAL; Player *plr = sObjectMgr->GetPlayer(p); @@ -688,7 +688,7 @@ void Channel::Invite(uint64 p, const char *newname) if (!plr) return; - if (newp->GetTeam() != plr->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) + if (newp->GetTeam() != plr->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) { WorldPacket data; MakeInviteWrongFaction(&data); diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index c0400b91160..2d617aa8294 100755 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -22,7 +22,7 @@ ChannelMgr* channelMgr(uint32 team) { - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) return ACE_Singleton::instance(); // cross-faction if (team == ALLIANCE) diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 6d6d282ebe2..c962a2f96d7 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -523,7 +523,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac return false; // ignore only for non-players for non strong checks (when allow apply command at least to same sec level) - if (m_session->GetSecurity() > SEC_PLAYER && !strong && !sWorld.getBoolConfig(CONFIG_GM_LOWER_SECURITY)) + if (m_session->GetSecurity() > SEC_PLAYER && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY)) return false; if (target) @@ -598,7 +598,7 @@ void ChatHandler::SendGlobalSysMessage(const char *str) while (char* line = LineFromMessage(pos)) { FillSystemMessageData(&data, line); - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); } free(buf); @@ -616,7 +616,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str) while (char* line = LineFromMessage(pos)) { FillSystemMessageData(&data, line); - sWorld.SendGlobalGMMessage(&data); + sWorld->SendGlobalGMMessage(&data); } free(buf); } @@ -716,7 +716,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co { Player* p = m_session->GetPlayer(); uint64 sel_guid = p->GetSelection(); - sLog.outCommand(m_session->GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]", + sLog->outCommand(m_session->GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]", fullcmd.c_str(),p->GetName(),m_session->GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(), GetLogNameForGuid(sel_guid), (p->GetSelectedUnit()) ? p->GetSelectedUnit()->GetName() : "", GUID_LOPART(sel_guid)); } @@ -768,12 +768,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->outErrorDb("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->outDetail("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; @@ -784,9 +784,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->outErrorDb("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->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str()); } return false; @@ -799,7 +799,7 @@ int ChatHandler::ParseCommands(const char* text) std::string fullcmd = text; - if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld.getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0) + if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld->getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0) return 0; /// chat case (.command or !command format) @@ -856,7 +856,7 @@ valid examples: const char* validSequenceIterator = validSequence; // more simple checks - if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3) + if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3) { const std::string validCommands = "cHhr|"; @@ -875,7 +875,7 @@ valid examples: ++message; // validate sequence - if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2) + if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2) { if (commandChar == *validSequenceIterator) { @@ -919,7 +919,7 @@ valid examples: else if (reader.get() != '|') { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage sequence aborted unexpectedly"); + sLog->outBasic("ChatHandler::isValidChatMessage sequence aborted unexpectedly"); #endif return false; } @@ -928,7 +928,7 @@ valid examples: if (reader.peek() == '\0') { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage pipe followed by \\0"); + sLog->outBasic("ChatHandler::isValidChatMessage pipe followed by \\0"); #endif return false; } @@ -953,7 +953,7 @@ valid examples: else { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage invalid sequence, expected %c but got %c", *validSequenceIterator, commandChar); + sLog->outBasic("ChatHandler::isValidChatMessage invalid sequence, expected %c but got %c", *validSequenceIterator, commandChar); #endif return false; } @@ -962,7 +962,7 @@ valid examples: { // no escaped pipes in sequences #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage got escaped pipe in sequence"); + sLog->outBasic("ChatHandler::isValidChatMessage got escaped pipe in sequence"); #endif return false; } @@ -979,7 +979,7 @@ valid examples: if (!c) { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage got \\0 while reading color in |c command"); + sLog->outBasic("ChatHandler::isValidChatMessage got \\0 while reading color in |c command"); #endif return false; } @@ -997,7 +997,7 @@ valid examples: continue; } #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage got non hex char '%c' while reading color", c); + sLog->outBasic("ChatHandler::isValidChatMessage got non hex char '%c' while reading color", c); #endif return false; } @@ -1015,7 +1015,7 @@ valid examples: if (!linkedItem) { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage got invalid itemID %u in |item command", atoi(buffer)); + sLog->outBasic("ChatHandler::isValidChatMessage got invalid itemID %u in |item command", atoi(buffer)); #endif return false; } @@ -1023,7 +1023,7 @@ valid examples: if (color != ItemQualityColors[linkedItem->Quality]) { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage linked item has color %u, but user claims %u", ItemQualityColors[linkedItem->Quality], + sLog->outBasic("ChatHandler::isValidChatMessage linked item has color %u, but user claims %u", ItemQualityColors[linkedItem->Quality], color); #endif return false; @@ -1096,7 +1096,7 @@ valid examples: if (!linkedQuest) { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage Questtemplate %u not found", questid); + sLog->outBasic("ChatHandler::isValidChatMessage Questtemplate %u not found", questid); #endif return false; } @@ -1236,7 +1236,7 @@ valid examples: else { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage user sent unsupported link type '%s'", buffer); + sLog->outBasic("ChatHandler::isValidChatMessage user sent unsupported link type '%s'", buffer); #endif return false; } @@ -1249,7 +1249,7 @@ valid examples: if (reader.get() != '[') { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage link caption doesn't start with '['"); + sLog->outBasic("ChatHandler::isValidChatMessage link caption doesn't start with '['"); #endif return false; } @@ -1314,7 +1314,7 @@ valid examples: if (!ql) { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage default questname didn't match and there is no locale"); + sLog->outBasic("ChatHandler::isValidChatMessage default questname didn't match and there is no locale"); #endif return false; } @@ -1331,7 +1331,7 @@ valid examples: if (!foundName) { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage no quest locale title matched"); + sLog->outBasic("ChatHandler::isValidChatMessage no quest locale title matched"); #endif return false; } @@ -1374,7 +1374,7 @@ valid examples: if (!foundName) { #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage linked item name wasn't found in any localization"); + sLog->outBasic("ChatHandler::isValidChatMessage linked item name wasn't found in any localization"); #endif return false; } @@ -1406,7 +1406,7 @@ valid examples: break; default: #ifdef TRINITY_DEBUG - sLog.outBasic("ChatHandler::isValidChatMessage got invalid command |%c", commandChar); + sLog->outBasic("ChatHandler::isValidChatMessage got invalid command |%c", commandChar); #endif return false; } @@ -1415,7 +1415,7 @@ valid examples: // check if every opened sequence was also closed properly #ifdef TRINITY_DEBUG if (validSequence != validSequenceIterator) - sLog.outBasic("ChatHandler::isValidChatMessage EOF in active sequence"); + sLog->outBasic("ChatHandler::isValidChatMessage EOF in active sequence"); #endif return validSequence == validSequenceIterator; } @@ -2170,7 +2170,7 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &plr, G LocaleConstant CliHandler::GetSessionDbcLocale() const { - return sWorld.GetDefaultDbcLocale(); + return sWorld->GetDefaultDbcLocale(); } int CliHandler::GetSessionDbLocaleIndex() const diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index a1321b81125..c76bceb74de 100755 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -84,14 +84,14 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/) bool ChatHandler::HandleServerInfoCommand(const char* /*args*/) { - uint32 PlayersNum = sWorld.GetPlayerCount(); - uint32 MaxPlayersNum = sWorld.GetMaxPlayerCount(); - uint32 activeClientsNum = sWorld.GetActiveSessionCount(); - uint32 queuedClientsNum = sWorld.GetQueuedSessionCount(); - uint32 maxActiveClientsNum = sWorld.GetMaxActiveSessionCount(); - uint32 maxQueuedClientsNum = sWorld.GetMaxQueuedSessionCount(); - std::string uptime = secsToTimeString(sWorld.GetUptime()); - uint32 updateTime = sWorld.GetUpdateTime(); + uint32 PlayersNum = sWorld->GetPlayerCount(); + uint32 MaxPlayersNum = sWorld->GetMaxPlayerCount(); + uint32 activeClientsNum = sWorld->GetActiveSessionCount(); + uint32 queuedClientsNum = sWorld->GetQueuedSessionCount(); + uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount(); + uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount(); + std::string uptime = secsToTimeString(sWorld->GetUptime()); + uint32 updateTime = sWorld->GetUpdateTime(); PSendSysMessage(_FULLVERSION); PSendSysMessage(LANG_CONNECTED_PLAYERS, PlayersNum, MaxPlayersNum); @@ -137,7 +137,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) } // save if the player has last been saved over 20 seconds ago - uint32 save_interval = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE); + 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(); @@ -147,7 +147,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) /// Display the 'Message of the day' for the realm bool ChatHandler::HandleServerMotdCommand(const char* /*args*/) { - PSendSysMessage(LANG_MOTD_CURRENT, sWorld.GetMotd()); + PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd()); return true; } diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 3036644ae0e..afc2a65de47 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -46,7 +46,7 @@ bool ChatHandler::HandleNameAnnounceCommand(const char* args) if (!*args) return false; - sWorld.SendWorldText(LANG_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args); + sWorld->SendWorldText(LANG_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args); return true; } @@ -56,7 +56,7 @@ bool ChatHandler::HandleGMNameAnnounceCommand(const char* args) if (!*args) return false; - sWorld.SendGMText(LANG_GM_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args); + sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args); return true; } @@ -68,7 +68,7 @@ bool ChatHandler::HandleAnnounceCommand(const char* args) char buff[2048]; sprintf(buff, GetTrinityString(LANG_SYSTEMMESSAGE), args); - sWorld.SendServerMessage(SERVER_MSG_STRING, buff); + sWorld->SendServerMessage(SERVER_MSG_STRING, buff); return true; } @@ -78,7 +78,7 @@ bool ChatHandler::HandleGMAnnounceCommand(const char* args) if (!*args) return false; - sWorld.SendGMText(LANG_GM_BROADCAST,args); + sWorld->SendGMText(LANG_GM_BROADCAST,args); return true; } @@ -93,7 +93,7 @@ bool ChatHandler::HandleNotifyCommand(const char* args) WorldPacket data(SMSG_NOTIFICATION, (str.size()+1)); data << str; - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); return true; } @@ -109,7 +109,7 @@ bool ChatHandler::HandleGMNotifyCommand(const char* args) WorldPacket data(SMSG_NOTIFICATION, (str.size()+1)); data << str; - sWorld.SendGlobalGMMessage(&data); + sWorld->SendGlobalGMMessage(&data); return true; } @@ -187,14 +187,14 @@ bool ChatHandler::HandleGPSCommand(const char* args) cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(), zone_x, zone_y, ground_z, floor_z, have_map, have_vmap); - sLog.outDebug("Player %s GPS call for %s '%s' (%s: %u):", + sLog->outDebug("Player %s GPS call for %s '%s' (%s: %u):", m_session ? GetNameLink().c_str() : GetTrinityString(LANG_CONSOLE_COMMAND), (obj->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), obj->GetName(), (obj->GetTypeId() == TYPEID_PLAYER ? "GUID" : "Entry"), (obj->GetTypeId() == TYPEID_PLAYER ? obj->GetGUIDLow(): obj->GetEntry())); - sLog.outDebug(GetTrinityString(LANG_MAP_POSITION), - obj->GetMapId(), (mapEntry ? mapEntry->name[sWorld.GetDefaultDbcLocale()] : ""), - zone_id, (zoneEntry ? zoneEntry->area_name[sWorld.GetDefaultDbcLocale()] : ""), - area_id, (areaEntry ? areaEntry->area_name[sWorld.GetDefaultDbcLocale()] : ""), + sLog->outDebug(GetTrinityString(LANG_MAP_POSITION), + obj->GetMapId(), (mapEntry ? mapEntry->name[sWorld->GetDefaultDbcLocale()] : ""), + zone_id, (zoneEntry ? zoneEntry->area_name[sWorld->GetDefaultDbcLocale()] : ""), + area_id, (areaEntry ? areaEntry->area_name[sWorld->GetDefaultDbcLocale()] : ""), obj->GetPhaseMask(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation(), cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(), @@ -555,7 +555,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); // converting string that we try to find to lower case wstrToLower (wnamepart); @@ -642,7 +642,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args) std::ostringstream reply; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); bool limitReached = false; GameTeleMap const & teleMap = sObjectMgr->GetGameTeleMap(); @@ -710,7 +710,7 @@ bool ChatHandler::HandleWhispersCommand(const char* args) //Save all players in the world bool ChatHandler::HandleSaveAllCommand(const char* /*args*/) { - sObjectAccessor.SaveAllPlayers(); + sObjectAccessor->SaveAllPlayers(); SendSysMessage(LANG_PLAYERS_SAVED); return true; } diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 7fe635dcc61..90714691d03 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -67,7 +67,7 @@ bool ChatHandler::HandleMuteCommand(const char* args) // find only player from same account if any if (!target) - if (WorldSession* session = sWorld.FindSession(account_id)) + if (WorldSession* session = sWorld->FindSession(account_id)) target = session->GetPlayer(); uint32 notspeaktime = (uint32) atoi(delayStr); @@ -106,7 +106,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args) // find only player from same account if any if (!target) - if (WorldSession* session = sWorld.FindSession(account_id)) + if (WorldSession* session = sWorld->FindSession(account_id)) target = session->GetPlayer(); // must have strong lesser security level @@ -221,8 +221,8 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args) if (HasLowerSecurity(target, 0)) return false; - if (sWorld.getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD)) - sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); + if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD)) + sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); else PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); @@ -528,7 +528,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); @@ -646,7 +646,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) int i = 0; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); do { if (maxResults && count++ == maxResults) @@ -693,7 +693,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) /// Triggering corpses expire check in world bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/) { - sObjectAccessor.RemoveOldCorpses(); + sObjectAccessor->RemoveOldCorpses(); return true; } @@ -800,7 +800,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/) if (!pet->InitStatsForLevel(creatureTarget->getLevel())) { - sLog.outError("InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); + sLog->outError("InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); PSendSysMessage("Error 2"); delete pet; return false; @@ -938,7 +938,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args) wstrToLower(wnamepart); uint32 counter = 0; // Counter for figure out that we found smth. - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); // Search in CharTitles.dbc for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 82745fa0cc8..b46db405101 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -259,7 +259,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args) if (!plTarget) plTarget = pl; - sLog.outDetail(GetTrinityString(LANG_ADDITEM), itemId, count); + sLog->outDetail(GetTrinityString(LANG_ADDITEM), itemId, count); ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemId); if (!pProto) @@ -338,7 +338,7 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args) if (!plTarget) plTarget = pl; - sLog.outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId); + sLog->outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId); bool found = false; for (uint32 id = 0; id < sItemStorage.MaxEntry; id++) @@ -756,7 +756,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); // Search in `item_template` for (uint32 id = 0; id < sItemStorage.MaxEntry; id++) @@ -841,7 +841,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); // Search in ItemSet.dbc for (uint32 id = 0; id < sItemSetStore.GetNumRows(); id++) @@ -914,7 +914,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); // Search in SkillLine.dbc for (uint32 id = 0; id < sSkillLineStore.GetNumRows(); id++) @@ -1001,7 +1001,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); // Search in Spell.dbc for (uint32 id = 0; id < sSpellStore.GetNumRows(); id++) @@ -1110,7 +1110,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates(); for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter) @@ -1227,7 +1227,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); for (uint32 id = 0; id< sCreatureStorage.MaxEntry; ++id) { @@ -1311,7 +1311,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); for (uint32 id = 0; id< sGOStorage.MaxEntry; id++) { @@ -1398,7 +1398,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id) { @@ -1497,7 +1497,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args) bool found = false; uint32 count = 0; - uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); + uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS); // Search in TaxiNodes.dbc for (uint32 id = 0; id < sTaxiNodesStore.GetNumRows(); id++) @@ -1575,7 +1575,7 @@ bool ChatHandler::HandleLookupMapCommand(const char *args) MapEntry const* MapInfo = sMapStore.LookupEntry(id); if (MapInfo) { - uint8 loc = m_session ? m_session->GetSessionDbcLocale() : sWorld.GetDefaultDbcLocale(); + uint8 loc = m_session ? m_session->GetSessionDbcLocale() : sWorld->GetDefaultDbcLocale(); std::string name = MapInfo->name[loc]; if (name.empty()) @@ -1851,7 +1851,7 @@ bool ChatHandler::HandleDieCommand(const char* /*args*/) if (target->isAlive()) { - if (sWorld.getBoolConfig(CONFIG_DIE_COMMAND_MODE)) + 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); @@ -1954,7 +1954,7 @@ bool ChatHandler::HandleReviveCommand(const char *args) } else // will resurrected at login without corpse - sObjectAccessor.ConvertCorpseForPlayer(target_guid); + sObjectAccessor->ConvertCorpseForPlayer(target_guid); return true; } @@ -2367,7 +2367,7 @@ bool ChatHandler::HandleChangeWeather(const char *args) return false; //Weather is OFF - if (!sWorld.getBoolConfig(CONFIG_WEATHER)) + if (!sWorld->getBoolConfig(CONFIG_WEATHER)) { SendSysMessage(LANG_WEATHER_DISABLED); SetSentErrorMessage(true); @@ -2505,7 +2505,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player) ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(player->getClass()); if (!cEntry) { - sLog.outError("Class %u not found in DBC (Wrong DBC files?)",player->getClass()); + sLog->outError("Class %u not found in DBC (Wrong DBC files?)",player->getClass()); return false; } @@ -2548,8 +2548,8 @@ bool ChatHandler::HandleResetLevelCommand(const char * args) // set starting level uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT - ? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL) - : sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); + ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) + : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); sScriptMgr->OnPlayerLevelChanged(target, start_level); @@ -2684,14 +2684,14 @@ bool ChatHandler::HandleResetAllCommand(const char * args) if (casename == "spells") { atLogin = AT_LOGIN_RESET_SPELLS; - sWorld.SendWorldText(LANG_RESETALL_SPELLS); + sWorld->SendWorldText(LANG_RESETALL_SPELLS); if (!m_session) SendSysMessage(LANG_RESETALL_SPELLS); } else if (casename == "talents") { atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS); - sWorld.SendWorldText(LANG_RESETALL_TALENTS); + sWorld->SendWorldText(LANG_RESETALL_TALENTS); if (!m_session) SendSysMessage(LANG_RESETALL_TALENTS); } @@ -2705,7 +2705,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args) CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin); ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder::GetLock(), true); - HashMapHolder::MapType const& plist = sObjectAccessor.GetPlayers(); + HashMapHolder::MapType const& plist = sObjectAccessor->GetPlayers(); for (HashMapHolder::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) itr->second->SetAtLoginFlag(atLogin); @@ -2714,7 +2714,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args) bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/) { - sWorld.ShutdownCancel(); + sWorld->ShutdownCancel(); return true; } @@ -2746,10 +2746,10 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld.ShutdownServ (time, 0, exitcode); + sWorld->ShutdownServ (time, 0, exitcode); } else - sWorld.ShutdownServ(time,0,SHUTDOWN_EXIT_CODE); + sWorld->ShutdownServ(time,0,SHUTDOWN_EXIT_CODE); return true; } @@ -2781,10 +2781,10 @@ bool ChatHandler::HandleServerRestartCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld.ShutdownServ (time, SHUTDOWN_MASK_RESTART, exitcode); + sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART, exitcode); } else - sWorld.ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); return true; } @@ -2816,10 +2816,10 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld.ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); } else - sWorld.ShutdownServ(time,SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE,RESTART_EXIT_CODE); + sWorld->ShutdownServ(time,SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE,RESTART_EXIT_CODE); return true; } @@ -2851,10 +2851,10 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld.ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode); } else - sWorld.ShutdownServ(time,SHUTDOWN_MASK_IDLE,SHUTDOWN_EXIT_CODE); + sWorld->ShutdownServ(time,SHUTDOWN_MASK_IDLE,SHUTDOWN_EXIT_CODE); return true; } @@ -2894,7 +2894,7 @@ bool ChatHandler::HandleBanCharacterCommand(const char *args) return false; } - switch (sWorld.BanCharacter(name, duration, reason, m_session ? m_session->GetPlayerName() : "")) + switch (sWorld->BanCharacter(name, duration, reason, m_session ? m_session->GetPlayerName() : "")) { case BAN_SUCCESS: { @@ -2965,7 +2965,7 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char *args) break; } - switch(sWorld.BanAccount(mode, nameOrIP, duration, reason,m_session ? m_session->GetPlayerName() : "")) + switch(sWorld->BanAccount(mode, nameOrIP, duration, reason,m_session ? m_session->GetPlayerName() : "")) { case BAN_SUCCESS: if (atoi(duration)>0) @@ -3023,7 +3023,7 @@ bool ChatHandler::HandleUnBanCharacterCommand(const char *args) return false; } - if (!sWorld.RemoveBanCharacter(name)) + if (!sWorld->RemoveBanCharacter(name)) { SendSysMessage(LANG_PLAYER_NOT_FOUND); SetSentErrorMessage(true); @@ -3073,7 +3073,7 @@ bool ChatHandler::HandleUnBanHelper(BanMode mode, const char *args) break; } - if (sWorld.RemoveBanAccount(mode,nameOrIP)) + if (sWorld->RemoveBanAccount(mode,nameOrIP)) PSendSysMessage(LANG_UNBAN_UNBANNED,nameOrIP.c_str()); else PSendSysMessage(LANG_UNBAN_ERROR,nameOrIP.c_str()); @@ -3771,30 +3771,30 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args) int l = strlen(param); if (strncmp(param,"player",l) == 0) - sWorld.SetPlayerSecurityLimit(SEC_PLAYER); + sWorld->SetPlayerSecurityLimit(SEC_PLAYER); else if (strncmp(param,"moderator",l) == 0) - sWorld.SetPlayerSecurityLimit(SEC_MODERATOR); + sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); else if (strncmp(param,"gamemaster",l) == 0) - sWorld.SetPlayerSecurityLimit(SEC_GAMEMASTER); + sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); else if (strncmp(param,"administrator",l) == 0) - sWorld.SetPlayerSecurityLimit(SEC_ADMINISTRATOR); + sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); else if (strncmp(param,"reset",l) == 0) { - sWorld.SetPlayerAmountLimit(sConfig.GetIntDefault("PlayerLimit", 100)); - sWorld.LoadDBAllowedSecurityLevel(); + sWorld->SetPlayerAmountLimit(sConfig->GetIntDefault("PlayerLimit", 100)); + sWorld->LoadDBAllowedSecurityLevel(); } else { int val = atoi(param); if (val < 0) - sWorld.SetPlayerSecurityLimit(AccountTypes(uint32(-val))); + sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val))); else - sWorld.SetPlayerAmountLimit(uint32(val)); + sWorld->SetPlayerAmountLimit(uint32(val)); } } - uint32 pLimit = sWorld.GetPlayerAmountLimit(); - AccountTypes allowedAccountType = sWorld.GetPlayerSecurityLimit(); + uint32 pLimit = sWorld->GetPlayerAmountLimit(); + AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); char const* secName = ""; switch(allowedAccountType) { @@ -4182,7 +4182,7 @@ bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/) /// Define the 'Message of the day' for the realm bool ChatHandler::HandleServerSetMotdCommand(const char *args) { - sWorld.SetMotd(args); + sWorld->SetMotd(args); PSendSysMessage(LANG_MOTD_NEW, args); return true; } @@ -4195,13 +4195,13 @@ bool ChatHandler::HandleServerSetClosedCommand(const char *args) if (strncmp(args, "on", 3) == 0) { SendSysMessage(LANG_WORLD_CLOSED); - sWorld.SetClosed(true); + sWorld->SetClosed(true); return true; } else if (strncmp(args, "off", 4) == 0) { SendSysMessage(LANG_WORLD_OPENED); - sWorld.SetClosed(false); + sWorld->SetClosed(false); return true; } @@ -4465,7 +4465,7 @@ bool ChatHandler::HandlePlayAllCommand(const char *args) WorldPacket data(SMSG_PLAY_SOUND, 4); data << uint32(soundId) << m_session->GetPlayer()->GetGUID(); - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId); return true; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 2b4a19f0a1a..46f7b4c9582 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -34,7 +34,7 @@ bool Condition::Meets(Player * player, Unit* invoker) { if (!player) { - sLog.outDebug("Condition player not found"); + sLog->outDebug("Condition player not found"); return false; // player not present, return false } uint32 refId = mConditionValue3;//value 3 can be a 'quick' reference @@ -255,7 +255,7 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player,const ConditionLis std::mapElseGroupMap; for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) { - sLog.outDebug("ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u",(*i)->mConditionType,(*i)->mConditionValue1); + sLog->outDebug("ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u",(*i)->mConditionType,(*i)->mConditionValue1); if ((*i)->isLoaded()) { std::map::const_iterator itr = ElseGroupMap.find((*i)->mElseGroup); @@ -274,7 +274,7 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player,const ConditionLis } else { - sLog.outDebug("IsPlayerMeetToConditionList: Reference template -%u not found", + sLog->outDebug("IsPlayerMeetToConditionList: Reference template -%u not found", (*i)->mReferenceId);//checked at loading, should never happen } @@ -301,7 +301,7 @@ bool ConditionMgr::IsPlayerMeetToConditions(Player* player, ConditionList condit if(player) player->m_ConditionErrorMsgId = 0; - sLog.outDebug("ConditionMgr::IsPlayerMeetToConditions"); + sLog->outDebug("ConditionMgr::IsPlayerMeetToConditions"); bool result = IsPlayerMeetToConditionList(player, conditions, invoker); if (player && player->m_ConditionErrorMsgId && player->GetSession() && !result) @@ -322,7 +322,7 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType if (i != (*itr).second.end()) { spellCond = (*i).second; - sLog.outDebug("GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sType), uEntry); + sLog->outDebug("GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sType), uEntry); } } } @@ -339,7 +339,7 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint if (i != (*itr).second.end()) { cond = (*i).second; - sLog.outDebug("GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureID, spellID); + sLog->outDebug("GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureID, spellID); } } return cond; @@ -354,7 +354,7 @@ void ConditionMgr::LoadConditions(bool isReload) //must clear all custom handled cases (groupped types) before reload if (isReload) { - sLog.outString("Reseting Loot Conditions..."); + sLog->outString("Reseting Loot Conditions..."); LootTemplates_Creature.ResetConditions(); LootTemplates_Fishing.ResetConditions(); LootTemplates_Gameobject.ResetConditions(); @@ -368,10 +368,10 @@ void ConditionMgr::LoadConditions(bool isReload) LootTemplates_Prospecting.ResetConditions(); LootTemplates_Spell.ResetConditions(); - sLog.outString("Re-Loading `gossip_menu` Table for Conditions!"); + sLog->outString("Re-Loading `gossip_menu` Table for Conditions!"); sObjectMgr->LoadGossipMenu(); - sLog.outString("Re-Loading `gossip_menu_option` Table for Conditions!"); + sLog->outString("Re-Loading `gossip_menu_option` Table for Conditions!"); sObjectMgr->LoadGossipMenuItems(); } @@ -381,8 +381,8 @@ void ConditionMgr::LoadConditions(bool isReload) if (!result) { - sLog.outErrorDb(">> Loaded 0 conditions. DB table `groups` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 conditions. DB table `groups` is empty!"); + sLog->outString(); return; } @@ -412,7 +412,7 @@ void ConditionMgr::LoadConditions(bool isReload) { if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skip { - sLog.outErrorDb("Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId); + sLog->outErrorDb("Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId); delete cond; continue; } @@ -423,15 +423,15 @@ void ConditionMgr::LoadConditions(bool isReload) rowType = "reference"; //check for useless data if (cond->mConditionValue1) - sLog.outErrorDb("Condition %s %i has useless data in value1 (%u)!", rowType, iSourceTypeOrReferenceId, cond->mConditionValue1); + sLog->outErrorDb("Condition %s %i has useless data in value1 (%u)!", rowType, iSourceTypeOrReferenceId, cond->mConditionValue1); if (cond->mConditionValue2) - sLog.outErrorDb("Condition %s %i has useless data in value2 (%u)!", rowType, iSourceTypeOrReferenceId, cond->mConditionValue2); + sLog->outErrorDb("Condition %s %i has useless data in value2 (%u)!", rowType, iSourceTypeOrReferenceId, cond->mConditionValue2); if (cond->mConditionValue3) - sLog.outErrorDb("Condition %s %i has useless data in value3 (%u)!", rowType, iSourceTypeOrReferenceId, cond->mConditionValue3); + sLog->outErrorDb("Condition %s %i has useless data in value3 (%u)!", rowType, iSourceTypeOrReferenceId, cond->mConditionValue3); if (cond->mSourceGroup && iSourceTypeOrReferenceId < 0) - sLog.outErrorDb("Condition %s %i has useless data in SourceGroup (%u)!", rowType, iSourceTypeOrReferenceId, cond->mSourceGroup); + sLog->outErrorDb("Condition %s %i has useless data in SourceGroup (%u)!", rowType, iSourceTypeOrReferenceId, cond->mSourceGroup); if (cond->mSourceEntry && iSourceTypeOrReferenceId < 0) - sLog.outErrorDb("Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->mSourceEntry); + sLog->outErrorDb("Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->mSourceEntry); } else if (!isConditionTypeValid(cond))//doesn't have reference, validate ConditionType { @@ -464,7 +464,7 @@ void ConditionMgr::LoadConditions(bool isReload) //Grouping is only allowed for some types (loot templates, gossip menus, gossip items) if (cond->mSourceGroup && !isGroupable(cond->mSourceType)) { - sLog.outErrorDb("Condition type %u has not allowed grouping %u!", uint32(cond->mSourceType), cond->mSourceGroup); + sLog->outErrorDb("Condition type %u has not allowed grouping %u!", uint32(cond->mSourceType), cond->mSourceGroup); delete cond; continue; } @@ -541,7 +541,7 @@ void ConditionMgr::LoadConditions(bool isReload) if (!bIsDone) { - sLog.outErrorDb("Not handled grouped condition, SourceGroup %u", cond->mSourceGroup); + sLog->outErrorDb("Not handled grouped condition, SourceGroup %u", cond->mSourceGroup); delete cond; } else @@ -573,22 +573,22 @@ void ConditionMgr::LoadConditions(bool isReload) } while (result->NextRow()); - sLog.outString(">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot) { if (!loot) { - sLog.outErrorDb("ConditionMgr: LootTemplate %u not found", cond->mSourceGroup); + sLog->outErrorDb("ConditionMgr: LootTemplate %u not found", cond->mSourceGroup); return false; } if (loot->addConditionItem(cond)) return true; - sLog.outErrorDb("ConditionMgr: Item %u not found in LootTemplate %u", cond->mSourceEntry, cond->mSourceGroup); + sLog->outErrorDb("ConditionMgr: Item %u not found in LootTemplate %u", cond->mSourceEntry, cond->mSourceGroup); return false; } @@ -608,7 +608,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond) } } - sLog.outErrorDb("addToGossipMenus: GossipMenu %u not found", cond->mSourceGroup); + sLog->outErrorDb("addToGossipMenus: GossipMenu %u not found", cond->mSourceGroup); return false; } @@ -627,7 +627,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond) } } - sLog.outErrorDb("addToGossipMenuItems: GossipMenuId %u Item %u not found", cond->mSourceGroup, cond->mSourceEntry); + sLog->outErrorDb("addToGossipMenuItems: GossipMenuId %u Item %u not found", cond->mSourceGroup, cond->mSourceEntry); return false; } @@ -635,7 +635,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (cond->mSourceType == CONDITION_SOURCE_TYPE_NONE || cond->mSourceType >= CONDITION_SOURCE_TYPE_MAX) { - sLog.outErrorDb("Invalid ConditionSourceType %u in `condition` table, ignoring.", uint32(cond->mSourceType)); + sLog->outErrorDb("Invalid ConditionSourceType %u in `condition` table, ignoring.", uint32(cond->mSourceType)); return false; } @@ -645,7 +645,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Creature.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `creature_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -653,7 +653,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -662,7 +662,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Disenchant.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `disenchant_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -670,7 +670,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -679,7 +679,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Fishing.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `fishing_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -687,7 +687,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -696,7 +696,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Gameobject.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `gameobject_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -704,7 +704,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -713,7 +713,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Item.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -721,7 +721,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -730,7 +730,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Mail.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -738,7 +738,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -747,7 +747,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Milling.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `milling_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -755,7 +755,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -764,7 +764,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Pickpocketing.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `pickpocketing_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -772,7 +772,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -781,7 +781,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Prospecting.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `prospecting_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -789,7 +789,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -798,7 +798,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Reference.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `reference_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -806,7 +806,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -815,7 +815,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Skinning.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `skinning_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -823,7 +823,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -832,7 +832,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!LootTemplates_Spell.HaveLootFor(cond->mSourceGroup)) { - sLog.outErrorDb("SourceGroup %u in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceGroup %u in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->mSourceGroup); return false; } @@ -840,7 +840,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) ItemPrototype const* pItemProto = sItemStorage.LookupEntry(cond->mSourceEntry); if (!pItemProto && !loot->isReference(cond->mSourceEntry)) { - sLog.outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); + sLog->outErrorDb("SourceType %u, SourceEntry %u in `condition` table, does not exist in `item_template`, ignoring.", cond->mSourceType, cond->mSourceEntry); return false; } break; @@ -849,14 +849,14 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (cond->mConditionType != CONDITION_SPELL_SCRIPT_TARGET) { - sLog.outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_SPELL_SCRIPT_TARGET(18) is valid for CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET(14), ignoring.", cond->mSourceEntry, uint32(cond->mConditionType)); + sLog->outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_SPELL_SCRIPT_TARGET(18) is valid for CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET(14), ignoring.", cond->mSourceEntry, uint32(cond->mConditionType)); return false; } SpellEntry const* spellProto = sSpellStore.LookupEntry(cond->mSourceEntry); if (!spellProto) { - sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); return false; } @@ -886,21 +886,21 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) else if (cond->mConditionValue3 & (1 << i)) { cond->mConditionValue3 &= ~(1 << i); - sLog.outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)" + sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)" ",TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" "TARGET_GAMEOBJECT_AREA_SRC(51), TARGET_GAMEOBJECT_AREA_DST(52) in effect %u", cond->mSourceEntry, uint32(i)); } } if (!targetfound && !cond->mConditionValue3) // cond->mConditionValue3 already errored up there { - sLog.outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)" + sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)" ",TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" "TARGET_GAMEOBJECT_AREA_SRC(51), TARGET_GAMEOBJECT_AREA_DST(52)", cond->mSourceEntry); return false; } if ((cond->mConditionValue1 == SPELL_TARGET_TYPE_DEAD) && !IsAllowingDeadTargetSpell(spellProto)) { - sLog.outErrorDb("SourceEntry %u in `condition` table does have SPELL_TARGET_TYPE_DEAD specified but spell does not have SPELL_ATTR2_ALLOW_DEAD_TARGET", cond->mSourceEntry); + sLog->outErrorDb("SourceEntry %u in `condition` table does have SPELL_TARGET_TYPE_DEAD specified but spell does not have SPELL_ATTR2_ALLOW_DEAD_TARGET", cond->mSourceEntry); return false; } break; @@ -909,7 +909,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!sCreatureStorage.LookupEntry(cond->mSourceEntry)) { - sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->mSourceEntry); + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->mSourceEntry); return false; } break; @@ -919,7 +919,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) SpellEntry const* spellProto = sSpellStore.LookupEntry(cond->mSourceEntry); if (!spellProto) { - sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); return false; } break; @@ -928,14 +928,14 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (cond->mConditionType != CONDITION_ITEM_TARGET) { - sLog.outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_ITEM_TARGET(24) is valid for CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET(18), ignoring.", cond->mSourceEntry, uint32(cond->mConditionType)); + sLog->outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_ITEM_TARGET(24) is valid for CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET(18), ignoring.", cond->mSourceEntry, uint32(cond->mConditionType)); return false; } ItemPrototype const *pItemProto = ObjectMgr::GetItemPrototype(cond->mSourceEntry); if (!pItemProto) { - sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->mSourceEntry); + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->mSourceEntry); return false; } @@ -971,7 +971,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) if (!bIsItemSpellValid) { - sLog.outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't have implicit target " + sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't have implicit target " "TARGET_UNIT_TARGET_ENEMY(6), TARGET_UNIT_TARGET_ANY(25), or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->mSourceEntry); break; } @@ -982,7 +982,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) Quest const *Quest = sObjectMgr->GetQuestTemplate(cond->mSourceEntry); if (!Quest) { - sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->mSourceEntry); + sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_ACCEPT specifies non-existing quest (%u), skipped", cond->mSourceEntry); return false; } } @@ -992,7 +992,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) Quest const *Quest = sObjectMgr->GetQuestTemplate(cond->mSourceEntry); if (!Quest) { - sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->mSourceEntry); + sLog->outErrorDb("CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK specifies non-existing quest (%u), skipped", cond->mSourceEntry); return false; } } @@ -1001,13 +1001,13 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { if (!sCreatureStorage.LookupEntry(cond->mSourceGroup)) { - sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->mSourceGroup); + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `creature_template`, ignoring.", cond->mSourceGroup); return false; } SpellEntry const* spellProto = sSpellStore.LookupEntry(cond->mSourceEntry); if (!spellProto) { - sLog.outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); + sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `spell.dbc`, ignoring.", cond->mSourceEntry); return false; } break; @@ -1025,7 +1025,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->mConditionType == CONDITION_NONE || cond->mConditionType >= CONDITION_MAX) { - sLog.outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->mConditionType),cond->mSourceEntry); + sLog->outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->mConditionType),cond->mSourceEntry); return false; } @@ -1035,13 +1035,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (!sSpellStore.LookupEntry(cond->mConditionValue1)) { - sLog.outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); + sLog->outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2 > 2) { - sLog.outErrorDb("Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->mConditionValue2); + sLog->outErrorDb("Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->mConditionValue2); return false; } break; @@ -1051,13 +1051,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) ItemPrototype const *proto = ObjectMgr::GetItemPrototype(cond->mConditionValue1); if (!proto) { - sLog.outErrorDb("Item condition has non existing item (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Item condition has non existing item (%u), skipped", cond->mConditionValue1); return false; } if (!cond->mConditionValue2) { - sLog.outErrorDb("Item condition has 0 set for item count in value2 (%u), skipped", cond->mConditionValue2); + sLog->outErrorDb("Item condition has 0 set for item count in value2 (%u), skipped", cond->mConditionValue2); return false; } break; @@ -1067,12 +1067,12 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) ItemPrototype const *proto = ObjectMgr::GetItemPrototype(cond->mConditionValue1); if (!proto) { - sLog.outErrorDb("ItemEquipped condition has non existing item (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("ItemEquipped condition has non existing item (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("ItemEquipped condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("ItemEquipped condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_ZONEID: @@ -1080,18 +1080,18 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(cond->mConditionValue1); if (!areaEntry) { - sLog.outErrorDb("Zone condition has non existing area (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Zone condition has non existing area (%u), skipped", cond->mConditionValue1); return false; } if (areaEntry->zone != 0) { - sLog.outErrorDb("Zone condition requires to be in area (%u) which is a subzone but zone expected, skipped", cond->mConditionValue1); + sLog->outErrorDb("Zone condition requires to be in area (%u) which is a subzone but zone expected, skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Zone condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Zone condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_REPUTATION_RANK: @@ -1099,7 +1099,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) FactionEntry const* factionEntry = sFactionStore.LookupEntry(cond->mConditionValue1); if (!factionEntry) { - sLog.outErrorDb("Reputation condition has non existing faction (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Reputation condition has non existing faction (%u), skipped", cond->mConditionValue1); return false; } break; @@ -1108,12 +1108,12 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->mConditionValue1 != ALLIANCE && cond->mConditionValue1 != HORDE) { - sLog.outErrorDb("Team condition specifies unknown team (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Team condition specifies unknown team (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Team condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Team condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_SKILL: @@ -1121,13 +1121,13 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(cond->mConditionValue1); if (!pSkill) { - sLog.outErrorDb("Skill condition specifies non-existing skill (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Skill condition specifies non-existing skill (%u), skipped", cond->mConditionValue1); return false; } - if (cond->mConditionValue2 < 1 || cond->mConditionValue2 > sWorld.GetConfigMaxSkillValue()) + if (cond->mConditionValue2 < 1 || cond->mConditionValue2 > sWorld->GetConfigMaxSkillValue()) { - sLog.outErrorDb("Skill condition specifies invalid skill value (%u), skipped", cond->mConditionValue2); + sLog->outErrorDb("Skill condition specifies invalid skill value (%u), skipped", cond->mConditionValue2); return false; } break; @@ -1140,25 +1140,25 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) Quest const *Quest = sObjectMgr->GetQuestTemplate(cond->mConditionValue1); if (!Quest) { - sLog.outErrorDb("Quest condition specifies non-existing quest (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Quest condition specifies non-existing quest (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Quest condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Quest condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_NO_AURA: { if (!sSpellStore.LookupEntry(cond->mConditionValue1)) { - sLog.outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); + sLog->outErrorDb("Aura condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2 > 2) { - sLog.outErrorDb("Aura condition has non existing effect index (%u) in value2 (must be 0..2), skipped", cond->mConditionValue2); + sLog->outErrorDb("Aura condition has non existing effect index (%u) in value2 (must be 0..2), skipped", cond->mConditionValue2); return false; } break; @@ -1168,12 +1168,12 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); if (cond->mConditionValue1 >=events.size() || !events[cond->mConditionValue1].isValid()) { - sLog.outErrorDb("Active event condition has non existing event id (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Active event condition has non existing event id (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Active event condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Active event condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_ACHIEVEMENT: @@ -1181,43 +1181,43 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) AchievementEntry const* achievement = GetAchievementStore()->LookupEntry(cond->mConditionValue1); if (!achievement) { - sLog.outErrorDb("Achivemen condition has non existing achivement id (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Achivemen condition has non existing achivement id (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Achivemen condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Achivemen condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_CLASS: { if (cond->mConditionValue1 >= MAX_CLASSES) { - sLog.outErrorDb("Class condition has non existing class (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Class condition has non existing class (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Class condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Class condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_RACE: { if (cond->mConditionValue1 >= MAX_RACES) { - sLog.outErrorDb("Race condition has non existing race (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Race condition has non existing race (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Race condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Race condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_SPELL_SCRIPT_TARGET: { if (cond->mConditionValue1 >= MAX_SPELL_TARGET_TYPE) { - sLog.outErrorDb("SpellTarget condition has non existing spell target type (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("SpellTarget condition has non existing spell target type (%u), skipped", cond->mConditionValue1); return false; } @@ -1227,7 +1227,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->mConditionValue2 && !sGOStorage.LookupEntry(cond->mConditionValue2)) { - sLog.outErrorDb("SpellTarget condition has non existing gameobject (%u) as target, skipped", cond->mConditionValue2); + sLog->outErrorDb("SpellTarget condition has non existing gameobject (%u) as target, skipped", cond->mConditionValue2); return false; } break; @@ -1238,14 +1238,14 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->mConditionValue2 && !sCreatureStorage.LookupEntry(cond->mConditionValue2)) { - sLog.outErrorDb("SpellTarget condition has non existing creature template entry (%u) as target, skipped", cond->mConditionValue2); + sLog->outErrorDb("SpellTarget condition has non existing creature template entry (%u) as target, skipped", cond->mConditionValue2); return false; } const CreatureInfo* cInfo = sCreatureStorage.LookupEntry(cond->mConditionValue2); if (cond->mSourceEntry == 30427 && !cInfo->SkinLootId) { - sLog.outErrorDb("SpellTarget condition has creature entry %u as a target of spellid 30427, but this creature has no skinlootid. Gas extraction will not work!, skipped", cond->mConditionValue2); + sLog->outErrorDb("SpellTarget condition has creature entry %u as a target of spellid 30427, but this creature has no skinlootid. Gas extraction will not work!, skipped", cond->mConditionValue2); return false; } break; @@ -1257,31 +1257,31 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (!cond->mConditionValue1 && !sCreatureStorage.LookupEntry(cond->mConditionValue1)) { - sLog.outErrorDb("CreatureTarget condition has non existing creature template entry (%u) as target, skipped", cond->mConditionValue1); + sLog->outErrorDb("CreatureTarget condition has non existing creature template entry (%u) as target, skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("CreatureTarget condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("CreatureTarget condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_TARGET_HEALTH_BELOW_PCT: { if (cond->mConditionValue1 > 100) { - sLog.outErrorDb("TargetHealthBelowPct condition has invalid data in value1 (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("TargetHealthBelowPct condition has invalid data in value1 (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("TargetHealthBelowPct condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("TargetHealthBelowPct condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_TARGET_RANGE: { if (cond->mConditionValue2 && cond->mConditionValue2 < cond->mConditionValue1)//maxDist can be 0 for infinit max range { - sLog.outErrorDb("TargetRange condition has max distance closer then min distance, skipped"); + sLog->outErrorDb("TargetRange condition has max distance closer then min distance, skipped"); return false; } break; @@ -1291,42 +1291,42 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) MapEntry const * me = sMapStore.LookupEntry(cond->mConditionValue1); if (!me) { - sLog.outErrorDb("Map condition has non existing map (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("Map condition has non existing map (%u), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Map condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Map condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_ITEM_TARGET: { if (!cond->mConditionValue1 || cond->mConditionValue1 > MAX_ITEM_REQ_TARGET_TYPE) { - sLog.outErrorDb("ItemTarget condition has incorrect target type (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("ItemTarget condition has incorrect target type (%u), skipped", cond->mConditionValue1); return false; } if (!cond->mConditionValue2 && !sCreatureStorage.LookupEntry(cond->mConditionValue2)) { - sLog.outErrorDb("ItemTarget condition has non existing creature template entry (%u) as target, skipped", cond->mConditionValue2); + sLog->outErrorDb("ItemTarget condition has non existing creature template entry (%u) as target, skipped", cond->mConditionValue2); return false; } if (cond->mConditionValue3) - sLog.outErrorDb("ItemTarget condition has useless data in value3 (%u)!", cond->mConditionValue3); + sLog->outErrorDb("ItemTarget condition has useless data in value3 (%u)!", cond->mConditionValue3); break; } case CONDITION_SPELL: { if (!sSpellStore.LookupEntry(cond->mConditionValue1)) { - sLog.outErrorDb("Spell condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); + sLog->outErrorDb("Spell condition has non existing spell (Id: %d), skipped", cond->mConditionValue1); return false; } if (cond->mConditionValue2) - sLog.outErrorDb("Spell condition has useless data in value2 (%u)!", cond->mConditionValue2); + sLog->outErrorDb("Spell condition has useless data in value2 (%u)!", cond->mConditionValue2); break; } case CONDITION_NOITEM: @@ -1334,7 +1334,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) ItemPrototype const *proto = ObjectMgr::GetItemPrototype(cond->mConditionValue1); if (!proto) { - sLog.outErrorDb("NoItem condition has non existing item (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("NoItem condition has non existing item (%u), skipped", cond->mConditionValue1); return false; } break; @@ -1343,7 +1343,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->mConditionValue2 >= LVL_COND_MAX) { - sLog.outErrorDb("Level condition has invalid option (%u), skipped", cond->mConditionValue2); + sLog->outErrorDb("Level condition has invalid option (%u), skipped", cond->mConditionValue2); return false; } break; @@ -1352,7 +1352,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->mConditionValue1 > DRUNKEN_SMASHED) { - sLog.outErrorDb("DrunkState condition has invalid state (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("DrunkState condition has invalid state (%u), skipped", cond->mConditionValue1); return false; } break; @@ -1361,7 +1361,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (!sCreatureStorage.LookupEntry(cond->mConditionValue1)) { - sLog.outErrorDb("NearCreature condition has non existing creature template entry (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("NearCreature condition has non existing creature template entry (%u), skipped", cond->mConditionValue1); return false; } break; @@ -1370,7 +1370,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (!sGOStorage.LookupEntry(cond->mConditionValue1)) { - sLog.outErrorDb("NearGameObject condition has non existing gameobject template entry (%u), skipped", cond->mConditionValue1); + sLog->outErrorDb("NearGameObject condition has non existing gameobject template entry (%u), skipped", cond->mConditionValue1); return false; } break; diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 77b8ad85050..4f085f84c2b 100755 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -49,8 +49,8 @@ void DisableMgr::LoadDisables() if (!result) { - sLog.outString(">> Loaded 0 disables. DB table `disables` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 disables. DB table `disables` is empty!"); + sLog->outString(); return; } @@ -62,7 +62,7 @@ void DisableMgr::LoadDisables() DisableType type = DisableType(fields[0].GetUInt32()); if (type >= MAX_DISABLE_TYPES) { - sLog.outErrorDb("Invalid type %u specified in `disables` table, skipped.", type); + sLog->outErrorDb("Invalid type %u specified in `disables` table, skipped.", type); continue; } @@ -80,13 +80,13 @@ void DisableMgr::LoadDisables() { if (!(sSpellStore.LookupEntry(entry) || flags & SPELL_DISABLE_DEPRECATED_SPELL)) { - sLog.outErrorDb("Spell entry %u from `disables` doesn't exist in dbc, skipped.", entry); + sLog->outErrorDb("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->outErrorDb("Disable flags for spell %u are invalid, skipped.", entry); continue; } @@ -113,7 +113,7 @@ void DisableMgr::LoadDisables() MapEntry const* mapEntry = sMapStore.LookupEntry(entry); if (!mapEntry) { - sLog.outErrorDb("Map entry %u from `disables` doesn't exist in dbc, skipped.", entry); + sLog->outErrorDb("Map entry %u from `disables` doesn't exist in dbc, skipped.", entry); continue; } bool isFlagInvalid = false; @@ -134,12 +134,12 @@ void DisableMgr::LoadDisables() break; case MAP_BATTLEGROUND: case MAP_ARENA: - sLog.outErrorDb("Battleground map %u specified to be disabled in map case, skipped.", entry); + sLog->outErrorDb("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->outErrorDb("Disable flags for map %u are invalid, skipped.", entry); continue; } break; @@ -147,29 +147,29 @@ void DisableMgr::LoadDisables() case DISABLE_TYPE_BATTLEGROUND: if (!sBattlemasterListStore.LookupEntry(entry)) { - sLog.outErrorDb("Battleground entry %u from `disables` doesn't exist in dbc, skipped.", entry); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Disable flags specified for Achievement Criteria %u, useless data.", entry); break; } @@ -178,8 +178,8 @@ void DisableMgr::LoadDisables() } while (result->NextRow()); - sLog.outString(">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u disables in %u ms", total_count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void DisableMgr::CheckQuestDisables() @@ -189,8 +189,8 @@ void DisableMgr::CheckQuestDisables() uint32 count = m_DisableMap[DISABLE_TYPE_QUEST].size(); if (!count) { - sLog.outString(">> Checked 0 quest disables."); - sLog.outString(); + sLog->outString(">> Checked 0 quest disables."); + sLog->outString(); return; } @@ -200,17 +200,17 @@ void DisableMgr::CheckQuestDisables() const uint32 entry = itr->first; if (!sObjectMgr->GetQuestTemplate(entry)) { - sLog.outErrorDb("Quest entry %u from `disables` doesn't exist, skipped.", entry); + sLog->outErrorDb("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->outErrorDb("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->outString(">> Checked %u quest disables in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit) diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index fa6f37f9201..a905706494e 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -193,7 +193,7 @@ typedef std::list StoreProblemList; 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("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; @@ -439,7 +439,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->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); newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0 } else @@ -593,7 +593,7 @@ void LoadDBCStores(const std::string& dataPath) // error checks if (bad_dbc_files.size() >= DBCFilesCount) { - sLog.outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str()); + sLog->outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.dbc files (%d) not found by path: %sdbc",DBCFilesCount,dataPath.c_str()); exit(1); } else if (!bad_dbc_files.empty()) @@ -602,7 +602,7 @@ void LoadDBCStores(const std::string& dataPath) for (std::list::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i) str += *i + "\n"; - sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",(uint32)bad_dbc_files.size(),DBCFilesCount,str.c_str()); + sLog->outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",(uint32)bad_dbc_files.size(),DBCFilesCount,str.c_str()); exit(1); } @@ -615,11 +615,11 @@ void LoadDBCStores(const std::string& dataPath) !sMapStore.LookupEntry(724) || // last map added in 3.3.5a !sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a { - sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client."); + sLog->outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client."); exit(1); } - sLog.outString(">> Initialized %d data stores in %u ms", DBCFilesCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Initialized %d data stores in %u ms", DBCFilesCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } SimpleFactionsList const* GetFactionTeamList(uint32 faction) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index aa9927f7b52..48222d99944 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -34,7 +34,7 @@ LFGMgr::LFGMgr(): m_update(true), m_QueueTimer(0), m_lfgProposalId(1), m_WaitTimeAvg(-1), m_WaitTimeTank(-1), m_WaitTimeHealer(-1), m_WaitTimeDps(-1), m_NumWaitTimeAvg(0), m_NumWaitTimeTank(0), m_NumWaitTimeHealer(0), m_NumWaitTimeDps(0) { - m_update = sWorld.getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE); + m_update = sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE); if (m_update) { new LFGScripts(); @@ -83,8 +83,8 @@ void LFGMgr::LoadDungeonEncounters() if (!result) { - sLog.outString(); - sLog.outErrorDb(">> Loaded 0 dungeon encounter lfg associations. DB table `lfg_dungeon_encounters` is empty!"); + sLog->outString(); + sLog->outErrorDb(">> Loaded 0 dungeon encounter lfg associations. DB table `lfg_dungeon_encounters` is empty!"); return; } @@ -101,19 +101,19 @@ void LFGMgr::LoadDungeonEncounters() { if (!(achievement->flags & ACHIEVEMENT_FLAG_COUNTER)) { - sLog.outErrorDb("Achievement %u specified in table `lfg_dungeon_encounters` is not a statistic!", achievementId); + sLog->outErrorDb("Achievement %u specified in table `lfg_dungeon_encounters` is not a statistic!", achievementId); continue; } } else { - sLog.outErrorDb("Achievement %u specified in table `lfg_dungeon_encounters` does not exist!", achievementId); + sLog->outErrorDb("Achievement %u specified in table `lfg_dungeon_encounters` does not exist!", achievementId); continue; } if (!sLFGDungeonStore.LookupEntry(dungeonId)) { - sLog.outErrorDb("Dungeon %u specified in table `lfg_dungeon_encounters` does not exist!", dungeonId); + sLog->outErrorDb("Dungeon %u specified in table `lfg_dungeon_encounters` does not exist!", dungeonId); continue; } @@ -121,8 +121,8 @@ void LFGMgr::LoadDungeonEncounters() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u dungeon encounter lfg associations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u dungeon encounter lfg associations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } @@ -140,8 +140,8 @@ void LFGMgr::LoadRewards() if (!result) { - sLog.outErrorDb(">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!"); + sLog->outString(); return; } @@ -162,25 +162,25 @@ void LFGMgr::LoadRewards() if (!sLFGDungeonStore.LookupEntry(dungeonId)) { - sLog.outErrorDb("Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId); + sLog->outErrorDb("Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId); continue; } - if (!maxLevel || maxLevel > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + 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); - 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); + 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->outErrorDb("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->outErrorDb("Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId); otherQuestId = 0; } @@ -188,8 +188,8 @@ void LFGMgr::LoadRewards() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void LFGMgr::Update(uint32 diff) @@ -258,7 +258,7 @@ void LFGMgr::Update(uint32 diff) LfgGuidList firstNew; while (!newToQueue.empty()) { - sLog.outDebug("LFGMgr::Update: QueueId %u: checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", it->first, newToQueue.front(), uint32(newToQueue.size()), uint32(currentQueue.size())); + sLog->outDebug("LFGMgr::Update: QueueId %u: checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", it->first, newToQueue.front(), uint32(newToQueue.size()), uint32(currentQueue.size())); firstNew.push_back(newToQueue.front()); LfgGuidList temporalList = currentQueue; if (LfgProposal* pProposal = FindNewGroups(firstNew, temporalList)) // Group found! @@ -313,7 +313,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("LFGMgr::Update: [" UI64FMTD "] queued with null queue info!", itQueue->first); continue; } uint32 dungeonId = (*queue->dungeons.begin()); @@ -363,16 +363,16 @@ void LFGMgr::Update(uint32 diff) */ void LFGMgr::AddToQueue(const uint64& guid, uint8 queueId) { - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) queueId = 0; LfgGuidList& list = m_newToQueue[queueId]; if (std::find(list.begin(), list.end(), guid) != list.end()) - sLog.outDebug("LFGMgr::AddToQueue: [" UI64FMTD "] already in new queue. ignoring", guid); + sLog->outDebug("LFGMgr::AddToQueue: [" UI64FMTD "] already in new queue. ignoring", guid); else { list.push_back(guid); - sLog.outDebug("LFGMgr::AddToQueue: [" UI64FMTD "] added to m_newToQueue (size: %u)", guid, uint32(list.size())); + sLog->outDebug("LFGMgr::AddToQueue: [" UI64FMTD "] added to m_newToQueue (size: %u)", guid, uint32(list.size())); } } @@ -397,12 +397,12 @@ bool LFGMgr::RemoveFromQueue(const uint64& guid) { delete it->second; m_QueueInfoMap.erase(it); - sLog.outDebug("LFGMgr::RemoveFromQueue: [" UI64FMTD "] removed", guid); + sLog->outDebug("LFGMgr::RemoveFromQueue: [" UI64FMTD "] removed", guid); return true; } else { - sLog.outDebug("LFGMgr::RemoveFromQueue: [" UI64FMTD "] not in queue", guid); + sLog->outDebug("LFGMgr::RemoveFromQueue: [" UI64FMTD "] not in queue", guid); return false; } @@ -605,7 +605,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon // Can't join. Send result if (joinData.result != LFG_JOIN_OK) { - sLog.outDebug("LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); + sLog->outDebug("LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); if (!dungeons.empty()) // Only should show lockmap when have no dungeons available joinData.lockmap.clear(); plr->GetSession()->SendLfgJoinResult(joinData); @@ -615,7 +615,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon // FIXME - Raid browser not supported yet if (isRaid) { - sLog.outDebug("LFGMgr::Join: [" UI64FMTD "] trying to join raid browser and it's disabled.", guid); + sLog->outDebug("LFGMgr::Join: [" UI64FMTD "] trying to join raid browser and it's disabled.", guid); return; } @@ -687,7 +687,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon } AddToQueue(guid, uint8(plr->GetTeam())); } - sLog.outDebug("LFGMgr::Join: [" UI64FMTD "] joined with %u members. dungeons: %u", guid, grp ? grp->GetMembersCount() : 1, uint8(dungeons.size())); + sLog->outDebug("LFGMgr::Join: [" UI64FMTD "] joined with %u members. dungeons: %u", guid, grp ? grp->GetMembersCount() : 1, uint8(dungeons.size())); } /** @@ -705,7 +705,7 @@ void LFGMgr::Leave(Player* plr, Group* grp /* = NULL*/) uint64 guid = grp ? grp->GetGUID() : plr->GetGUID(); LfgState state = GetState(guid); - sLog.outDebug("LFGMgr::Leave: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::Leave: [" UI64FMTD "]", guid); switch(state) { case LFG_STATE_QUEUED: @@ -785,7 +785,7 @@ void LFGMgr::OfferContinue(Group* grp) */ LfgProposal* LFGMgr::FindNewGroups(LfgGuidList& check, LfgGuidList& all) { - sLog.outDebug("LFGMgr::FindNewGroup: (%s) - all(%s)", ConcatenateGuids(check).c_str(), ConcatenateGuids(all).c_str()); + sLog->outDebug("LFGMgr::FindNewGroup: (%s) - all(%s)", ConcatenateGuids(check).c_str(), ConcatenateGuids(all).c_str()); LfgProposal* pProposal = NULL; if (!check.size() || check.size() > MAXGROUPSIZE || !CheckCompatibility(check, pProposal)) @@ -818,7 +818,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) if (check.size() > MAXGROUPSIZE || !check.size()) { - sLog.outDebug("LFGMgr::CheckCompatibility: (%s): Size wrong - Not compatibles", strGuids.c_str()); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s): Size wrong - Not compatibles", strGuids.c_str()); return false; } @@ -829,7 +829,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) LfgAnswer answer = GetCompatibles(strGuids); if (answer != LFG_ANSWER_PENDING) { - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) compatibles (cached): %d", strGuids.c_str(), answer); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) compatibles (cached): %d", strGuids.c_str(), answer); return bool(answer); } @@ -842,7 +842,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // Check all-but-new compatibilities (New,A,B,C,D) --> check(A,B,C,D) if (!CheckCompatibility(check, pProposal)) // Group not compatible { - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) not compatibles (%s not compatibles)", strGuids.c_str(), ConcatenateGuids(check).c_str()); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) not compatibles (%s not compatibles)", strGuids.c_str(), ConcatenateGuids(check).c_str()); SetCompatibles(strGuids, false); return false; } @@ -860,7 +860,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid); if (itQueue == m_QueueInfoMap.end()) { - sLog.outError("LFGMgr::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", (*it)); + sLog->outError("LFGMgr::CheckCompatibility: [" UI64FMTD "] is not queued but listed as queued!", (*it)); RemoveFromQueue(guid); return false; } @@ -888,9 +888,9 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) { SetCompatibles(strGuids, false); if (numLfgGroups > 1) - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) More than one Lfggroup (%u)", strGuids.c_str(), numLfgGroups); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) More than one Lfggroup (%u)", strGuids.c_str(), numLfgGroups); else - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) Too much players (%u)", strGuids.c_str(), numPlayers); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Too much players (%u)", strGuids.c_str(), numPlayers); return false; } @@ -917,7 +917,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) { Player* plr = sObjectMgr->GetPlayer(it->first); if (!plr) - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) Warning! [" UI64FMTD "] offline! Marking as not compatibles!", strGuids.c_str(), it->first); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Warning! [" UI64FMTD "] offline! Marking as not compatibles!", strGuids.c_str(), it->first); else { for (PlayerSet::const_iterator itPlayer = players.begin(); itPlayer != players.end() && plr; ++itPlayer) @@ -925,7 +925,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // Do not form a group with ignoring candidates if (plr->GetSocial()->HasIgnore((*itPlayer)->GetGUIDLow()) || (*itPlayer)->GetSocial()->HasIgnore(plr->GetGUIDLow())) { - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) Players [" UI64FMTD "] and [" UI64FMTD "] ignoring", strGuids.c_str(), (*itPlayer)->GetGUID(), plr->GetGUID()); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Players [" UI64FMTD "] and [" UI64FMTD "] ignoring", strGuids.c_str(), (*itPlayer)->GetGUID(), plr->GetGUID()); plr = NULL; } } @@ -939,7 +939,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) if (players.size() != numPlayers || !CheckGroupRoles(rolesMap)) { if (players.size() == numPlayers) - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) Roles not compatible", strGuids.c_str()); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Roles not compatible", strGuids.c_str()); SetCompatibles(strGuids, false); return false; } @@ -972,10 +972,10 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // ----- Group is compatible, if we have MAXGROUPSIZE members then match is found if (numPlayers != MAXGROUPSIZE) { - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) Compatibles but not match. Players(%u)", strGuids.c_str(), numPlayers); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Compatibles but not match. Players(%u)", strGuids.c_str(), numPlayers); return true; } - sLog.outDebug("LFGMgr::CheckCompatibility: (%s) MATCH! Group formed", strGuids.c_str()); + sLog->outDebug("LFGMgr::CheckCompatibility: (%s) MATCH! Group formed", strGuids.c_str()); // GROUP FORMED! // TODO - Improve algorithm to select proper group based on Item Level @@ -1155,7 +1155,7 @@ void LFGMgr::RemoveFromCompatibles(uint64 guid) out << guid; std::string strGuid = out.str(); - sLog.outDebug("LFGMgr::RemoveFromCompatibles: Removing [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::RemoveFromCompatibles: Removing [" UI64FMTD "]", guid); for (LfgCompatibleMap::iterator itNext = m_CompatibleMap.begin(); itNext != m_CompatibleMap.end();) { LfgCompatibleMap::iterator it = itNext++; @@ -1315,7 +1315,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept) LfgProposalPlayer* ppPlayer = itProposalPlayer->second; ppPlayer->accept = LfgAnswer(accept); - sLog.outDebug("LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); + sLog->outDebug("LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); if (!accept) { RemoveProposal(itProposal, LFG_UPDATETYPE_PROPOSAL_DECLINED); @@ -1364,13 +1364,13 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept) LfgProposalPlayer* pPlayer = pProposal->players[(*it)->GetGUID()]; uint32 lowgroupguid = (*it)->GetGroup() ? (*it)->GetGroup()->GetLowGUID() : 0; if (pPlayer->groupLowGuid != lowgroupguid) - sLog.outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, pPlayer->groupLowGuid); + sLog->outError("LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, pPlayer->groupLowGuid); uint64 guid = pPlayer->groupLowGuid ? MAKE_NEW_GUID(pPlayer->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID(); LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid); if (itQueue == m_QueueInfoMap.end()) { - sLog.outError("LFGMgr::UpdateProposal: Queue info for guid [" UI64FMTD "] not found!", guid); + sLog->outError("LFGMgr::UpdateProposal: Queue info for guid [" UI64FMTD "] not found!", guid); waitTimesMap[(*it)->GetGUID()] = -1; } else @@ -1468,7 +1468,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t LfgProposal* pProposal = itProposal->second; pProposal->state = LFG_PROPOSAL_FAILED; - sLog.outDebug("LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); + sLog->outDebug("LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); // Mark all people that didn't answered as no accept if (type == LFG_UPDATETYPE_PROPOSAL_FAILED) for (LfgProposalPlayerMap::const_iterator it = pProposal->players.begin(); it != pProposal->players.end(); ++it) @@ -1512,12 +1512,12 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t if (it->second->accept == LFG_ANSWER_DENY) { updateData.updateType = type; - sLog.outDebug("LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); + sLog->outDebug("LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); } else { updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE; - sLog.outDebug("LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); + sLog->outDebug("LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); } ClearState(guid); if (grp) @@ -1530,7 +1530,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t } else { - sLog.outDebug("LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); + sLog->outDebug("LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); SetState(guid, LFG_STATE_QUEUED); if (grp) { @@ -1694,7 +1694,7 @@ void LFGMgr::UpdateBoot(Player* plr, bool accept) */ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/) { - sLog.outDebug("LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", plr->GetGUID(), out ? "out" : "in"); + sLog->outDebug("LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", plr->GetGUID(), out ? "out" : "in"); if (out) { plr->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); @@ -1750,7 +1750,7 @@ void LFGMgr::TeleportPlayer(Player* plr, 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", plr->GetGUID(), dungeon->map, dungeon->difficulty); + sLog->outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "]: No areatrigger found for map: %u difficulty: %u", plr->GetGUID(), dungeon->map, dungeon->difficulty); error = LFG_TELEPORTERROR_INVALID_LOCATION; } else @@ -1780,7 +1780,7 @@ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/) else { error = LFG_TELEPORTERROR_INVALID_LOCATION; - sLog.outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", plr->GetGUID(), mapid); + sLog->outError("LfgMgr::TeleportPlayer: Failed to teleport [" UI64FMTD "] to map %u: ", plr->GetGUID(), mapid); } } } @@ -1801,7 +1801,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player) Group* group = player->GetGroup(); if (!group || !group->isLFGGroup()) { - sLog.outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] is not in a group or not a LFGGroup. Ignoring", player->GetGUID()); + sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] is not in a group or not a LFGGroup. Ignoring", player->GetGUID()); return; } @@ -1810,7 +1810,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player) if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON) { - sLog.outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Already rewarded player. Ignoring", guid); + sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Already rewarded player. Ignoring", guid); return; } @@ -1826,7 +1826,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player) LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(rDungeonId); if (!dungeon || dungeon->type != LFG_TYPE_RANDOM) { - sLog.outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] dungeon %u is not random", guid, rDungeonId); + sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] dungeon %u is not random", guid, rDungeonId); return; } @@ -1857,7 +1857,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 /*dungeonId*/, Player* player) } // Give rewards - sLog.outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u,%s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not"); + sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u,%s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not"); player->GetSession()->SendLfgPlayerReward(dungeon->Entry(), GetDungeon(gguid, false), index, reward, qReward); } @@ -1952,7 +1952,7 @@ std::string LFGMgr::ConcatenateGuids(LfgGuidList check) LfgState LFGMgr::GetState(const uint64& guid) { - sLog.outDebug("LFGMgr::GetState: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::GetState: [" UI64FMTD "]", guid); if (IS_GROUP(guid)) return m_Groups[guid].GetState(); else @@ -1961,61 +1961,61 @@ LfgState LFGMgr::GetState(const uint64& guid) uint32 LFGMgr::GetDungeon(const uint64& guid, bool asId /*= true*/) { - sLog.outDebug("LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId); + sLog->outDebug("LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId); return m_Groups[guid].GetDungeon(asId); } uint8 LFGMgr::GetRoles(const uint64& guid) { - sLog.outDebug("LFGMgr::GetRoles: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::GetRoles: [" UI64FMTD "]", guid); return m_Players[guid].GetRoles(); } const std::string& LFGMgr::GetComment(const uint64& guid) { - sLog.outDebug("LFGMgr::GetComment: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::GetComment: [" UI64FMTD "]", guid); return m_Players[guid].GetComment(); } const LfgDungeonSet& LFGMgr::GetSelectedDungeons(const uint64& guid) { - sLog.outDebug("LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); return m_Players[guid].GetSelectedDungeons(); } const LfgLockMap& LFGMgr::GetLockedDungeons(const uint64& guid) { - sLog.outDebug("LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); return m_Players[guid].GetLockedDungeons(); } uint8 LFGMgr::GetKicksLeft(const uint64& guid) { - sLog.outDebug("LFGMgr::GetKicksLeft: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::GetKicksLeft: [" UI64FMTD "]", guid); return m_Groups[guid].GetKicksLeft(); } uint8 LFGMgr::GetVotesNeeded(const uint64& guid) { - sLog.outDebug("LFGMgr::GetVotesNeeded: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::GetVotesNeeded: [" UI64FMTD "]", guid); return m_Groups[guid].GetVotesNeeded(); } void LFGMgr::RestoreState(const uint64& guid) { - sLog.outDebug("LFGMgr::RestoreState: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::RestoreState: [" UI64FMTD "]", guid); m_Groups[guid].RestoreState(); } void LFGMgr::ClearState(const uint64& guid) { - sLog.outDebug("LFGMgr::ClearState: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::ClearState: [" UI64FMTD "]", guid); m_Players[guid].ClearState(); } void LFGMgr::SetState(const uint64& guid, LfgState state) { - sLog.outDebug("LFGMgr::SetState: [" UI64FMTD "] state %u", guid, state); + sLog->outDebug("LFGMgr::SetState: [" UI64FMTD "] state %u", guid, state); if (IS_GROUP(guid)) m_Groups[guid].SetState(state); else @@ -2024,43 +2024,43 @@ void LFGMgr::SetState(const uint64& guid, LfgState state) void LFGMgr::SetDungeon(const uint64& guid, uint32 dungeon) { - sLog.outDebug("LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); + sLog->outDebug("LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); m_Groups[guid].SetDungeon(dungeon); } void LFGMgr::SetRoles(const uint64& guid, uint8 roles) { - sLog.outDebug("LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); + sLog->outDebug("LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); m_Players[guid].SetRoles(roles); } void LFGMgr::SetComment(const uint64& guid, const std::string& comment) { - sLog.outDebug("LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); + sLog->outDebug("LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); m_Players[guid].SetComment(comment); } void LFGMgr::SetSelectedDungeons(const uint64& guid, const LfgDungeonSet& dungeons) { - sLog.outDebug("LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); m_Players[guid].SetSelectedDungeons(dungeons); } void LFGMgr::SetLockedDungeons(const uint64& guid, const LfgLockMap& lock) { - sLog.outDebug("LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); m_Players[guid].SetLockedDungeons(lock); } void LFGMgr::DecreaseKicksLeft(const uint64& guid) { - sLog.outDebug("LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); m_Groups[guid].DecreaseKicksLeft(); } void LFGMgr::RemovePlayerData(const uint64& guid) { - sLog.outDebug("LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid); LfgPlayerDataMap::iterator it = m_Players.find(guid); if (it != m_Players.end()) m_Players.erase(it); @@ -2068,7 +2068,7 @@ void LFGMgr::RemovePlayerData(const uint64& guid) void LFGMgr::RemoveGroupData(const uint64& guid) { - sLog.outDebug("LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); + sLog->outDebug("LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); LfgGroupDataMap::iterator it = m_Groups.find(guid); if (it != m_Groups.end()) m_Groups.erase(it); diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index 49a14ff8896..12ce142a292 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -35,7 +35,7 @@ void LFGScripts::OnAddMember(Group* group, uint64 guid) if (!gguid) return; - sLog.outDebug("LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "]", gguid, guid); + sLog->outDebug("LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "]", gguid, guid); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_CLEAR_LOCK_LIST); for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -61,7 +61,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, if (!gguid || method == GROUP_REMOVEMETHOD_DEFAULT) return; - sLog.outDebug("LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); + sLog->outDebug("LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED) { // TODO - Do not remove, just remove the one leaving and rejoin queue with all other data @@ -104,7 +104,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, void LFGScripts::OnDisband(Group* group) { uint64 gguid = group->GetGUID(); - sLog.outDebug("LFGScripts::OnDisband [" UI64FMTD "]", gguid); + sLog->outDebug("LFGScripts::OnDisband [" UI64FMTD "]", gguid); sLFGMgr->RemoveGroupData(gguid); } @@ -115,7 +115,7 @@ void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLe if (!gguid) return; - sLog.outDebug("LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); + sLog->outDebug("LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); Player *plr = sObjectMgr->GetPlayer(newLeaderGuid); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER); @@ -137,7 +137,7 @@ void LFGScripts::OnInviteMember(Group* group, uint64 guid) if (!gguid) return; - sLog.outDebug("LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); + sLog->outDebug("LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); sLFGMgr->Leave(NULL, group); } diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 29a2b83e32d..4d08ab073f8 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -52,7 +52,7 @@ void Corpse::AddToWorld() { ///- Register the corpse for guid lookup if (!IsInWorld()) - sObjectAccessor.AddObject(this); + sObjectAccessor->AddObject(this); Object::AddToWorld(); } @@ -61,7 +61,7 @@ void Corpse::RemoveFromWorld() { ///- Remove the corpse from the accessor if (IsInWorld()) - sObjectAccessor.RemoveObject(this); + sObjectAccessor->RemoveObject(this); Object::RemoveFromWorld(); } @@ -81,7 +81,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("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; } @@ -140,7 +140,7 @@ void Corpse::DeleteBonesFromWorld() if (!corpse) { - sLog.outError("Bones %u not found in world.", GetGUIDLow()); + sLog->outError("Bones %u not found in world.", GetGUIDLow()); return; } @@ -183,7 +183,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) if (m_type >= MAX_CORPSE_TYPE) { - sLog.outError("Corpse (guidlow %d, owner %d) have wrong corpse type, not load.",GetGUIDLow(),GUID_LOPART(GetOwnerGUID())); + sLog->outError("Corpse (guidlow %d, owner %d) have wrong corpse type, not load.",GetGUIDLow(),GUID_LOPART(GetOwnerGUID())); return false; } @@ -201,7 +201,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) if (!IsPositionValid()) { - sLog.outError("Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", + sLog->outError("Corpse (guidlow %d, owner %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", GetGUIDLow(), GUID_LOPART(GetOwnerGUID()), GetPositionX(), GetPositionY()); return false; } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6d4a5443344..f2347e0882f 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -158,7 +158,7 @@ m_formation(NULL) DisableReputationGain = false; //m_unit_movement_flags = MONSTER_MOVE_WALK; - m_SightDistance = sWorld.getFloatConfig(CONFIG_SIGHT_MONSTER); + m_SightDistance = sWorld->getFloatConfig(CONFIG_SIGHT_MONSTER); m_CombatDistance = 0;//MELEE_RANGE; ResetLootMode(); // restore default loot mode @@ -173,7 +173,7 @@ Creature::~Creature() i_AI = NULL; //if (m_uint32Values) - // sLog.outError("Deconstruct Creature Entry = %u", GetEntry()); + // sLog->outError("Deconstruct Creature Entry = %u", GetEntry()); } void Creature::AddToWorld() @@ -183,7 +183,7 @@ void Creature::AddToWorld() { if (m_zoneScript) m_zoneScript->OnCreatureCreate(this); - sObjectAccessor.AddObject(this); + sObjectAccessor->AddObject(this); Unit::AddToWorld(); SearchFormation(); AIM_Initialize(); @@ -199,9 +199,9 @@ void Creature::RemoveFromWorld() if (m_zoneScript) m_zoneScript->OnCreatureRemove(this); if (m_formation) - formation_mgr.RemoveCreatureFromGroup(m_formation, this); + sFormationMgr->RemoveCreatureFromGroup(m_formation, this); Unit::RemoveFromWorld(); - sObjectAccessor.RemoveObject(this); + sObjectAccessor->RemoveObject(this); } } @@ -226,7 +226,7 @@ void Creature::SearchFormation() CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid); if (frmdata != CreatureGroupMap.end()) - formation_mgr.AddCreatureToGroup(frmdata->second->leaderGUID, this); + sFormationMgr->AddCreatureToGroup(frmdata->second->leaderGUID, this); } void Creature::RemoveCorpse(bool setSpawnTime) @@ -260,7 +260,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data CreatureInfo const *normalInfo = ObjectMgr::GetCreatureTemplate(Entry); if (!normalInfo) { - sLog.outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry); + sLog->outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry); return false; } @@ -279,7 +279,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data if (!cinfo) { // maybe check such things already at startup - sLog.outErrorDb("Creature::UpdateEntry creature difficulty %u entry %u does not exist.", diff + 1, actualEntry); + sLog->outErrorDb("Creature::UpdateEntry creature difficulty %u entry %u does not exist.", diff + 1, actualEntry); return false; } } @@ -298,7 +298,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->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry); return false; } @@ -306,7 +306,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id); 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->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry); return false; } @@ -449,11 +449,11 @@ void Creature::Update(uint32 diff) { case JUST_ALIVED: // Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. - sLog.outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry()); + sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry()); break; case JUST_DIED: // Don't must 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("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry()); break; case DEAD: { @@ -500,7 +500,7 @@ void Creature::Update(uint32 diff) else if (m_corpseRemoveTime <= time(NULL)) { RemoveCorpse(false); - sLog.outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); + sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); } else { @@ -517,7 +517,7 @@ void Creature::Update(uint32 diff) if (m_corpseRemoveTime <= time(NULL)) { RemoveCorpse(false); - sLog.outStaticDebug("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); + sLog->outStaticDebug("Removing alive corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); } } @@ -611,7 +611,7 @@ void Creature::RegenerateMana() { if (!IsUnderLastManaUseEffect()) { - float ManaIncreaseRate = sWorld.getRate(RATE_POWER_MANA); + float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA); float Spirit = GetStat(STAT_SPIRIT); addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate); @@ -647,7 +647,7 @@ void Creature::RegenerateHealth() // Not only pet, but any controlled creature if (GetCharmerOrOwnerGUID()) { - float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH); + float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH); float Spirit = GetStat(STAT_SPIRIT); if (GetPower(POWER_MANA) > 0) @@ -676,7 +676,7 @@ void Creature::DoFleeToGetAssistance() if (HasAuraType(SPELL_AURA_PREVENTS_FLEEING)) return; - float radius = sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS); + float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS); if (radius >0) { Creature* pCreature = NULL; @@ -696,7 +696,7 @@ void Creature::DoFleeToGetAssistance() UpdateSpeed(MOVE_RUN, false); if (!pCreature) - //SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); + //SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); //TODO: use 31365 SetControlled(true, UNIT_STAT_FLEEING); else @@ -709,7 +709,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai) // make sure nothing can change the AI during AI update if (m_AI_locked) { - sLog.outDebug("AIM_Initialize: failed to init, locked."); + sLog->outDebug("AIM_Initialize: failed to init, locked."); return false; } @@ -748,7 +748,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry); if (!cinfo) { - sLog.outErrorDb("Creature entry %u does not exist.", Entry); + sLog->outErrorDb("Creature entry %u does not exist.", Entry); return false; } @@ -756,7 +756,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, if (!IsPositionValid()) { - sLog.outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,Entry,x,y); + sLog->outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,Entry,x,y); return false; } @@ -768,19 +768,19 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, switch (GetCreatureInfo()->rank) { case CREATURE_ELITE_RARE: - m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_RARE); + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE); break; case CREATURE_ELITE_ELITE: - m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_ELITE); + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_ELITE); break; case CREATURE_ELITE_RAREELITE: - m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_RAREELITE); + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RAREELITE); break; case CREATURE_ELITE_WORLDBOSS: - m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_WORLDBOSS); + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_WORLDBOSS); break; default: - m_corpseDelay = sWorld.getIntConfig(CONFIG_CORPSE_DECAY_NORMAL); + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_NORMAL); break; } LoadCreaturesAddon(); @@ -836,7 +836,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS) { - sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.", + sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.", GetGUIDLow(),GetEntry()); return false; } @@ -1037,7 +1037,7 @@ void Creature::SaveToDB() CreatureData const *data = sObjectMgr->GetCreatureData(m_DBTableGuid); if (!data) { - sLog.outError("Creature::SaveToDB failed, cannot get creature data!"); + sLog->outError("Creature::SaveToDB failed, cannot get creature data!"); return; } @@ -1186,17 +1186,17 @@ float Creature::_GetHealthMod(int32 Rank) switch (Rank) // define rates for each elite rank { case CREATURE_ELITE_NORMAL: - return sWorld.getRate(RATE_CREATURE_NORMAL_HP); + return sWorld->getRate(RATE_CREATURE_NORMAL_HP); case CREATURE_ELITE_ELITE: - return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_HP); + return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP); case CREATURE_ELITE_RAREELITE: - return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_HP); + return sWorld->getRate(RATE_CREATURE_ELITE_RAREELITE_HP); case CREATURE_ELITE_WORLDBOSS: - return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_HP); + return sWorld->getRate(RATE_CREATURE_ELITE_WORLDBOSS_HP); case CREATURE_ELITE_RARE: - return sWorld.getRate(RATE_CREATURE_ELITE_RARE_HP); + return sWorld->getRate(RATE_CREATURE_ELITE_RARE_HP); default: - return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_HP); + return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_HP); } } @@ -1205,17 +1205,17 @@ float Creature::_GetDamageMod(int32 Rank) switch (Rank) // define rates for each elite rank { case CREATURE_ELITE_NORMAL: - return sWorld.getRate(RATE_CREATURE_NORMAL_DAMAGE); + return sWorld->getRate(RATE_CREATURE_NORMAL_DAMAGE); case CREATURE_ELITE_ELITE: - return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE); case CREATURE_ELITE_RAREELITE: - return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_DAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_RAREELITE_DAMAGE); case CREATURE_ELITE_WORLDBOSS: - return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE); case CREATURE_ELITE_RARE: - return sWorld.getRate(RATE_CREATURE_ELITE_RARE_DAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_RARE_DAMAGE); default: - return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_DAMAGE); } } @@ -1224,17 +1224,17 @@ float Creature::GetSpellDamageMod(int32 Rank) switch (Rank) // define rates for each elite rank { case CREATURE_ELITE_NORMAL: - return sWorld.getRate(RATE_CREATURE_NORMAL_SPELLDAMAGE); + return sWorld->getRate(RATE_CREATURE_NORMAL_SPELLDAMAGE); case CREATURE_ELITE_ELITE: - return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE); case CREATURE_ELITE_RAREELITE: - return sWorld.getRate(RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE); case CREATURE_ELITE_WORLDBOSS: - return sWorld.getRate(RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE); case CREATURE_ELITE_RARE: - return sWorld.getRate(RATE_CREATURE_ELITE_RARE_SPELLDAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_RARE_SPELLDAMAGE); default: - return sWorld.getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE); + return sWorld->getRate(RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE); } } @@ -1251,7 +1251,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3 CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry); if (!cinfo) { - sLog.outErrorDb("Creature entry %u does not exist.", Entry); + sLog->outErrorDb("Creature entry %u does not exist.", Entry); return false; } @@ -1277,7 +1277,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) if (!data) { - sLog.outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ",guid); + sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ",guid); return false; } @@ -1392,7 +1392,7 @@ void Creature::DeleteFromDB() { if (!m_DBTableGuid) { - sLog.outDebug("Trying to delete not saved creature!"); + sLog->outDebug("Trying to delete not saved creature!"); return; } @@ -1436,7 +1436,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const if (who->isInCombat()) if (Unit *victim = who->getAttackerForHelper()) - if (IsWithinDistInMap(victim, sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))) + if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))) force = true; if (!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance))) @@ -1451,7 +1451,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const float Creature::GetAttackDistance(Unit const* pl) const { - float aggroRate = sWorld.getRate(RATE_CREATURE_AGGRO); + float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO); if (aggroRate == 0) return 0.0f; @@ -1471,7 +1471,7 @@ float Creature::GetAttackDistance(Unit const* pl) const // radius grow if playlevel < creaturelevel RetDistance -= (float)leveldif; - if (creaturelevel+5 <= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (creaturelevel+5 <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { // detect range auras RetDistance += GetTotalAuraModifier(SPELL_AURA_MOD_DETECT_RANGE); @@ -1495,7 +1495,7 @@ void Creature::setDeathState(DeathState s) m_respawnTime = time(NULL) + m_respawnDelay + m_corpseDelay; // always save boss respawn time at death to prevent crash cheating - if (sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss()) + if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss()) SaveRespawnTime(); } Unit::setDeathState(s); @@ -1589,7 +1589,7 @@ void Creature::Respawn(bool force) if (m_DBTableGuid) sObjectMgr->RemoveCreatureRespawnTime(m_DBTableGuid, GetInstanceId()); - sLog.outStaticDebug("Respawning..."); + sLog->outStaticDebug("Respawning..."); m_respawnTime = 0; lootForPickPocketed = false; lootForBody = false; @@ -1687,7 +1687,7 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim) SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i]); if (!spellInfo) { - sLog.outError("WORLD: unknown spell id %i", m_spells[i]); + sLog->outError("WORLD: unknown spell id %i", m_spells[i]); continue; } @@ -1737,7 +1737,7 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim) SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_spells[i]); if (!spellInfo) { - sLog.outError("WORLD: unknown spell id %i", m_spells[i]); + sLog->outError("WORLD: unknown spell id %i", m_spells[i]); continue; } @@ -1809,7 +1809,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const Unit *target = NULL; if (dist > ATTACK_DISTANCE) - sLog.outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.",GetGUIDLow(),GetEntry()); + sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.",GetGUIDLow(),GetEntry()); { Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist); @@ -1834,7 +1834,7 @@ void Creature::SendAIReaction(AiReaction reactionType) ((WorldObject*)this)->SendMessageToSet(&data, true); - sLog.outDebug("WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType); + sLog->outDebug("WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType); } void Creature::CallAssistance() @@ -1843,7 +1843,7 @@ void Creature::CallAssistance() { SetNoCallAssistance(true); - float radius = sWorld.getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS); + float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS); if (radius > 0) { @@ -1872,7 +1872,7 @@ void Creature::CallAssistance() e->AddAssistant((*assistList.begin())->GetGUID()); assistList.pop_front(); } - m_Events.AddEvent(e, m_Events.CalculateTime(sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY))); + m_Events.AddEvent(e, m_Events.CalculateTime(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY))); } } } @@ -1992,7 +1992,7 @@ bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const return true; //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. - float dist = std::max(GetAttackDistance(pVictim), sWorld.getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance; + float dist = std::max(GetAttackDistance(pVictim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance; if (Unit *unit = GetCharmerOrOwner()) return pVictim->IsWithinDist(unit, dist); @@ -2065,7 +2065,7 @@ bool Creature::LoadCreaturesAddon(bool reload) SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(cAura->spell_id); if (!AdditionalSpellInfo) { - sLog.outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id); + sLog->outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id); continue; } @@ -2073,13 +2073,13 @@ bool Creature::LoadCreaturesAddon(bool reload) if (HasAura(cAura->spell_id)) { if (!reload) - sLog.outErrorDb("Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id); + sLog->outErrorDb("Creature (GUID: %u Entry: %u) has duplicate aura (spell %u) in `auras` field.",GetGUIDLow(),GetEntry(),cAura->spell_id); continue; } AddAura(AdditionalSpellInfo, cAura->effectMask, this); - sLog.outDebug("Spell: %u with AuraEffectMask %u added to creature (GUID: %u Entry: %u)", cAura->spell_id, cAura->effectMask,GetGUIDLow(),GetEntry()); + sLog->outDebug("Spell: %u with AuraEffectMask %u added to creature (GUID: %u Entry: %u)", cAura->spell_id, cAura->effectMask,GetGUIDLow(),GetEntry()); } } return true; @@ -2092,14 +2092,14 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker) WorldPacket data(SMSG_ZONE_UNDER_ATTACK,4); data << (uint32)GetAreaId(); - sWorld.SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE)); + sWorld->SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE)); } void Creature::SetInCombatWithZone() { if (!CanHaveThreatList()) { - sLog.outError("Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry()); + sLog->outError("Creature entry %u call SetInCombatWithZone but creature cannot have threat list.", GetEntry()); return; } @@ -2107,7 +2107,7 @@ void Creature::SetInCombatWithZone() if (!pMap->IsDungeon()) { - sLog.outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), pMap->GetId()); + sLog->outError("Creature entry %u call SetInCombatWithZone for map (id: %u) that isn't an instance.", GetEntry(), pMap->GetId()); return; } @@ -2238,7 +2238,7 @@ void Creature::AllLootRemovedFromCorpse() float decayRate; CreatureInfo const *cinfo = GetCreatureInfo(); - decayRate = sWorld.getRate(RATE_CORPSE_DECAY_LOOTED); + decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED); uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate); m_respawnTime -= diff; @@ -2256,7 +2256,7 @@ uint8 Creature::getLevelForTarget(WorldObject const* target) const if (!isWorldBoss() || !target->ToUnit()) return Unit::getLevelForTarget(target); - uint16 level = target->ToUnit()->getLevel() + sWorld.getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF); + uint16 level = target->ToUnit()->getLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF); if (level < 1) return 1; if (level > 255) diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 349dc09409f..c03fc0381e5 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -37,13 +37,13 @@ void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member) //Add member to an existing group if (itr != map->CreatureGroupHolder.end()) { - sLog.outDebug("Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId()); + sLog->outDebug("Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId()); itr->second->AddMember(member); } //Create new group else { - sLog.outDebug("Group not found: %u. Creating new group.", groupId); + sLog->outDebug("Group not found: %u. Creating new group.", groupId); CreatureGroup* group = new CreatureGroup(groupId); map->CreatureGroupHolder[groupId] = group; group->AddMember(member); @@ -52,7 +52,7 @@ void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member) void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *group, Creature *member) { - sLog.outDebug("Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); + sLog->outDebug("Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); group->RemoveMember(member); if (group->isEmpty()) @@ -61,7 +61,7 @@ void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *group, Creatur if (!map) return; - sLog.outDebug("Deleting group with InstanceID %u", member->GetInstanceId()); + sLog->outDebug("Deleting group with InstanceID %u", member->GetInstanceId()); map->CreatureGroupHolder.erase(group->GetId()); delete group; } @@ -80,8 +80,8 @@ void CreatureGroupManager::LoadCreatureFormations() if (!result) { - sLog.outErrorDb(">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); + sLog->outString(); return; } @@ -129,14 +129,14 @@ void CreatureGroupManager::LoadCreatureFormations() { if (guidSet.find(group_member->leaderGUID) == guidSet.end()) { - sLog.outErrorDb("creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID); + sLog->outErrorDb("creature_formations table leader guid %u incorrect (not exist)", group_member->leaderGUID); delete group_member; continue; } if (guidSet.find(memberGUID) == guidSet.end()) { - sLog.outErrorDb("creature_formations table member guid %u incorrect (not exist)", memberGUID); + sLog->outErrorDb("creature_formations table member guid %u incorrect (not exist)", memberGUID); delete group_member; continue; } @@ -147,18 +147,18 @@ void CreatureGroupManager::LoadCreatureFormations() } while (result->NextRow()) ; - sLog.outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void CreatureGroup::AddMember(Creature *member) { - sLog.outDebug("CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); + sLog->outDebug("CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); //Check if it is a leader if (member->GetDBTableGUIDLow() == m_groupID) { - sLog.outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); + sLog->outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); m_leader = member; } @@ -187,7 +187,7 @@ void CreatureGroup::MemberAttackStart(Creature *member, Unit *target) for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { if (m_leader) // avoid crash if leader was killed and reset. - sLog.outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); + sLog->outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); //Skip one check if (itr->first == member) @@ -214,7 +214,7 @@ void CreatureGroup::FormationReset(bool dismiss) itr->first->GetMotionMaster()->Initialize(); else itr->first->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE); - sLog.outDebug("Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow()); + sLog->outDebug("Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow()); } } m_Formed = !dismiss; diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index 167a2820e52..ff313cf76b1 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -40,7 +40,7 @@ class CreatureGroupManager void LoadCreatureFormations(); }; -#define formation_mgr (*ACE_Singleton::instance()) +#define sFormationMgr ACE_Singleton::instance() typedef UNORDERED_MAP CreatureGroupInfoType; @@ -59,7 +59,7 @@ class CreatureGroup public: //Group cannot be created empty explicit CreatureGroup(uint32 id) : m_leader(NULL), m_groupID(id), m_Formed(false) {} - ~CreatureGroup() { sLog.outDebug("Destroying group"); } + ~CreatureGroup() { sLog->outDebug("Destroying group"); } Creature* getLeader() const { return m_leader; } uint32 GetId() const { return m_groupID; } diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index e1463580495..2d07e0b1fe9 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -198,7 +198,7 @@ void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags data << locName; pSession->SendPacket(&data); - //sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI"); + //sLog->outDebug("WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendPointOfInterest(uint32 poi_id) @@ -206,7 +206,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id) PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(poi_id); if (!poi) { - sLog.outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id); + sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id); return; } @@ -226,7 +226,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id) data << icon_name; pSession->SendPacket(&data); - //sLog.outDebug("WORLD: Sent SMSG_GOSSIP_POI"); + //sLog->outDebug("WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendTalking(uint32 textID) @@ -297,7 +297,7 @@ void PlayerMenu::SendTalking(uint32 textID) } pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); + sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); } void PlayerMenu::SendTalking(char const * title, char const * text) @@ -320,7 +320,7 @@ void PlayerMenu::SendTalking(char const * title, char const * text) pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); + sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); } /*********************************************************/ @@ -406,7 +406,7 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title data.put(count_pos, count); pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); } void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) @@ -416,7 +416,7 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) data << uint8(questStatus); pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); } void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, bool ActivateAccept) @@ -497,7 +497,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, } data << uint32(pQuest->GetRewOrReqMoney()); - data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST)); + data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld->getRate(RATE_XP_QUEST)); } // rewarded honor points. Multiply with 10 to satisfy client @@ -527,7 +527,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, } pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); } void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest) @@ -667,7 +667,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest) data << ObjectiveText[iI]; pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId()); + sLog->outDebug("WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId()); } void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, bool EnableNext) @@ -741,7 +741,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, } data << uint32(pQuest->GetRewOrReqMoney()); - data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld.getRate(RATE_XP_QUEST)); + data << uint32(pQuest->XPValue(pSession->GetPlayer())*sWorld->getRate(RATE_XP_QUEST)); // rewarded honor points. Multiply with 10 to satisfy client data << 10 * Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorMultiplier()); @@ -764,7 +764,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, data << uint32(pQuest->RewRepValue[i]); pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); } void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel) @@ -844,5 +844,5 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID, data << uint32(0x10); pSession->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); } diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index af15bcd50b7..50184673051 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("Temporary summoned creature (entry: %u) have unknown type %u of ",GetEntry(),m_type); break; } } @@ -253,7 +253,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("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 f0e3f191bfe..8d7f30dbdd6 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -45,7 +45,7 @@ void DynamicObject::AddToWorld() ///- Register the dynamicObject for guid lookup if (!IsInWorld()) { - sObjectAccessor.AddObject(this); + sObjectAccessor->AddObject(this); WorldObject::AddToWorld(); } } @@ -64,11 +64,11 @@ void DynamicObject::RemoveFromWorld() } else { - sLog.outCrash("DynamicObject::RemoveFromWorld cannot find viewpoint owner"); + sLog->outCrash("DynamicObject::RemoveFromWorld cannot find viewpoint owner"); } } WorldObject::RemoveFromWorld(); - sObjectAccessor.RemoveObject(this); + sObjectAccessor->RemoveObject(this); } } @@ -78,7 +78,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit *caster, uint32 spellId, const P 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("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 554c165513b..503d017281f 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -112,7 +112,7 @@ void GameObject::CleanupsBeforeDelete(bool /*finalCleanup*/) else if (IS_PET_GUID(owner_guid)) ownerType = "pet"; - sLog.outError("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->outError("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()->id, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), GUID_LOPART(owner_guid), ownerType); } } @@ -127,7 +127,7 @@ void GameObject::AddToWorld() if (m_zoneScript) m_zoneScript->OnGameObjectCreate(this); - sObjectAccessor.AddObject(this); + sObjectAccessor->AddObject(this); WorldObject::AddToWorld(); } } @@ -146,10 +146,10 @@ void GameObject::RemoveFromWorld() if (Unit * owner = GetOwner()) owner->RemoveGameObject(this,false); else - sLog.outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid)); + sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->id,GUID_LOPART(owner_guid)); } WorldObject::RemoveFromWorld(); - sObjectAccessor.RemoveObject(this); + sObjectAccessor->RemoveObject(this); } } @@ -161,7 +161,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("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y); return false; } @@ -178,7 +178,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(name_id); if (!goinfo) { - sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); + sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); return false; } @@ -188,7 +188,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: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type); + sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type); return false; } @@ -257,7 +257,7 @@ void GameObject::Update(uint32 diff) if(!AI()) { if (!AIM_Initialize()) - sLog.outError("Could not initialize GameObjectAI"); + sLog->outError("Could not initialize GameObjectAI"); } else AI()->UpdateAI(diff); @@ -560,7 +560,7 @@ void GameObject::Update(uint32 diff) m_respawnTime = time(NULL) + m_respawnDelayTime; // if option not set then object will be saved at grid unload - if (sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) + if (sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) SaveRespawnTime(); UpdateObjectVisibility(); @@ -627,7 +627,7 @@ void GameObject::SaveToDB() GameObjectData const *data = sObjectMgr->GetGOData(m_DBTableGuid); if (!data) { - sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!"); + sLog->outError("GameObject::SaveToDB failed, cannot get gameobject data!"); return; } @@ -696,7 +696,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) if (!data) { - sLog.outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid); + sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid); return false; } @@ -1161,7 +1161,7 @@ void GameObject::Use(Unit* user) if (info->goober.eventId) { - sLog.outDebug("Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); + sLog->outDebug("Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this); EventInform(info->goober.eventId); } @@ -1245,7 +1245,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->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.",subzone); int32 skill = player->GetSkillValue(SKILL_FISHING); @@ -1261,7 +1261,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->outStaticDebug("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) @@ -1548,7 +1548,7 @@ void GameObject::Use(Unit* user) return; } default: - sLog.outDebug("Unknown Object Type %u", GetGoType()); + sLog->outDebug("Unknown Object Type %u", GetGoType()); break; } @@ -1559,9 +1559,9 @@ void GameObject::Use(Unit* user) if (!spellInfo) { if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell((Player*)user,spellId,this)) - sLog.outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType()); + sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType()); else - sLog.outDebug("WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); + sLog->outDebug("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 635f6294c9f..94f1a91311e 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->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.", 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 ee4b8a7885e..ff9f8fd2174 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -37,7 +37,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->outErrorDb("Item set %u for item (id %u) not found, mods not applied.",setid,proto->ItemId); return; } @@ -98,7 +98,7 @@ void AddItemsSetItem(Player*player,Item *item) SpellEntry const *spellInfo = sSpellStore.LookupEntry(set->spells[x]); if (!spellInfo) { - sLog.outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x],setid); + sLog->outError("WORLD: unknown spell id %u in items set %u effects", set->spells[x],setid); break; } @@ -119,7 +119,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto) if (!set) { - sLog.outErrorDb("Item set #%u for item #%u not found, mods not removed.",setid,proto->ItemId); + sLog->outErrorDb("Item set #%u for item #%u not found, mods not removed.",setid,proto->ItemId); return; } @@ -286,7 +286,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff) if (!GetUInt32Value(ITEM_FIELD_DURATION)) return; - sLog.outDebug("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff); + sLog->outDebug("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff); if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff) { @@ -566,7 +566,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->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0",itemProto->ItemId,itemProto->RandomProperty,itemProto->RandomSuffix); return 0; } @@ -577,7 +577,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->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'",randomPropId); return 0; } @@ -590,7 +590,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->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.",randomPropId); return 0; } @@ -680,7 +680,7 @@ void Item::AddToUpdateQueueOf(Player *player) if (player->GetGUID() != GetOwnerGUID()) { - sLog.outDebug("Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); + sLog->outDebug("Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); return; } @@ -700,7 +700,7 @@ void Item::RemoveFromUpdateQueueOf(Player *player) if (player->GetGUID() != GetOwnerGUID()) { - sLog.outDebug("Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); + sLog->outDebug("Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); return; } diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index fb815e63f8a..b21dec552c9 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -69,13 +69,13 @@ void LoadRandomEnchantmentsTable() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } else { - sLog.outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); + sLog->outString(); } } @@ -90,7 +90,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->outErrorDb("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 6e75114b003..c184142d23b 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -86,7 +86,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->outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry()); ASSERT(false); } ResetMap(); @@ -97,18 +97,18 @@ Object::~Object() { if (IsInWorld()) { - sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry()); + sLog->outCrash("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->outCrash("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->outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry()); ASSERT(false); - sObjectAccessor.RemoveUpdateObject(this); + sObjectAccessor->RemoveUpdateObject(this); } delete [] m_uint32Values; @@ -211,7 +211,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) c } } - //sLog.outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2); + //sLog->outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2); ByteBuffer buf(500); buf << (uint8)updatetype; @@ -635,7 +635,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask // FG: pretend that OTHER players in own group are friendly ("blue") else if (index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE) { - if (((Unit*)this)->IsControlledByPlayer() && target != this && sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && ((Unit*)this)->IsInRaidWith(target)) + if (((Unit*)this)->IsControlledByPlayer() && target != this && sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && ((Unit*)this)->IsInRaidWith(target)) { FactionTemplateEntry const *ft1, *ft2; ft1 = ((Unit*)this)->getFactionTemplateEntry(); @@ -741,7 +741,7 @@ void Object::ClearUpdateMask(bool remove) if (m_objectUpdated) { if (remove) - sObjectAccessor.RemoveUpdateObject(this); + sObjectAccessor->RemoveUpdateObject(this); m_objectUpdated = false; } } @@ -824,7 +824,7 @@ void Object::SetInt32Value(uint16 index, int32 value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -843,7 +843,7 @@ void Object::SetUInt32Value(uint16 index, uint32 value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -869,7 +869,7 @@ void Object::SetUInt64Value(uint16 index, const uint64 &value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -888,7 +888,7 @@ bool Object::AddUInt64Value(uint16 index, const uint64 &value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -909,7 +909,7 @@ bool Object::RemoveUInt64Value(uint16 index, const uint64 &value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -930,7 +930,7 @@ void Object::SetFloatValue(uint16 index, float value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -943,7 +943,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value) if (offset > 4) { - sLog.outError("Object::SetByteValue: wrong offset %u", offset); + sLog->outError("Object::SetByteValue: wrong offset %u", offset); return; } @@ -956,7 +956,7 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -969,7 +969,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value) if (offset > 2) { - sLog.outError("Object::SetUInt16Value: wrong offset %u", offset); + sLog->outError("Object::SetUInt16Value: wrong offset %u", offset); return; } @@ -982,7 +982,7 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -1051,7 +1051,7 @@ void Object::SetFlag(uint16 index, uint32 newFlag) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -1074,7 +1074,7 @@ void Object::RemoveFlag(uint16 index, uint32 oldFlag) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -1087,7 +1087,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag) if (offset > 4) { - sLog.outError("Object::SetByteFlag: wrong offset %u", offset); + sLog->outError("Object::SetByteFlag: wrong offset %u", offset); return; } @@ -1099,7 +1099,7 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -1112,7 +1112,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag) if (offset > 4) { - sLog.outError("Object::RemoveByteFlag: wrong offset %u", offset); + sLog->outError("Object::RemoveByteFlag: wrong offset %u", offset); return; } @@ -1124,7 +1124,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -1133,7 +1133,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("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; @@ -1188,34 +1188,34 @@ ByteBuffer & operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const & 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->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()); if (flags & MOVEMENTFLAG_ONTRANSPORT) { - 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->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); if (flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT) - sLog.outString("time2: %u", t_time2); + sLog->outString("time2: %u", t_time2); } if ((flags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) { - sLog.outString("pitch: %f", pitch); + sLog->outString("pitch: %f", pitch); } - sLog.outString("fallTime: %u", fallTime); + sLog->outString("fallTime: %u", fallTime); if (flags & MOVEMENTFLAG_JUMPING) { - sLog.outString("j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed); + sLog->outString("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->outString("splineElevation: %f", splineElevation); } } @@ -1582,21 +1582,21 @@ void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGui { WorldPacket data(SMSG_MESSAGECHAT, 200); BuildMonsterChat(&data,CHAT_MSG_MONSTER_SAY,text,language,GetName(),TargetGuid); - SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true); + SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true); } void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid) { WorldPacket data(SMSG_MESSAGECHAT, 200); BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,GetName(),TargetGuid); - SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true); + SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true); } void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote) { WorldPacket data(SMSG_MESSAGECHAT, 200); BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid); - SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true); + SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true); } void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper) @@ -1861,7 +1861,7 @@ void Object::ForceValuesUpdateAtIndex(uint32 i) { if (!m_objectUpdated) { - sObjectAccessor.AddUpdateObject(this); + sObjectAccessor->AddUpdateObject(this); m_objectUpdated = true; } } @@ -1901,9 +1901,9 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid) Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid); Trinity::LocalizedPacketDo say_do(say_build); - Trinity::PlayerDistWorker > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do); + Trinity::PlayerDistWorker > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); + cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); } void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) @@ -1916,9 +1916,9 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); Trinity::LocalizedPacketDo say_do(say_build); - Trinity::PlayerDistWorker > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),say_do); + Trinity::PlayerDistWorker > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL)); + cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL)); } void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid) @@ -1944,9 +1944,9 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid); Trinity::LocalizedPacketDo say_do(say_build); - Trinity::PlayerDistWorker > say_worker(this,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do); + Trinity::PlayerDistWorker > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetMap(), *this, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); + cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); } void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper) @@ -2017,7 +2017,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->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()); ASSERT(false); } m_currMap = map; @@ -2052,7 +2052,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("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).",GetTypeId(),GetEntry(),GetGUIDLow(),GetMapId()); return; } @@ -2188,7 +2188,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("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; } @@ -2197,7 +2197,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("no such creature entry %u", entry); delete pet; return NULL; } @@ -2274,7 +2274,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry); if (!goinfo) { - sLog.outErrorDb("Gameobject template %u not found in database!", entry); + sLog->outErrorDb("Gameobject template %u not found in database!", entry); return NULL; } Map *map = GetMap(); @@ -2451,7 +2451,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float /* // if detection disabled, return first point - if (!sWorld.getIntConfig(CONFIG_DETECT_POS_COLLISION)) + if (!sWorld->getIntConfig(CONFIG_DETECT_POS_COLLISION)) { UpdateGroundPositionZ(x,y,z); // update to LOS height if available return; diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index d7a93ad1dce..41610502fc5 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -54,10 +54,10 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) c_stream.opaque = (voidpf)0; // default Z_BEST_SPEED (1) - int z_res = deflateInit(&c_stream, sWorld.getIntConfig(CONFIG_COMPRESSION)); + int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION)); if (z_res != Z_OK) { - sLog.outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res)); *dst_size = 0; return; } @@ -70,14 +70,14 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) z_res = deflate(&c_stream, Z_NO_FLUSH); if (z_res != Z_OK) { - sLog.outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res)); *dst_size = 0; return; } if (c_stream.avail_in != 0) { - sLog.outError("Can't compress update packet (zlib: deflate not greedy)"); + sLog->outError("Can't compress update packet (zlib: deflate not greedy)"); *dst_size = 0; return; } @@ -85,7 +85,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) z_res = deflate(&c_stream, Z_FINISH); if (z_res != Z_STREAM_END) { - sLog.outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res)); *dst_size = 0; return; } @@ -93,7 +93,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) z_res = deflateEnd(&c_stream); if (z_res != Z_OK) { - sLog.outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res)); *dst_size = 0; return; } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index aafe705f284..688893889bb 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -73,7 +73,7 @@ void Pet::AddToWorld() if (!IsInWorld()) { ///- Register the pet for guid lookup - sObjectAccessor.AddObject(this); + sObjectAccessor->AddObject(this); Unit::AddToWorld(); AIM_Initialize(); } @@ -97,7 +97,7 @@ void Pet::RemoveFromWorld() { ///- Don't call the function for Creature, normal mobs + totems go in a different storage Unit::RemoveFromWorld(); - sObjectAccessor.RemoveObject(this); + sObjectAccessor->RemoveObject(this); } } @@ -178,7 +178,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("Pet (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)", GetGUIDLow(), GetEntry(), GetPositionX(), GetPositionY()); return false; } @@ -224,7 +224,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("Pet have incorrect type (%u) for pet loading.", getPetType()); break; } @@ -308,7 +308,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c CleanupActionBar(); // remove unknown spells from action bar after load - sLog.outDebug("New Pet has guid %u", GetGUIDLow()); + sLog->outDebug("New Pet has guid %u", GetGUIDLow()); owner->PetSpellInitialize(); @@ -518,7 +518,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("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; } @@ -596,7 +596,7 @@ void Creature::Regenerate(Powers power) case POWER_FOCUS: { // For hunter pets. - addvalue = 24 * sWorld.getRate(RATE_POWER_FOCUS); + addvalue = 24 * sWorld->getRate(RATE_POWER_FOCUS); break; } case POWER_ENERGY: @@ -696,7 +696,7 @@ void Pet::GivePetXP(uint32 xp) if (!isAlive()) return; - uint8 maxlevel = std::min((uint8)sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->getLevel()); + uint8 maxlevel = std::min((uint8)sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->getLevel()); uint8 petlevel = getLevel(); // If pet is detected to be at, or above(?) the players level, don't hand out XP @@ -749,7 +749,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("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; } @@ -757,14 +757,14 @@ bool Pet::CreateBaseAtCreature(Creature* creature) CreatureInfo const *cinfo = GetCreatureInfo(); if (!cinfo) { - sLog.outError("CreateBaseAtCreature() failed, creatureInfo is missing!"); + sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!"); return false; } SetDisplayId(creature->GetDisplayId()); if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]); + SetName(cFamily->Name[sWorld->GetDefaultDbcLocale()]); else SetName(creature->GetNameForLocaleIdx(sObjectMgr->GetDBCLocaleIndex())); @@ -777,7 +777,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner) return false; if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]); + SetName(cFamily->Name[sWorld->GetDefaultDbcLocale()]); Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation()); @@ -786,7 +786,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner) bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseMask) { - sLog.outDebug("Pet::CreateBaseForTamed"); + sLog->outDebug("Pet::CreateBaseForTamed"); uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET); uint32 pet_number = sObjectMgr->GeneratePetNumber(); if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number)) @@ -832,7 +832,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("Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass()); } uint32 creature_ID = (petType == HUNTER_PET) ? 1 : cinfo->Entry; @@ -1112,7 +1112,7 @@ void Pet::_LoadSpellCooldowns() if (!sSpellStore.LookupEntry(spell_id)) { - sLog.outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.",m_charmInfo->GetPetNumber(),spell_id); + sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.",m_charmInfo->GetPetNumber(),spell_id); continue; } @@ -1125,7 +1125,7 @@ void Pet::_LoadSpellCooldowns() _AddCreatureSpellCooldown(spell_id,db_time); - sLog.outDebug("Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); + sLog->outDebug("Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); } while (result->NextRow()); @@ -1201,7 +1201,7 @@ void Pet::_SaveSpells(SQLTransaction& trans) void Pet::_LoadAuras(uint32 timediff) { - sLog.outDebug("Loading auras for pet %u",GetGUIDLow()); + sLog->outDebug("Loading auras for pet %u",GetGUIDLow()); QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber()); @@ -1230,7 +1230,7 @@ void Pet::_LoadAuras(uint32 timediff) SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid); if (!spellproto) { - sLog.outError("Unknown aura (spellid %u), ignore.",spellid); + sLog->outError("Unknown aura (spellid %u), ignore.",spellid); continue; } @@ -1261,7 +1261,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", spellproto->Id, effmask); + sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask); } } while (result->NextRow()); @@ -1317,11 +1317,11 @@ bool Pet::addSpell(uint32 spell_id,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`.",spell_id); + sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.",spell_id); CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE spell = '%u'",spell_id); } else - sLog.outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); + sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); return false; } @@ -1770,7 +1770,7 @@ void Pet::InitTalentForLevel() uint32 Pet::resetTalentsCost() const { - int64 days = int64(sWorld.GetGameTime() - m_resetTalentsTime)/DAY; + int64 days = int64(sWorld->GetGameTime() - m_resetTalentsTime)/DAY; // The first time reset costs 10 silver; after 1 day cost is reset to 10 silver if (m_resetTalentsCost < 10*SILVER || days > 0) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index afdadc347be..4404ea15bc2 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -433,7 +433,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa m_areaUpdateId = 0; - m_nextSave = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE); + m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); clearResurrectRequestData(); @@ -602,7 +602,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa m_ControlledByPlayer = true; m_isWorldObject = true; - sWorld.IncreasePlayerCount(); + sWorld->IncreasePlayerCount(); m_ChampioningFaction = 0; @@ -650,7 +650,7 @@ Player::~Player () delete m_declinedname; delete m_runes; - sWorld.DecreasePlayerCount(); + sWorld->DecreasePlayerCount(); } void Player::CleanupsBeforeDelete(bool finalCleanup) @@ -680,7 +680,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c PlayerInfo const* info = sObjectMgr->GetPlayerInfo(race, class_); if (!info) { - sLog.outError("Player have incorrect race/class pair. Can't be loaded."); + sLog->outError("Player have incorrect race/class pair. Can't be loaded."); return false; } @@ -692,7 +692,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(class_); if (!cEntry) { - sLog.outError("Class %u not found in DBC (Wrong DBC files?)",class_); + sLog->outError("Class %u not found in DBC (Wrong DBC files?)",class_); return false; } @@ -709,7 +709,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c SetUInt32Value(UNIT_FIELD_BYTES_0, (RaceClassGender | (powertype << 24))); InitDisplayIds(); - if (sWorld.getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld.getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP) + if (sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP) { SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); @@ -741,12 +741,12 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c // set starting level uint32 start_level = getClass() != CLASS_DEATH_KNIGHT - ? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL) - : sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); + ? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL) + : sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); if (GetSession()->GetSecurity() >= SEC_MODERATOR) { - uint32 gm_level = sWorld.getIntConfig(CONFIG_START_GM_LEVEL); + uint32 gm_level = sWorld->getIntConfig(CONFIG_START_GM_LEVEL); if (gm_level > start_level) start_level = gm_level; } @@ -755,19 +755,19 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c InitRunes(); - SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld.getIntConfig(CONFIG_START_PLAYER_MONEY)); - SetHonorPoints(sWorld.getIntConfig(CONFIG_START_HONOR_POINTS)); - SetArenaPoints(sWorld.getIntConfig(CONFIG_START_ARENA_POINTS)); + SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY)); + SetHonorPoints(sWorld->getIntConfig(CONFIG_START_HONOR_POINTS)); + SetArenaPoints(sWorld->getIntConfig(CONFIG_START_ARENA_POINTS)); // start with every map explored - if (sWorld.getBoolConfig(CONFIG_START_ALL_EXPLORED)) + if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED)) { for (uint8 i=0; igetBoolConfig(CONFIG_START_ALL_REP)) { GetReputationMgr().SetReputation(sFactionStore.LookupEntry(942),42999); GetReputationMgr().SetReputation(sFactionStore.LookupEntry(935),42999); @@ -938,7 +938,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount) { - sLog.outDebug("STORAGE: Creating initial item, itemId = %u, count = %u",titem_id, titem_amount); + sLog->outDebug("STORAGE: Creating initial item, itemId = %u, count = %u",titem_id, titem_amount); // attempt equip by one while (titem_amount > 0) @@ -967,7 +967,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("STORAGE: Can't equip or store initial item %u for race %u class %u , error msg = %u",titem_id,getRace(),getClass(),msg); return false; } @@ -1028,7 +1028,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->outStaticDebug("We are fall to death, loosing 10 percents durability"); DurabilityLossAll(0.10f,false); // durability lost message WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0); @@ -1049,7 +1049,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer) return MINUTE * IN_MILLISECONDS; case BREATH_TIMER: { - if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld.getIntConfig(CONFIG_DISABLE_BREATHING))) + if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_DISABLE_BREATHING))) return DISABLED_MIRROR_TIMER; int32 UnderWaterTime = 3 * MINUTE * IN_MILLISECONDS; AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING); @@ -1271,9 +1271,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->outCrash("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->outCrash("Player has m_spellModTakingSpell %u during update!", m_spellModTakingSpell->m_spellInfo->Id); m_spellModTakingSpell = NULL; } @@ -1408,7 +1408,7 @@ void Player::Update(uint32 p_time) time_t time_inn = time(NULL)-GetTimeInnEnter(); if (time_inn >= 10) // freeze update { - float bubble = 0.125f*sWorld.getRate(RATE_REST_INGAME); + float bubble = 0.125f*sWorld->getRate(RATE_REST_INGAME); // speed collect rest bonus (section/in hour) SetRestBonus(GetRestBonus()+ time_inn*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble); UpdateInnerTime(time(NULL)); @@ -1470,7 +1470,7 @@ void Player::Update(uint32 p_time) { // m_nextSave reseted in SaveToDB call SaveToDB(); - sLog.outDetail("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow()); + sLog->outDetail("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow()); } else m_nextSave -= p_time; @@ -1536,7 +1536,7 @@ void Player::setDeathState(DeathState s) { if (!cur) { - sLog.outError("setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow()); + sLog->outError("setDeathState: attempt to kill a dead player %s(%d)", GetName(), GetGUIDLow()); return; } @@ -1598,7 +1598,7 @@ bool Player::BuildEnumData(QueryResult result, WorldPacket * p_data) PlayerInfo const *info = sObjectMgr->GetPlayerInfo(pRace, pClass); if (!info) { - sLog.outError("Player %u has incorrect race/class pair. Don't build enum.", guid); + sLog->outError("Player %u has incorrect race/class pair. Don't build enum.", guid); return false; } @@ -1640,7 +1640,7 @@ bool Player::BuildEnumData(QueryResult result, WorldPacket * p_data) char_flags |= CHARACTER_FLAG_RENAME; if (fields[20].GetUInt32()) char_flags |= CHARACTER_FLAG_LOCKED_BY_BILLING; - if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED)) + if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED)) { if (!fields[21].GetString().empty()) char_flags |= CHARACTER_FLAG_DECLINED; @@ -1808,7 +1808,7 @@ void Player::TeleportOutOfMap(Map *oldMap) if (GetMap() == oldMap) { - sLog.outCrash("Cannot teleport player out of map!"); + sLog->outCrash("Cannot teleport player out of map!"); ResetMap(); ASSERT(false); } @@ -1818,13 +1818,13 @@ 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 absent instance template.", mapid); + sLog->outError("TeleportTo: invalid map %d or absent instance template.", mapid); return false; } if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, mapid, this)) { - sLog.outError("Player %s tried to enter a forbidden map %u", GetName(), mapid); + sLog->outError("Player %s tried to enter a forbidden map %u", GetName(), mapid); SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED); return false; } @@ -1842,7 +1842,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // client without expansion support if (GetSession()->Expansion() < mEntry->Expansion()) { - sLog.outDebug("Player %s using client without required expansion tried teleport to non accessible map %u", GetName(), mapid); + sLog->outDebug("Player %s using client without required expansion tried teleport to non accessible map %u", GetName(), mapid); if (GetTransport()) { @@ -1859,7 +1859,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati return false; // normal client can't teleport to this map... } else - sLog.outDebug("Player %s is being teleported to map %u", GetName(), mapid); + sLog->outDebug("Player %s is being teleported to map %u", GetName(), mapid); // reset movement flags at teleport, because player will continue move with these flags after teleport SetUnitMovementFlags(0); @@ -2162,7 +2162,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->outCrash("Player %s has viewpoint %u %u when removed from world", GetName(), viewpoint->GetEntry(), viewpoint->GetTypeId()); SetViewpoint(viewpoint, false); } } @@ -2223,10 +2223,10 @@ void Player::Regenerate(Powers power) case POWER_MANA: { bool recentCast = IsUnderLastManaUseEffect(); - float ManaIncreaseRate = sWorld.getRate(RATE_POWER_MANA); + float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA); if (getLevel() < 15) - ManaIncreaseRate = sWorld.getRate(RATE_POWER_MANA) * (2.066f - (getLevel() * 0.066f)); + ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA) * (2.066f - (getLevel() * 0.066f)); if (recentCast) // Trinity Updates Mana in intervals of 2s, which is correct addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * 0.001f * m_regenTimer; @@ -2237,18 +2237,18 @@ void Player::Regenerate(Powers power) { if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN)) { - float RageDecreaseRate = sWorld.getRate(RATE_POWER_RAGE_LOSS); + float RageDecreaseRate = sWorld->getRate(RATE_POWER_RAGE_LOSS); addvalue += -20 * RageDecreaseRate; // 2 rage by tick (= 2 seconds => 1 rage/sec) } } break; case POWER_ENERGY: // Regenerate energy (rogue) - addvalue += 0.01f * m_regenTimer * sWorld.getRate(RATE_POWER_ENERGY); + addvalue += 0.01f * m_regenTimer * sWorld->getRate(RATE_POWER_ENERGY); break; case POWER_RUNIC_POWER: { if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN)) { - float RunicPowerDecreaseRate = sWorld.getRate(RATE_POWER_RUNICPOWER_LOSS); + float RunicPowerDecreaseRate = sWorld->getRate(RATE_POWER_RUNICPOWER_LOSS); addvalue += -30 * RunicPowerDecreaseRate; // 3 RunicPower by tick } } break; @@ -2329,10 +2329,10 @@ void Player::RegenerateHealth() if (curValue >= maxValue) return; - float HealthIncreaseRate = sWorld.getRate(RATE_HEALTH); + float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH); if (getLevel() < 15) - HealthIncreaseRate = sWorld.getRate(RATE_HEALTH) * (2.066f - (getLevel() * 0.066f)); + HealthIncreaseRate = sWorld->getRate(RATE_HEALTH) * (2.066f - (getLevel() * 0.066f)); float addvalue = 0.0f; @@ -2475,7 +2475,7 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes if (go->IsWithinDistInMap(this, maxdist)) return go; - sLog.outDebug("IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name, + sLog->outDebug("IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name, go->GetGUIDLow(), GetName(), GetGUIDLow(), go->GetDistance(this)); } } @@ -2554,7 +2554,7 @@ void Player::SetGameMaster(bool on) } // restore FFA PvP Server state - if (sWorld.IsFFAPvPRealm()) + if (sWorld->IsFFAPvPRealm()) SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); // restore FFA PvP area state, remove not allowed for GM mounts @@ -2588,7 +2588,7 @@ void Player::SetGMVisible(bool on) bool Player::IsGroupVisibleFor(Player const* p) const { - switch(sWorld.getIntConfig(CONFIG_GROUP_VISIBILITY)) + switch(sWorld->getIntConfig(CONFIG_GROUP_VISIBILITY)) { default: return IsInSameGroupWith(p); case 1: return IsInSameRaidWith(p); @@ -2688,7 +2688,7 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate) // Favored experience increase END // XP to money conversion processed in Player::RewardQuest - if (level >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) return; uint32 bonus_xp = 0; @@ -2706,11 +2706,11 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate) uint32 nextLvlXP = GetUInt32Value(PLAYER_NEXT_LEVEL_XP); uint32 newXP = curXP + xp + bonus_xp; - while (newXP >= nextLvlXP && level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + while (newXP >= nextLvlXP && level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { newXP -= nextLvlXP; - if (level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) GiveLevel(level + 1); level = getLevel(); @@ -2777,7 +2777,7 @@ void Player::GiveLevel(uint8 level) UpdateAllStats(); - if (sWorld.getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up + if (sWorld->getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up UpdateSkillsToMaxSkillsForLevel(); // set current level health and mana/energy to maximum after applying all mods. @@ -2821,7 +2821,7 @@ void Player::InitTalentForLevel() } else { - if (level < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL) || m_specsCount == 0) + if (level < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL) || m_specsCount == 0) { m_specsCount = 1; m_activeSpec = 0; @@ -2857,7 +2857,7 @@ void Player::InitStatsForLevel(bool reapplyMods) PlayerLevelInfo info; sObjectMgr->GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info); - SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); + SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(getLevel())); // reset before any aura state sources (health set/aura apply) @@ -3072,7 +3072,7 @@ void Player::SendInitialSpells() GetSession()->SendPacket(&data); - sLog.outDetail("CHARACTER: Sent Initial Spells"); + sLog->outDetail("CHARACTER: Sent Initial Spells"); } void Player::RemoveMail(uint32 id) @@ -3153,11 +3153,11 @@ bool Player::AddTalent(uint32 spell_id, 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`.",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.",spell_id); CharacterDatabase.PExecute("DELETE FROM character_talent WHERE spell = '%u'",spell_id); } else - sLog.outError("Player::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); return false; } @@ -3167,11 +3167,11 @@ bool Player::AddTalent(uint32 spell_id, 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`.",spell_id); + sLog->outError("Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.",spell_id); CharacterDatabase.PExecute("DELETE FROM character_talent WHERE spell = '%u'",spell_id); } else - sLog.outError("Player::addTalent: Broken spell #%u learning not allowed.",spell_id); + sLog->outError("Player::addTalent: Broken spell #%u learning not allowed.",spell_id); return false; } @@ -3216,11 +3216,11 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // 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`.",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.",spell_id); CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'",spell_id); } else - sLog.outError("Player::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); return false; } @@ -3230,11 +3230,11 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // 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`.",spell_id); + sLog->outError("Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.",spell_id); CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'",spell_id); } else - sLog.outError("Player::addSpell: Broken spell #%u learning not allowed.",spell_id); + sLog->outError("Player::addSpell: Broken spell #%u learning not allowed.",spell_id); return false; } @@ -3714,7 +3714,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) if (sSpellMgr->IsPrimaryProfessionFirstRankSpell(spell_id)) { uint32 freeProfs = GetFreePrimaryProfessionPoints()+1; - if (freeProfs <= sWorld.getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)) + if (freeProfs <= sWorld->getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)) SetFreePrimaryProfessions(freeProfs); } @@ -3847,7 +3847,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) if (spell_id == 674 && m_canDualWield) SetCanDualWield(false); - if (sWorld.getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN)) + if (sWorld->getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN)) AutoUnequipOffhandIfNeed(); // remove from spell book if not replaced by lesser rank @@ -3989,7 +3989,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) if (!sSpellStore.LookupEntry(spell_id)) { - sLog.outError("Player %u has unknown spell %u in `character_spell_cooldown`, skipping.", GetGUIDLow(), spell_id); + sLog->outError("Player %u has unknown spell %u in `character_spell_cooldown`, skipping.", GetGUIDLow(), spell_id); continue; } @@ -3999,7 +3999,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) AddSpellCooldown(spell_id, item_id, db_time); - sLog.outDebug("Player (GUID: %u) spell %u, item %u cooldown loaded (%u secs).", GetGUIDLow(), spell_id, item_id, uint32(db_time-curTime)); + sLog->outDebug("Player (GUID: %u) spell %u, item %u cooldown loaded (%u secs).", GetGUIDLow(), spell_id, item_id, uint32(db_time-curTime)); } while (result->NextRow()); } @@ -4055,7 +4055,7 @@ uint32 Player::resetTalentsCost() const return 10*GOLD; else { - uint64 months = (sWorld.GetGameTime() - m_resetTalentsTime)/MONTH; + uint64 months = (sWorld->GetGameTime() - m_resetTalentsTime)/MONTH; if (months > 0) { // This cost will be reduced by a rate of 5 gold per month @@ -4093,7 +4093,7 @@ bool Player::resetTalents(bool no_cost) uint32 cost = 0; - if (!no_cost && !sWorld.getBoolConfig(CONFIG_NO_RESET_TALENT_COST)) + if (!no_cost && !sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST)) { cost = resetTalentsCost(); @@ -4464,8 +4464,8 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC if (accountId == 0) updateRealmChars = false; - uint32 charDelete_method = sWorld.getIntConfig(CONFIG_CHARDELETE_METHOD); - uint32 charDelete_minLvl = sWorld.getIntConfig(CONFIG_CHARDELETE_MIN_LEVEL); + uint32 charDelete_method = sWorld->getIntConfig(CONFIG_CHARDELETE_METHOD); + uint32 charDelete_minLvl = sWorld->getIntConfig(CONFIG_CHARDELETE_MIN_LEVEL); // if we want to finally delete the character or the character does not meet the level requirement, // we set it to mode CHAR_DELETE_REMOVE @@ -4476,7 +4476,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // convert corpse to bones if exist (to prevent exiting Corpse in World without DB entry) // bones will be deleted by corpse/bones deleting thread shortly - sObjectAccessor.ConvertCorpseForPlayer(playerguid); + sObjectAccessor->ConvertCorpseForPlayer(playerguid); if (uint32 guildId = GetGuildIdFromDB(playerguid)) if (Guild* pGuild = sObjectMgr->GetGuildById(guildId)) @@ -4595,7 +4595,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC { do { - if (Player* pFriend = sObjectAccessor.FindPlayer(MAKE_NEW_GUID((*resultFriends)[0].GetUInt32(), 0, HIGHGUID_PLAYER))) + if (Player* pFriend = ObjectAccessor::FindPlayer(MAKE_NEW_GUID((*resultFriends)[0].GetUInt32(), 0, HIGHGUID_PLAYER))) { if (pFriend->IsInWorld()) { @@ -4648,11 +4648,11 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC CharacterDatabase.PExecute("UPDATE characters SET deleteInfos_Name=name, deleteInfos_Account=account, deleteDate='" UI64FMTD "', name='', account=0 WHERE guid=%u", uint64(time(NULL)), guid); break; default: - sLog.outError("Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method); + sLog->outError("Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method); } if (updateRealmChars) - sWorld.UpdateRealmCharCount(accountId); + sWorld->UpdateRealmCharCount(accountId); } /** @@ -4662,7 +4662,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC */ void Player::DeleteOldCharacters() { - uint32 keepDays = sWorld.getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); + uint32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); if (!keepDays) return; @@ -4678,12 +4678,12 @@ void Player::DeleteOldCharacters() */ void Player::DeleteOldCharacters(uint32 keepDays) { - sLog.outString("Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays); + sLog->outString("Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays); QueryResult resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '" UI64FMTD "'", uint64(time(NULL) - time_t(keepDays * DAY))); if (resultChars) { - sLog.outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete",resultChars->GetRowCount()); + sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete",resultChars->GetRowCount()); do { Field *charFields = resultChars->Fetch(); @@ -4702,7 +4702,7 @@ void Player::SetMovement(PlayerMovementType pType) case MOVE_WATER_WALK: data.Initialize(SMSG_MOVE_WATER_WALK, GetPackGUID().size()+4); break; case MOVE_LAND_WALK: data.Initialize(SMSG_MOVE_LAND_WALK, GetPackGUID().size()+4); break; default: - sLog.outError("Player::SetMovement: Unsupported move type (%d), data not sent to client.",pType); + sLog->outError("Player::SetMovement: Unsupported move type (%d), data not sent to client.",pType); return; } data.append(GetPackGUID()); @@ -4731,7 +4731,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("BuildPlayerRepop: player %s(%d) already has a corpse", GetName(), GetGUIDLow()); return; } @@ -4740,7 +4740,7 @@ void Player::BuildPlayerRepop() Corpse *corpse = GetCorpse(); if (!corpse) { - sLog.outError("Error creating corpse for Player %s [%u]", GetName(), GetGUIDLow()); + sLog->outError("Error creating corpse for Player %s [%u]", GetName(), GetGUIDLow()); return; } GetMap()->Add(corpse); @@ -4817,7 +4817,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) //Characters from level 11-19 will suffer from one minute of sickness //for each level they are above 10. //Characters level 20 and up suffer from ten minutes of sickness. - int32 startLevel = sWorld.getIntConfig(CONFIG_DEATH_SICKNESS_LEVEL); + int32 startLevel = sWorld->getIntConfig(CONFIG_DEATH_SICKNESS_LEVEL); if (int32(getLevel()) >= startLevel) { @@ -4861,7 +4861,7 @@ bool Player::FallGround(uint8 FallMode) // Below formula for falling damage is from Player::HandleFall if (FallMode == 2 && z_diff >= 14.57f) { - uint32 damage = std::min(GetMaxHealth(), (uint32)((0.018f*z_diff-0.2426f)*GetMaxHealth()*sWorld.getRate(RATE_DAMAGE_FALL))); + uint32 damage = std::min(GetMaxHealth(), (uint32)((0.018f*z_diff-0.2426f)*GetMaxHealth()*sWorld->getRate(RATE_DAMAGE_FALL))); if (damage > 0) EnvironmentalDamage(DAMAGE_FALL, damage); } else if (FallMode == 0) @@ -4961,19 +4961,19 @@ void Player::CreateCorpse() corpse->SaveToDB(); // register for player, but not show - sObjectAccessor.AddCorpse(corpse); + sObjectAccessor->AddCorpse(corpse); } void Player::SpawnCorpseBones() { - if (sObjectAccessor.ConvertCorpseForPlayer(GetGUID())) + if (sObjectAccessor->ConvertCorpseForPlayer(GetGUID())) if (!GetSession()->PlayerLogoutWithSave()) // at logout we will already store the player SaveToDB(); // prevent loading as ghost without corpse } Corpse* Player::GetCorpse() const { - return sObjectAccessor.GetCorpseForPlayerGUID(GetGUID()); + return sObjectAccessor->GetCorpseForPlayerGUID(GetGUID()); } void Player::DurabilityLossAll(double percent, bool inventory) @@ -5119,7 +5119,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("RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel); return TotalCost; } @@ -5127,14 +5127,14 @@ 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("RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId); return TotalCost; } uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class,ditemProto->SubClass)]; uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod)); - costs = uint32(costs * discountMod * sWorld.getRate(RATE_REPAIRCOST)); + costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST)); if (costs == 0) //fix for ITEM_QUALITY_ARTIFACT costs = 1; @@ -5143,7 +5143,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->outStaticDebug("You are not member of a guild"); return TotalCost; } @@ -5158,7 +5158,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g } else if (!HasEnoughMoney(costs)) { - sLog.outStaticDebug("You do not have enough money"); + sLog->outStaticDebug("You do not have enough money"); return TotalCost; } else @@ -5254,7 +5254,7 @@ void Player::CleanupChannels() cMgr->LeftChannel(ch->GetName()); // deleted channel if empty } - sLog.outDebug("Player: channels cleaned up!"); + sLog->outDebug("Player: channels cleaned up!"); } void Player::UpdateLocalChannels(uint32 newZone) @@ -5360,7 +5360,7 @@ void Player::LeaveLFGChannel() void Player::UpdateDefense() { - uint32 defense_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_DEFENSE); + uint32 defense_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_DEFENSE); if (UpdateSkill(SKILL_DEFENSE,defense_skill_gain)) { @@ -5373,7 +5373,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("ERROR in HandleBaseModValue(): non existed BaseModGroup of wrong BaseModType!"); return; } @@ -5406,7 +5406,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("trial to access non existed BaseModGroup or wrong BaseModType!"); return 0.0f; } @@ -5420,7 +5420,7 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const { if (modGroup >= BASEMOD_END) { - sLog.outError("wrong BaseModGroup in GetTotalBaseModValue()!"); + sLog->outError("wrong BaseModGroup in GetTotalBaseModValue()!"); return 0.0f; } @@ -5776,17 +5776,17 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step) inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLevel, uint32 YellowLevel) { if (SkillValue >= GrayLevel) - return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_GREY)*10; + return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_GREY)*10; if (SkillValue >= GreenLevel) - return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_GREEN)*10; + return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_GREEN)*10; if (SkillValue >= YellowLevel) - return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_YELLOW)*10; - return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_ORANGE)*10; + return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_YELLOW)*10; + return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_ORANGE)*10; } bool Player::UpdateCraftSkill(uint32 spellid) { - sLog.outDebug("UpdateCraftSkill spellid %d", spellid); + sLog->outDebug("UpdateCraftSkill spellid %d", spellid); SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellid); @@ -5804,7 +5804,7 @@ bool Player::UpdateCraftSkill(uint32 spellid) learnSpell(discoveredSpell, false); } - uint32 craft_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_CRAFTING); + uint32 craft_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING); return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue, _spell_idx->second->max_value, @@ -5818,9 +5818,9 @@ bool Player::UpdateCraftSkill(uint32 spellid) bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator) { - sLog.outDebug("UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); + sLog->outDebug("UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); - uint32 gathering_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_GATHERING); + uint32 gathering_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING); // For skinning and Mining chance decrease with level. 1-74 - no decrease, 75-149 - 2 times, 225-299 - 8 times switch (SkillId) @@ -5831,28 +5831,28 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve case SKILL_INSCRIPTION: return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); case SKILL_SKINNING: - if (sWorld.getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0) + if (sWorld->getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0) return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); else - return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain); + return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld->getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain); case SKILL_MINING: - if (sWorld.getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0) + if (sWorld->getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0) return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); else - return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain); + return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld->getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain); } return false; } bool Player::UpdateFishingSkill() { - sLog.outDebug("UpdateFishingSkill"); + sLog->outDebug("UpdateFishingSkill"); uint32 SkillValue = GetPureSkillValue(SKILL_FISHING); int32 chance = SkillValue < 75 ? 100 : 2500/(SkillValue-50); - uint32 gathering_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_GATHERING); + uint32 gathering_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING); return UpdateSkillPro(SKILL_FISHING,chance*10,gathering_skill_gain); } @@ -5864,13 +5864,13 @@ static uint32 bonusSkillLevels[] = {75,150,225,300,375,450}; bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) { - sLog.outDebug("UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance/10.0); + sLog->outDebug("UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance/10.0); if (!SkillId) return false; if (Chance <= 0) // speedup in 0 chance case { - sLog.outDebug("Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); + sLog->outDebug("Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); return false; } @@ -5908,11 +5908,11 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) } UpdateSkillEnchantments(SkillId, SkillValue, new_value); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,SkillId); - sLog.outDebug("Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0); + sLog->outDebug("Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0); return true; } - sLog.outDebug("Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); + sLog->outDebug("Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); return false; } @@ -5932,7 +5932,7 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType) if (pVictim && pVictim->GetTypeId() == TYPEID_UNIT && (pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN)) return; - uint32 weapon_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_WEAPON); + uint32 weapon_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_WEAPON); switch(attType) { @@ -6017,10 +6017,10 @@ void Player::ModifySkillBonus(uint32 skillid,int32 val, bool talent) void Player::UpdateSkillsForLevel() { - uint16 maxconfskill = sWorld.GetConfigMaxSkillValue(); + uint16 maxconfskill = sWorld->GetConfigMaxSkillValue(); uint32 maxSkill = GetMaxSkillValueForLevel(); - bool alwaysMaxSkill = sWorld.getBoolConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL); + bool alwaysMaxSkill = sWorld->getBoolConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL); for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end(); ++itr) { @@ -6148,7 +6148,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("Skill not found in SkillLineStore: skill #%u", id); return; } @@ -6308,7 +6308,7 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const void Player::SendActionButtons(uint32 state) const { - sLog.outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); + sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4)); data << uint8(state); @@ -6331,20 +6331,20 @@ void Player::SendActionButtons(uint32 state) const } GetSession()->SendPacket(&data); - sLog.outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec); + sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec); } 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( "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( "Action %u not added into button %u for player %s: action must be < %u", action, button, GetName(), MAX_ACTION_BUTTON_ACTION_VALUE ); return false; } @@ -6353,20 +6353,20 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) case ACTION_BUTTON_SPELL: if (!sSpellStore.LookupEntry(action)) { - sLog.outError( "Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName() ); + sLog->outError( "Spell action %u not added into button %u for player %s: spell not exist", action, button, GetName() ); return false; } if (!HasSpell(action)) { - sLog.outError( "Spell action %u not added into button %u for player %s: player don't known this spell", action, button, GetName() ); + sLog->outError( "Spell action %u not added into button %u for player %s: player don't known this spell", action, button, GetName() ); return false; } break; case ACTION_BUTTON_ITEM: if (!ObjectMgr::GetItemPrototype(action)) { - sLog.outError( "Item action %u not added into button %u for player %s: item not exist", action, button, GetName() ); + sLog->outError( "Item action %u not added into button %u for player %s: item not exist", action, button, GetName() ); return false; } break; @@ -6388,7 +6388,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->outDetail("Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button); return &ab; } @@ -6403,7 +6403,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->outDetail("Action Button '%u' Removed from Player '%u'", button, GetGUIDLow()); } ActionButton const* Player::GetActionButton(uint8 button) @@ -6517,7 +6517,7 @@ void Player::CheckAreaExploreAndOutdoor() bool isOutdoor; uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor); - if (sWorld.getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor) + if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor) RemoveAurasWithAttribute(SPELL_ATTR0_OUTDOORS_ONLY); if (areaFlag==0xffff) @@ -6526,7 +6526,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("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; } @@ -6542,12 +6542,12 @@ void Player::CheckAreaExploreAndOutdoor() AreaTableEntry const *p = GetAreaEntryByAreaFlagAndMap(areaFlag,GetMapId()); if (!p) { - sLog.outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(),GetPositionY(),GetMapId()); + sLog->outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(),GetPositionY(),GetMapId()); } else if (p->area_level > 0) { uint32 area = p->ID; - if (getLevel() >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { SendExplorationExperience(area,0); } @@ -6557,7 +6557,7 @@ void Player::CheckAreaExploreAndOutdoor() uint32 XP = 0; if (diff < -5) { - XP = uint32(sObjectMgr->GetBaseXP(getLevel()+5)*sWorld.getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(getLevel()+5)*sWorld->getRate(RATE_XP_EXPLORE)); } else if (diff > 5) { @@ -6567,17 +6567,17 @@ void Player::CheckAreaExploreAndOutdoor() else if (exploration_percent < 0) exploration_percent = 0; - XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*exploration_percent/100*sWorld.getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); } else { - XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*sWorld.getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*sWorld->getRate(RATE_XP_EXPLORE)); } GiveXP(XP, NULL); SendExplorationExperience(area,XP); } - sLog.outDetail("PLAYER: Player %u discovered a new area: %u", GetGUIDLow(), area); + sLog->outDetail("PLAYER: Player %u discovered a new area: %u", GetGUIDLow(), area); } } } @@ -6587,7 +6587,7 @@ uint32 Player::TeamForRace(uint8 race) ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); if (!rEntry) { - sLog.outError("Race %u not found in DBC: wrong DBC files?",uint32(race)); + sLog->outError("Race %u not found in DBC: wrong DBC files?",uint32(race)); return ALLIANCE; } @@ -6597,7 +6597,7 @@ uint32 Player::TeamForRace(uint8 race) case 1: return HORDE; } - sLog.outError("Race %u have wrong teamid %u in DBC: wrong DBC files?",uint32(race),rEntry->TeamID); + sLog->outError("Race %u have wrong teamid %u in DBC: wrong DBC files?",uint32(race),rEntry->TeamID); return ALLIANCE; } @@ -6606,7 +6606,7 @@ uint32 Player::getFactionForRace(uint8 race) ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); if (!rEntry) { - sLog.outError("Race %u not found in DBC: wrong DBC files?",uint32(race)); + sLog->outError("Race %u not found in DBC: wrong DBC files?",uint32(race)); return 0; } @@ -6637,7 +6637,7 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in percent *= repRate; } - float rate = for_quest ? sWorld.getRate(RATE_REPUTATION_LOWLEVEL_QUEST) : sWorld.getRate(RATE_REPUTATION_LOWLEVEL_KILL); + float rate = for_quest ? sWorld->getRate(RATE_REPUTATION_LOWLEVEL_QUEST) : sWorld->getRate(RATE_REPUTATION_LOWLEVEL_KILL); if (rate != 1.0f && creatureOrQuestLevel <= Trinity::XP::GetGrayLevel(getLevel())) percent *= rate; @@ -6710,7 +6710,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) donerep1 = int32(donerep1*(rate + favored_rep_mult)); if (recruitAFriend) - donerep1 = int32(donerep1 * (1 + sWorld.getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + donerep1 = int32(donerep1 * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); FactionEntry const *factionEntry1 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->repfaction1); uint32 current_reputation_rank1 = GetReputationMgr().GetRank(factionEntry1); @@ -6724,7 +6724,7 @@ void Player::RewardReputation(Unit *pVictim, float rate) donerep2 = int32(donerep2*(rate + favored_rep_mult)); if (recruitAFriend) - donerep2 = int32(donerep2 * (1 + sWorld.getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + donerep2 = int32(donerep2 * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); FactionEntry const *factionEntry2 = sFactionStore.LookupEntry(ChampioningFaction ? ChampioningFaction : Rep->repfaction2); uint32 current_reputation_rank2 = GetReputationMgr().GetRank(factionEntry2); @@ -6748,7 +6748,7 @@ void Player::RewardReputation(Quest const *pQuest) int32 rep = CalculateReputationGain(GetQuestLevel(pQuest), pQuest->RewRepValue[i]/100, pQuest->RewRepFaction[i], true, true); if (recruitAFriend) - rep = int32(rep * (1 + sWorld.getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + rep = int32(rep * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i])) GetReputationMgr().ModifyReputation(factionEntry, rep); @@ -6768,7 +6768,7 @@ void Player::RewardReputation(Quest const *pQuest) repPoints = CalculateReputationGain(GetQuestLevel(pQuest), repPoints, pQuest->RewRepFaction[i], true); if (recruitAFriend) - repPoints = int32(repPoints * (1 + sWorld.getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); + repPoints = int32(repPoints * (1 + sWorld->getRate(RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS))); if (const FactionEntry* factionEntry = sFactionStore.LookupEntry(pQuest->RewRepFaction[i])) GetReputationMgr().ModifyReputation(factionEntry, repPoints); @@ -6854,7 +6854,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt { Player *pVictim = uVictim->ToPlayer(); - if (GetTeam() == pVictim->GetTeam() && !sWorld.IsFFAPvPRealm()) + if (GetTeam() == pVictim->GetTeam() && !sWorld->IsFFAPvPRealm()) return false; uint8 k_level = getLevel(); @@ -6916,7 +6916,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt AddPctN(honor_f, GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN_PCT)); } - honor_f *= sWorld.getRate(RATE_HONOR); + honor_f *= sWorld->getRate(RATE_HONOR); // Back to int now honor = int32(honor_f); // honor - for show honor points in log @@ -6944,7 +6944,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt } } - if (sWorld.getBoolConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken) + if (sWorld->getBoolConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken) { if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) return true; @@ -6952,14 +6952,14 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt if (uVictim->GetTypeId() == TYPEID_PLAYER) { // Check if allowed to receive it in current map - uint8 MapType = sWorld.getIntConfig(CONFIG_PVP_TOKEN_MAP_TYPE); + uint8 MapType = sWorld->getIntConfig(CONFIG_PVP_TOKEN_MAP_TYPE); if ((MapType == 1 && !InBattleground() && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) || (MapType == 2 && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) || (MapType == 3 && !InBattleground())) return true; - uint32 itemId = sWorld.getIntConfig(CONFIG_PVP_TOKEN_ID); - int32 count = sWorld.getIntConfig(CONFIG_PVP_TOKEN_COUNT); + uint32 itemId = sWorld->getIntConfig(CONFIG_PVP_TOKEN_ID); + int32 count = sWorld->getIntConfig(CONFIG_PVP_TOKEN_COUNT); if(AddItem(itemId, count)) ChatHandler(this).PSendSysMessage("You have been awarded a token for slaying another player."); @@ -6973,26 +6973,26 @@ void Player::ModifyHonorPoints(int32 value) { if (value < 0) { - if (GetHonorPoints() > sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS)) - SetHonorPoints(sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS) + value); + if (GetHonorPoints() > sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS)) + SetHonorPoints(sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS) + value); else SetHonorPoints(GetHonorPoints() > uint32(-value) ? GetHonorPoints() + value : 0); } else - SetHonorPoints(GetHonorPoints() < sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS)); + SetHonorPoints(GetHonorPoints() < sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS)); } void Player::ModifyArenaPoints(int32 value) { if (value < 0) { - if (GetArenaPoints() > sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS)) - SetArenaPoints(sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS) + value); + if (GetArenaPoints() > sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)) + SetArenaPoints(sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS) + value); else SetArenaPoints(GetArenaPoints() > uint32(-value) ? GetArenaPoints() + value : 0); } else - SetArenaPoints(GetArenaPoints() < sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS)); + SetArenaPoints(GetArenaPoints() < sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)); } uint32 Player::GetGuildIdFromDB(uint64 guid) @@ -7101,7 +7101,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) if (!zone) return; - if (sWorld.getBoolConfig(CONFIG_WEATHER)) + if (sWorld->getBoolConfig(CONFIG_WEATHER)) { Weather *wth = sWeatherMgr->FindWeather(zone->ID); if (wth) @@ -7121,14 +7121,14 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) switch (zone->team) { case AREATEAM_ALLY: - pvpInfo.inHostileArea = GetTeam() != ALLIANCE && (sWorld.IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); + pvpInfo.inHostileArea = GetTeam() != ALLIANCE && (sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); break; case AREATEAM_HORDE: - pvpInfo.inHostileArea = GetTeam() != HORDE && (sWorld.IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); + pvpInfo.inHostileArea = GetTeam() != HORDE && (sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); break; case AREATEAM_NONE: // overwrite for battlegrounds, maybe batter some zone flags but current known not 100% fit to this - pvpInfo.inHostileArea = sWorld.IsPvPRealm() || InBattleground() || zone->flags & AREA_FLAG_OUTDOOR_PVP; + pvpInfo.inHostileArea = sWorld->IsPvPRealm() || InBattleground() || zone->flags & AREA_FLAG_OUTDOOR_PVP; break; default: // 6 in fact pvpInfo.inHostileArea = false; @@ -7232,7 +7232,7 @@ void Player::CheckDuelDistance(time_t currTime) bool Player::IsOutdoorPvPActive() { - return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (IsPvP() || sWorld.IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight(); + return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (IsPvP() || sWorld->IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight(); } void Player::DuelComplete(DuelCompleteType type) @@ -7241,7 +7241,7 @@ void Player::DuelComplete(DuelCompleteType type) if (!duel) return; - sLog.outDebug("Duel Complete %s %s", GetName(), duel->opponent->GetName()); + sLog->outDebug("Duel Complete %s %s", GetName(), duel->opponent->GetName()); WorldPacket data(SMSG_DUEL_COMPLETE, (1)); data << (uint8)((type != DUEL_INTERUPTED) ? 1 : 0); @@ -7332,7 +7332,7 @@ void Player::DuelComplete(DuelCompleteType type) duel->opponent->ClearComboPoints(); // Honor points after duel (the winner) - ImpConfig - if (uint32 amount = sWorld.getIntConfig(CONFIG_HONOR_AFTER_DUEL)) + if (uint32 amount = sWorld->getIntConfig(CONFIG_HONOR_AFTER_DUEL)) duel->opponent->RewardHonor(NULL,1,amount); //cleanups @@ -7363,7 +7363,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) if (item->IsBroken()) return; - sLog.outDetail("applying mods for item %u ",item->GetGUIDLow()); + sLog->outDetail("applying mods for item %u ",item->GetGUIDLow()); uint8 attacktype = Player::GetAttackBySlot(slot); @@ -7385,7 +7385,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) ApplyItemEquipSpell(item,apply); ApplyEnchantment(item, apply); - sLog.outDebug("_ApplyItemMods complete."); + sLog->outDebug("_ApplyItemMods complete."); } void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool apply, bool only_level_scale /*= false*/) @@ -7667,7 +7667,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl { damage = apply ? minDamage : BASE_MINDAMAGE; SetBaseWeaponDamage(attType, MINDAMAGE, damage); - //sLog.outError("applying mindam: assigning %f to weapon mindamage, now is: %f", damage, GetWeaponDamageRange(attType, MINDAMAGE)); + //sLog->outError("applying mindam: assigning %f to weapon mindamage, now is: %f", damage, GetWeaponDamageRange(attType, MINDAMAGE)); } if (maxDamage > 0) @@ -7820,7 +7820,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply return; } - sLog.outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); + sLog->outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); CastSpell(this,spellInfo,true,item); } @@ -7926,7 +7926,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId); if (!spellInfo) { - sLog.outError("WORLD: unknown Item spellid %i", spellData.SpellId); + sLog->outError("WORLD: unknown Item spellid %i", spellData.SpellId); continue; } @@ -7993,7 +7993,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]); if (!spellInfo) { - sLog.outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]); + sLog->outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]); continue; } @@ -8037,7 +8037,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c SpellEntry const *spellInfo = sSpellStore.LookupEntry(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("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, learn_spell_id); SendEquipError(EQUIP_ERR_NONE,item,NULL); return; } @@ -8069,7 +8069,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId); if (!spellInfo) { - sLog.outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring",proto->ItemId, spellData.SpellId); + sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring",proto->ItemId, spellData.SpellId); continue; } @@ -8097,7 +8097,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]); if (!spellInfo) { - sLog.outError("Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]); + sLog->outError("Player::CastItemUseSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]); continue; } @@ -8114,7 +8114,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c void Player::_RemoveAllItemMods() { - sLog.outDebug("_RemoveAllItemMods start."); + sLog->outDebug("_RemoveAllItemMods start."); for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -8157,12 +8157,12 @@ void Player::_RemoveAllItemMods() } } - sLog.outDebug("_RemoveAllItemMods complete."); + sLog->outDebug("_RemoveAllItemMods complete."); } void Player::_ApplyAllItemMods() { - sLog.outDebug("_ApplyAllItemMods start."); + sLog->outDebug("_ApplyAllItemMods start."); for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -8206,7 +8206,7 @@ void Player::_ApplyAllItemMods() } } - sLog.outDebug("_ApplyAllItemMods complete."); + sLog->outDebug("_ApplyAllItemMods complete."); } void Player::_ApplyAllLevelScaleItemMods(bool apply) @@ -8305,7 +8305,7 @@ void Player::RemovedInsignia(Player* looterPlr) // We have to convert player corpse to bones, not to be able to resurrect there // SpawnCorpseBones isn't handy, 'cos it saves player while he in BG - Corpse *bones = sObjectAccessor.ConvertCorpseForPlayer(GetGUID(),true); + Corpse *bones = sObjectAccessor->ConvertCorpseForPlayer(GetGUID(),true); if (!bones) return; @@ -8334,10 +8334,10 @@ void Player::SendLoot(uint64 guid, LootType loot_type) Loot *loot = 0; PermissionTypes permission = ALL_PERMISSION; - sLog.outDebug("Player::SendLoot"); + sLog->outDebug("Player::SendLoot"); if (IS_GAMEOBJECT_GUID(guid)) { - sLog.outDebug(" IS_GAMEOBJECT_GUID(guid)"); + sLog->outDebug(" IS_GAMEOBJECT_GUID(guid)"); GameObject *go = GetMap()->GetGameObject(guid); // not check distance for GO in case owned GO (fishing bobber case, for example) @@ -8491,7 +8491,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) loot->FillLoot(1, LootTemplates_Creature, this, true); // It may need a better formula // Now it works like this: lvl10: ~6copper, lvl70: ~9silver - bones->loot.gold = uint32(urand(50, 150) * 0.016f * pow(float(pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY)); + bones->loot.gold = uint32(urand(50, 150) * 0.016f * pow(float(pLevel)/5.76f, 2.5f) * sWorld->getRate(RATE_DROP_MONEY)); } if (bones->lootRecipient != this) @@ -8529,7 +8529,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) // Generate extra money for pick pocket loot const uint32 a = urand(0, creature->getLevel()/2); const uint32 b = urand(0, getLevel()/2); - loot->gold = uint32(10 * (a + b) * sWorld.getRate(RATE_DROP_MONEY)); + loot->gold = uint32(10 * (a + b) * sWorld->getRate(RATE_DROP_MONEY)); } } else @@ -8663,7 +8663,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) uint32 mapid = GetMapId(); OutdoorPvP * pvp = sOutdoorPvPMgr->GetOutdoorPvPToZoneId(zoneid); - sLog.outDebug("Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); + sLog->outDebug("Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); // may be exist better way to do this... switch (zoneid) @@ -8746,9 +8746,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(0x8d4) << uint32(0x0); // 5 data << uint32(0x8d3) << uint32(0x0); // 6 // 7 1 - Arena season in progress, 0 - end of season - data << uint32(0xC77) << uint32(sWorld.getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS)); + data << uint32(0xC77) << uint32(sWorld->getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS)); // 8 Arena season id - data << uint32(0xF3D) << uint32(sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID)); + data << uint32(0xF3D) << uint32(sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); if (mapid == 530) // Outland { @@ -9256,7 +9256,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->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f",xp+rested_bonus,rested_bonus,GetRestBonus()); return rested_bonus; } @@ -9271,7 +9271,7 @@ void Player::SendTalentWipeConfirm(uint64 guid) { WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4)); data << uint64(guid); - uint32 cost = sWorld.getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost(); + uint32 cost = sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost(); data << cost; GetSession()->SendPacket(&data); } @@ -9288,7 +9288,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("Object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); return; } pet->resetTalents(); @@ -10293,7 +10293,7 @@ uint8 Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, I uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item *pItem, bool swap, uint32* no_space_count) const { - sLog.outDebug("STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); + sLog->outDebug("STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); if (!pProto) @@ -10792,7 +10792,7 @@ uint8 Player::CanStoreItems(Item **pItems,int count) const // no item if (!pItem) continue; - sLog.outDebug("STORAGE: CanStoreItems %i. item = %u, count = %u", k+1, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug("STORAGE: CanStoreItems %i. item = %u, count = %u", k+1, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); // strange item @@ -11002,7 +11002,7 @@ uint8 Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, boo dest = 0; if (pItem) { - sLog.outDebug("STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug("STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); if (pProto) { @@ -11153,7 +11153,7 @@ uint8 Player::CanUnequipItem(uint16 pos, bool swap) const if (!pItem) return EQUIP_ERR_OK; - sLog.outDebug("STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug("STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); if (!pProto) @@ -11189,7 +11189,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI uint32 count = pItem->GetCount(); - sLog.outDebug("STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug("STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; @@ -11205,7 +11205,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI uint8 pItemslot = pItem->GetSlot(); if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END) { - sLog.outError("Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!", + sLog->outError("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; } @@ -11377,7 +11377,7 @@ uint8 Player::CanUseItem(Item *pItem, bool not_loading) const { if (pItem) { - sLog.outDebug("STORAGE: CanUseItem item = %u", pItem->GetEntry()); + sLog->outDebug("STORAGE: CanUseItem item = %u", pItem->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11465,7 +11465,7 @@ uint8 Player::CanUseItem(ItemPrototype const *pProto) const uint8 Player::CanUseAmmo(uint32 item) const { - sLog.outDebug("STORAGE: CanUseAmmo item = %u", item); + sLog->outDebug("STORAGE: CanUseAmmo item = %u", item); if (!isAlive()) return EQUIP_ERR_YOU_ARE_DEAD; //if (isStunned()) @@ -11604,7 +11604,7 @@ Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool uint8 bag = pos >> 8; uint8 slot = pos & 255; - sLog.outDebug("STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); + sLog->outDebug("STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); Item *pItem2 = GetItemByPos(bag, slot); @@ -11746,7 +11746,7 @@ Item* Player::EquipItem(uint16 pos, Item *pItem, bool update) SpellEntry const* spellProto = sSpellStore.LookupEntry(cooldownSpell); if (!spellProto) - sLog.outError("Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell); + sLog->outError("Weapon switch cooldown spell %u couldn't be found in Spell.dbc", cooldownSpell); else { m_weaponChangeTimer = spellProto->StartRecoveryTime; @@ -11870,7 +11870,7 @@ void Player::VisualizeItem(uint8 slot, Item *pItem) if (pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED || pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM) pItem->SetBinding(true); - sLog.outDebug("STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); + sLog->outDebug("STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); m_items[slot] = pItem; SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); @@ -11895,7 +11895,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) Item *pItem = GetItemByPos(bag, slot); if (pItem) { - sLog.outDebug("STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug("STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); RemoveEnchantmentDurations(pItem); RemoveItemDurations(pItem); @@ -12016,7 +12016,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) Item *pItem = GetItemByPos(bag, slot); if (pItem) { - sLog.outDebug("STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug("STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); // Also remove all contained items if the item is a bag. // This if() prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow. if (pItem->IsBag() && !((Bag*)pItem)->IsEmpty()) @@ -12103,7 +12103,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check) { - sLog.outDebug("STORAGE: DestroyItemCount item = %u, count = %u", item, count); + sLog->outDebug("STORAGE: DestroyItemCount item = %u, count = %u", item, count); uint32 remcount = 0; // in inventory @@ -12232,7 +12232,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) { - sLog.outDebug("STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); + sLog->outDebug("STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12264,7 +12264,7 @@ void Player::DestroyConjuredItems(bool update) { // used when entering arena // destroys all conjured items - sLog.outDebug("STORAGE: DestroyConjuredItems"); + sLog->outDebug("STORAGE: DestroyConjuredItems"); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12327,7 +12327,7 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) if (!pItem) return; - sLog.outDebug("STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(),pItem->GetEntry(), count); + sLog->outDebug("STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(),pItem->GetEntry(), count); if (pItem->GetCount() <= count) { @@ -12382,7 +12382,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) return; } - sLog.outDebug("STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); + sLog->outDebug("STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); Item *pNewItem = pSrcItem->CloneItem(count, this); if (!pNewItem) { @@ -12467,7 +12467,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!pSrcItem) return; - sLog.outDebug("STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); + sLog->outDebug("STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); if (!isAlive()) { @@ -12837,7 +12837,7 @@ void Player::AddItemToBuyBackSlot(Item *pItem) } RemoveItemFromBuyBackSlot(slot, true); - sLog.outDebug("STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); + sLog->outDebug("STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); m_items[slot] = pItem; time_t base = time(NULL); @@ -12859,7 +12859,7 @@ void Player::AddItemToBuyBackSlot(Item *pItem) Item* Player::GetItemFromBuyBackSlot(uint32 slot) { - sLog.outDebug("STORAGE: GetItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug("STORAGE: GetItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) return m_items[slot]; return NULL; @@ -12867,7 +12867,7 @@ Item* Player::GetItemFromBuyBackSlot(uint32 slot) void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) { - sLog.outDebug("STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug("STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { Item *pItem = m_items[slot]; @@ -12893,7 +12893,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2, uint32 itemid) { - sLog.outDebug("WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); + sLog->outDebug("WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); data << uint8(msg); @@ -12936,7 +12936,7 @@ void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2, uint32 itemid) void Player::SendBuyError(uint8 msg, Creature* pCreature, uint32 item, uint32 param) { - sLog.outDebug("WORLD: Sent SMSG_BUY_FAILED"); + sLog->outDebug("WORLD: Sent SMSG_BUY_FAILED"); WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1)); data << uint64(pCreature ? pCreature->GetGUID() : 0); data << uint32(item); @@ -12948,7 +12948,7 @@ void Player::SendBuyError(uint8 msg, Creature* pCreature, uint32 item, uint32 pa void Player::SendSellError(uint8 msg, Creature* pCreature, uint64 guid, uint32 param) { - sLog.outDebug("WORLD: Sent SMSG_SELL_ITEM"); + sLog->outDebug("WORLD: Sent SMSG_SELL_ITEM"); WorldPacket data(SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10 data << uint64(pCreature ? pCreature->GetGUID() : 0); data << uint64(guid); @@ -13022,7 +13022,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly) if (m_itemDuration.empty()) return; - sLog.outDebug("Player::UpdateItemDuration(%u,%u)", time, realtimeonly); + sLog->outDebug("Player::UpdateItemDuration(%u,%u)", time, realtimeonly); for (ItemDurationList::const_iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end();) { @@ -13294,81 +13294,81 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool } } - sLog.outDebug("Adding %u to stat nb %u",enchant_amount,enchant_spell_id); + sLog->outDebug("Adding %u to stat nb %u",enchant_amount,enchant_spell_id); switch (enchant_spell_id) { case ITEM_MOD_MANA: - sLog.outDebug("+ %u MANA",enchant_amount); + sLog->outDebug("+ %u MANA",enchant_amount); HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_HEALTH: - sLog.outDebug("+ %u HEALTH",enchant_amount); + sLog->outDebug("+ %u HEALTH",enchant_amount); HandleStatModifier(UNIT_MOD_HEALTH, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_AGILITY: - sLog.outDebug("+ %u AGILITY",enchant_amount); + sLog->outDebug("+ %u AGILITY",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_AGILITY, (float)enchant_amount, apply); break; case ITEM_MOD_STRENGTH: - sLog.outDebug("+ %u STRENGTH",enchant_amount); + sLog->outDebug("+ %u STRENGTH",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STRENGTH, (float)enchant_amount, apply); break; case ITEM_MOD_INTELLECT: - sLog.outDebug("+ %u INTELLECT",enchant_amount); + sLog->outDebug("+ %u INTELLECT",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_INTELLECT, (float)enchant_amount, apply); break; case ITEM_MOD_SPIRIT: - sLog.outDebug("+ %u SPIRIT",enchant_amount); + sLog->outDebug("+ %u SPIRIT",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_SPIRIT, (float)enchant_amount, apply); break; case ITEM_MOD_STAMINA: - sLog.outDebug("+ %u STAMINA",enchant_amount); + sLog->outDebug("+ %u STAMINA",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STAMINA, (float)enchant_amount, apply); break; case ITEM_MOD_DEFENSE_SKILL_RATING: ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply); - sLog.outDebug("+ %u DEFENCE", enchant_amount); + sLog->outDebug("+ %u DEFENCE", enchant_amount); break; case ITEM_MOD_DODGE_RATING: ApplyRatingMod(CR_DODGE, enchant_amount, apply); - sLog.outDebug("+ %u DODGE", enchant_amount); + sLog->outDebug("+ %u DODGE", enchant_amount); break; case ITEM_MOD_PARRY_RATING: ApplyRatingMod(CR_PARRY, enchant_amount, apply); - sLog.outDebug("+ %u PARRY", enchant_amount); + sLog->outDebug("+ %u PARRY", enchant_amount); break; case ITEM_MOD_BLOCK_RATING: ApplyRatingMod(CR_BLOCK, enchant_amount, apply); - sLog.outDebug("+ %u SHIELD_BLOCK", enchant_amount); + sLog->outDebug("+ %u SHIELD_BLOCK", enchant_amount); break; case ITEM_MOD_HIT_MELEE_RATING: ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); - sLog.outDebug("+ %u MELEE_HIT", enchant_amount); + sLog->outDebug("+ %u MELEE_HIT", enchant_amount); break; case ITEM_MOD_HIT_RANGED_RATING: ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); - sLog.outDebug("+ %u RANGED_HIT", enchant_amount); + sLog->outDebug("+ %u RANGED_HIT", enchant_amount); break; case ITEM_MOD_HIT_SPELL_RATING: ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); - sLog.outDebug("+ %u SPELL_HIT", enchant_amount); + sLog->outDebug("+ %u SPELL_HIT", enchant_amount); break; case ITEM_MOD_CRIT_MELEE_RATING: ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); - sLog.outDebug("+ %u MELEE_CRIT", enchant_amount); + sLog->outDebug("+ %u MELEE_CRIT", enchant_amount); break; case ITEM_MOD_CRIT_RANGED_RATING: ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); - sLog.outDebug("+ %u RANGED_CRIT", enchant_amount); + sLog->outDebug("+ %u RANGED_CRIT", enchant_amount); break; case ITEM_MOD_CRIT_SPELL_RATING: ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); - sLog.outDebug("+ %u SPELL_CRIT", enchant_amount); + sLog->outDebug("+ %u SPELL_CRIT", enchant_amount); break; // Values from ITEM_STAT_MELEE_HA_RATING to ITEM_MOD_HASTE_RANGED_RATING are never used // in Enchantments @@ -13403,13 +13403,13 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); - sLog.outDebug("+ %u HIT", enchant_amount); + sLog->outDebug("+ %u HIT", enchant_amount); break; case ITEM_MOD_CRIT_RATING: ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); - sLog.outDebug("+ %u CRITICAL", enchant_amount); + sLog->outDebug("+ %u CRITICAL", enchant_amount); break; // Values ITEM_MOD_HIT_TAKEN_RATING and ITEM_MOD_CRIT_TAKEN_RATING are never used in Enchantment // case ITEM_MOD_HIT_TAKEN_RATING: @@ -13426,54 +13426,54 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); - sLog.outDebug("+ %u RESILIENCE", enchant_amount); + sLog->outDebug("+ %u RESILIENCE", enchant_amount); break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply); - sLog.outDebug("+ %u HASTE", enchant_amount); + sLog->outDebug("+ %u HASTE", enchant_amount); break; case ITEM_MOD_EXPERTISE_RATING: ApplyRatingMod(CR_EXPERTISE, enchant_amount, apply); - sLog.outDebug("+ %u EXPERTISE", enchant_amount); + sLog->outDebug("+ %u EXPERTISE", enchant_amount); break; case ITEM_MOD_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply); HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); - sLog.outDebug("+ %u ATTACK_POWER", enchant_amount); + sLog->outDebug("+ %u ATTACK_POWER", enchant_amount); break; case ITEM_MOD_RANGED_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); - sLog.outDebug("+ %u RANGED_ATTACK_POWER", enchant_amount); + sLog->outDebug("+ %u RANGED_ATTACK_POWER", enchant_amount); break; // case ITEM_MOD_FERAL_ATTACK_POWER: // ApplyFeralAPBonus(enchant_amount, apply); -// sLog.outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount); +// sLog->outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount); // break; case ITEM_MOD_MANA_REGENERATION: ApplyManaRegenBonus(enchant_amount, apply); - sLog.outDebug("+ %u MANA_REGENERATION", enchant_amount); + sLog->outDebug("+ %u MANA_REGENERATION", enchant_amount); break; case ITEM_MOD_ARMOR_PENETRATION_RATING: ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply); - sLog.outDebug("+ %u ARMOR PENETRATION", enchant_amount); + sLog->outDebug("+ %u ARMOR PENETRATION", enchant_amount); break; case ITEM_MOD_SPELL_POWER: ApplySpellPowerBonus(enchant_amount, apply); - sLog.outDebug("+ %u SPELL_POWER", enchant_amount); + sLog->outDebug("+ %u SPELL_POWER", enchant_amount); break; case ITEM_MOD_HEALTH_REGEN: ApplyHealthRegenBonus(enchant_amount, apply); - sLog.outDebug("+ %u HEALTH_REGENERATION", enchant_amount); + sLog->outDebug("+ %u HEALTH_REGENERATION", enchant_amount); break; case ITEM_MOD_SPELL_PENETRATION: ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, enchant_amount, apply); - sLog.outDebug("+ %u SPELL_PENETRATION", enchant_amount); + sLog->outDebug("+ %u SPELL_PENETRATION", enchant_amount); break; case ITEM_MOD_BLOCK_VALUE: HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(enchant_amount), apply); - sLog.outDebug("+ %u BLOCK_VALUE", enchant_amount); + sLog->outDebug("+ %u BLOCK_VALUE", enchant_amount); break; case ITEM_MOD_SPELL_HEALING_DONE: // deprecated case ITEM_MOD_SPELL_DAMAGE_DONE: // deprecated @@ -13507,7 +13507,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("Unknown item enchantment (id = %d) display type: %d", enchant_id, enchant_display_type); break; } /*switch(enchant_display_type)*/ } /*for*/ @@ -13677,7 +13677,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue VendorItemData const* vItems = pCreature->GetVendorItems(); if (!vItems || vItems->Empty()) { - sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", pCreature->GetGUIDLow(), pCreature->GetEntry()); + sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", pCreature->GetGUIDLow(), pCreature->GetEntry()); bCanTalk = false; } break; @@ -13687,7 +13687,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue bCanTalk = false; break; case GOSSIP_OPTION_LEARNDUALSPEC: - if (!(GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(this) && !(getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))) + if (!(GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(this) && !(getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))) bCanTalk = false; break; case GOSSIP_OPTION_UNLEARNTALENTS: @@ -13726,7 +13726,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue bCanTalk = false; break; default: - sLog.outErrorDb("Creature entry %u have unknown gossip option %u for menu %u", pCreature->GetEntry(), itr->second.option_id, itr->second.menu_id); + sLog->outErrorDb("Creature entry %u have unknown gossip option %u for menu %u", pCreature->GetEntry(), itr->second.option_id, itr->second.menu_id); bCanTalk = false; break; } @@ -13827,7 +13827,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me { if (gossipOptionId > GOSSIP_OPTION_QUESTGIVER) { - sLog.outError("Player guid %u request invalid gossip option for GameObject entry %u", GetGUIDLow(), pSource->GetEntry()); + sLog->outError("Player guid %u request invalid gossip option for GameObject entry %u", GetGUIDLow(), pSource->GetEntry()); return; } } @@ -13878,7 +13878,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me GetSession()->SendTrainerList(guid); break; case GOSSIP_OPTION_LEARNDUALSPEC: - if (GetSpecsCount() == 1 && !(getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) + if (GetSpecsCount() == 1 && !(getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) { if (!HasEnoughMoney(10000000)) { @@ -13939,7 +13939,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me if (bgTypeId == BATTLEGROUND_TYPE_NONE) { - sLog.outError("a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", GetGUIDLow()); + sLog->outError("a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", GetGUIDLow()); return; } @@ -14191,7 +14191,7 @@ bool Player::CanSeeStartQuest(Quest const *pQuest) SatisfyQuestPrevChain(pQuest, false) && SatisfyQuestDay(pQuest, false) && SatisfyQuestWeek(pQuest, false) && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this)) { - return getLevel() + sWorld.getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel(); + return getLevel() + sWorld->getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel(); } return false; @@ -14568,7 +14568,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, QuestStatusData& q_status = mQuestStatus[quest_id]; // Not give XP in case already completed once repeatable quest - uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue(this)*sWorld.getRate(RATE_XP_QUEST)); + uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue(this)*sWorld->getRate(RATE_XP_QUEST)); // handle SPELL_AURA_MOD_XP_QUEST_PCT auras Unit::AuraEffectList const& ModXPPctAuras = GetAuraEffectsByType(SPELL_AURA_MOD_XP_QUEST_PCT); @@ -14576,10 +14576,10 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, AddPctN(XP, (*i)->GetAmount()); int32 moneyRew = 0; - if (getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) GiveXP(XP, NULL); else - moneyRew = int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY)); + moneyRew = int32(pQuest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY)); // Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative if (pQuest->GetRewOrReqMoney()) @@ -14800,7 +14800,7 @@ bool Player::SatisfyQuestLog(bool msg) { WorldPacket data(SMSG_QUESTLOG_FULL, 0); GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTLOG_FULL"); + sLog->outDebug("WORLD: Sent SMSG_QUESTLOG_FULL"); } return false; } @@ -14956,7 +14956,7 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); - sLog.outDebug("Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId()); + sLog->outDebug("Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId()); return false; } return true; @@ -15750,19 +15750,19 @@ void Player::SendQuestComplete(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); + sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); } } void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver) { uint32 questid = pQuest->GetQuestId(); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); sGameEventMgr->HandleQuestComplete(questid); WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); data << uint32(questid); - if (getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { data << uint32(XP); data << uint32(pQuest->GetRewOrReqMoney()); @@ -15770,7 +15770,7 @@ void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver else { data << uint32(0); - data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld.getRate(RATE_DROP_MONEY))); + data << uint32(pQuest->GetRewOrReqMoney() + int32(pQuest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY))); } data << 10 * Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorMultiplier()); @@ -15790,7 +15790,7 @@ void Player::SendQuestFailed(uint32 quest_id) data << uint32(quest_id); data << uint32(0); // failed reason (4 for inventory is full) GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED"); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED"); } } @@ -15801,7 +15801,7 @@ void Player::SendQuestTimerFailed(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_FAILEDTIMER, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER"); + sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER"); } } @@ -15810,7 +15810,7 @@ void Player::SendCanTakeQuestResponse(uint32 msg) WorldPacket data(SMSG_QUESTGIVER_QUEST_INVALID, 4); data << uint32(msg); GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID"); + sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID"); } void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver) @@ -15830,7 +15830,7 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver) data << uint64(GetGUID()); pReceiver->GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); + sLog->outDebug("WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); } } @@ -15842,14 +15842,14 @@ void Player::SendPushToPartyResponse(Player *pPlayer, uint32 msg) data << uint64(pPlayer->GetGUID()); data << uint8(msg); // valid values: 0-8 GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent MSG_QUEST_PUSH_RESULT"); + sLog->outDebug("WORLD: Sent MSG_QUEST_PUSH_RESULT"); } } void Player::SendQuestUpdateAddItem(Quest const* /*pQuest*/, uint32 /*item_idx*/, uint16 /*count*/) { WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0); - sLog.outDebug("WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); + sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); //data << pQuest->ReqItemId[item_idx]; //data << count; GetSession()->SendPacket(&data); @@ -15865,7 +15865,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, ui entry = (-entry) | 0x80000000; WorldPacket data(SMSG_QUESTUPDATE_ADD_KILL, (4*4+8)); - sLog.outDebug("WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL"); + sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL"); data << uint32(pQuest->GetQuestId()); data << uint32(entry); data << uint32(old_count + add_count); @@ -15917,7 +15917,7 @@ void Player::_LoadArenaTeamInfo(PreparedQueryResult result) ArenaTeam* aTeam = sObjectMgr->GetArenaTeamById(arenateamid); if (!aTeam) { - sLog.outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenateamid); + sLog->outError("Player::_LoadArenaTeamInfo: couldn't load arenateam %u", arenateamid); continue; } @@ -16083,7 +16083,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("Player (GUID: %u) not found in table `characters`, can't load. ",guid); return false; } @@ -16095,13 +16095,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("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("Player (GUID: %u) is banned, can't load.", guid); return false; } @@ -16167,7 +16167,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_items[slot] = NULL; } - sLog.outDebug("Load Basic value of player %s is: ", m_name.c_str()); + sLog->outDebug("Load Basic value of player %s is: ", m_name.c_str()); outDebugValues(); //Need to call it to initialize m_team (m_team can be calculated from race) @@ -16205,8 +16205,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) _LoadArenaStatsInfo(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADARENASTATS)); uint32 arena_currency = fields[39].GetUInt32(); - if (arena_currency > sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS)) - arena_currency = sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS); + if (arena_currency > sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)) + arena_currency = sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS); SetArenaPoints(arena_currency); @@ -16239,7 +16239,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("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 @@ -16277,7 +16277,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("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 @@ -16299,7 +16299,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("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); @@ -16319,7 +16319,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("Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.", guid,transGUID); RelocateToHomebind(); @@ -16346,12 +16346,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("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("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); } @@ -16380,7 +16380,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { if (GetSession()->Expansion() < mapEntry->Expansion()) { - sLog.outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); + sLog->outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); RelocateToHomebind(); } @@ -16401,13 +16401,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("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("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); RelocateToHomebind(); } @@ -16417,11 +16417,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("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, 0); 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("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; } } @@ -16435,7 +16435,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("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(); } } @@ -16485,7 +16485,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_stableSlots = fields[32].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("Player can have not more %u stable slots, but have in DB %u",MAX_PET_STABLES,uint32(m_stableSlots)); m_stableSlots = MAX_PET_STABLES; } @@ -16541,8 +16541,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //speed collect rest bonus in offline, in logout, in tavern, city (section/in hour) float bubble1 = 0.125f; float bubble = fields[23].GetUInt32() > 0 - ? bubble1*sWorld.getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) - : bubble0*sWorld.getRate(RATE_REST_OFFLINE_IN_WILDERNESS); + ? bubble1*sWorld->getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) + : bubble0*sWorld->getRate(RATE_REST_OFFLINE_IN_WILDERNESS); SetRestBonus(GetRestBonus()+ time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble); } @@ -16563,7 +16563,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS) { m_activeSpec = 0; - sLog.outError("Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), m_specsCount, m_activeSpec); + sLog->outError("Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), m_specsCount, m_activeSpec); } _LoadTalents(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADTALENTS)); @@ -16634,13 +16634,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetPower(Powers(i),savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } - sLog.outDebug("The value of player %s after load item and aura is: ", m_name.c_str()); + sLog->outDebug("The value of player %s after load item and aura is: ", m_name.c_str()); outDebugValues(); // GM state if (GetSession()->GetSecurity() > SEC_PLAYER) { - switch (sWorld.getIntConfig(CONFIG_GM_LOGIN_STATE)) + switch (sWorld->getIntConfig(CONFIG_GM_LOGIN_STATE)) { default: case 0: break; // disable @@ -16651,7 +16651,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) break; } - switch (sWorld.getIntConfig(CONFIG_GM_VISIBLE_STATE)) + switch (sWorld->getIntConfig(CONFIG_GM_VISIBLE_STATE)) { default: case 0: SetGMVisible(false); break; // invisible @@ -16662,7 +16662,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) break; } - /*switch(sWorld.getIntConfig(CONFIG_GM_ACCEPT_TICKETS)) + /*switch(sWorld->getIntConfig(CONFIG_GM_ACCEPT_TICKETS)) { default: case 0: break; // disable @@ -16673,7 +16673,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) break; }*/ - switch (sWorld.getIntConfig(CONFIG_GM_CHAT)) + switch (sWorld->getIntConfig(CONFIG_GM_CHAT)) { default: case 0: break; // disable @@ -16684,7 +16684,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) break; } - switch (sWorld.getIntConfig(CONFIG_GM_WHISPERING_TO)) + switch (sWorld->getIntConfig(CONFIG_GM_WHISPERING_TO)) { default: case 0: break; // disable @@ -16767,7 +16767,7 @@ void Player::_LoadActions(PreparedQueryResult result) ab->uState = ACTIONBUTTON_UNCHANGED; else { - sLog.outError(" ...at loading, and will deleted in DB also"); + sLog->outError(" ...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; @@ -16778,7 +16778,7 @@ void Player::_LoadActions(PreparedQueryResult result) void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) { - sLog.outDebug("Loading auras for player %u",GetGUIDLow()); + sLog->outDebug("Loading auras for player %u",GetGUIDLow()); //QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow()); @@ -16807,7 +16807,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid); if (!spellproto) { - sLog.outError("Unknown aura (spellid %u), ignore.",spellid); + sLog->outError("Unknown aura (spellid %u), ignore.",spellid); continue; } @@ -16838,7 +16838,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", spellproto->Id, effmask); + sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask); } } while (result->NextRow()); @@ -16864,13 +16864,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("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("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("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); @@ -16881,7 +16881,7 @@ void Player::_LoadGlyphAuras() void Player::LoadCorpse() { if (isAlive()) - sObjectAccessor.ConvertCorpseForPlayer(GetGUID()); + sObjectAccessor->ConvertCorpseForPlayer(GetGUID()); else { if (Corpse *corpse = GetCorpse()) @@ -16929,7 +16929,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); stmt->setUInt32(0, item_guid); trans->Append(stmt); - sLog.outError("Player::_LoadInventory: Player %s has an unknown item (id: #%u) in inventory, deleted.", GetName(),item_id); + sLog->outError("Player::_LoadInventory: Player %s has an unknown item (id: #%u) in inventory, deleted.", GetName(),item_id); continue; } @@ -16937,7 +16937,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) if (!item->LoadFromDB(item_guid, GetGUID(), fields, item_id)) { - sLog.outError("Player::_LoadInventory: Player %s has broken item (id: #%u) in inventory, deleted.", GetName(),item_id); + sLog->outError("Player::_LoadInventory: Player %s has broken item (id: #%u) in inventory, deleted.", GetName(),item_id); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); stmt->setUInt32(0, item_guid); trans->Append(stmt); @@ -16972,7 +16972,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) { if (item->GetPlayedTime() > (2*HOUR)) { - sLog.outDebug("Item::LoadFromDB, Item GUID: %u: refund time expired, deleting refund data and removing refundable flag.", item->GetGUIDLow()); + sLog->outDebug("Item::LoadFromDB, Item GUID: %u: refund time expired, deleting refund data and removing refundable flag.", item->GetGUIDLow()); trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", item->GetGUIDLow()); item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } @@ -16984,7 +16984,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) PreparedQueryResult result2 = CharacterDatabase.Query(stmt); if (!result2) { - sLog.outDebug("Item::LoadFromDB, Item GUID: %u has field flags & ITEM_FLAGS_REFUNDABLE but has no data in item_refund_instance, removing flag.", item->GetGUIDLow()); + sLog->outDebug("Item::LoadFromDB, Item GUID: %u has field flags & ITEM_FLAGS_REFUNDABLE but has no data in item_refund_instance, removing flag.", item->GetGUIDLow()); item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } else @@ -17004,7 +17004,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) PreparedQueryResult result2 = CharacterDatabase.Query(stmt); if (!result2) { - sLog.outDebug("Item::LoadFromDB, Item GUID: %u has flag ITEM_FLAG_BOP_TRADEABLE but has no data in item_soulbound_trade_data, removing flag.", item->GetGUIDLow()); + sLog->outDebug("Item::LoadFromDB, Item GUID: %u has flag ITEM_FLAG_BOP_TRADEABLE but has no data in item_soulbound_trade_data, removing flag.", item->GetGUIDLow()); item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); } else @@ -17073,7 +17073,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) itr->second->StoreItem(slot, item, true); else { - sLog.outError("Player::_LoadInventory: Player %s has item (GUID: %u Entry: %u) can't be loaded to inventory (Bag GUID: %u Slot: %u) by reason %u.", GetName(),item_guid, item_id, bag_guid, slot, result); + sLog->outError("Player::_LoadInventory: Player %s has item (GUID: %u Entry: %u) can't be loaded to inventory (Bag GUID: %u Slot: %u) by reason %u.", GetName(),item_guid, item_id, bag_guid, slot, result); success = false; } } @@ -17086,7 +17086,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) item->SetState(ITEM_UNCHANGED, this); else { - sLog.outError("Player::_LoadInventory: Player %s has item (GUID: %u Entry: %u) can't be loaded to inventory (Bag GUID: %u Slot: %u) by some reason, will send by mail.", GetName(),item_guid, item_id, bag_guid, slot); + sLog->outError("Player::_LoadInventory: Player %s has item (GUID: %u Entry: %u) can't be loaded to inventory (Bag GUID: %u Slot: %u) by some reason, will send by mail.", GetName(),item_guid, item_id, bag_guid, slot); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); stmt->setUInt32(0, item_guid); trans->Append(stmt); @@ -17144,7 +17144,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(), item_guid_low, item_template,mail->messageID); + sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), item_guid_low, item_template,mail->messageID); trans->PAppend("DELETE FROM mail_items WHERE item_guid = '%u'", item_guid_low); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); stmt->setUInt32(0, item_guid_low); @@ -17156,7 +17156,7 @@ void Player::_LoadMailedItems(Mail *mail) if (!item->LoadFromDB(item_guid_low, MAKE_NEW_GUID(fields[13].GetUInt32(), 0, HIGHGUID_PLAYER), fields, item_template)) { - sLog.outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, item_guid_low); + sLog->outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, item_guid_low); CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid = '%u'", item_guid_low); item->FSetState(ITEM_REMOVED); item->SaveToDB(trans); // it also deletes item object ! @@ -17211,7 +17211,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("Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId); m->mailTemplateId = 0; } @@ -17267,7 +17267,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) else { questStatusData.m_status = QUEST_STATUS_NONE; - sLog.outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_NONE(0).",GetName(),quest_id,qstatus); + sLog->outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_NONE(0).",GetName(),quest_id,qstatus); } questStatusData.m_rewarded = (fields[2].GetUInt8() > 0); @@ -17279,10 +17279,10 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) { AddTimedQuest(quest_id); - if (quest_time <= sWorld.GetGameTime()) + if (quest_time <= sWorld->GetGameTime()) questStatusData.m_timer = 1; else - questStatusData.m_timer = uint32((quest_time - sWorld.GetGameTime()) * IN_MILLISECONDS); + questStatusData.m_timer = uint32((quest_time - sWorld->GetGameTime()) * IN_MILLISECONDS); } else quest_time = 0; @@ -17336,7 +17336,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) m_questRewardTalentCount += pQuest->GetBonusTalents(); } - sLog.outDebug("Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.m_status, quest_id, GetGUIDLow()); + sLog->outDebug("Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.m_status, quest_id, GetGUIDLow()); } } while (result->NextRow()); @@ -17375,7 +17375,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("Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`",GetGUIDLow()); break; } @@ -17391,7 +17391,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id); ++quest_daily_idx; - sLog.outDebug("Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); + sLog->outDebug("Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); } while (result->NextRow()); } @@ -17413,7 +17413,7 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result) continue; m_weeklyquests.insert(quest_id); - sLog.outDebug("Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); + sLog->outDebug("Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); } while (result->NextRow()); } @@ -17479,14 +17479,14 @@ 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("_LoadBoundInstances: player %s(%d) has bind to not existed or not dungeon map %d", GetName(), GetGUIDLow(), mapId); CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId); continue; } 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("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId); CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId); continue; } @@ -17494,14 +17494,14 @@ 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("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId); CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId); continue; } 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("_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); CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId); continue; } @@ -17585,7 +17585,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave *save, bool permanent, b bind.save = save; bind.perm = permanent; if (!load) - sLog.outDebug("Player::BindToInstance: %s(%d) is now bound to map %d, instance %d, difficulty %d", GetName(), GetGUIDLow(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); + sLog->outDebug("Player::BindToInstance: %s(%d) is now bound to map %d, instance %d, difficulty %d", GetName(), GetGUIDLow(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent); return &bind; } @@ -17725,7 +17725,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report if (!mapEntry) return false; - if (!sWorld.getBoolConfig(CONFIG_INSTANCE_IGNORE_LEVEL)) + if (!sWorld->getBoolConfig(CONFIG_INSTANCE_IGNORE_LEVEL)) { if (ar->levelMin && getLevel() < ar->levelMin) LevelMin = ar->levelMin; @@ -17810,7 +17810,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); if (!info) { - sLog.outError("Player have incorrect race/class pair. Can't be loaded."); + sLog->outError("Player have incorrect race/class pair. Can't be loaded."); return false; } @@ -17848,7 +17848,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) GetGUIDLow(), m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); } - sLog.outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", + sLog->outStaticDebug("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; @@ -17861,7 +17861,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) void Player::SaveToDB() { // delay auto save at any saves (manual, in code, or autosave) - m_nextSave = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE); + m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); //lets allow only players in world to be saved if (IsBeingTeleportedFar()) @@ -17873,7 +17873,7 @@ void Player::SaveToDB() // first save/honor gain after midnight will also update the player's honor fields UpdateHonorFields(); - sLog.outDebug("The value of player %s at save: ", m_name.c_str()); + sLog->outDebug("The value of player %s at save: ", m_name.c_str()); outDebugValues(); std::string sql_name = m_name; @@ -18041,7 +18041,7 @@ void Player::SaveToDB() // check if stats should only be saved on logout // save stats can be out of transaction - if (m_session->isLogingOut() || !sWorld.getBoolConfig(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT)) + if (m_session->isLogingOut() || !sWorld->getBoolConfig(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT)) _SaveStats(trans); CharacterDatabase.CommitTransaction(trans); @@ -18184,7 +18184,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("Can't find item guid %u but is in refundable storage for player %u ! Removing.", *itr, GetGUIDLow()); m_refundableItems.erase(itr); } } @@ -18215,7 +18215,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("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 trans->PAppend("DELETE FROM character_inventory WHERE bag=%u AND slot=%u AND guid=%u", bagTestGUID, item->GetSlot(), lowGuid); // also THIS item should be somewhere else, cheat attempt @@ -18226,7 +18226,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("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); @@ -18324,11 +18324,11 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) case QUEST_NEW : trans->PAppend("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) " "VALUES ('%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILLISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]); + GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILLISECONDS+ sWorld->GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]); break; case QUEST_CHANGED : trans->PAppend("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" UI64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ", - i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILLISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first); + i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILLISECONDS + sWorld->GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first); break; case QUEST_UNCHANGED: break; @@ -18451,7 +18451,7 @@ void Player::_SaveSpells(SQLTransaction& trans) void Player::_SaveStats(SQLTransaction& trans) { // check if stat saving is enabled and if char level is high enough - if (!sWorld.getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld.getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE)) + if (!sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE)) return; trans->PAppend("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow()); @@ -18482,21 +18482,21 @@ void Player::_SaveStats(SQLTransaction& trans) void Player::outDebugValues() const { - if (!sLog.IsOutDebug()) // optimize disabled debug output + if (!sLog->IsOutDebug()) // optimize disabled debug output return; - sLog.outDebug("HP is: \t\t\t%u\t\tMP is: \t\t\t%u",GetMaxHealth(), GetMaxPower(POWER_MANA)); - sLog.outDebug("AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f",GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); - sLog.outDebug("INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f",GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); - sLog.outDebug("STAMINA is: \t\t%f",GetStat(STAT_STAMINA)); - sLog.outDebug("Armor is: \t\t%u\t\tBlock is: \t\t%f",GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); - sLog.outDebug("HolyRes is: \t\t%u\t\tFireRes is: \t\t%u",GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); - sLog.outDebug("NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u",GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); - sLog.outDebug("ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u",GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); - sLog.outDebug("MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f",GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); - sLog.outDebug("MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); - sLog.outDebug("MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); - sLog.outDebug("ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u",GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); + sLog->outDebug("HP is: \t\t\t%u\t\tMP is: \t\t\t%u",GetMaxHealth(), GetMaxPower(POWER_MANA)); + sLog->outDebug("AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f",GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); + sLog->outDebug("INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f",GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); + sLog->outDebug("STAMINA is: \t\t%f",GetStat(STAT_STAMINA)); + sLog->outDebug("Armor is: \t\t%u\t\tBlock is: \t\t%f",GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); + sLog->outDebug("HolyRes is: \t\t%u\t\tFireRes is: \t\t%u",GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); + sLog->outDebug("NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u",GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); + sLog->outDebug("ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u",GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); + sLog->outDebug("MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f",GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); + sLog->outDebug("MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); + sLog->outDebug("MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); + sLog->outDebug("ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u",GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); } /*********************************************************/ @@ -18512,7 +18512,7 @@ void Player::UpdateSpeakTime() time_t current = time (NULL); if (m_speakTime > current) { - uint32 max_count = sWorld.getIntConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT); + uint32 max_count = sWorld->getIntConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT); if (!max_count) return; @@ -18520,7 +18520,7 @@ void Player::UpdateSpeakTime() if (m_speakCount >= max_count) { // prevent overwrite mute time, if message send just before mutes set, for example. - time_t new_mute = current + sWorld.getIntConfig(CONFIG_CHATFLOOD_MUTE_TIME); + time_t new_mute = current + sWorld->getIntConfig(CONFIG_CHATFLOOD_MUTE_TIME); if (GetSession()->m_muteTime < new_mute) GetSession()->m_muteTime = new_mute; @@ -18530,7 +18530,7 @@ void Player::UpdateSpeakTime() else m_speakCount = 0; - m_speakTime = current + sWorld.getIntConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY); + m_speakTime = current + sWorld->getIntConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY); } bool Player::CanSpeak() const @@ -18555,7 +18555,7 @@ void Player::SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint << "',position_z='"<outDebug("%s", ss.str().c_str()); CharacterDatabase.Execute(ss.str().c_str()); } @@ -18785,7 +18785,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("Player::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid)); //const_cast(this)->SetPetGUID(0); } @@ -18799,7 +18799,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) if (pet) { - sLog.outDebug("RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); + sLog->outDebug("RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); if (pet->m_removed) return; @@ -18887,10 +18887,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->outCrash("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->outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID()); ASSERT(false); } else @@ -18917,7 +18917,7 @@ void Player::Say(const std::string& text, const uint32 language) WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_SAY, _text, language); - SendMessageToSetInRange(&data, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); } void Player::Yell(const std::string& text, const uint32 language) @@ -18927,7 +18927,7 @@ void Player::Yell(const std::string& text, const uint32 language) WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_YELL, _text, language); - SendMessageToSetInRange(&data, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true); } void Player::TextEmote(const std::string& text) @@ -18937,7 +18937,7 @@ void Player::TextEmote(const std::string& text) WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_EMOTE, _text, LANG_UNIVERSAL); - SendMessageToSetInRange(&data, sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)); } void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) @@ -18991,7 +18991,7 @@ void Player::PetSpellInitialize() if (!pet) return; - sLog.outDebug("Pet Spells Groups"); + sLog->outDebug("Pet Spells Groups"); CharmInfo *charmInfo = pet->GetCharmInfo(); @@ -19065,7 +19065,7 @@ void Player::PossessSpellInitialize() if (!charmInfo) { - sLog.outError("Player::PossessSpellInitialize(): charm ("UI64FMTD") has no charminfo!", charm->GetGUID()); + sLog->outError("Player::PossessSpellInitialize(): charm ("UI64FMTD") has no charminfo!", charm->GetGUID()); return; } @@ -19112,7 +19112,7 @@ void Player::VehicleSpellInitialize() ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(veh->ToCreature()->GetEntry(), spellId); if (!sConditionMgr->IsPlayerMeetToConditions(this, conditions)) { - sLog.outDebug("VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId); + sLog->outDebug("VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId); continue; } if (IsPassiveSpell(spellId)) @@ -19141,7 +19141,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("Player::CharmSpellInitialize(): the player's charm ("UI64FMTD") has no charminfo!", charm->GetGUID()); return; } @@ -19211,7 +19211,7 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo void Player::AddSpellMod(SpellModifier* mod, bool apply) { - sLog.outDebug("Player::AddSpellMod %d", mod->spellId); + sLog->outDebug("Player::AddSpellMod %d", mod->spellId); uint16 Opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; int i = 0; @@ -19424,7 +19424,7 @@ void Player::LeaveAllArenaTeams(uint64 guid) void Player::SetRestBonus (float rest_bonus_new) { // Prevent resting on max level - if (getLevel() >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) rest_bonus_new = 0; if (rest_bonus_new < 0) @@ -19636,7 +19636,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc // prevent stealth flight //RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); - if (sWorld.getBoolConfig(CONFIG_INSTANT_TAXI)) + if (sWorld->getBoolConfig(CONFIG_INSTANT_TAXI)) { TaxiNodesEntry const* lastnode = sTaxiNodesStore.LookupEntry(nodes[nodes.size()-1]); m_taxi.ClearTaxiDestinations(); @@ -19648,7 +19648,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); data << uint32(ERR_TAXIOK); GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_ACTIVATETAXIREPLY"); + sLog->outDebug("WORLD: Sent SMSG_ACTIVATETAXIREPLY"); GetSession()->SendDoFlight(mount_display_id, sourcepath); } return true; @@ -19683,7 +19683,7 @@ void Player::ContinueTaxiFlight() if (!sourceNode) return; - sLog.outDebug("WORLD: Restart character %u taxi flight", GetGUIDLow()); + sLog->outDebug("WORLD: Restart character %u taxi flight", GetGUIDLow()); uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeam(),true); uint32 path = m_taxi.GetCurrentTaxiPath(); @@ -19818,7 +19818,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("Player %u has incorrect race/class pair. Can't init display ids.", GetGUIDLow()); return; } @@ -19834,7 +19834,7 @@ void Player::InitDisplayIds() SetNativeDisplayId(info->displayId_m); break; default: - sLog.outError("Invalid gender %u for player",gender); + sLog->outError("Invalid gender %u for player",gender); return; } } @@ -19924,7 +19924,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 Creature *pCreature = GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog.outDebug("WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug("WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, item, 0); return false; } @@ -19971,7 +19971,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("Item %u have wrong ExtendedCost field value %u", pProto->ItemId, crItem->ExtendedCost); return false; } @@ -20099,7 +20099,7 @@ void Player::UpdateHomebindTime(uint32 time) data << uint32(m_HomebindTimer); data << uint32(1); GetSession()->SendPacket(&data); - sLog.outDebug("PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(),GetGUIDLow()); + sLog->outDebug("PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(),GetGUIDLow()); } } @@ -20107,7 +20107,7 @@ void Player::UpdatePvPState(bool onlyFFA) { // TODO: should we always synchronize UNIT_FIELD_BYTES_2, 1 of controller and controlled? if (!pvpInfo.inNoPvPArea && !isGameMaster() - && (pvpInfo.inFFAPvPArea || sWorld.IsFFAPvPRealm())) + && (pvpInfo.inFFAPvPArea || sWorld->IsFFAPvPRealm())) { if (!HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP)) { @@ -20371,7 +20371,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) } } - sLog.outDebug("Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no"); + sLog->outDebug("Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no"); return activate; } @@ -20487,7 +20487,7 @@ void Player::SetBattlegroundEntryPoint() return; } else - sLog.outError("SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId()); + sLog->outError("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()) @@ -20508,7 +20508,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint) bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true); // call after remove to be sure that player resurrected for correct cast - if (bg->isBattleground() && !isGameMaster() && sWorld.getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER)) + if (bg->isBattleground() && !isGameMaster() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER)) { if (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN) { @@ -20689,8 +20689,8 @@ void Player::UpdateVisibilityOf(WorldObject* target) m_clientGUIDs.erase(target->GetGUID()); #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog.outDebug("Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); + if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) + sLog->outDebug("Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); #endif } } @@ -20705,8 +20705,8 @@ void Player::UpdateVisibilityOf(WorldObject* target) m_clientGUIDs.insert(target->GetGUID()); #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog.outDebug("Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); + if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) + sLog->outDebug("Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); #endif // target aura duration for caster show only if target exist at caster client @@ -20764,8 +20764,8 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set& vi m_clientGUIDs.erase(target->GetGUID()); #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog.outDebug("Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); + if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) + sLog->outDebug("Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); #endif } } @@ -20780,8 +20780,8 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set& vi UpdateVisibilityOf_helper(m_clientGUIDs,target,visibleNow); #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog.outDebug("Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); + if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) + sLog->outDebug("Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); #endif } } @@ -20814,7 +20814,7 @@ void Player::UpdateVisibilityForPlayer() void Player::InitPrimaryProfessions() { - SetFreePrimaryProfessions(sWorld.getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)); + SetFreePrimaryProfessions(sWorld->getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)); } void Player::ModifyMoney(int32 d) @@ -20994,7 +20994,7 @@ void Player::SendInitialPacketsBeforeAddToMap() SendEquipmentSetList(); data.Initialize(SMSG_LOGIN_SETTIMESPEED, 4 + 4 + 4); - data << uint32(secsToTimeBitFields(sWorld.GetGameTime())); + data << uint32(secsToTimeBitFields(sWorld->GetGameTime())); data << (float)0.01666667f; // game speed data << uint32(0); // added in 3.1.2 GetSession()->SendPacket(&data); @@ -21213,7 +21213,7 @@ void Player::learnDefaultSpells() for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr != info->spell.end(); ++itr) { uint32 tspell = *itr; - sLog.outDebug("PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",uint32(getClass()),uint32(getRace()), tspell); + sLog->outDebug("PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",uint32(getClass()),uint32(getRace()), tspell); if (!IsInWorld()) // will send in INITIAL_SPELLS in list anyway at map add addSpell(tspell,true,true,true,false); else // but send in normal spell in game learn case @@ -21719,7 +21719,7 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons break; } default: - sLog.outError("HasItemFitToSpellReqirements: Not handled spell requirement for item class %u",spellInfo->EquippedItemClass); + sLog->outError("HasItemFitToSpellReqirements: Not handled spell requirement for item class %u",spellInfo->EquippedItemClass); break; } @@ -21797,7 +21797,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("Unhandled spell %u: S.Resurrection",(*itr)->GetId()); continue; } @@ -21841,7 +21841,7 @@ bool Player::isHonorOrXPTarget(Unit* pVictim) bool Player::GetsRecruitAFriendBonus(bool forXP) { bool recruitAFriend = false; - if (getLevel() <= sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP) + if (getLevel() <= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP) { if (Group *group = this->GetGroup()) { @@ -21857,12 +21857,12 @@ bool Player::GetsRecruitAFriendBonus(bool forXP) if (forXP) { // level must be allowed to get RaF bonus - if (pGroupGuy->getLevel() > sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL)) + if (pGroupGuy->getLevel() > sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL)) continue; // level difference must be small enough to get RaF bonus, UNLESS we are lower level if (pGroupGuy->getLevel() < getLevel()) - if (uint8(getLevel() - pGroupGuy->getLevel()) > sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE)) + if (uint8(getLevel() - pGroupGuy->getLevel()) > sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE)) continue; } @@ -22025,7 +22025,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const if (player->GetMapId() != pRewardSource->GetMapId() || player->GetInstanceId() != pRewardSource->GetInstanceId()) return false; - return pRewardSource->GetDistance(player) <= sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE); + return pRewardSource->GetDistance(player) <= sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE); } bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const @@ -22039,7 +22039,7 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const if (player->GetMapId() != pOther->GetMapId() || player->GetInstanceId() != pOther->GetInstanceId()) return false; - return pOther->GetDistance(player) <= sWorld.getFloatConfig(CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE); + return pOther->GetDistance(player) <= sWorld->getFloatConfig(CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE); } uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const @@ -22144,10 +22144,10 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const { if (pvp) { - if (!sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) + if (!sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) return copseReclaimDelay[0]; } - else if (!sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)) + else if (!sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)) return 0; time_t now = time(NULL); @@ -22161,8 +22161,8 @@ void Player::UpdateCorpseReclaimDelay() { bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH; - if ((pvp && !sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) || - (!pvp && !sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))) + if ((pvp && !sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) || + (!pvp && !sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))) return; time_t now = time(NULL); @@ -22198,8 +22198,8 @@ void Player::SendCorpseReclaimDelay(bool load) return; uint64 count; - if ((pvp && sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) || - (!pvp && sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))) + if ((pvp && sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) || + (!pvp && sWorld->getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))) { count = (m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP; if (count >= MAX_DEATH_COUNT) @@ -22430,11 +22430,11 @@ void Player::SetViewpoint(WorldObject* target, bool apply) { if (apply) { - sLog.outDebug("Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName(), target->GetEntry(), target->GetTypeId()); + sLog->outDebug("Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName(), target->GetEntry(), target->GetTypeId()); if (!AddUInt64Value(PLAYER_FARSIGHT, target->GetGUID())) { - sLog.outCrash("Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName()); + sLog->outCrash("Player::CreateViewpoint: Player %s cannot add new viewpoint!", GetName()); return; } @@ -22446,11 +22446,11 @@ void Player::SetViewpoint(WorldObject* target, bool apply) } else { - sLog.outDebug("Player::CreateViewpoint: Player %s remove seer", GetName()); + sLog->outDebug("Player::CreateViewpoint: Player %s remove seer", GetName()); if (!RemoveUInt64Value(PLAYER_FARSIGHT, target->GetGUID())) { - sLog.outCrash("Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName()); + sLog->outCrash("Player::CreateViewpoint: Player %s cannot remove current viewpoint!", GetName()); return; } @@ -22693,7 +22693,7 @@ bool Player::HasGlobalCooldown(SpellEntry const *spellInfo) const return false; std::map::const_iterator itr = m_globalCooldowns.find(spellInfo->StartRecoveryCategory); - return itr != m_globalCooldowns.end() && (itr->second > sWorld.GetUpdateTime()); + return itr != m_globalCooldowns.end() && (itr->second > sWorld->GetUpdateTime()); } void Player::RemoveGlobalCooldown(SpellEntry const *spellInfo) @@ -22918,7 +22918,7 @@ uint32 Player::CalculateTalentsPoints() const uint32 base_talent = getLevel() < 10 ? 0 : getLevel()-9; if (getClass() != CLASS_DEATH_KNIGHT || GetMapId() != 609) - return uint32(base_talent * sWorld.getRate(RATE_TALENT)); + return uint32(base_talent * sWorld->getRate(RATE_TALENT)); uint32 talentPointsForLevel = getLevel() < 56 ? 0 : getLevel() - 55; talentPointsForLevel += m_questRewardTalentCount; @@ -22926,7 +22926,7 @@ uint32 Player::CalculateTalentsPoints() const if (talentPointsForLevel > base_talent) talentPointsForLevel = base_talent; - return uint32(talentPointsForLevel * sWorld.getRate(RATE_TALENT)); + return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT)); } bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const @@ -22962,7 +22962,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("Character %u has skill %u that does not exist.", GetGUIDLow(), skill); continue; } @@ -22980,7 +22980,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("Character %u has skill %u with value 0. Will be deleted.", GetGUIDLow(), skill); CharacterDatabase.PExecute("DELETE FROM character_skills WHERE guid = '%u' AND skill = '%u' ", GetGUIDLow(), skill); continue; } @@ -23002,7 +23002,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("Character %u has more than %u skills.", GetGUIDLow(), PLAYER_MAX_SKILLS); break; } } @@ -23019,7 +23019,7 @@ void Player::_LoadSkills(PreparedQueryResult result) // special settings if (getClass() == CLASS_DEATH_KNIGHT) { - uint8 base_level = std::min(getLevel(),uint8(sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL))); + uint8 base_level = std::min(getLevel(),uint8(sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL))); if (base_level < 1) base_level = 1; uint16 base_skill = (base_level-1)*5; // 270 at starting level 55 @@ -23131,7 +23131,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("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 @@ -23146,7 +23146,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) if (damageperc > 0) { - uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld.getRate(RATE_DAMAGE_FALL)); + uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld->getRate(RATE_DAMAGE_FALL)); float height = movementInfo.pos.m_positionZ; UpdateGroundPositionZ(movementInfo.pos.m_positionX,movementInfo.pos.m_positionY,height); @@ -23170,7 +23170,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->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); } } RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LANDING); // No fly zone - Parachute @@ -23284,7 +23284,7 @@ void 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("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank); return; } @@ -23296,7 +23296,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) learnSpell(spellid, false); AddTalent(spellid, m_activeSpec, true); - sLog.outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, m_activeSpec); + sLog->outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, m_activeSpec); // update free talent points SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1)); @@ -23421,7 +23421,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("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank); return; } @@ -23431,7 +23431,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->outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid); // update free talent points pet->SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1)); @@ -23732,7 +23732,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("Player %s tried to save equipment set "UI64FMTD" (index %u), but that equipment set not found!", GetName(), eqset.Guid, index); return; } } @@ -24176,13 +24176,13 @@ void Player::SendRefundInfo(Item *item) if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { - sLog.outDebug("Item refund: item not refundable!"); + sLog->outDebug("Item refund: item not refundable!"); return; } if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { - sLog.outDebug("Item refund: item was traded!"); + sLog->outDebug("Item refund: item was traded!"); item->SetNotRefundable(this); return; } @@ -24190,7 +24190,7 @@ void Player::SendRefundInfo(Item *item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { - sLog.outDebug("Item refund: cannot find extendedcost data."); + sLog->outDebug("Item refund: cannot find extendedcost data."); return; } @@ -24236,7 +24236,7 @@ void Player::RefundItem(Item *item) { if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { - sLog.outDebug("Item refund: item not refundable!"); + sLog->outDebug("Item refund: item not refundable!"); return; } @@ -24252,7 +24252,7 @@ void Player::RefundItem(Item *item) if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { - sLog.outDebug("Item refund: item was traded!"); + sLog->outDebug("Item refund: item was traded!"); item->SetNotRefundable(this); return; } @@ -24260,7 +24260,7 @@ void Player::RefundItem(Item *item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { - sLog.outDebug("Item refund: cannot find extendedcost data."); + sLog->outDebug("Item refund: cannot find extendedcost data."); return; } diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index 5bd02968759..d2639294390 100755 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -144,7 +144,7 @@ void PlayerSocial::SendSocialList(Player* plr) } plr->GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_CONTACT_LIST"); + sLog->outDebug("WORLD: Sent SMSG_CONTACT_LIST"); } bool PlayerSocial::HasFriend(uint32 friend_guid) @@ -187,8 +187,8 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri uint32 team = player->GetTeam(); AccountTypes security = player->GetSession()->GetSecurity(); - bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); - AccountTypes gmLevelInWhoList = AccountTypes (sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST)); + bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); + AccountTypes gmLevelInWhoList = AccountTypes (sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST)); PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID); if (itr != player->GetSocial()->m_playerSocialMap.end()) @@ -263,8 +263,8 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet) uint32 team = player->GetTeam(); AccountTypes security = player->GetSession()->GetSecurity(); uint32 guid = player->GetGUIDLow(); - AccountTypes gmLevelInWhoList = AccountTypes(sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST)); - bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); + AccountTypes gmLevelInWhoList = AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST)); + bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); for (SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr) { diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 421a931005f..744e7ed59bb 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->outString(">> Loaded 0 transports. DB table `transports` is empty!"); + sLog->outString(); return; } @@ -58,26 +58,26 @@ void MapManager::LoadTransports() if (!goinfo) { - sLog.outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str()); + sLog->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template missing", entry, name.c_str()); delete t; 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->outErrorDb("Transport ID:%u, Name: %s, will not be loaded, gameobject_template type wrong", entry, name.c_str()); delete t; continue; } - // sLog.outString("Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name); + // sLog->outString("Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name); std::set mapsUsed; 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->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId); delete t; continue; } @@ -119,13 +119,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 DON'T must have any records in `gameobject` or its behavior will be unpredictable/bugged.",entry,name.c_str(),guid); + sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports DON'T must 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->outString(">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void MapManager::LoadTransportNPCs() @@ -137,8 +137,8 @@ void MapManager::LoadTransportNPCs() if (!result) { - sLog.outString(">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!"); + sLog->outString(); return; } @@ -169,8 +169,8 @@ void MapManager::LoadTransportNPCs() } while (result->NextRow()); - sLog.outString(">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } Transport::Transport(uint32 period, uint32 script) : GameObject(), m_period(period), ScriptId(script) @@ -196,7 +196,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("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow,x,y); return false; } @@ -207,7 +207,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->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); return false; } @@ -354,7 +354,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &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->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); // } // Now we're completely set up; we can move along the length of each waypoint at 100 ms intervals @@ -398,7 +398,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) cM = keyFrames[i].node->mapid; } - // sLog.outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ); + // sLog->outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ); WayPoint pos(keyFrames[i].node->mapid, newX, newY, newZ, teleport, 0); if (teleport) m_WayPoints[t] = pos; @@ -447,7 +447,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) WayPoint pos(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->outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport); /* if (keyFrames[i+1].delay > 5) pos.delayed = true; @@ -456,12 +456,12 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set &mapids) m_WayPoints[t] = pos; t += keyFrames[i + 1].node->delay * 1000; - // sLog.outString("------"); + // sLog->outString("------"); } uint32 timer = t; - // sLog.outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer); + // sLog->outDetail(" Generated %lu waypoints, total time %u.", (unsigned long)m_WayPoints.size(), timer); m_curr = m_WayPoints.begin(); m_next = GetNextWayPoint(); @@ -520,7 +520,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->outDetail("Player %s boarded transport %s.", passenger->GetName(), GetName()); sScriptMgr->OnAddPassenger(this, passenger); return true; @@ -529,7 +529,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->outDetail("Player %s removed from transport %s.", passenger->GetName(), GetName()); sScriptMgr->OnRemovePassenger(this, passenger); return true; @@ -540,7 +540,7 @@ void Transport::Update(uint32 p_diff) if(!AI()) { if (!AIM_Initialize()) - sLog.outError("Could not initialize GameObjectAI for Transport"); + sLog->outError("Could not initialize GameObjectAI for Transport"); } else AI()->UpdateAI(p_diff); @@ -572,11 +572,11 @@ void Transport::Update(uint32 p_diff) m_nextNodeTime = m_curr->first; - if (m_curr == m_WayPoints.begin() && (sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0) - sLog.outDetail(" ************ BEGIN ************** %s", m_name.c_str()); + if (m_curr == m_WayPoints.begin() && (sLog->getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0) + sLog->outDetail(" ************ BEGIN ************** %s", m_name.c_str()); - if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0) - sLog.outDetail("%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); + if ((sLog->getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0) + sLog->outDetail("%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); } sScriptMgr->OnTransportUpdate(this, p_diff); @@ -619,7 +619,7 @@ void Transport::DoEventIfAny(WayPointMap::value_type const& node, bool departure { if (uint32 eventid = departure ? node.second.departureEventID : node.second.arrivalEventID) { - sLog.outDebug("Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.first, GetName()); + sLog->outDebug("Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.first, GetName()); GetMap()->ScriptsStart(sEventScripts, eventid, this, this); EventInform(eventid); } @@ -668,7 +668,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, if(!pCreature->IsPositionValid()) { - sLog.outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); + sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); delete pCreature; return 0; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 003b06a0b67..63aaa6b0669 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -476,9 +476,9 @@ void Unit::GetRandomContactPoint(const Unit* obj, float &x, float &y, float &z, float combat_reach = GetCombatReach(); if (combat_reach < 0.1) // sometimes bugged for players { - //sLog.outError("Unit %u (Type: %u) has invalid combat_reach %f",GetGUIDLow(),GetTypeId(),combat_reach); + //sLog->outError("Unit %u (Type: %u) has invalid combat_reach %f",GetGUIDLow(),GetTypeId(),combat_reach); //if (GetTypeId() == TYPEID_UNIT) - // sLog.outError("Creature entry %u has invalid combat_reach", this->ToCreature()->GetEntry()); + // sLog->outError("Creature entry %u has invalid combat_reach", this->ToCreature()->GetEntry()); combat_reach = DEFAULT_COMBAT_REACH; } uint32 attacker_number = getAttackers().size(); @@ -618,10 +618,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa return 0; } - sLog.outStaticDebug("DealDamageStart"); + sLog->outStaticDebug("DealDamageStart"); uint32 health = pVictim->GetHealth(); - sLog.outDetail("deal dmg:%d to health:%d ",damage,health); + sLog->outDetail("deal dmg:%d to health:%d ",damage,health); // duel ends when player has 1 or less hp bool duel_hasEnded = false; @@ -660,7 +660,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (health <= damage) { - sLog.outStaticDebug("DealDamage: victim just died"); + sLog->outStaticDebug("DealDamage: victim just died"); if (pVictim->GetTypeId() == TYPEID_PLAYER) { @@ -675,7 +675,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa } else { - sLog.outStaticDebug("DealDamageAlive"); + sLog->outStaticDebug("DealDamageAlive"); if (pVictim->GetTypeId() == TYPEID_PLAYER) pVictim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage); @@ -695,7 +695,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa else // victim is a player { // random durability for items (HIT TAKEN) - if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_DAMAGE))) + if (roll_chance_f(sWorld->getRate(RATE_DURABILITY_LOSS_DAMAGE))) { EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1)); pVictim->ToPlayer()->DurabilityPointLossForEquipSlot(slot); @@ -712,7 +712,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (GetTypeId() == TYPEID_PLAYER) { // random durability for items (HIT DONE) - if (roll_chance_f(sWorld.getRate(RATE_DURABILITY_LOSS_DAMAGE))) + if (roll_chance_f(sWorld->getRate(RATE_DURABILITY_LOSS_DAMAGE))) { EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1)); this->ToPlayer()->DurabilityPointLossForEquipSlot(slot); @@ -768,7 +768,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa } } - sLog.outStaticDebug("DealDamageEnd returned %d damage", damage); + sLog->outStaticDebug("DealDamageEnd returned %d damage", damage); return damage; } @@ -786,7 +786,7 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte if (!spellInfo) { - sLog.outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } @@ -797,7 +797,7 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I { 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("CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } @@ -809,7 +809,7 @@ void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, I targets.setUnitTarget(Victim); if (castItem) - sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog->outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); if (!originalCaster && triggeredByAura) originalCaster = triggeredByAura->GetCasterGUID(); @@ -844,7 +844,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { - sLog.outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } @@ -858,7 +858,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* if (castItem) { - sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog->outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); spell->m_CastItem = castItem; } @@ -875,12 +875,12 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, if (!spellInfo) { - sLog.outError("CastSpell(x,y,z): unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell(x,y,z): unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } if (castItem) - sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog->outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); if (!originalCaster && triggeredByAura) originalCaster = triggeredByAura->GetCasterGUID(); @@ -905,18 +905,18 @@ void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castI if (!spellInfo) { - sLog.outError("CastSpell(x,y,z): unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell(x,y,z): unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } if (!(spellInfo->Targets & (TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_CASTER))) { - sLog.outError("CastSpell: spell id %i by caster: %s %u) is not gameobject spell", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell: spell id %i by caster: %s %u) is not gameobject spell", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } if (castItem) - sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog->outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); if (!originalCaster && triggeredByAura) originalCaster = triggeredByAura->GetCasterGUID(); @@ -1067,7 +1067,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss) SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID); if (spellProto == NULL) { - sLog.outDebug("Unit::DealSpellDamage have wrong damageInfo->SpellID: %u", damageInfo->SpellID); + sLog->outDebug("Unit::DealSpellDamage have wrong damageInfo->SpellID: %u", damageInfo->SpellID); return; } @@ -1806,7 +1806,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff ); break; default: - sLog.outError("Unit::CalcAbsorbResist: unknown Reflective Shield spell %d", aurEff->GetId()); + sLog->outError("Unit::CalcAbsorbResist: unknown Reflective Shield spell %d", aurEff->GetId()); break; } } @@ -2274,10 +2274,10 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex 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->outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->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->outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist); } @@ -2309,7 +2309,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackT float parry_chance = pVictim->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->outStaticDebug("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance); return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100)); } @@ -2330,22 +2330,22 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack 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->outStaticDebug ("RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus); + sLog->outStaticDebug ("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->outStaticDebug ("RollMeleeOutcomeAgainst: MISS"); return MELEE_HIT_MISS; } // always crit against a sitting target (except 0 crit chance) if (pVictim->GetTypeId() == TYPEID_PLAYER && crit_chance > 0 && !pVictim->IsStandState()) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)"); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)"); return MELEE_HIT_CRIT; } @@ -2354,7 +2354,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack // only players can't dodge if attacker is behind if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player."); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player."); } else { @@ -2373,7 +2373,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack && ((tmp -= skillBonus) > 0) && roll < (sum += tmp)) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum); return MELEE_HIT_DODGE; } } @@ -2382,7 +2382,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack // check if attack comes from behind, nobody can parry or block if attacker is behind if (!pVictim->HasInArc(M_PI, this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind."); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind."); else { // Reduce parry chance by attacker expertise rating @@ -2398,7 +2398,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack && (tmp2 -= skillBonus) > 0 && roll < (sum += tmp2)) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); return MELEE_HIT_PARRY; } } @@ -2410,7 +2410,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack && (tmp -= skillBonus) > 0 && roll < (sum += tmp)) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); return MELEE_HIT_BLOCK; } } @@ -2421,9 +2421,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack if (tmp > 0 && roll < (sum += tmp)) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); if (GetTypeId() == TYPEID_UNIT && (this->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); else return MELEE_HIT_CRIT; } @@ -2443,7 +2443,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack tmp = tmp > 4000 ? 4000 : tmp; if (roll < (sum += tmp)) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); return MELEE_HIT_GLANCING; } } @@ -2467,13 +2467,13 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack tmp = tmp * 200 - 1500; if (roll < (sum += tmp)) { - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum); return MELEE_HIT_CRUSHING; } } } - sLog.outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL"); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL"); return MELEE_HIT_NORMAL; } @@ -2539,7 +2539,7 @@ void Unit::SendMeleeAttackStart(Unit* pVictim) data << uint64(pVictim->GetGUID()); SendMessageToSet(&data, true); - sLog.outStaticDebug("WORLD: Sent SMSG_ATTACKSTART"); + sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART"); } void Unit::SendMeleeAttackStop(Unit* victim) @@ -2552,7 +2552,7 @@ void Unit::SendMeleeAttackStop(Unit* victim) data.append(victim->GetPackGUID()); // can be 0x00... data << uint32(0); // can be 0x1 SendMessageToSet(&data, true); - sLog.outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"),victim->GetGUIDLow()); + sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"),victim->GetGUIDLow()); } bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType) @@ -2706,7 +2706,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry 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 have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue()); + sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT have unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue()); break; } } @@ -3281,7 +3281,7 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi { ASSERT(spellType < CURRENT_MAX_SPELL); - //sLog.outDebug("Interrupt spell for unit %u.", GetEntry()); + //sLog->outDebug("Interrupt spell for unit %u.", GetEntry()); Spell *spell = m_currentSpells[spellType]; if (spell && (withDelayed || spell->getState() != SPELL_STATE_DELAYED) @@ -3572,7 +3572,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo ASSERT(aurApp->GetTarget() == this); aurApp->SetRemoveMode(removeMode); Aura * aura = aurApp->GetBase(); - sLog.outDebug("Aura %u now is remove mode %d", aura->GetId(), removeMode); + sLog->outDebug("Aura %u now is remove mode %d", aura->GetId(), removeMode); // dead loop is killing the server probably ASSERT(m_removedAurasCount < 0xFFFFFFFF); @@ -3975,7 +3975,7 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit triggeredSpellId = 64694; break; default: - sLog.outError("Aura::HandleAuraSpecificMods: Unknown rank of Lava Flows (%d) found", aurEff->GetId()); + sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Lava Flows (%d) found", aurEff->GetId()); } } if (triggeredSpellId) @@ -4335,7 +4335,7 @@ void Unit::DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime) // update for out of range group members (on 1 slot use) aura->SetNeedClientUpdateForTargets(); - sLog.outDebug("Aura %u partially interrupted on unit %u, new duration: %u ms",aura->GetId() , GetGUIDLow(), aura->GetDuration()); + sLog->outDebug("Aura %u partially interrupted on unit %u, new duration: %u ms",aura->GetId() , GetGUIDLow(), aura->GetDuration()); } } } @@ -5052,7 +5052,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("Unit::SendPeriodicAuraLog: unknown aura %u", uint32(aura->GetAuraType())); return; } @@ -5085,7 +5085,7 @@ void Unit::SendSpellDamageImmune(Unit * target, uint32 spellId) void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo) { - sLog.outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); + sLog->outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); uint32 count = 1; size_t maxsize = 4+5+5+4+4+1+4+4+4+4+4+1+4+4+4+4+4*12; @@ -5202,7 +5202,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (!triggerEntry) { - sLog.outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u",hasteSpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u",hasteSpell->Id,triggered_spell_id); return false; } @@ -5264,7 +5264,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*damage*/, AuraE if (!triggerEntry) { - sLog.outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u",triggeredByAuraSpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u",triggeredByAuraSpell->Id,triggered_spell_id); return false; } @@ -5327,7 +5327,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // return damage % to attacker but < 50% own total health basepoints0 = int32(std::min(CalculatePctN(damage, triggerAmount), CountPctFromMaxHealth(50))); - sLog.outDebug("DEBUG LINE: Data about Eye for an Eye ID %u, damage taken %u, unit max health %u, damage done %u", dummySpell->Id, damage, GetMaxHealth(), basepoints0); + sLog->outDebug("DEBUG LINE: Data about Eye for an Eye ID %u, damage taken %u, unit max health %u, damage done %u", dummySpell->Id, damage, GetMaxHealth(), basepoints0); triggered_spell_id = 25997; @@ -5885,7 +5885,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger 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("Unit::HandleDummyAuraProc: non handled spell id: %u",dummySpell->Id); return false; } break; @@ -5966,7 +5966,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger 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("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)",dummySpell->Id); return false; } @@ -6045,7 +6045,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger 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("Unit::HandleDummyAuraProc: non handled spell id: %u (SW)",dummySpell->Id); return false; } @@ -7215,7 +7215,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger 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("Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)", castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)),dummySpell->Id); return false; } @@ -7224,7 +7224,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger SpellEntry const* windfurySpellEntry = sSpellStore.LookupEntry(spellId); if (!windfurySpellEntry) { - sLog.outError("Unit::HandleDummyAuraProc: non existed spell id: %u (Windfury)",spellId); + sLog->outError("Unit::HandleDummyAuraProc: non existed spell id: %u (Windfury)",spellId); return false; } @@ -7543,7 +7543,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger 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("Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id); return false; } @@ -7872,7 +7872,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id); if (!triggerEntry) { - sLog.outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); return false; } @@ -7934,7 +7934,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 /*damage*/, AuraEffe // Try handle unknown trigger spells if (!triggerEntry) { - sLog.outError("Unit::HandleObsModEnergyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleObsModEnergyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); return false; } @@ -7991,7 +7991,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, Aur if (!triggerEntry) { - sLog.outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); return false; } @@ -8284,7 +8284,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig trigger_spell_id = 31643; break; default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed",auraSpellInfo->Id); + sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed",auraSpellInfo->Id); return false; } } @@ -8350,7 +8350,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig 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("Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id); return false; } basepoints0 = CalculatePctN(int32(damage), triggerAmount) / 3; @@ -8401,7 +8401,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig trigger_spell_id = 63468; break; default: - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots",auraSpellInfo->Id); + sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots",auraSpellInfo->Id); return false; } SpellEntry const *TriggerPS = sSpellStore.LookupEntry(trigger_spell_id); @@ -8526,14 +8526,14 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig 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("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); return false; } } SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId); if (!originalSpell) { - sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId); + sLog->outError("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 *pVictim, uint32 damage, AuraEffect* trig if (triggerEntry == NULL) { // Not cast unknown spell - // sLog.outError("Unit::HandleProcTriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",auraSpellInfo->Id,triggeredByAura->GetEffIndex()); + // sLog->outError("Unit::HandleProcTriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",auraSpellInfo->Id,triggeredByAura->GetEffIndex()); return false; } @@ -9115,7 +9115,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 /*damage*/, A if (!triggerEntry) { - sLog.outError("Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u",triggered_spell_id,scriptId); + sLog->outError("Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u",triggered_spell_id,scriptId); return false; } @@ -9183,11 +9183,11 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const if (GetGUID() != guid) { if (const Player *player = ToPlayer()) - sLog.outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction()); + sLog->outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction()); else if (const Creature *creature = ToCreature()) - sLog.outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureInfo()->Entry, getFaction()); + sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureInfo()->Entry, getFaction()); else - sLog.outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction()); + sLog->outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction()); guid = GetGUID(); } @@ -9628,7 +9628,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("WORLD: Unit has an attacker that isn't attacking it!"); m_attackers.erase(iter); } } @@ -9758,7 +9758,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("Unit::GetFirstMinion: Minion %u not exist.",GUID_LOPART(pet_guid)); const_cast(this)->SetMinionGUID(0); } @@ -9773,7 +9773,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->outCrash("Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid); const_cast(this)->SetPetGUID(0); } @@ -9787,7 +9787,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("Unit::GetCharm: Charmed creature %u not exist.",GUID_LOPART(charm_guid)); const_cast(this)->SetUInt64Value(UNIT_FIELD_CHARM, 0); } @@ -9796,13 +9796,13 @@ Unit* Unit::GetCharm() const void Unit::SetMinion(Minion *minion, bool apply) { - sLog.outDebug("SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); + sLog->outDebug("SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); if (apply) { if (!minion->AddUInt64Value(UNIT_FIELD_SUMMONEDBY, GetGUID())) { - sLog.outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry()); + sLog->outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry()); return; } @@ -9873,7 +9873,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->outCrash("SetMinion: Minion %u is not the minion of owner %u", minion->GetEntry(), GetEntry()); return; } @@ -9985,7 +9985,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->outCrash("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 @@ -9998,7 +9998,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->outCrash("Unit %u is being charmed, but it already has a charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID()); if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) { @@ -10013,11 +10013,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->outCrash("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->outCrash("Unit %u is being uncharmed, but it has another charmer " UI64FMTD "", charm->GetEntry(), charm->GetCharmerGUID()); if (charm->GetTypeId() == TYPEID_PLAYER) { @@ -10148,14 +10148,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("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->outCrash("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->outCrash("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->outCrash("Unit %u is not able to release its charm " UI64FMTD, GetEntry(), GetCharmGUID()); } Unit* Unit::GetNextRandomRaidMemberOrPet(float radius) @@ -11798,7 +11798,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att AuraEffect* eff0 = (*i)->GetBase()->GetEffect(0); if (!eff0 || (*i)->GetEffIndex() != 1) { - sLog.outError("Spell structure of DD (%u) changed.",(*i)->GetId()); + sLog->outError("Spell structure of DD (%u) changed.",(*i)->GetId()); continue; } @@ -12372,7 +12372,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) break; } default: - sLog.outError("Unit::UpdateSpeed: Unsupported move type (%d)", mtype); + sLog->outError("Unit::UpdateSpeed: Unsupported move type (%d)", mtype); return; } @@ -12479,7 +12479,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.Initialize(MSG_MOVE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4); break; default: - sLog.outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype); + sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype); return; } @@ -12538,7 +12538,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16); break; default: - sLog.outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype); + sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype); return; } data.append(GetPackGUID()); @@ -13214,7 +13214,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f { if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END) { - sLog.outError("ERROR in HandleStatModifier(): non existed UnitMods or wrong UnitModifierType!"); + sLog->outError("ERROR in HandleStatModifier(): non existed UnitMods or wrong UnitModifierType!"); return false; } @@ -13279,7 +13279,7 @@ float Unit::GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) co { if (unitMod >= UNIT_MOD_END || modifierType >= MODIFIER_TYPE_END) { - sLog.outError("trial to access non existed modifier value from UnitMods!"); + sLog->outError("trial to access non existed modifier value from UnitMods!"); return 0.0f; } @@ -13309,7 +13309,7 @@ float Unit::GetTotalAuraModValue(UnitMods unitMod) const { if (unitMod >= UNIT_MOD_END) { - sLog.outError("trial to access non existed UnitMods in GetTotalAuraModValue()!"); + sLog->outError("trial to access non existed UnitMods in GetTotalAuraModValue()!"); return 0.0f; } @@ -13638,7 +13638,7 @@ void Unit::RemoveFromWorld() if (GetCharmerGUID()) { - sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry()); + sLog->outCrash("Unit %u has charmer guid when removed from world", GetEntry()); ASSERT(false); } @@ -13646,7 +13646,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->outCrash("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry()); ASSERT(false); } } @@ -14232,7 +14232,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, bool handled = false; if (HandleAuraProc(pTarget, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { - sLog.outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), Id); + sLog->outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), Id); takeCharges = true; } @@ -14249,7 +14249,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, { case SPELL_AURA_PROC_TRIGGER_SPELL: { - sLog.outDebug("ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); // Don`t drop charge or add cooldown for not started trigger if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -14257,7 +14257,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, } case SPELL_AURA_PROC_TRIGGER_DAMAGE: { - sLog.outDebug("ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount() , spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount() , spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, spellInfo->SchoolMask); uint32 damage = SpellDamageBonus(pTarget, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); @@ -14270,38 +14270,38 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, case SPELL_AURA_MANA_SHIELD: case SPELL_AURA_DUMMY: { - sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; } case SPELL_AURA_OBS_MOD_POWER: - sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: - sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleModDamagePctTakenAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; case SPELL_AURA_MOD_MELEE_HASTE: { - sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; } case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: { - sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleOverrideClassScriptAuraProc(pTarget, damage, triggeredByAura, procSpell, cooldown)) takeCharges = true; break; } case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: { - sLog.outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", + sLog->outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId()); HandleAuraRaidProcFromChargeWithValue(triggeredByAura); @@ -14310,7 +14310,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, } case SPELL_AURA_RAID_PROC_FROM_CHARGE: { - sLog.outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", + sLog->outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId()); HandleAuraRaidProcFromCharge(triggeredByAura); @@ -14319,7 +14319,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, } case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: { - sLog.outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -14359,7 +14359,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, takeCharges = true; break; case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: - sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (procSpell && HandleSpellCritChanceAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; @@ -14938,7 +14938,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("Pet::InitStatsForLevel() failed for creature (Entry: %u)!",pet->GetEntry()); return false; } @@ -15062,7 +15062,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect *triggeredByAura) //Currently only Prayer of Mending if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20)) { - sLog.outDebug("Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); + sLog->outDebug("Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); return false; } @@ -15119,7 +15119,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura) damageSpellId = 43594; break; default: - sLog.outError("Unit::HandleAuraRaidProcFromCharge, received not handled spell: %u", spellProto->Id); + sLog->outError("Unit::HandleAuraRaidProcFromCharge, received not handled spell: %u", spellProto->Id); return false; } @@ -15292,7 +15292,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) if (!SpiritOfRedemption) { - sLog.outStaticDebug("SET JUST_DIED"); + sLog->outStaticDebug("SET JUST_DIED"); pVictim->setDeathState(JUST_DIED); } @@ -15305,10 +15305,10 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) pVictim->ToPlayer()->SetPvPDeath(player != NULL); // only if not player and not controlled by player pet. And not at BG - if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld.getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) + if ((durabilityLoss && !player && !pVictim->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)); - pVictim->ToPlayer()->DurabilityLossAll(sWorld.getRate(RATE_DURABILITY_LOSS_ON_DEATH),false); + sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); + pVictim->ToPlayer()->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH),false); // durability lost message WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); pVictim->ToPlayer()->GetSession()->SendPacket(&data); @@ -15327,7 +15327,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) } else // creature died { - sLog.outStaticDebug("DealDamageNotPlayer"); + sLog->outStaticDebug("DealDamageNotPlayer"); if (!creature->isPet()) { @@ -15593,7 +15593,7 @@ void Unit::SetFeared(bool apply) caster = ObjectAccessor::GetUnit(*this, fearAuras.front()->GetCasterGUID()); if (!caster) caster = getAttackerForHelper(); - GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == NULL processed in MoveFleeing + GetMotionMaster()->MoveFleeing(caster, fearAuras.empty() ? sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY) : 0); // caster == NULL processed in MoveFleeing } else { @@ -15644,11 +15644,11 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle()); - sLog.outDebug("SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); + sLog->outDebug("SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); if (this == charmer) { - sLog.outCrash("Unit::SetCharmedBy: Unit %u (GUID %u) is trying to charm itself!", GetEntry(), GetGUIDLow()); + sLog->outCrash("Unit::SetCharmedBy: Unit %u (GUID %u) is trying to charm itself!", GetEntry(), GetGUIDLow()); return false; } @@ -15657,14 +15657,14 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) if (GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->GetTransport()) { - sLog.outCrash("Unit::SetCharmedBy: Player on transport is trying to charm %u (GUID %u)", GetEntry(), GetGUIDLow()); + sLog->outCrash("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->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()); return false; } @@ -15689,7 +15689,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) // 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->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()); return false; } @@ -15776,7 +15776,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->outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD, // GetGUID(), GetCharmerGUID(), charmer->GetGUID()); // ASSERT(false); return; @@ -15852,7 +15852,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("Aura::HandleModCharm: target="UI64FMTD" with typeid=%d has a charm aura but no charm info!", GetGUID(), GetTypeId()); } } break; @@ -16676,14 +16676,14 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId) { if (seatId >= 0) { - sLog.outDebug("EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); + sLog->outDebug("EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); ChangeSeat(seatId); } return; } else { - sLog.outDebug("EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry()); + sLog->outDebug("EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry()); ExitVehicle(); } } @@ -16762,7 +16762,7 @@ void Unit::ExitVehicle() if (!m_vehicle) return; - //sLog.outError("exit vehicle"); + //sLog->outError("exit vehicle"); m_vehicle->RemovePassenger(this); @@ -16833,7 +16833,7 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const data->append(GetTransport()->GetPackGUID()); else { - sLog.outError("Unit %u does not have transport!", GetEntry()); + sLog->outError("Unit %u does not have transport!", GetEntry()); *data << (uint8)0; } *data << float (GetTransOffsetX()); @@ -16896,7 +16896,7 @@ bool Unit::SetPosition(float x, float y, float z, float orientation, bool telepo // prevent crash when a bad coord is sent by the client if (!Trinity::IsValidMapCoord(x,y,z,orientation)) { - sLog.outDebug("Unit::SetPosition(%f, %f, %f) .. bad coordinates!",x,y,z); + sLog->outDebug("Unit::SetPosition(%f, %f, %f) .. bad coordinates!",x,y,z); return false; } @@ -16929,7 +16929,7 @@ void Unit::SendThreatListUpdate() { if (uint32 count = getThreatManager().getThreatList().size()) { - //sLog.outDebug("WORLD: Send SMSG_THREAT_UPDATE Message"); + //sLog->outDebug("WORLD: Send SMSG_THREAT_UPDATE Message"); WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8); data.append(GetPackGUID()); data << uint32(count); @@ -16947,7 +16947,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) { if (uint32 count = getThreatManager().getThreatList().size()) { - sLog.outDebug("WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); + sLog->outDebug("WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8); data.append(GetPackGUID()); data.appendPackGUID(pHostileReference->getUnitGuid()); @@ -16964,7 +16964,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) void Unit::SendClearThreatListOpcode() { - sLog.outDebug("WORLD: Send SMSG_THREAT_CLEAR Message"); + sLog->outDebug("WORLD: Send SMSG_THREAT_CLEAR Message"); WorldPacket data(SMSG_THREAT_CLEAR, 8); data.append(GetPackGUID()); SendMessageToSet(&data, false); @@ -16972,7 +16972,7 @@ void Unit::SendClearThreatListOpcode() void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference) { - sLog.outDebug("WORLD: Send SMSG_THREAT_REMOVE Message"); + sLog->outDebug("WORLD: Send SMSG_THREAT_REMOVE Message"); WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8); data.append(GetPackGUID()); data.appendPackGUID(pHostileReference->getUnitGuid()); @@ -17005,7 +17005,7 @@ void Unit::RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker) addRage *= 2.0f; } - addRage *= sWorld.getRate(RATE_POWER_RAGE_INCOME); + addRage *= sWorld->getRate(RATE_POWER_RAGE_INCOME); ModifyPower(POWER_RAGE, uint32(addRage * 10)); } @@ -17046,39 +17046,39 @@ 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("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); if (IsInWorld()) - sLog.outString("Mapid %u", GetMapId()); + sLog->outString("Mapid %u", GetMapId()); - sLog.outStringInLine("Summon Slot: "); + sLog->outStringInLine("Summon Slot: "); for (uint32 i = 0; i < MAX_SUMMON_SLOT; ++i) - sLog.outStringInLine(UI64FMTD", ", m_SummonSlot[i]); - sLog.outString(); + sLog->outStringInLine(UI64FMTD", ", m_SummonSlot[i]); + sLog->outString(); - sLog.outStringInLine("Controlled List: "); + sLog->outStringInLine("Controlled List: "); for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) - sLog.outStringInLine(UI64FMTD", ", (*itr)->GetGUID()); - sLog.outString(); + sLog->outStringInLine(UI64FMTD", ", (*itr)->GetGUID()); + sLog->outString(); - sLog.outStringInLine("Aura List: "); + sLog->outStringInLine("Aura List: "); for (AuraApplicationMap::const_iterator itr = m_appliedAuras.begin(); itr != m_appliedAuras.end(); ++itr) - sLog.outStringInLine("%u, ", itr->first); - sLog.outString(); + sLog->outStringInLine("%u, ", itr->first); + sLog->outString(); if (IsVehicle()) { - sLog.outStringInLine("Passenger List: "); + sLog->outStringInLine("Passenger List: "); for (SeatMap::iterator itr = GetVehicleKit()->m_Seats.begin(); itr != GetVehicleKit()->m_Seats.end(); ++itr) if (Unit *passenger = itr->second.passenger) - sLog.outStringInLine(UI64FMTD", ", passenger->GetGUID()); - sLog.outString(); + sLog->outStringInLine(UI64FMTD", ", passenger->GetGUID()); + sLog->outString(); } if (GetVehicle()) - sLog.outString("On vehicle %u.", GetVehicleBase()->GetEntry()); + sLog->outString("On vehicle %u.", GetVehicleBase()->GetEntry()); } uint32 Unit::GetRemainingDotDamage(uint64 caster, uint32 spellId, uint8 effectIndex) const diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 06e9ca5cbf5..b9912eec152 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -129,7 +129,7 @@ void Vehicle::InstallAllAccessories(uint32 entry) void Vehicle::Uninstall() { - sLog.outDebug("Vehicle::Uninstall %u", me->GetEntry()); + sLog->outDebug("Vehicle::Uninstall %u", me->GetEntry()); for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) if (Unit *passenger = itr->second.passenger) if (passenger->HasUnitTypeMask(UNIT_MASK_ACCESSORY)) @@ -143,7 +143,7 @@ void Vehicle::Uninstall() void Vehicle::Die() { - sLog.outDebug("Vehicle::Die %u", me->GetEntry()); + sLog->outDebug("Vehicle::Die %u", me->GetEntry()); for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) if (Unit *passenger = itr->second.passenger) if (passenger->HasUnitTypeMask(UNIT_MASK_ACCESSORY)) @@ -157,7 +157,7 @@ void Vehicle::Die() void Vehicle::Reset() { - sLog.outDebug("Vehicle::Reset"); + sLog->outDebug("Vehicle::Reset"); if (me->GetTypeId() == TYPEID_PLAYER) { if (m_usableSeatNum) @@ -176,18 +176,18 @@ void Vehicle::Reset() void Vehicle::RemoveAllPassengers() { - sLog.outDebug("Vehicle::RemoveAllPassengers"); + sLog->outDebug("Vehicle::RemoveAllPassengers"); for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) if (Unit *passenger = itr->second.passenger) { if (passenger->IsVehicle()) passenger->GetVehicleKit()->RemoveAllPassengers(); if (passenger->GetVehicle() != this) - sLog.outCrash("Vehicle %u has invalid passenger %u.", me->GetEntry(), passenger->GetEntry()); + sLog->outCrash("Vehicle %u has invalid passenger %u.", me->GetEntry(), passenger->GetEntry()); passenger->ExitVehicle(); if (itr->second.passenger) { - sLog.outCrash("Vehicle %u cannot remove passenger %u. %u is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger->GetEntry()); + sLog->outCrash("Vehicle %u cannot remove passenger %u. %u is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger->GetEntry()); itr->second.passenger = NULL; } @@ -294,7 +294,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) ASSERT(!seat->second.passenger); } - sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); + sLog->outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); seat->second.passenger = unit; if (seat->second.seatInfo->IsUsable()) @@ -377,7 +377,7 @@ void Vehicle::RemovePassenger(Unit *unit) ASSERT(seat != m_Seats.end()); - sLog.outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); + sLog->outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); seat->second.passenger = NULL; if (seat->second.seatInfo->IsUsable()) @@ -439,7 +439,7 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) void Vehicle::Dismiss() { - sLog.outDebug("Vehicle::Dismiss %u", me->GetEntry()); + sLog->outDebug("Vehicle::Dismiss %u", me->GetEntry()); Uninstall(); me->SendObjectDeSpawnAnim(me->GetGUID()); me->CombatStop(); diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 407e816f7e2..d7e5007cae3 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -153,7 +153,7 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite) // this update is needed to possibly start events dependent on the started one // or to scedule another update where the next event will be started if (overwrite && conditions_met) - sWorld.ForceGameEventUpdate(); + sWorld->ForceGameEventUpdate(); return conditions_met; } @@ -198,8 +198,8 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event"); if (!result) { - sLog.outString(">> Loaded 0 weather definitions. DB table `game_event` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 weather definitions. DB table `game_event` is empty."); + sLog->outString(); return; } @@ -213,8 +213,8 @@ void GameEventMgr::LoadFromDB() if (!result) { mGameEvent.clear(); - sLog.outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); + sLog->outString(); return; } @@ -228,7 +228,7 @@ void GameEventMgr::LoadFromDB() uint16 event_id = fields[0].GetUInt16(); if (event_id == 0) { - sLog.outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id); + sLog->outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id); continue; } @@ -246,7 +246,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->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id); continue; } @@ -254,7 +254,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->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id); pGameEvent.holiday_id = HOLIDAY_NONE; } } @@ -263,12 +263,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); // load game event saves - sLog.outString("Loading Game Event Saves Data..."); + sLog->outString("Loading Game Event Saves Data..."); oldMSTime = getMSTime(); // 0 1 2 @@ -276,8 +276,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->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + sLog->outString(); } else { @@ -291,7 +291,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog.outErrorDb("`game_event_save` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_save` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -302,7 +302,7 @@ void GameEventMgr::LoadFromDB() } else { - sLog.outErrorDb("game_event_save includes event save for non-worldevent id %u",event_id); + sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u",event_id); continue; } @@ -310,20 +310,20 @@ 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->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // load game event links (prerequisites) - sLog.outString("Loading Game Event Prerequisite Data..."); + sLog->outString("Loading Game Event Prerequisite Data..."); oldMSTime = getMSTime(); result = WorldDatabase.Query("SELECT event_id, 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->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + sLog->outString(); } else { @@ -337,7 +337,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->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -346,14 +346,14 @@ void GameEventMgr::LoadFromDB() uint16 prerequisite_event = fields[1].GetUInt16(); 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->outErrorDb("`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->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u",event_id); continue; } @@ -361,13 +361,13 @@ 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->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Creatures - sLog.outString("Loading Game Event Creature Data..."); + sLog->outString("Loading Game Event Creature Data..."); oldMSTime = getMSTime(); mGameEventCreatureGuids.resize(mGameEvent.size()*2-1); @@ -377,8 +377,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); - sLog.outString(); + sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + sLog->outString(); } else { @@ -395,7 +395,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->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -405,13 +405,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Gameobjects - sLog.outString("Loading Game Event GO Data..."); + sLog->outString("Loading Game Event GO Data..."); oldMSTime = getMSTime(); mGameEventGameobjectGuids.resize(mGameEvent.size()*2-1); @@ -421,8 +421,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + sLog->outString(); } else { @@ -439,7 +439,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->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -449,13 +449,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Model/Equipment Changes - sLog.outString("Loading Game Event Model/Equipment Change Data..."); + sLog->outString("Loading Game Event Model/Equipment Change Data..."); oldMSTime = getMSTime(); mGameEventModelEquip.resize(mGameEvent.size()); @@ -467,8 +467,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->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); + sLog->outString(); } else { @@ -482,7 +482,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->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -498,7 +498,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.", guid, 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.", guid, newModelEquipSet.equipment_id); continue; } } @@ -507,13 +507,13 @@ 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->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Quests - sLog.outString("Loading Game Event Quest Data..."); + sLog->outString("Loading Game Event Quest Data..."); oldMSTime = getMSTime(); mGameEventCreatureQuests.resize(mGameEvent.size()); @@ -522,8 +522,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->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); + sLog->outString(); } else { @@ -538,7 +538,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->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -548,13 +548,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // GO Quests - sLog.outString("Loading Game Event GO Quest Data..."); + sLog->outString("Loading Game Event GO Quest Data..."); oldMSTime = getMSTime(); mGameEventGameObjectQuests.resize(mGameEvent.size()); @@ -563,8 +563,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->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); + sLog->outString(); } else { @@ -579,7 +579,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->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -589,22 +589,22 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load quest to (event,condition) mapping // 0 1 2 3 - sLog.outString("Loading Game Event Quest Condition Data..."); + sLog->outString("Loading Game Event Quest Condition Data..."); oldMSTime = getMSTime(); result = WorldDatabase.Query("SELECT quest, event_id, condition_id, num FROM game_event_quest_condition"); if (!result) { - sLog.outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); + sLog->outString(); } else { @@ -620,7 +620,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->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -631,13 +631,13 @@ 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->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load conditions for events - sLog.outString("Loading Game Event Condition Data..."); + sLog->outString("Loading Game Event Condition Data..."); oldMSTime = getMSTime(); // 0 1 2 3 4 @@ -645,8 +645,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); + sLog->outString(); } else { @@ -660,7 +660,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->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -673,13 +673,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load condition saves - sLog.outString("Loading Game Event Condition Save Data..."); + sLog->outString("Loading Game Event Condition Save Data..."); oldMSTime = getMSTime(); // 0 1 2 @@ -687,8 +687,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->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); + sLog->outString(); } else { @@ -702,7 +702,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->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -713,7 +713,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->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u",event_id, condition); continue; } @@ -721,13 +721,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event npcflag - sLog.outString("Loading Game Event NPCflag Data..."); + sLog->outString("Loading Game Event NPCflag Data..."); oldMSTime = getMSTime(); mGameEventNPCFlags.resize(mGameEvent.size()); @@ -737,8 +737,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); + sLog->outString(); } else { @@ -753,7 +753,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->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -763,13 +763,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event vendors - sLog.outString("Loading Game Event Vendor Additions Data..."); + sLog->outString("Loading Game Event Vendor Additions Data..."); oldMSTime = getMSTime(); mGameEventVendors.resize(mGameEvent.size()); @@ -779,8 +779,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->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); + sLog->outString(); } else { @@ -793,7 +793,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->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -829,13 +829,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event npc gossip ids - sLog.outString("Loading Game Event NPC Gossip Data..."); + sLog->outString("Loading Game Event NPC Gossip Data..."); oldMSTime = getMSTime(); // 0 1 2 @@ -843,8 +843,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 npc gossip textids in game events. DB table `game_event_npc_gossip` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 npc gossip textids in game events. DB table `game_event_npc_gossip` is empty."); + sLog->outString(); } else { @@ -859,7 +859,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog.outErrorDb("`game_event_npc_gossip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_npc_gossip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -869,13 +869,13 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u npc gossip textids in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u npc gossip textids in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Load game event battleground flags - sLog.outString("Loading Game Event Battleground Data..."); + sLog->outString("Loading Game Event Battleground Data..."); oldMSTime = getMSTime(); // set all flags to 0 @@ -886,8 +886,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->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); + sLog->outString(); } else { @@ -901,7 +901,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->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } @@ -911,15 +911,15 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } //////////////////////// // GameEventPool //////////////////////// - sLog.outString("Loading Game Event Pool Data..."); + sLog->outString("Loading Game Event Pool Data..."); oldMSTime = getMSTime(); mGameEventPoolIds.resize(mGameEvent.size()*2-1); @@ -930,8 +930,8 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog.outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); + sLog->outString(); } else { @@ -948,13 +948,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->outErrorDb("`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->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); continue; } @@ -964,8 +964,8 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } @@ -1005,11 +1005,11 @@ uint32 GameEventMgr::Initialize() // return the next e void GameEventMgr::StartArenaSeason() { - QueryResult result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID)); + QueryResult result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); if (!result) { - sLog.outError("ArenaSeason (%i) must be an existant Arena Season",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID)); + sLog->outError("ArenaSeason (%i) must be an existant Arena Season",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); return; } @@ -1018,8 +1018,8 @@ void GameEventMgr::StartArenaSeason() uint16 eventId = fields[0].GetUInt16(); StartEvent(eventId,true); - sLog.outString("Arena Season %i started...",sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID)); - sLog.outString(); + sLog->outString("Arena Season %i started...",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); + sLog->outString(); } uint32 GameEventMgr::Update() // return the next event delay in ms @@ -1032,7 +1032,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->outErrorDb("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 @@ -1053,14 +1053,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("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("GameEvent %u is not active",itr->first); if (IsActiveEvent(itr)) deactivate.insert(itr); else @@ -1088,13 +1088,13 @@ uint32 GameEventMgr::Update() // return the next e nextEventDelay = 0; for (std::set::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr) StopEvent(*itr); - sLog.outDetail("Next game event check in %u seconds.", nextEventDelay + 1); + sLog->outDetail("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->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); // un-spawn positive event tagged objects GameEventUnspawn(event_id); // spawn negative event tagget objects @@ -1115,16 +1115,16 @@ void GameEventMgr::UnApplyEvent(uint16 event_id) void GameEventMgr::ApplyNewEvent(uint16 event_id) { - switch(sWorld.getIntConfig(CONFIG_EVENT_ANNOUNCE)) + switch(sWorld->getIntConfig(CONFIG_EVENT_ANNOUNCE)) { case 0: // disable break; case 1: // announce events - sWorld.SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str()); + sWorld->SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str()); break; } - sLog.outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); + sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); // spawn positive event tagget objects GameEventSpawn(event_id); @@ -1193,7 +1193,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("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1211,7 +1211,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { Creature* pCreature = new Creature; - //sLog.outDebug("Spawning creature %u",*itr); + //sLog->outDebug("Spawning creature %u",*itr); if (!pCreature->LoadFromDB(*itr, map)) delete pCreature; else @@ -1222,7 +1222,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("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1240,7 +1240,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { GameObject* pGameobject = new GameObject; - //sLog.outDebug("Spawning gameobject %u", *itr); + //sLog->outDebug("Spawning gameobject %u", *itr); if (!pGameobject->LoadFromDB(*itr, map)) delete pGameobject; else @@ -1254,7 +1254,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("GameEventMgr::GameEventSpawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); return; } @@ -1269,7 +1269,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("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventCreatureGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventCreatureGuids.size()); return; } @@ -1284,14 +1284,14 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) { sObjectMgr->RemoveCreatureFromGrid(*itr, data); - if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL)) + if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->AddObjectToRemoveList(); } } 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("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventGameobjectGuids element %i (size: " SIZEFMTD ")", internal_event_id, mGameEventGameobjectGuids.size()); return; } @@ -1306,13 +1306,13 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) { sObjectMgr->RemoveGameobjectFromGrid(*itr, data); - if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) + if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->AddObjectToRemoveList(); } } 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("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",internal_event_id,mGameEventPoolIds.size()); return; } @@ -1332,7 +1332,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) continue; // Update if spawned - Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL); + Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL); if (pCreature) { if (activate) @@ -1530,7 +1530,7 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate) { WorldPacket data; sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0); - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); } } } @@ -1580,7 +1580,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id) // changed, save to DB the gameevent state SaveWorldEventStateToDB(event_id); // force update events to set timer - sWorld.ForceGameEventUpdate(); + sWorld->ForceGameEventUpdate(); } } } diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 2ef43497f9b..4c49daec427 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -274,11 +274,11 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insign //in fact this function is called from several places //even when player doesn't have a corpse, not an error // TODO: really, now... - //sLog.outError("Try remove corpse that not in map for GUID %ul", player_guid); + //sLog->outError("Try remove corpse that not in map for GUID %ul", player_guid); return NULL; } - sLog.outStaticDebug("Deleting Corpse and spawned bones."); + sLog->outStaticDebug("Deleting Corpse and spawned bones."); //Map* map = corpse->FindMap(); @@ -306,7 +306,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool /*insign // create the bones only if the map and the grid is loaded at the corpse's location // ignore bones creating option in case insignia if (map && (insignia || - (map->IsBattlegroundOrArena() ? sWorld.getIntConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld.getIntConfig(CONFIG_DEATH_BONES_WORLD))) && + (map->IsBattlegroundOrArena() ? sWorld->getIntConfig(CONFIG_DEATH_BONES_BG_OR_ARENA) : sWorld->getIntConfig(CONFIG_DEATH_BONES_WORLD))) && !map->IsRemovalGrid(corpse->GetPositionX(), corpse->GetPositionY())) { // Create bones, don't change Corpse diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index c81e8aff09b..a1c3c56c38f 100755 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -156,14 +156,14 @@ class ObjectAccessor CellPair p = Trinity::ComputeCellPair(x, y); if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) { - 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("ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord); return NULL; } CellPair q = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); if (q.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || q.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) { - 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("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; } @@ -268,5 +268,5 @@ class ObjectAccessor LockType i_corpseGuard; }; -#define sObjectAccessor (*ACE_Singleton::instance()) +#define sObjectAccessor ACE_Singleton::instance() #endif diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index ad7cba1ab2c..26248bc38ac 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -456,8 +456,8 @@ void ObjectMgr::LoadCreatureLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded %lu creature locale strings in %u ms", (unsigned long)mCreatureLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu creature locale strings in %u ms", (unsigned long)mCreatureLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadGossipMenuItemsLocales() @@ -497,8 +497,8 @@ void ObjectMgr::LoadGossipMenuItemsLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)mGossipMenuItemsLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)mGossipMenuItemsLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadPointOfInterestLocales() @@ -528,8 +528,8 @@ void ObjectMgr::LoadPointOfInterestLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)mPointOfInterestLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)mPointOfInterestLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } struct SQLCreatureLoader : public SQLStorageLoaderBase @@ -555,8 +555,8 @@ void ObjectMgr::LoadCreatureTemplates() CheckCreatureTemplate(cInfo); } - sLog.outString(">> Loaded %u creature definitions in %u ms", sCreatureStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creature definitions in %u ms", sCreatureStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) @@ -574,7 +574,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) CreatureInfo 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->outErrorDb("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; } @@ -585,20 +585,20 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("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->outErrorDb("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->outErrorDb("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; } @@ -609,51 +609,51 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); continue; } if (difficultyInfo->AIName && *difficultyInfo->AIName) { - 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->outErrorDb("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->outErrorDb("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; } @@ -665,11 +665,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("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->outErrorDb("Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H); // used later for scale CreatureDisplayInfoEntry const* displayScaleEntry = NULL; @@ -679,7 +679,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("Creature (Entry: %u) lists non-existing Modelid1 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid1); const_cast(cInfo)->Modelid1 = 0; } else if (!displayScaleEntry) @@ -687,7 +687,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry(cInfo->Modelid1); if (!minfo) - sLog.outErrorDb("No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry); + sLog->outErrorDb("No model data exist for `Modelid1` = %u listed by creature (Entry: %u).", cInfo->Modelid1, cInfo->Entry); } if (cInfo->Modelid2) @@ -695,7 +695,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("Creature (Entry: %u) lists non-existing Modelid2 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid2); const_cast(cInfo)->Modelid2 = 0; } else if (!displayScaleEntry) @@ -703,7 +703,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry(cInfo->Modelid2); if (!minfo) - sLog.outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry); + sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry); } if (cInfo->Modelid3) @@ -711,7 +711,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("Creature (Entry: %u) lists non-existing Modelid3 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid3); const_cast(cInfo)->Modelid3 = 0; } else if (!displayScaleEntry) @@ -719,7 +719,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry(cInfo->Modelid3); if (!minfo) - sLog.outErrorDb("No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry); + sLog->outErrorDb("No model data exist for `Modelid3` = %u listed by creature (Entry: %u).", cInfo->Modelid3, cInfo->Entry); } if (cInfo->Modelid4) @@ -727,7 +727,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("Creature (Entry: %u) lists non-existing Modelid4 id (%u), this can crash the client.", cInfo->Entry, cInfo->Modelid4); const_cast(cInfo)->Modelid4 = 0; } else if (!displayScaleEntry) @@ -735,11 +735,11 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) CreatureModelInfo const* minfo = sCreatureModelStorage.LookupEntry(cInfo->Modelid4); if (!minfo) - sLog.outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry); + sLog->outErrorDb("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->outErrorDb("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) { @@ -747,7 +747,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("Creature (Entry: %u) lists non-existing creature entry %u in `KillCredit%d`.", cInfo->Entry, cInfo->KillCredit[k], k + 1); const_cast(cInfo)->KillCredit[k] = 0; } } @@ -755,13 +755,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("Creature (Entry: %u) has invalid unit_class (%u) in creature_template. Set to 1 (UNIT_CLASS_WARRIOR).", cInfo->Entry, cInfo->unit_class); const_cast(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->outErrorDb("Creature (Entry: %u) has invalid spell school value (%u) in `dmgschool`.", cInfo->Entry, cInfo->dmgschool); const_cast(cInfo)->dmgschool = SPELL_SCHOOL_NORMAL; } @@ -773,29 +773,29 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) if (cInfo->npcflag & UNIT_NPC_FLAG_SPELLCLICK) { - sLog.outErrorDb("Creature (Entry: %u) has dynamic flag UNIT_NPC_FLAG_SPELLCLICK (%u) set, it is expected to be set by code handling `npc_spellclick_spells` content.", cInfo->Entry, UNIT_NPC_FLAG_SPELLCLICK); + sLog->outErrorDb("Creature (Entry: %u) has dynamic flag UNIT_NPC_FLAG_SPELLCLICK (%u) set, it is expected to be set by code handling `npc_spellclick_spells` content.", cInfo->Entry, UNIT_NPC_FLAG_SPELLCLICK); const_cast(cInfo)->npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK; } 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->outErrorDb("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->outErrorDb("Creature (Entry: %u) has invalid creature type (%u) in `type`.", cInfo->Entry, cInfo->type); const_cast(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->outErrorDb("Creature (Entry: %u) has invalid creature family (%u) in `family`.", cInfo->Entry, cInfo->family); const_cast(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->outErrorDb("Creature (Entry: %u) has wrong value (%u) in `InhabitType`, creature will not correctly walk/swim/fly.", cInfo->Entry, cInfo->InhabitType); const_cast(cInfo)->InhabitType = INHABIT_ANYWHERE; } @@ -804,7 +804,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId); const_cast(cInfo)->VehicleId = 0; } } @@ -813,21 +813,21 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->outErrorDb("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] && !sSpellStore.LookupEntry(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->outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0.", cInfo->Entry, j+1, cInfo->spells[j]); const_cast(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->outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignored and set to IDLE.", cInfo->Entry, cInfo->MovementType); const_cast(cInfo)->MovementType = IDLE_MOTION_TYPE; } @@ -835,7 +835,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo 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->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); const_cast(cInfo)->equipmentId = 0; } } @@ -851,7 +851,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) if (cInfo->expansion > (MAX_CREATURE_BASE_HP - 1)) { - sLog.outErrorDb("Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion); + sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion); const_cast(cInfo)->expansion = 0; } @@ -880,7 +880,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* uint8 eff = atoi(s); if (eff >=3) { - sLog.outErrorDb("Creature (%s: %u) has wrong `auras` data in `%s`(too high aura effect: %d for spell: %d)",guidEntryStr,addon->guidOrEntry,table,eff,currSpellId); + sLog->outErrorDb("Creature (%s: %u) has wrong `auras` data in `%s`(too high aura effect: %d for spell: %d)",guidEntryStr,addon->guidOrEntry,table,eff,currSpellId); } val[currSpellId] |= 1<auras = NULL; - sLog.outErrorDb("Creature (%s: %u) has wrong `auras` data in `%s`.",guidEntryStr,addon->guidOrEntry,table); + sLog->outErrorDb("Creature (%s: %u) has wrong `auras` data in `%s`.",guidEntryStr,addon->guidOrEntry,table); return; } } @@ -921,13 +921,13 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* cAura.effectMask = itr->second; if (cAura.effectMask > 7 || !cAura.effectMask) { - sLog.outErrorDb("Creature (%s: %u) has wrong effect for spell %u in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,cAura.spell_id,table); + sLog->outErrorDb("Creature (%s: %u) has wrong effect for spell %u in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,cAura.spell_id,table); continue; } SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(cAura.spell_id); if (!AdditionalSpellInfo) { - sLog.outErrorDb("Creature (%s: %u) has wrong spell %u defined in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,cAura.spell_id,table); + sLog->outErrorDb("Creature (%s: %u) has wrong spell %u defined in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,cAura.spell_id,table); continue; } for (uint8 eff = 0; eff < MAX_SPELL_EFFECTS; ++eff) @@ -936,12 +936,12 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* { if (!AdditionalSpellInfo->Effect[eff] || !AdditionalSpellInfo->EffectApplyAuraName[eff]) { - sLog.outErrorDb("Creature (%s: %u) has not aura effect %u of spell %u defined in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,eff,cAura.spell_id,table); + sLog->outErrorDb("Creature (%s: %u) has not aura effect %u of spell %u defined in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,eff,cAura.spell_id,table); continue; } else if (AdditionalSpellInfo->Effect[eff] == SPELL_EFFECT_PERSISTENT_AREA_AURA) { - sLog.outErrorDb("Creature (%s: %u) has persistent area aura effect %u of spell %u defined in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,eff,cAura.spell_id,table); + sLog->outErrorDb("Creature (%s: %u) has persistent area aura effect %u of spell %u defined in `auras` field in `%s`.",guidEntryStr,addon->guidOrEntry,eff,cAura.spell_id,table); continue; } } @@ -971,17 +971,17 @@ uint32 ObjectMgr::LoadCreatureAddons(SQLStorage& creatureaddons, char const* ent { if (!sCreatureDisplayInfoStore.LookupEntry(addon->mount)) { - sLog.outErrorDb("Creature (%s %u) have invalid displayInfoId for mount (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->mount, creatureaddons.GetTableName()); + sLog->outErrorDb("Creature (%s %u) have invalid displayInfoId for mount (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->mount, creatureaddons.GetTableName()); const_cast(addon)->mount = 0; } } if (!sEmotesStore.LookupEntry(addon->emote)) - sLog.outErrorDb("Creature (%s %u) have invalid emote (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->emote, creatureaddons.GetTableName()); + sLog->outErrorDb("Creature (%s %u) have invalid emote (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->emote, creatureaddons.GetTableName()); /*if (addon->move_flags & (MONSTER_MOVE_UNK1|MONSTER_MOVE_UNK4)) { - sLog.outErrorDb("Creature (%s %u) movement flags mask defined in `%s` include forbidden flags (" I32FMT ") that can crash client, cleanup at load.", entryName, addon->guidOrEntry, creatureaddons.GetTableName(), (MONSTER_MOVE_UNK1|MONSTER_MOVE_UNK4)); + sLog->outErrorDb("Creature (%s %u) movement flags mask defined in `%s` include forbidden flags (" I32FMT ") that can crash client, cleanup at load.", entryName, addon->guidOrEntry, creatureaddons.GetTableName(), (MONSTER_MOVE_UNK1|MONSTER_MOVE_UNK4)); const_cast(addon)->move_flags &= ~(MONSTER_MOVE_UNK1|MONSTER_MOVE_UNK4); }*/ @@ -1001,22 +1001,22 @@ void ObjectMgr::LoadCreatureAddons() for (uint32 i = 1; i < sCreatureInfoAddonStorage.MaxEntry; ++i) if (CreatureDataAddon const* addon = sCreatureInfoAddonStorage.LookupEntry(i)) if (!sCreatureStorage.LookupEntry(addon->guidOrEntry)) - sLog.outErrorDb("Creature (Entry: %u) does not exist but has a record in `%s`",addon->guidOrEntry, sCreatureInfoAddonStorage.GetTableName()); + sLog->outErrorDb("Creature (Entry: %u) does not exist but has a record in `%s`",addon->guidOrEntry, sCreatureInfoAddonStorage.GetTableName()); - sLog.outString(">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); - sLog.outString("Loading Creature Addon Data..."); + sLog->outString("Loading Creature Addon Data..."); count = LoadCreatureAddons(sCreatureDataAddonStorage,"GUID"); // check entry ids for (uint32 i = 1; i < sCreatureDataAddonStorage.MaxEntry; ++i) if (CreatureDataAddon const* addon = sCreatureDataAddonStorage.LookupEntry(i)) if (mCreatureDataMap.find(addon->guidOrEntry) == mCreatureDataMap.end()) - sLog.outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`",addon->guidOrEntry); + sLog->outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`",addon->guidOrEntry); - sLog.outString(">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry) @@ -1046,7 +1046,7 @@ void ObjectMgr::LoadEquipmentTemplates() if (!dbcitem) { - sLog.outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i); + sLog->outErrorDb("Unknown item (entry=%u) in creature_equip_template.equipentry%u for entry = %u, forced to 0.", eqInfo->equipentry[j], j+1, i); const_cast(eqInfo)->equipentry[j] = 0; continue; } @@ -1061,14 +1061,14 @@ void ObjectMgr::LoadEquipmentTemplates() dbcitem->InventoryType != INVTYPE_THROWN && dbcitem->InventoryType != INVTYPE_RANGEDRIGHT) { - sLog.outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j+1, i); + sLog->outErrorDb("Item (entry=%u) in creature_equip_template.equipentry%u for entry = %u is not equipable in a hand, forced to 0.", eqInfo->equipentry[j], j+1, i); const_cast(eqInfo)->equipentry[j] = 0; } } } - sLog.outString(">> Loaded %u equipment templates in %u ms", sEquipmentStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u equipment templates in %u ms", sEquipmentStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelid) @@ -1122,7 +1122,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32 display_ CreatureModelInfo const *minfo_tmp = GetCreatureModelInfo(minfo->modelid_other_gender); if (!minfo_tmp) { - sLog.outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", minfo->modelid, minfo->modelid_other_gender); + sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", minfo->modelid, minfo->modelid_other_gender); return minfo; // not fatal, just use the previous one } else @@ -1146,17 +1146,17 @@ void ObjectMgr::LoadCreatureModelInfo() continue; if (!sCreatureDisplayInfoStore.LookupEntry(minfo->modelid)) - sLog.outErrorDb("Table `creature_model_info` has model for not existed display id (%u).", minfo->modelid); + sLog->outErrorDb("Table `creature_model_info` has model for not existed display id (%u).", minfo->modelid); if (minfo->gender > GENDER_NONE) { - sLog.outErrorDb("Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(minfo->gender), minfo->modelid); + sLog->outErrorDb("Table `creature_model_info` has wrong gender (%u) for display id (%u).", uint32(minfo->gender), minfo->modelid); const_cast(minfo)->gender = GENDER_MALE; } if (minfo->modelid_other_gender && !sCreatureDisplayInfoStore.LookupEntry(minfo->modelid_other_gender)) { - sLog.outErrorDb("Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", minfo->modelid_other_gender, minfo->modelid); + sLog->outErrorDb("Table `creature_model_info` has not existed alt.gender model (%u) for existed display id (%u).", minfo->modelid_other_gender, minfo->modelid); const_cast(minfo)->modelid_other_gender = 0; } } @@ -1170,13 +1170,13 @@ void ObjectMgr::LoadCreatureModelInfo() if (mInfo->combat_reach < 0.1f) { - //sLog.outErrorDb("Creature model (Entry: %u) has invalid combat reach (%f), setting it to 0.5", mInfo->modelid, mInfo->combat_reach); + //sLog->outErrorDb("Creature model (Entry: %u) has invalid combat reach (%f), setting it to 0.5", mInfo->modelid, mInfo->combat_reach); const_cast(mInfo)->combat_reach = DEFAULT_COMBAT_REACH; } } - sLog.outString(">> Loaded %u creature model based info in %u ms", sCreatureModelStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creature model based info in %u ms", sCreatureModelStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool ObjectMgr::CheckCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) const @@ -1186,7 +1186,7 @@ bool ObjectMgr::CheckCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) const if (!slave || !master) // they must have a corresponding entry in db { - sLog.outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' which doesn't exist",guid,linkedGuid); + sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' which doesn't exist",guid,linkedGuid); return false; } @@ -1195,14 +1195,14 @@ bool ObjectMgr::CheckCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) const if (master->mapid != slave->mapid // link only to same map && (!map || map->Instanceable())) // or to unistanced world { - sLog.outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' on an unpermitted map",guid,linkedGuid); + sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' on an unpermitted map",guid,linkedGuid); return false; } if (!(master->spawnMask & slave->spawnMask) // they must have a possibility to meet (normal/heroic difficulty) && (!map || map->Instanceable())) { - sLog.outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask",guid,linkedGuid); + sLog->outErrorDb("LinkedRespawn: Creature '%u' linking to '%u' with not corresponding spawnMask",guid,linkedGuid); return false; } @@ -1218,8 +1218,8 @@ void ObjectMgr::LoadCreatureLinkedRespawn() if (!result) { - sLog.outErrorDb(">> Loaded 0 linked respawns. DB table `creature_linked_respawn` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 linked respawns. DB table `creature_linked_respawn` is empty."); + sLog->outString(); return; } @@ -1236,8 +1236,8 @@ void ObjectMgr::LoadCreatureLinkedRespawn() } while (result->NextRow()); - sLog.outString(">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(mCreatureLinkedRespawnMap.size()), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(mCreatureLinkedRespawnMap.size()), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) @@ -1285,8 +1285,8 @@ void ObjectMgr::LoadCreatures() if (!result) { - sLog.outErrorDb(">> Loaded 0 creatures. DB table `creature` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 creatures. DB table `creature` is empty."); + sLog->outString(); return; } @@ -1320,7 +1320,7 @@ void ObjectMgr::LoadCreatures() CreatureInfo const* cInfo = GetCreatureTemplate(entry); if (!cInfo) { - sLog.outErrorDb("Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry); + sLog->outErrorDb("Table `creature` has creature (GUID: %u) with non existing creature entry %u, skipped.", guid, entry); continue; } @@ -1352,19 +1352,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->outErrorDb("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).",guid, data.spawnMask, 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).",guid, data.spawnMask, data.mapid); bool ok = true; for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff) { if (difficultyCreatures[diff].find(data.id) != difficultyCreatures[diff].end()) { - sLog.outErrorDb("Table `creature` have creature (GUID: %u) that listed as difficulty %u template (entry: %u) in `creature_template`, skipped.", + sLog->outErrorDb("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; } @@ -1386,7 +1386,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->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); data.equipmentId = -1; } } @@ -1394,19 +1394,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->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); } 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->outErrorDb("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->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); data.movementType = IDLE_MOTION_TYPE; } else if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER) @@ -1416,20 +1416,20 @@ 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->outErrorDb("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->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id); data.phaseMask = 1; } if (data.npcflag & UNIT_NPC_FLAG_SPELLCLICK) { - sLog.outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with npcflag UNIT_NPC_FLAG_SPELLCLICK (%u) set, it is expected to be set by code handling `npc_spellclick_spells` content.", guid, data.id, UNIT_NPC_FLAG_SPELLCLICK); + sLog->outErrorDb("Table `creature` have creature (GUID: %u Entry: %u) with npcflag UNIT_NPC_FLAG_SPELLCLICK (%u) set, it is expected to be set by code handling `npc_spellclick_spells` content.", guid, data.id, UNIT_NPC_FLAG_SPELLCLICK); data.npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK; } @@ -1454,8 +1454,8 @@ void ObjectMgr::LoadCreatures() } while (result->NextRow()); - sLog.outString(">> Loaded %u creatures in %u ms", (uint32)mCreatureDataMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creatures in %u ms", (uint32)mCreatureDataMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data) @@ -1529,14 +1529,14 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float GameObject *go = new GameObject; if (!go->LoadFromDB(guid, map)) { - sLog.outError("AddGOData: cannot add gameobject entry %u to map", entry); + sLog->outError("AddGOData: cannot add gameobject entry %u to map", entry); delete go; return 0; } map->Add(go); } - sLog.outDebug("AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o); + sLog->outDebug("AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o); return guid; } @@ -1565,7 +1565,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos) Creature *creature = new Creature; if (!creature->LoadFromDB(guid, map)) { - sLog.outError("AddCreature: cannot add creature entry %u to map", guid); + sLog->outError("AddCreature: cannot add creature entry %u to map", guid); delete creature; return false; } @@ -1620,7 +1620,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float Creature* creature = new Creature; if (!creature->LoadFromDB(guid, map)) { - sLog.outError("AddCreature: cannot add creature entry %u to map", entry); + sLog->outError("AddCreature: cannot add creature entry %u to map", entry); delete creature; return 0; } @@ -1646,8 +1646,8 @@ void ObjectMgr::LoadGameobjects() if (!result) { - sLog.outErrorDb(">> Loaded 0 gameobjects. DB table `gameobject` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 gameobjects. DB table `gameobject` is empty."); + sLog->outString(); return; } @@ -1670,7 +1670,7 @@ void ObjectMgr::LoadGameobjects() GameObjectInfo const* gInfo = GetGameObjectInfo(entry); if (!gInfo) { - sLog.outErrorDb("Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry); + sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u) with non existing gameobject entry %u, skipped.", guid, entry); continue; } @@ -1682,14 +1682,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->outErrorDb("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->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.",guid, entry, gInfo->type, gInfo->displayId); continue; } @@ -1710,13 +1710,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->outErrorDb("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->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); } data.animprogress = fields[12].GetUInt32(); @@ -1725,7 +1725,7 @@ void ObjectMgr::LoadGameobjects() uint32 go_state = fields[13].GetUInt32(); 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->outErrorDb("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); @@ -1733,7 +1733,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->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); data.phaseMask = fields[15].GetUInt16(); int16 gameEvent = fields[16].GetInt16(); @@ -1741,25 +1741,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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id); data.phaseMask = 1; } @@ -1769,8 +1769,8 @@ void ObjectMgr::LoadGameobjects() } while (result->NextRow()); - sLog.outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)mGameObjectDataMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)mGameObjectDataMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data) @@ -1815,8 +1815,8 @@ void ObjectMgr::LoadCreatureRespawnTimes() if (!result) { - sLog.outString(">> Loaded 0 creature respawn time."); - sLog.outString(); + sLog->outString(">> Loaded 0 creature respawn time."); + sLog->outString(); return; } @@ -1834,8 +1834,8 @@ void ObjectMgr::LoadCreatureRespawnTimes() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %lu creature respawn times in %u ms", (unsigned long)mCreatureRespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu creature respawn times in %u ms", (unsigned long)mCreatureRespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadGameobjectRespawnTimes() @@ -1852,8 +1852,8 @@ void ObjectMgr::LoadGameobjectRespawnTimes() if (!result) { - sLog.outString(">> Loaded 0 gameobject respawn times. DB table `gameobject_respawn` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 gameobject respawn times. DB table `gameobject_respawn` is empty!"); + sLog->outString(); return; } @@ -1871,8 +1871,8 @@ void ObjectMgr::LoadGameobjectRespawnTimes() ++count; } while (result->NextRow()); - sLog.outString(); - sLog.outString(">> Loaded %lu gameobject respawn times in %u ms", (unsigned long)mGORespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + sLog->outString(">> Loaded %lu gameobject respawn times in %u ms", (unsigned long)mGORespawnTimes.size(), GetMSTimeDiffToNow(oldMSTime)); } Player* ObjectMgr::GetPlayerByLowGUID(uint32 lowguid) const @@ -1996,8 +1996,8 @@ void ObjectMgr::LoadItemLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded %lu Item locale strings in %u ms", (unsigned long)mItemLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu Item locale strings in %u ms", (unsigned long)mItemLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } struct SQLItemLoader : public SQLStorageLoaderBase @@ -2017,7 +2017,7 @@ void ObjectMgr::LoadItemPrototypes() loader.Load(sItemStorage); // check data correctness - bool enforceDBCAttributes = sWorld.getBoolConfig(CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES); + bool enforceDBCAttributes = sWorld->getBoolConfig(CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES); for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i) { ItemPrototype const* proto = sItemStorage.LookupEntry(i); @@ -2026,7 +2026,7 @@ void ObjectMgr::LoadItemPrototypes() { /* to many errors, and possible not all items really used in game if (dbcitem) - sLog.outErrorDb("Item (Entry: %u) doesn't exists in DB, but must exist.",i); + sLog->outErrorDb("Item (Entry: %u) doesn't exists in DB, but must exist.",i); */ continue; } @@ -2035,7 +2035,7 @@ void ObjectMgr::LoadItemPrototypes() { if (proto->Class != dbcitem->Class) { - sLog.outErrorDb("Item (Entry: %u) does not have a correct class %u, must be %u .", i, proto->Class, dbcitem->Class); + sLog->outErrorDb("Item (Entry: %u) does not have a correct class %u, must be %u .", i, proto->Class, dbcitem->Class); if (enforceDBCAttributes) const_cast(proto)->Class = dbcitem->Class; } @@ -2043,61 +2043,61 @@ void ObjectMgr::LoadItemPrototypes() for enable also uncomment Subclass field in ItemEntry structure and in Itemfmt[] if (proto->SubClass != dbcitem->SubClass) { - sLog.outErrorDb("Item (Entry: %u) not correct (Class: %u, Sub: %u) pair, must be (Class: %u, Sub: %u) (still using DB value).",i,proto->Class,proto->SubClass,dbcitem->Class,dbcitem->SubClass); + sLog->outErrorDb("Item (Entry: %u) not correct (Class: %u, Sub: %u) pair, must be (Class: %u, Sub: %u) (still using DB value).",i,proto->Class,proto->SubClass,dbcitem->Class,dbcitem->SubClass); // It safe let use Subclass from DB } */ if (proto->Unk0 != dbcitem->Unk0) { - sLog.outErrorDb("Item (Entry: %u) does not have a correct Unk0 (%i) , must be %i .", i, proto->Unk0, dbcitem->Unk0); + sLog->outErrorDb("Item (Entry: %u) does not have a correct Unk0 (%i) , must be %i .", i, proto->Unk0, dbcitem->Unk0); if (enforceDBCAttributes) const_cast(proto)->Unk0 = dbcitem->Unk0; } if (proto->Material != dbcitem->Material) { - sLog.outErrorDb("Item (Entry: %u) does not have a correct material (%i), must be %i .", i, proto->Material, dbcitem->Material); + sLog->outErrorDb("Item (Entry: %u) does not have a correct material (%i), must be %i .", i, proto->Material, dbcitem->Material); if (enforceDBCAttributes) const_cast(proto)->Material = dbcitem->Material; } if (proto->InventoryType != dbcitem->InventoryType) { - sLog.outErrorDb("Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", i, proto->InventoryType, dbcitem->InventoryType); + sLog->outErrorDb("Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", i, proto->InventoryType, dbcitem->InventoryType); if (enforceDBCAttributes) const_cast(proto)->InventoryType = dbcitem->InventoryType; } if (proto->DisplayInfoID != dbcitem->DisplayId) { - sLog.outErrorDb("Item (Entry: %u) does not have a correct display id (%u), must be %u .", i, proto->DisplayInfoID, dbcitem->DisplayId); + sLog->outErrorDb("Item (Entry: %u) does not have a correct display id (%u), must be %u .", i, proto->DisplayInfoID, dbcitem->DisplayId); if (enforceDBCAttributes) const_cast(proto)->DisplayInfoID = dbcitem->DisplayId; } if (proto->Sheath != dbcitem->Sheath) { - sLog.outErrorDb("Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", i, proto->Sheath, dbcitem->Sheath); + sLog->outErrorDb("Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", i, proto->Sheath, dbcitem->Sheath); if (enforceDBCAttributes) const_cast(proto)->Sheath = dbcitem->Sheath; } } else - sLog.outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).",i); + sLog->outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).",i); if (proto->Class >= MAX_ITEM_CLASS) { - sLog.outErrorDb("Item (Entry: %u) has wrong Class value (%u)",i,proto->Class); + sLog->outErrorDb("Item (Entry: %u) has wrong Class value (%u)",i,proto->Class); const_cast(proto)->Class = ITEM_CLASS_MISC; } if (proto->SubClass >= MaxItemSubclassValues[proto->Class]) { - sLog.outErrorDb("Item (Entry: %u) has wrong Subclass value (%u) for class %u",i,proto->SubClass,proto->Class); + sLog->outErrorDb("Item (Entry: %u) has wrong Subclass value (%u) for class %u",i,proto->SubClass,proto->Class); const_cast(proto)->SubClass = 0;// exist for all item classes } if (proto->Quality >= MAX_ITEM_QUALITY) { - sLog.outErrorDb("Item (Entry: %u) has wrong Quality value (%u)",i,proto->Quality); + sLog->outErrorDb("Item (Entry: %u) has wrong Quality value (%u)",i,proto->Quality); const_cast(proto)->Quality = ITEM_QUALITY_NORMAL; } @@ -2105,36 +2105,36 @@ void ObjectMgr::LoadItemPrototypes() { if (FactionEntry const* faction = sFactionStore.LookupEntry(HORDE)) if ((proto->AllowableRace & faction->BaseRepRaceMask[0]) == 0) - sLog.outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", + sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", i, proto->AllowableRace, ITEM_FLAGS_EXTRA_HORDE_ONLY); if (proto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) - sLog.outErrorDb("Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.", + sLog->outErrorDb("Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.", i, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY, ITEM_FLAGS_EXTRA_HORDE_ONLY); } else if (proto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) { if (FactionEntry const* faction = sFactionStore.LookupEntry(ALLIANCE)) if ((proto->AllowableRace & faction->BaseRepRaceMask[0]) == 0) - sLog.outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", + sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", i, proto->AllowableRace, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY); } if (proto->BuyCount <= 0) { - sLog.outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).",i,proto->BuyCount); + sLog->outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).",i,proto->BuyCount); const_cast(proto)->BuyCount = 1; } if (proto->InventoryType >= MAX_INVTYPE) { - sLog.outErrorDb("Item (Entry: %u) has wrong InventoryType value (%u)",i,proto->InventoryType); + sLog->outErrorDb("Item (Entry: %u) has wrong InventoryType value (%u)",i,proto->InventoryType); const_cast(proto)->InventoryType = INVTYPE_NON_EQUIP; } if (proto->RequiredSkill >= MAX_SKILL_TYPE) { - sLog.outErrorDb("Item (Entry: %u) has wrong RequiredSkill value (%u)",i,proto->RequiredSkill); + sLog->outErrorDb("Item (Entry: %u) has wrong RequiredSkill value (%u)",i,proto->RequiredSkill); const_cast(proto)->RequiredSkill = 0; } @@ -2154,60 +2154,60 @@ void ObjectMgr::LoadItemPrototypes() if (req) { if (!(proto->AllowableClass & CLASSMASK_ALL_PLAYABLE)) - sLog.outErrorDb("Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.",i,proto->AllowableClass); + sLog->outErrorDb("Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.",i,proto->AllowableClass); if (!(proto->AllowableRace & RACEMASK_ALL_PLAYABLE)) - sLog.outErrorDb("Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.",i,proto->AllowableRace); + sLog->outErrorDb("Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.",i,proto->AllowableRace); } } if (proto->RequiredSpell && !sSpellStore.LookupEntry(proto->RequiredSpell)) { - sLog.outErrorDb("Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)",i,proto->RequiredSpell); + sLog->outErrorDb("Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)",i,proto->RequiredSpell); const_cast(proto)->RequiredSpell = 0; } if (proto->RequiredReputationRank >= MAX_REPUTATION_RANK) - sLog.outErrorDb("Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.",i,proto->RequiredReputationRank); + sLog->outErrorDb("Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.",i,proto->RequiredReputationRank); if (proto->RequiredReputationFaction) { if (!sFactionStore.LookupEntry(proto->RequiredReputationFaction)) { - sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) faction in RequiredReputationFaction (%u)",i,proto->RequiredReputationFaction); + sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) faction in RequiredReputationFaction (%u)",i,proto->RequiredReputationFaction); const_cast(proto)->RequiredReputationFaction = 0; } if (proto->RequiredReputationRank == MIN_REPUTATION_RANK) - sLog.outErrorDb("Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.",i); + sLog->outErrorDb("Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.",i); } if (proto->MaxCount < -1) { - sLog.outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.",i,proto->MaxCount); + sLog->outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.",i,proto->MaxCount); const_cast(proto)->MaxCount = -1; } if (proto->Stackable == 0) { - sLog.outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.",i,proto->Stackable); + sLog->outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.",i,proto->Stackable); const_cast(proto)->Stackable = 1; } else if (proto->Stackable < -1) { - sLog.outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.",i,proto->Stackable); + sLog->outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.",i,proto->Stackable); const_cast(proto)->Stackable = -1; } if (proto->ContainerSlots > MAX_BAG_SIZE) { - sLog.outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).",i,proto->ContainerSlots,MAX_BAG_SIZE); + sLog->outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).",i,proto->ContainerSlots,MAX_BAG_SIZE); const_cast(proto)->ContainerSlots = MAX_BAG_SIZE; } if (proto->StatsCount > MAX_ITEM_PROTO_STATS) { - sLog.outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).",i,proto->StatsCount,MAX_ITEM_PROTO_STATS); + sLog->outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).",i,proto->StatsCount,MAX_ITEM_PROTO_STATS); const_cast(proto)->StatsCount = MAX_ITEM_PROTO_STATS; } @@ -2216,7 +2216,7 @@ void ObjectMgr::LoadItemPrototypes() // for ItemStatValue != 0 if (proto->ItemStat[j].ItemStatValue && proto->ItemStat[j].ItemStatType >= MAX_ITEM_MOD) { - sLog.outErrorDb("Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)",i,j+1,proto->ItemStat[j].ItemStatType); + sLog->outErrorDb("Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)",i,j+1,proto->ItemStat[j].ItemStatType); const_cast(proto)->ItemStat[j].ItemStatType = 0; } @@ -2224,7 +2224,7 @@ void ObjectMgr::LoadItemPrototypes() { case ITEM_MOD_SPELL_HEALING_DONE: case ITEM_MOD_SPELL_DAMAGE_DONE: - sLog.outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)",i,j+1,proto->ItemStat[j].ItemStatType); + sLog->outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)",i,j+1,proto->ItemStat[j].ItemStatType); break; default: break; @@ -2235,7 +2235,7 @@ void ObjectMgr::LoadItemPrototypes() { if (proto->Damage[j].DamageType >= MAX_SPELL_SCHOOL) { - sLog.outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)",i,j+1,proto->Damage[j].DamageType); + sLog->outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)",i,j+1,proto->Damage[j].DamageType); const_cast(proto)->Damage[j].DamageType = 0; } } @@ -2246,7 +2246,7 @@ void ObjectMgr::LoadItemPrototypes() // spell_1 if (proto->Spells[0].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) { - sLog.outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format",i,0+1,proto->Spells[0].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format",i,0+1,proto->Spells[0].SpellTrigger); const_cast(proto)->Spells[0].SpellId = 0; const_cast(proto)->Spells[0].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; const_cast(proto)->Spells[1].SpellId = 0; @@ -2256,14 +2256,14 @@ void ObjectMgr::LoadItemPrototypes() // spell_2 have learning spell if (proto->Spells[1].SpellTrigger != ITEM_SPELLTRIGGER_LEARN_SPELL_ID) { - sLog.outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.",i,1+1,proto->Spells[1].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.",i,1+1,proto->Spells[1].SpellTrigger); const_cast(proto)->Spells[0].SpellId = 0; const_cast(proto)->Spells[1].SpellId = 0; const_cast(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } else if (!proto->Spells[1].SpellId) { - sLog.outErrorDb("Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.",i,1+1); + sLog->outErrorDb("Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.",i,1+1); const_cast(proto)->Spells[0].SpellId = 0; const_cast(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } @@ -2272,7 +2272,7 @@ void ObjectMgr::LoadItemPrototypes() SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[1].SpellId); if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[1].SpellId, NULL)) { - sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId); + sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId); const_cast(proto)->Spells[0].SpellId = 0; const_cast(proto)->Spells[1].SpellId = 0; const_cast(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; @@ -2280,7 +2280,7 @@ void ObjectMgr::LoadItemPrototypes() // allowed only in special format else if ((proto->Spells[1].SpellId == 483) || (proto->Spells[1].SpellId == 55884)) { - sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId); + sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId); const_cast(proto)->Spells[0].SpellId = 0; const_cast(proto)->Spells[1].SpellId = 0; const_cast(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; @@ -2292,13 +2292,13 @@ void ObjectMgr::LoadItemPrototypes() { if (proto->Spells[j].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) { - sLog.outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)",i,j+1,proto->Spells[j].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)",i,j+1,proto->Spells[j].SpellTrigger); const_cast(proto)->Spells[j].SpellId = 0; const_cast(proto)->Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } else if (proto->Spells[j].SpellId != 0) { - sLog.outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format",i,j+1,proto->Spells[j].SpellId); + sLog->outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format",i,j+1,proto->Spells[j].SpellId); const_cast(proto)->Spells[j].SpellId = 0; } } @@ -2310,7 +2310,7 @@ void ObjectMgr::LoadItemPrototypes() { if (proto->Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || proto->Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID) { - sLog.outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)",i,j+1,proto->Spells[j].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)",i,j+1,proto->Spells[j].SpellTrigger); const_cast(proto)->Spells[j].SpellId = 0; const_cast(proto)->Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } @@ -2320,13 +2320,13 @@ void ObjectMgr::LoadItemPrototypes() SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[j].SpellId); if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[j].SpellId, NULL)) { - sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId); + sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId); const_cast(proto)->Spells[j].SpellId = 0; } // allowed only in special format else if ((proto->Spells[j].SpellId == 483) || (proto->Spells[j].SpellId == 55884)) { - sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId); + sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId); const_cast(proto)->Spells[j].SpellId = 0; } } @@ -2334,17 +2334,17 @@ void ObjectMgr::LoadItemPrototypes() } if (proto->Bonding >= MAX_BIND_TYPE) - sLog.outErrorDb("Item (Entry: %u) has wrong Bonding value (%u)",i,proto->Bonding); + sLog->outErrorDb("Item (Entry: %u) has wrong Bonding value (%u)",i,proto->Bonding); if (proto->PageText && !sPageTextStore.LookupEntry(proto->PageText)) - sLog.outErrorDb("Item (Entry: %u) has non existing first page (Id:%u)", i,proto->PageText); + sLog->outErrorDb("Item (Entry: %u) has non existing first page (Id:%u)", i,proto->PageText); if (proto->LockID && !sLockStore.LookupEntry(proto->LockID)) - sLog.outErrorDb("Item (Entry: %u) has wrong LockID (%u)",i,proto->LockID); + sLog->outErrorDb("Item (Entry: %u) has wrong LockID (%u)",i,proto->LockID); if (proto->Sheath >= MAX_SHEATHETYPE) { - sLog.outErrorDb("Item (Entry: %u) has wrong Sheath (%u)",i,proto->Sheath); + sLog->outErrorDb("Item (Entry: %u) has wrong Sheath (%u)",i,proto->Sheath); const_cast(proto)->Sheath = SHEATHETYPE_NONE; } @@ -2356,28 +2356,28 @@ void ObjectMgr::LoadItemPrototypes() else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(proto->RandomProperty))) { - sLog.outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",i,proto->RandomProperty); + sLog->outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",i,proto->RandomProperty); const_cast(proto)->RandomProperty = 0; } } if (proto->RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(proto->RandomSuffix))) { - sLog.outErrorDb("Item (Entry: %u) has wrong RandomSuffix (%u)",i,proto->RandomSuffix); + sLog->outErrorDb("Item (Entry: %u) has wrong RandomSuffix (%u)",i,proto->RandomSuffix); const_cast(proto)->RandomSuffix = 0; } if (proto->ItemSet && !sItemSetStore.LookupEntry(proto->ItemSet)) { - sLog.outErrorDb("Item (Entry: %u) have wrong ItemSet (%u)",i,proto->ItemSet); + sLog->outErrorDb("Item (Entry: %u) have wrong ItemSet (%u)",i,proto->ItemSet); const_cast(proto)->ItemSet = 0; } if (proto->Area && !GetAreaEntryByAreaID(proto->Area)) - sLog.outErrorDb("Item (Entry: %u) has wrong Area (%u)",i,proto->Area); + sLog->outErrorDb("Item (Entry: %u) has wrong Area (%u)",i,proto->Area); if (proto->Map && !sMapStore.LookupEntry(proto->Map)) - sLog.outErrorDb("Item (Entry: %u) has wrong Map (%u)",i,proto->Map); + sLog->outErrorDb("Item (Entry: %u) has wrong Map (%u)",i,proto->Map); if (proto->BagFamily) { @@ -2391,7 +2391,7 @@ void ObjectMgr::LoadItemPrototypes() ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(j+1); if (!bf) { - sLog.outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit",i); + sLog->outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit",i); const_cast(proto)->BagFamily &= ~mask; continue; } @@ -2401,7 +2401,7 @@ void ObjectMgr::LoadItemPrototypes() CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(proto->ItemId); if (!ctEntry) { - sLog.outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit",i); + sLog->outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit",i); const_cast(proto)->BagFamily &= ~mask; } } @@ -2409,35 +2409,35 @@ void ObjectMgr::LoadItemPrototypes() } if (proto->TotemCategory && !sTotemCategoryStore.LookupEntry(proto->TotemCategory)) - sLog.outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory); + sLog->outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",i,proto->TotemCategory); for (uint8 j = 0; j < MAX_ITEM_PROTO_SOCKETS; ++j) { if (proto->Socket[j].Color && (proto->Socket[j].Color & SOCKET_COLOR_ALL) != proto->Socket[j].Color) { - sLog.outErrorDb("Item (Entry: %u) has wrong socketColor_%d (%u)",i,j+1,proto->Socket[j].Color); + sLog->outErrorDb("Item (Entry: %u) has wrong socketColor_%d (%u)",i,j+1,proto->Socket[j].Color); const_cast(proto)->Socket[j].Color = 0; } } if (proto->GemProperties && !sGemPropertiesStore.LookupEntry(proto->GemProperties)) - sLog.outErrorDb("Item (Entry: %u) has wrong GemProperties (%u)",i,proto->GemProperties); + sLog->outErrorDb("Item (Entry: %u) has wrong GemProperties (%u)",i,proto->GemProperties); if (proto->FoodType >= MAX_PET_DIET) { - sLog.outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)",i,proto->FoodType); + sLog->outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)",i,proto->FoodType); const_cast(proto)->FoodType = 0; } if (proto->ItemLimitCategory && !sItemLimitCategoryStore.LookupEntry(proto->ItemLimitCategory)) { - sLog.outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)",i,proto->ItemLimitCategory); + sLog->outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)",i,proto->ItemLimitCategory); const_cast(proto)->ItemLimitCategory = 0; } if (proto->HolidayId && !sHolidaysStore.LookupEntry(proto->HolidayId)) { - sLog.outErrorDb("Item (Entry: %u) has wrong HolidayId value (%u)", i, proto->HolidayId); + sLog->outErrorDb("Item (Entry: %u) has wrong HolidayId value (%u)", i, proto->HolidayId); const_cast(proto)->HolidayId = 0; } } @@ -2463,10 +2463,10 @@ void ObjectMgr::LoadItemPrototypes() } for (std::set::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->outErrorDb("Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr); - sLog.outString(">> Loaded %u item prototypes in %u ms", sItemStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u item prototypes in %u ms", sItemStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadItemSetNameLocales() @@ -2496,8 +2496,8 @@ void ObjectMgr::LoadItemSetNameLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(mItemSetNameLocaleMap.size()), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(mItemSetNameLocaleMap.size()), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadItemSetNames() @@ -2524,8 +2524,8 @@ void ObjectMgr::LoadItemSetNames() if (!result) { - sLog.outString(">> Loaded 0 item set names. DB table `item_set_names` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 item set names. DB table `item_set_names` is empty."); + sLog->outString(); return; } @@ -2538,7 +2538,7 @@ void ObjectMgr::LoadItemSetNames() uint32 entry = fields[0].GetUInt32(); if (itemSetItems.find(entry) == itemSetItems.end()) { - sLog.outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry); + sLog->outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry); continue; } @@ -2548,7 +2548,7 @@ void ObjectMgr::LoadItemSetNames() uint32 invType = fields[2].GetUInt32(); if (invType >= MAX_INVTYPE) { - sLog.outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); + sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); invType = INVTYPE_NON_EQUIP; } @@ -2568,19 +2568,19 @@ void ObjectMgr::LoadItemSetNames() pProto = ObjectMgr::GetItemPrototype(entry); if (pProto) { - sLog.outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry); + sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry); ItemSetNameEntry &data = mItemSetNameMap[entry]; data.name = pProto->Name1; data.InventoryType = pProto->InventoryType; ++count; } else - sLog.outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry); + sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry); } } - sLog.outString(">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadVehicleAccessories() @@ -2595,8 +2595,8 @@ void ObjectMgr::LoadVehicleAccessories() if (!result) { - sLog.outErrorDb(">> Loaded 0 LoadVehicleAccessor. DB table `vehicle_accessory` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 LoadVehicleAccessor. DB table `vehicle_accessory` is empty."); + sLog->outString(); return; } @@ -2612,13 +2612,13 @@ void ObjectMgr::LoadVehicleAccessories() if (!sCreatureStorage.LookupEntry(uiEntry)) { - sLog.outErrorDb("Table `vehicle_accessory`: creature template entry %u does not exist.", uiEntry); + sLog->outErrorDb("Table `vehicle_accessory`: creature template entry %u does not exist.", uiEntry); continue; } if (!sCreatureStorage.LookupEntry(uiAccessory)) { - sLog.outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory); + sLog->outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory); continue; } @@ -2627,8 +2627,8 @@ void ObjectMgr::LoadVehicleAccessories() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadVehicleScaling() @@ -2643,8 +2643,8 @@ void ObjectMgr::LoadVehicleScaling() if (!result) { - sLog.outString(">> Loaded 0 vehicle scaling entries. DB table `vehicle_scaling_info` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 vehicle scaling entries. DB table `vehicle_scaling_info` is empty."); + sLog->outString(); return; } @@ -2659,7 +2659,7 @@ void ObjectMgr::LoadVehicleScaling() if (!sVehicleStore.LookupEntry(vehicleEntry)) { - sLog.outErrorDb("Table `vehicle_scaling_info`: vehicle entry %u does not exist.", vehicleEntry); + sLog->outErrorDb("Table `vehicle_scaling_info`: vehicle entry %u does not exist.", vehicleEntry); continue; } @@ -2670,8 +2670,8 @@ void ObjectMgr::LoadVehicleScaling() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u vehicle scaling entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u vehicle scaling entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadPetLevelInfo() @@ -2683,8 +2683,8 @@ void ObjectMgr::LoadPetLevelInfo() if (!result) { - sLog.outErrorDb(">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); + sLog->outString(); return; } @@ -2697,32 +2697,32 @@ void ObjectMgr::LoadPetLevelInfo() uint32 creature_id = fields[0].GetUInt32(); if (!sCreatureStorage.LookupEntry(creature_id)) { - sLog.outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.",creature_id); + sLog->outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.",creature_id); continue; } uint32 current_level = fields[1].GetUInt32(); - if (current_level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + 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->outErrorDb("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->outDetail("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->outErrorDb("Wrong (<1) level %u in `pet_levelstats` table, ignoring.",current_level); continue; } PetLevelInfo*& pInfoMapEntry = petInfo[creature_id]; if (pInfoMapEntry == NULL) - pInfoMapEntry = new PetLevelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; + pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; // data for level 1 stored in [0] array element, ... PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level-1]; @@ -2748,29 +2748,29 @@ 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->outErrorDb("Creature %u does not have pet stats data for Level 1!",itr->first); exit(1); } // fill level gaps - for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) + for (uint8 level = 1; level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) { 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->outErrorDb("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->outString(">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) const { - if (level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) - level = sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); + if (level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + level = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); PetLevelInfoMap::const_iterator itr = petInfo.find(creature_id); if (itr == petInfo.end()) @@ -2786,7 +2786,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->outErrorDb("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; @@ -2808,7 +2808,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->outErrorDb("Item %u specified to be removed from original create info not found in dbc!", itemId); if (!doneOne) doneOne = true; @@ -2830,8 +2830,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog.outString(); - sLog.outErrorDb(">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); + sLog->outString(); + sLog->outErrorDb(">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); exit(1); } else @@ -2853,39 +2853,39 @@ void ObjectMgr::LoadPlayerInfo() if (current_race >= MAX_RACES) { - sLog.outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.",current_race); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.",current_class,current_race); continue; } @@ -2905,13 +2905,13 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog.outString(">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // Load playercreate items - sLog.outString("Loading Player Create Items Data..."); + sLog->outString("Loading Player Create Items Data..."); { uint32 oldMSTime = getMSTime(); // 0 1 2 3 @@ -2919,8 +2919,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog.outString(">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); + sLog->outString(); } else { @@ -2933,14 +2933,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog.outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.",current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog.outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.",current_class); continue; } @@ -2948,7 +2948,7 @@ void ObjectMgr::LoadPlayerInfo() if (!ObjectMgr::GetItemPrototype(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->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); continue; } @@ -2956,7 +2956,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->outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.",item_id,current_race,current_class); continue; } @@ -2977,26 +2977,26 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog.outString(">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // Load playercreate spells - sLog.outString("Loading Player Create Spell Data..."); + sLog->outString("Loading Player Create Spell Data..."); { uint32 oldMSTime = getMSTime(); QueryResult result = QueryResult(NULL); - if (sWorld.getBoolConfig(CONFIG_START_ALL_SPELLS)) + if (sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS)) result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom"); else result = WorldDatabase.Query("SELECT race, class, Spell FROM playercreateinfo_spell"); 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->outErrorDb(">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"); + sLog->outString(); } else { @@ -3009,14 +3009,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog.outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.",current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog.outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.",current_class); continue; } @@ -3037,13 +3037,13 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog.outString(">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // Load playercreate actions - sLog.outString("Loading Player Create Action Data..."); + sLog->outString("Loading Player Create Action Data..."); { uint32 oldMSTime = getMSTime(); @@ -3052,8 +3052,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog.outErrorDb(">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); + sLog->outString(); } else { @@ -3066,14 +3066,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog.outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.",current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog.outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.",current_class); continue; } @@ -3084,13 +3084,13 @@ void ObjectMgr::LoadPlayerInfo() } while (result->NextRow()); - sLog.outString(">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // Loading levels data (class only dependent) - sLog.outString("Loading Player Create Level HP/Mana Data..."); + sLog->outString("Loading Player Create Level HP/Mana Data..."); { uint32 oldMSTime = getMSTime(); @@ -3099,8 +3099,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog.outErrorDb(">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty."); + sLog->outString(); exit(1); } @@ -3113,14 +3113,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_class = fields[0].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog.outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.",current_class); continue; } uint8 current_level = fields[1].GetUInt8(); // Can't be > than STRONG_MAX_LEVEL (hardcoded level maximum) due to var type - if (current_level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - sLog.outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.",current_level); + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.",current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. continue; } @@ -3128,7 +3128,7 @@ void ObjectMgr::LoadPlayerInfo() PlayerClassInfo* pClassInfo = &playerClassInfo[current_class]; if (!pClassInfo->levelInfo) - pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; + pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; PlayerClassLevelInfo* pClassLevelInfo = &pClassInfo->levelInfo[current_level-1]; @@ -3151,27 +3151,27 @@ void ObjectMgr::LoadPlayerInfo() // fatal error if no level 1 data if (!pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0) { - sLog.outErrorDb("Class %i Level 1 does not have health/mana data!",class_); + sLog->outErrorDb("Class %i Level 1 does not have health/mana data!",class_); exit(1); } // fill level gaps - for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) + for (uint8 level = 1; level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) { if (pClassInfo->levelInfo[level].basehealth == 0) { - sLog.outErrorDb("Class %i Level %i does not have health/mana data. Using stats data of level %i.",class_,level+1, level); + sLog->outErrorDb("Class %i Level %i does not have health/mana data. Using stats data of level %i.",class_,level+1, level); pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level-1]; } } } - sLog.outString(">> Loaded %u level health/mana definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u level health/mana definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Loading levels data (class/race dependent) - sLog.outString("Loading Player Create Level Stats Data..."); + sLog->outString("Loading Player Create Level Stats Data..."); { uint32 oldMSTime = getMSTime(); @@ -3180,8 +3180,8 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog.outErrorDb(">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); + sLog->outString(); exit(1); } @@ -3194,25 +3194,25 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog.outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.",current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog.outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.",current_class); continue; } uint32 current_level = fields[2].GetUInt32(); - if (current_level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + 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->outErrorDb("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->outDetail("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; @@ -3221,7 +3221,7 @@ void ObjectMgr::LoadPlayerInfo() PlayerInfo* pInfo = &playerInfo[current_race][current_class]; if (!pInfo->levelInfo) - pInfo->levelInfo = new PlayerLevelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; + pInfo->levelInfo = new PlayerLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; PlayerLevelInfo* pLevelInfo = &pInfo->levelInfo[current_level-1]; @@ -3254,43 +3254,43 @@ void ObjectMgr::LoadPlayerInfo() continue; // skip expansion races if not playing with expansion - if (sWorld.getIntConfig(CONFIG_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI)) + if (sWorld->getIntConfig(CONFIG_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI)) continue; // skip expansion classes if not playing with expansion - if (sWorld.getIntConfig(CONFIG_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT) + if (sWorld->getIntConfig(CONFIG_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT) continue; // 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->outErrorDb("Race %i Class %i Level 1 does not have stats data!",race,class_); exit(1); } // fill level gaps - for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) + for (uint8 level = 1; level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) { 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->outErrorDb("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->outString(">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Loading xp per level data - sLog.outString("Loading Player Create XP Data..."); + sLog->outString("Loading Player Create XP Data..."); { uint32 oldMSTime = getMSTime(); - mPlayerXPperLevel.resize(sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); - for (uint8 level = 0; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) + mPlayerXPperLevel.resize(sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); + for (uint8 level = 0; level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) mPlayerXPperLevel[level] = 0; // 0 1 @@ -3298,8 +3298,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->outErrorDb(">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty."); + sLog->outString(); exit(1); } @@ -3312,13 +3312,13 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_level = fields[0].GetUInt32(); uint32 current_xp = fields[1].GetUInt32(); - if (current_level >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + 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->outErrorDb("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->outDetail("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; @@ -3330,17 +3330,17 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); // fill level gaps - for (uint8 level = 1; level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) + for (uint8 level = 1; level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) { if (mPlayerXPperLevel[level] == 0) { - sLog.outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.",level+1, level); + sLog->outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.",level+1, level); mPlayerXPperLevel[level] = mPlayerXPperLevel[level-1]+100; } } - sLog.outString(">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } @@ -3351,8 +3351,8 @@ void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassL PlayerClassInfo const* pInfo = &playerClassInfo[class_]; - if (level > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) - level = sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL); + if (level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + level = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); *info = pInfo->levelInfo[level-1]; } @@ -3366,7 +3366,7 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, Play if (pInfo->displayId_m == 0 || pInfo->displayId_f == 0) return; - if (level <= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (level <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) *info = pInfo->levelInfo[level-1]; else BuildPlayerLevelInfo(race,class_,level,info); @@ -3375,10 +3375,10 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, Play void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, PlayerLevelInfo* info) const { // base data (last known level) - *info = playerInfo[race][_class].levelInfo[sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)-1]; + *info = playerInfo[race][_class].levelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)-1]; // if conversion from uint32 to uint8 causes unexpected behaviour, change lvl to uint32 - for (uint8 lvl = sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl) + for (uint8 lvl = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl) { switch(_class) { @@ -3451,7 +3451,7 @@ void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, Play void ObjectMgr::LoadGuilds() { // 1. Load all guilds - sLog.outString("Loading guilds definitions..."); + sLog->outString("Loading guilds definitions..."); { uint32 oldMSTime = getMSTime(); @@ -3460,8 +3460,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild definitions. DB table `guild` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild definitions. DB table `guild` is empty."); + sLog->outString(); return; } else @@ -3485,13 +3485,13 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 2. Load all guild ranks - sLog.outString("Loading guild ranks..."); + sLog->outString("Loading guild ranks..."); { uint32 oldMSTime = getMSTime(); @@ -3504,8 +3504,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); + sLog->outString(); } else { @@ -3522,13 +3522,13 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 3. Load all guild members - sLog.outString("Loading guild members..."); + sLog->outString("Loading guild members..."); { uint32 oldMSTime = getMSTime(); @@ -3541,8 +3541,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild members. DB table `guild_member` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild members. DB table `guild_member` is empty."); + sLog->outString(); } else { @@ -3559,13 +3559,13 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 4. Load all guild bank tab rights - sLog.outString("Loading bank tab rights..."); + sLog->outString("Loading bank tab rights..."); { uint32 oldMSTime = getMSTime(); @@ -3578,8 +3578,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); + sLog->outString(); } else { @@ -3596,18 +3596,18 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 5. Load all event logs - sLog.outString("Loading guild event logs..."); + sLog->outString("Loading guild event logs..."); { uint32 oldMSTime = getMSTime(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_GUILD_EVENT_LOGS); - stmt->setUInt32(0, sWorld.getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT)); + stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT)); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_EVENTLOGS); @@ -3615,8 +3615,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); + sLog->outString(); } else { @@ -3633,19 +3633,19 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 6. Load all bank event logs - sLog.outString("Loading guild bank event logs..."); + sLog->outString("Loading guild bank event logs..."); { uint32 oldMSTime = getMSTime(); // Remove log entries that exceed the number of allowed entries per guild PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_GUILD_BANK_EVENT_LOGS); - stmt->setUInt32(0, sWorld.getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT)); + stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT)); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_BANK_EVENTLOGS); @@ -3653,8 +3653,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); + sLog->outString(); } else { @@ -3671,13 +3671,13 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 7. Load all guild bank tabs - sLog.outString("Loading guild bank tabs..."); + sLog->outString("Loading guild bank tabs..."); { uint32 oldMSTime = getMSTime(); @@ -3690,8 +3690,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); + sLog->outString(); } else { @@ -3708,13 +3708,13 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 8. Fill all guild bank tabs - sLog.outString("Filling bank tabs with items..."); + sLog->outString("Filling bank tabs with items..."); { uint32 oldMSTime = getMSTime(); @@ -3727,8 +3727,8 @@ void ObjectMgr::LoadGuilds() if (!result) { - sLog.outString(">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); + sLog->outString(); } else { @@ -3745,13 +3745,13 @@ void ObjectMgr::LoadGuilds() } while (result->NextRow()); - sLog.outString(">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } // 9. Validate loaded guild data - sLog.outString("Validating data of loaded guilds..."); + sLog->outString("Validating data of loaded guilds..."); { uint32 oldMSTime = getMSTime(); @@ -3768,8 +3768,8 @@ void ObjectMgr::LoadGuilds() } } - sLog.outString("Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString("Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } @@ -3785,8 +3785,8 @@ void ObjectMgr::LoadArenaTeams() if (!result) { - sLog.outString(">> Loaded 0 arena team definitions. DB table `arena_team` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 arena team definitions. DB table `arena_team` is empty!"); + sLog->outString(); return; } @@ -3815,8 +3815,8 @@ void ObjectMgr::LoadArenaTeams() AddArenaTeam(newArenaTeam); }while (result->NextRow()); - sLog.outString(); - sLog.outString(">> Loaded %u arena team definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + sLog->outString(">> Loaded %u arena team definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadGroups() @@ -3835,8 +3835,8 @@ void ObjectMgr::LoadGroups() ",icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups"); if (!result) { - sLog.outString(">> Loaded 0 group definitions. DB table `groups` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 group definitions. DB table `groups` is empty!"); + sLog->outString(); return; } @@ -3853,11 +3853,11 @@ void ObjectMgr::LoadGroups() } while (result->NextRow()); - sLog.outString(">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } - sLog.outString("Loading Group members..."); + sLog->outString("Loading Group members..."); { uint32 oldMSTime = getMSTime(); @@ -3871,8 +3871,8 @@ void ObjectMgr::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->outString(">> Loaded 0 group members. DB table `group_member` is empty!"); + sLog->outString(); return; } @@ -3890,17 +3890,17 @@ void ObjectMgr::LoadGroups() if (group) // Should never be null group->LoadMemberFromDB(fields[1].GetUInt32(), fields[2].GetUInt8(), fields[3].GetUInt8(), fields[4].GetUInt8()); else - sLog.outError("ObjectMgr::LoadGroups: Consistency failed, can't find group (lowguid %u)", groupLowGuid); + sLog->outError("ObjectMgr::LoadGroups: Consistency failed, can't find group (lowguid %u)", groupLowGuid); ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } - sLog.outString("Loading Group instance saves..."); + sLog->outString("Loading Group instance saves..."); { uint32 oldMSTime = getMSTime(); @@ -3912,8 +3912,8 @@ void ObjectMgr::LoadGroups() if (!result) { - sLog.outString(); - sLog.outString(">> Loaded 0 group-instance saves. DB table `group_instance` is empty!"); + sLog->outString(); + sLog->outString(">> Loaded 0 group-instance saves. DB table `group_instance` is empty!"); return; } @@ -3927,14 +3927,14 @@ void ObjectMgr::LoadGroups() MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt32()); if (!mapEntry || !mapEntry->IsDungeon()) { - sLog.outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt32()); + sLog->outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt32()); 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->outErrorDb("Wrong dungeon difficulty use in group_instance table: %d", diff + 1); diff = 0; // default for both difficaly types } @@ -3944,8 +3944,8 @@ void ObjectMgr::LoadGroups() } while (result->NextRow()); - sLog.outString(">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } @@ -3999,8 +3999,8 @@ void ObjectMgr::LoadQuests() " FROM quest_template"); if (result == NULL) { - sLog.outErrorDb(">> Loaded 0 quests definitions. DB table `quest_template` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 quests definitions. DB table `quest_template` is empty."); + sLog->outString(); return; } @@ -4030,19 +4030,19 @@ void ObjectMgr::LoadQuests() if (qinfo->GetQuestMethod() >= 3) { - sLog.outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.",qinfo->GetQuestId(),qinfo->GetQuestMethod()); + sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.",qinfo->GetQuestId(),qinfo->GetQuestMethod()); } if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) { - sLog.outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", + sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", qinfo->GetQuestId(),qinfo->QuestFlags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; } if (qinfo->QuestFlags & QUEST_FLAGS_DAILY && qinfo->QuestFlags & QUEST_FLAGS_WEEKLY) { - sLog.outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.",qinfo->GetQuestId()); + sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.",qinfo->GetQuestId()); qinfo->QuestFlags &= ~QUEST_FLAGS_DAILY; } @@ -4050,7 +4050,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) { - sLog.outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); + sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } @@ -4059,7 +4059,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) { - sLog.outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); + sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } @@ -4071,7 +4071,7 @@ void ObjectMgr::LoadQuests() { if (uint32 id = qinfo->RewChoiceItemId[j]) { - sLog.outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item from `RewChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.", + sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item from `RewChoiceItemId%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 } @@ -4083,7 +4083,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->outErrorDb("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 } @@ -4094,7 +4094,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->outErrorDb("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) } @@ -4104,7 +4104,7 @@ void ObjectMgr::LoadQuests() // SkillOrClass should not have class case when class case already set in ZoneOrSort. if (qinfo->SkillOrClassMask < 0) { - sLog.outErrorDb("Quest %u has `ZoneOrSort` = %i (class sort case) and `SkillOrClassMask` = %i (class case), redundant.", + sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (class sort case) and `SkillOrClassMask` = %i (class case), redundant.", qinfo->GetQuestId(),qinfo->ZoneOrSort,qinfo->SkillOrClassMask); } } @@ -4114,7 +4114,7 @@ void ObjectMgr::LoadQuests() // skill is positive value in SkillOrClass if (qinfo->SkillOrClassMask != skill_id) { - sLog.outErrorDb("Quest %u has `ZoneOrSort` = %i (skill sort case) but `SkillOrClassMask` does not have a corresponding value (%i).", + sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (skill sort case) but `SkillOrClassMask` does not have a corresponding value (%i).", qinfo->GetQuestId(),qinfo->ZoneOrSort,skill_id); //override, and force proper value here? } @@ -4126,7 +4126,7 @@ void ObjectMgr::LoadQuests() { if (!(-int32(qinfo->SkillOrClassMask) & CLASSMASK_ALL_PLAYABLE)) { - sLog.outErrorDb("Quest %u has `SkillOrClassMask` = %i (class case) but classmask does not have valid class", + sLog->outErrorDb("Quest %u has `SkillOrClassMask` = %i (class case) but classmask does not have valid class", qinfo->GetQuestId(),qinfo->SkillOrClassMask); } } @@ -4135,23 +4135,23 @@ void ObjectMgr::LoadQuests() { if (!sSkillLineStore.LookupEntry(qinfo->SkillOrClassMask)) { - sLog.outErrorDb("Quest %u has `SkillOrClass` = %u (skill case) but skill (%i) does not exist", + sLog->outErrorDb("Quest %u has `SkillOrClass` = %u (skill case) but skill (%i) does not exist", qinfo->GetQuestId(),qinfo->SkillOrClassMask,qinfo->SkillOrClassMask); } } if (qinfo->RequiredSkillValue) { - if (qinfo->RequiredSkillValue > sWorld.GetConfigMaxSkillValue()) + if (qinfo->RequiredSkillValue > sWorld->GetConfigMaxSkillValue()) { - sLog.outErrorDb("Quest %u has `RequiredSkillValue` = %u but max possible skill is %u, quest can't be done.", - qinfo->GetQuestId(),qinfo->RequiredSkillValue,sWorld.GetConfigMaxSkillValue()); + sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but max possible skill is %u, quest can't be done.", + qinfo->GetQuestId(),qinfo->RequiredSkillValue,sWorld->GetConfigMaxSkillValue()); // no changes, quest can't be done for this requirement } if (qinfo->SkillOrClassMask <= 0) { - sLog.outErrorDb("Quest %u has `RequiredSkillValue` = %u but `SkillOrClass` = %i (class case), value ignored.", + sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but `SkillOrClass` = %i (class case), value ignored.", qinfo->GetQuestId(),qinfo->RequiredSkillValue,qinfo->SkillOrClassMask); // no changes, quest can't be done for this requirement (fail at wrong skill id) } @@ -4160,77 +4160,77 @@ void ObjectMgr::LoadQuests() if (qinfo->RepObjectiveFaction2 && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction2)) { - sLog.outErrorDb("Quest %u has `RepObjectiveFaction2` = %u but faction template %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RepObjectiveFaction2` = %u but faction template %u does not exist, quest can't be done.", qinfo->GetQuestId(),qinfo->RepObjectiveFaction2,qinfo->RepObjectiveFaction2); // no changes, quest can't be done for this requirement } if (qinfo->RepObjectiveFaction && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction)) { - sLog.outErrorDb("Quest %u has `RepObjectiveFaction` = %u but faction template %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RepObjectiveFaction` = %u but faction template %u does not exist, quest can't be done.", qinfo->GetQuestId(),qinfo->RepObjectiveFaction,qinfo->RepObjectiveFaction); // 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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->RepObjectiveFaction && qinfo->RepObjectiveValue > 0) { - sLog.outErrorDb("Quest %u has `RepObjectiveValue` = %d but `RepObjectiveFaction` is 0, value has no effect", + sLog->outErrorDb("Quest %u has `RepObjectiveValue` = %d but `RepObjectiveFaction` is 0, value has no effect", qinfo->GetQuestId(),qinfo->RepObjectiveValue); // warning } if (!qinfo->RepObjectiveFaction2 && qinfo->RepObjectiveValue2 > 0) { - sLog.outErrorDb("Quest %u has `RepObjectiveValue2` = %d but `RepObjectiveFaction2` is 0, value has no effect", + sLog->outErrorDb("Quest %u has `RepObjectiveValue2` = %d but `RepObjectiveFaction2` is 0, value has no effect", qinfo->GetQuestId(),qinfo->RepObjectiveValue2); // warning } if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue > 0) { - sLog.outErrorDb("Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect", + sLog->outErrorDb("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->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect", qinfo->GetQuestId(),qinfo->RequiredMaxRepValue); // warning } if (qinfo->CharTitleId && !sCharTitlesStore.LookupEntry(qinfo->CharTitleId)) { - sLog.outErrorDb("Quest %u has `CharTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", + sLog->outErrorDb("Quest %u has `CharTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", qinfo->GetQuestId(),qinfo->GetCharTitleId(),qinfo->GetCharTitleId()); qinfo->CharTitleId = 0; // quest can't reward this title @@ -4240,20 +4240,20 @@ void ObjectMgr::LoadQuests() { if (!sItemStorage.LookupEntry(qinfo->SrcItemId)) { - sLog.outErrorDb("Quest %u has `SrcItemId` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `SrcItemId` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(),qinfo->SrcItemId,qinfo->SrcItemId); qinfo->SrcItemId = 0; // quest can't be done for this requirement } else if (qinfo->SrcItemCount == 0) { - sLog.outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.", + sLog->outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.", qinfo->GetQuestId(),qinfo->SrcItemId); qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB } } else if (qinfo->SrcItemCount>0) { - sLog.outErrorDb("Quest %u has `SrcItemId` = 0 but `SrcItemCount` = %u, useless value.", + sLog->outErrorDb("Quest %u has `SrcItemId` = 0 but `SrcItemCount` = %u, useless value.", qinfo->GetQuestId(),qinfo->SrcItemCount); qinfo->SrcItemCount=0; // no quest work changes in fact } @@ -4263,13 +4263,13 @@ void ObjectMgr::LoadQuests() SpellEntry const* spellInfo = sSpellStore.LookupEntry(qinfo->SrcSpell); if (!spellInfo) { - sLog.outErrorDb("Quest %u has `SrcSpell` = %u but spell %u doesn't exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u doesn't exist, quest can't be done.", qinfo->GetQuestId(),qinfo->SrcSpell,qinfo->SrcSpell); qinfo->SrcSpell = 0; // quest can't be done for this requirement } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog.outErrorDb("Quest %u has `SrcSpell` = %u but spell %u is broken, quest can't be done.", + sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u is broken, quest can't be done.", qinfo->GetQuestId(),qinfo->SrcSpell,qinfo->SrcSpell); qinfo->SrcSpell = 0; // quest can't be done for this requirement } @@ -4282,7 +4282,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->ReqItemCount[j] == 0) { - sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.", qinfo->GetQuestId(),j+1,id,j+1); // no changes, quest can't be done for this requirement } @@ -4291,14 +4291,14 @@ void ObjectMgr::LoadQuests() if (!sItemStorage.LookupEntry(id)) { - sLog.outErrorDb("Quest %u has `ReqItemId%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(),j+1,id,id); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } } else if (qinfo->ReqItemCount[j]>0) { - sLog.outErrorDb("Quest %u has `ReqItemId%d` = 0 but `ReqItemCount%d` = %u, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqItemId%d` = 0 but `ReqItemCount%d` = %u, quest can't be done.", qinfo->GetQuestId(),j+1,j+1,qinfo->ReqItemCount[j]); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } @@ -4311,7 +4311,7 @@ void ObjectMgr::LoadQuests() { if (!sItemStorage.LookupEntry(id)) { - sLog.outErrorDb("Quest %u has `ReqSourceId%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqSourceId%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 } @@ -4320,7 +4320,7 @@ void ObjectMgr::LoadQuests() { if (qinfo->ReqSourceCount[j]>0) { - sLog.outErrorDb("Quest %u has `ReqSourceId%d` = 0 but `ReqSourceCount%d` = %u.", + sLog->outErrorDb("Quest %u has `ReqSourceId%d` = 0 but `ReqSourceCount%d` = %u.", qinfo->GetQuestId(),j+1,j+1,qinfo->ReqSourceCount[j]); // no changes, quest ignore this data } @@ -4335,7 +4335,7 @@ void ObjectMgr::LoadQuests() SpellEntry const* spellInfo = sSpellStore.LookupEntry(id); if (!spellInfo) { - sLog.outErrorDb("Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.", qinfo->GetQuestId(),j+1,id,id); continue; } @@ -4357,7 +4357,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 ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1); + sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1); // this will prevent quest completing without objective const_cast(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -4365,7 +4365,7 @@ void ObjectMgr::LoadQuests() } else { - sLog.outErrorDb("Quest %u has `ReqSpellCast%d` = %u and ReqCreatureOrGOId%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->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and ReqCreatureOrGOId%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 } @@ -4378,14 +4378,14 @@ void ObjectMgr::LoadQuests() int32 id = qinfo->ReqCreatureOrGOId[j]; if (id < 0 && !sGOStorage.LookupEntry(-id)) { - sLog.outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but gameobject %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but gameobject %u does not exist, quest can't be done.", qinfo->GetQuestId(),j+1,id,uint32(-id)); qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement } if (id > 0 && !sCreatureStorage.LookupEntry(id)) { - sLog.outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but creature with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but creature with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(),j+1,id,uint32(id)); qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement } @@ -4398,14 +4398,14 @@ void ObjectMgr::LoadQuests() if (!qinfo->ReqCreatureOrGOCount[j]) { - sLog.outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %u but `ReqCreatureOrGOCount%d` = 0, quest can't be done.", + sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %u but `ReqCreatureOrGOCount%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->ReqCreatureOrGOCount[j]>0) { - sLog.outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = 0 but `ReqCreatureOrGOCount%d` = %u.", + sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = 0 but `ReqCreatureOrGOCount%d` = %u.", qinfo->GetQuestId(),j+1,j+1,qinfo->ReqCreatureOrGOCount[j]); // no changes, quest ignore this data } @@ -4418,21 +4418,21 @@ void ObjectMgr::LoadQuests() { if (!sItemStorage.LookupEntry(id)) { - sLog.outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", + sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(),j+1,id,id); qinfo->RewChoiceItemId[j] = 0; // no changes, quest will not reward this } if (!qinfo->RewChoiceItemCount[j]) { - sLog.outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but `RewChoiceItemCount%d` = 0, quest can't be done.", + sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but `RewChoiceItemCount%d` = 0, quest can't be done.", qinfo->GetQuestId(),j+1,id,j+1); // no changes, quest can't be done } } else if (qinfo->RewChoiceItemCount[j]>0) { - sLog.outErrorDb("Quest %u has `RewChoiceItemId%d` = 0 but `RewChoiceItemCount%d` = %u.", + sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = 0 but `RewChoiceItemCount%d` = %u.", qinfo->GetQuestId(),j+1,j+1,qinfo->RewChoiceItemCount[j]); // no changes, quest ignore this data } @@ -4445,21 +4445,21 @@ void ObjectMgr::LoadQuests() { if (!sItemStorage.LookupEntry(id)) { - sLog.outErrorDb("Quest %u has `RewItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", + sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", qinfo->GetQuestId(),j+1,id,id); qinfo->RewItemId[j] = 0; // no changes, quest will not reward this item } if (!qinfo->RewItemCount[j]) { - sLog.outErrorDb("Quest %u has `RewItemId%d` = %u but `RewItemCount%d` = 0, quest will not reward this item.", + sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but `RewItemCount%d` = 0, quest will not reward this item.", qinfo->GetQuestId(),j+1,id,j+1); // no changes } } else if (qinfo->RewItemCount[j]>0) { - sLog.outErrorDb("Quest %u has `RewItemId%d` = 0 but `RewItemCount%d` = %u.", + sLog->outErrorDb("Quest %u has `RewItemId%d` = 0 but `RewItemCount%d` = %u.", qinfo->GetQuestId(),j+1,j+1,qinfo->RewItemCount[j]); // no changes, quest ignore this data } @@ -4471,11 +4471,11 @@ void ObjectMgr::LoadQuests() { if (abs(qinfo->RewRepValueId[j]) > 9) { - sLog.outErrorDb("Quest %u has RewRepValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewRepValueId[j]); + sLog->outErrorDb("Quest %u has RewRepValueId%d = %i. That is outside the range of valid values (-9 to 9).", qinfo->GetQuestId(), j+1, qinfo->RewRepValueId[j]); } if (!sFactionStore.LookupEntry(qinfo->RewRepFaction[j])) { - sLog.outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(),j+1,qinfo->RewRepFaction[j] ,qinfo->RewRepFaction[j]); + sLog->outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(),j+1,qinfo->RewRepFaction[j] ,qinfo->RewRepFaction[j]); qinfo->RewRepFaction[j] = 0; // quest will not reward this } } @@ -4483,7 +4483,7 @@ void ObjectMgr::LoadQuests() else if (qinfo->RewRepValue[j] != 0) { - sLog.outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.", + sLog->outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.", qinfo->GetQuestId(),j+1,j+1,qinfo->RewRepValue[j]); // no changes, quest ignore this data } @@ -4496,21 +4496,21 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { - sLog.outErrorDb("Quest %u has `RewSpell` = %u but spell %u does not exist, spell removed as display reward.", + sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u does not exist, spell removed as display reward.", qinfo->GetQuestId(),qinfo->RewSpell,qinfo->RewSpell); qinfo->RewSpell = 0; // no spell reward will display for this quest } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog.outErrorDb("Quest %u has `RewSpell` = %u but spell %u is broken, quest will not have a spell reward.", + sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is broken, quest will not have a spell reward.", qinfo->GetQuestId(),qinfo->RewSpell,qinfo->RewSpell); qinfo->RewSpell = 0; // no spell reward will display for this quest } else if (GetTalentSpellCost(qinfo->RewSpell)) { - sLog.outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", + sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", qinfo->GetQuestId(),qinfo->RewSpell,qinfo->RewSpell); qinfo->RewSpell = 0; // no spell reward will display for this quest } @@ -4522,21 +4522,21 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { - sLog.outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", + sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", qinfo->GetQuestId(),qinfo->RewSpellCast,qinfo->RewSpellCast); qinfo->RewSpellCast = 0; // no spell will be casted on player } else if (!SpellMgr::IsSpellValid(spellInfo)) { - sLog.outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", + sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", qinfo->GetQuestId(),qinfo->RewSpellCast,qinfo->RewSpellCast); qinfo->RewSpellCast = 0; // no spell will be casted on player } else if (GetTalentSpellCost(qinfo->RewSpellCast)) { - sLog.outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", + sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", qinfo->GetQuestId(),qinfo->RewSpellCast,qinfo->RewSpellCast); qinfo->RewSpellCast = 0; // no spell will be casted on player } @@ -4546,7 +4546,7 @@ void ObjectMgr::LoadQuests() { if (!sMailTemplateStore.LookupEntry(qinfo->RewMailTemplateId)) { - sLog.outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", + sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", qinfo->GetQuestId(),qinfo->RewMailTemplateId,qinfo->RewMailTemplateId); qinfo->RewMailTemplateId = 0; // no mail will send to player qinfo->RewMailDelaySecs = 0; // no mail will send to player @@ -4554,7 +4554,7 @@ void ObjectMgr::LoadQuests() else if (usedMailTemplates.find(qinfo->RewMailTemplateId) != usedMailTemplates.end()) { std::map::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewMailTemplateId); - sLog.outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", + sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", qinfo->GetQuestId(),qinfo->RewMailTemplateId,qinfo->RewMailTemplateId,used_mt_itr->second); qinfo->RewMailTemplateId = 0; // no mail will send to player qinfo->RewMailDelaySecs = 0; // no mail will send to player @@ -4568,7 +4568,7 @@ void ObjectMgr::LoadQuests() QuestMap::iterator qNextItr = mQuestTemplates.find(qinfo->NextQuestInChain); if (qNextItr == mQuestTemplates.end()) { - sLog.outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.", + sLog->outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.", qinfo->GetQuestId(),qinfo->NextQuestInChain ,qinfo->NextQuestInChain); qinfo->NextQuestInChain = 0; } @@ -4581,7 +4581,7 @@ void ObjectMgr::LoadQuests() { if (mQuestTemplates.find(abs(qinfo->GetPrevQuestId())) == mQuestTemplates.end()) { - sLog.outErrorDb("Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId()); + sLog->outErrorDb("Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId()); } else { @@ -4594,7 +4594,7 @@ void ObjectMgr::LoadQuests() QuestMap::iterator qNextItr = mQuestTemplates.find(abs(qinfo->GetNextQuestId())); if (qNextItr == mQuestTemplates.end()) { - sLog.outErrorDb("Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); + sLog->outErrorDb("Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); } else { @@ -4631,7 +4631,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->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); // this will prevent quest completing without objective const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -4639,8 +4639,8 @@ void ObjectMgr::LoadQuests() } } - sLog.outString(">> Loaded %lu quests definitions in %u ms", (unsigned long)mQuestTemplates.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu quests definitions in %u ms", (unsigned long)mQuestTemplates.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadQuestLocales() @@ -4704,8 +4704,8 @@ void ObjectMgr::LoadQuestLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded %lu Quest locale strings in %u ms", (unsigned long)mQuestLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu Quest locale strings in %u ms", (unsigned long)mQuestLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadScripts(ScriptsType type) @@ -4720,10 +4720,10 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (tableName.empty()) return; - if (sWorld.IsScriptScheduled()) // function don't must be called in time scripts use. + if (sWorld->IsScriptScheduled()) // function don't must be called in time scripts use. return; - sLog.outString("Loading %s...", tableName.c_str()); + sLog->outString("Loading %s...", tableName.c_str()); scripts->clear(); // need for reload support @@ -4735,8 +4735,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->outString(">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str()); + sLog->outString(); return; } @@ -4768,19 +4768,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->outErrorDb("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->outErrorDb("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->outErrorDb("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; } @@ -4792,7 +4792,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->outErrorDb("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; } @@ -4803,14 +4803,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->outErrorDb("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->outErrorDb("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; } @@ -4822,14 +4822,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->outErrorDb("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->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.", tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id); // this will prevent quest completing without objective @@ -4840,21 +4840,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->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", 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->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", 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->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", tableName.c_str(), tmp.QuestExplored.Distance, tmp.id, INTERACTION_DISTANCE); continue; } @@ -4866,7 +4866,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->outErrorDb("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; } @@ -4878,7 +4878,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->outErrorDb("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; } @@ -4886,7 +4886,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) GameObjectInfo const* info = GetGameObjectInfo(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->outErrorDb("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; } @@ -4897,7 +4897,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->outErrorDb("Table `%s` have gameobject type (%u) unsupported by command SCRIPT_COMMAND_RESPAWN_GAMEOBJECT for script id %u", tableName.c_str(), info->id, tmp.id); continue; } @@ -4908,14 +4908,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->outErrorDb("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->outErrorDb("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; } @@ -4928,7 +4928,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->outErrorDb("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; } @@ -4936,14 +4936,14 @@ void ObjectMgr::LoadScripts(ScriptsType type) GameObjectInfo const* info = GetGameObjectInfo(data->id); if (!info) { - sLog.outErrorDb("Table `%s` has gameobject with invalid entry (GUID: %u Entry: %u) in %s for script id %u", + sLog->outErrorDb("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->outErrorDb("Table `%s` has gameobject type (%u) non supported by command %s for script id %u", tableName.c_str(), info->id, GetScriptCommandName(tmp.command).c_str(), tmp.id); continue; } @@ -4955,13 +4955,13 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!sSpellStore.LookupEntry(tmp.RemoveAura.SpellID)) { - sLog.outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", + sLog->outErrorDb("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->outErrorDb("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; } @@ -4972,25 +4972,25 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!sSpellStore.LookupEntry(tmp.CastSpell.SpellID)) { - sLog.outErrorDb("Table `%s` using non-existent spell (id: %u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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; } @@ -5001,13 +5001,13 @@ void ObjectMgr::LoadScripts(ScriptsType type) { if (!ObjectMgr::GetItemPrototype(tmp.CreateItem.ItemEntry)) { - sLog.outErrorDb("Table `%s` has nonexistent item (entry: %u) in SCRIPT_COMMAND_CREATE_ITEM for script id %u", + sLog->outErrorDb("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->outErrorDb("Table `%s` SCRIPT_COMMAND_CREATE_ITEM but amount is %u for script id %u", tableName.c_str(), tmp.CreateItem.Amount, tmp.id); continue; } @@ -5028,8 +5028,8 @@ void ObjectMgr::LoadScripts(ScriptsType type) } while (result->NextRow()); - sLog.outString(">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadGameObjectScripts() @@ -5040,7 +5040,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->outErrorDb("Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id",itr->first); } } @@ -5052,7 +5052,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->outErrorDb("Table `quest_end_scripts` has not existing quest (Id: %u) as script id",itr->first); } } @@ -5064,7 +5064,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->outErrorDb("Table `quest_start_scripts` has not existing quest (Id: %u) as script id",itr->first); } } @@ -5080,14 +5080,14 @@ void ObjectMgr::LoadSpellScripts() if (!spellInfo) { - sLog.outErrorDb("Table `spell_scripts` has not existing spell (Id: %u) as script id", spellId); + sLog->outErrorDb("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->Effect[i] || (spellInfo->Effect[i] != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->Effect[i] != 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->outErrorDb("Table `spell_scripts` - spell %u effect %u is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, i); } } @@ -5139,7 +5139,7 @@ void ObjectMgr::LoadEventScripts() { std::set::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->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", itr->first, SPELL_EFFECT_SEND_EVENT); } } @@ -5168,7 +5168,7 @@ void ObjectMgr::LoadWaypointScripts() } for (std::set::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr) - sLog.outErrorDb("There is no waypoint which links to the waypoint script %u", *itr); + sLog->outErrorDb("There is no waypoint which links to the waypoint script %u", *itr); } void ObjectMgr::LoadSpellScriptNames() @@ -5181,8 +5181,8 @@ void ObjectMgr::LoadSpellScriptNames() if (!result) { - sLog.outString(">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); + sLog->outString(); return; } @@ -5206,7 +5206,7 @@ void ObjectMgr::LoadSpellScriptNames() SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); if (!spellEntry) { - sLog.outErrorDb("Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.",scriptName,fields[0].GetInt32()); + sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.",scriptName,fields[0].GetInt32()); continue; } @@ -5214,7 +5214,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->outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.",scriptName,fields[0].GetInt32()); continue; } while(spellId) @@ -5229,8 +5229,8 @@ void ObjectMgr::LoadSpellScriptNames() } while (result->NextRow()); - sLog.outString(">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::ValidateSpellScripts() @@ -5239,8 +5239,8 @@ void ObjectMgr::ValidateSpellScripts() if (mSpellScripts.empty()) { - sLog.outString(">> Validated 0 scripts."); - sLog.outString(); + sLog->outString(">> Validated 0 scripts."); + sLog->outString(); return; } @@ -5261,7 +5261,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("TSCR: Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second)); valid = false; } if (spellScript) @@ -5288,8 +5288,8 @@ void ObjectMgr::ValidateSpellScripts() ++count; } - sLog.outString(">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadGossipScripts() @@ -5316,7 +5316,7 @@ void ObjectMgr::LoadPageTexts() if (page->Next_Page && !sPageTextStore.LookupEntry(page->Next_Page)) { - sLog.outErrorDb("Page text (Id: %u) has not existing next page (Id:%u)", i,page->Next_Page); + sLog->outErrorDb("Page text (Id: %u) has not existing next page (Id:%u)", i,page->Next_Page); continue; } @@ -5335,15 +5335,15 @@ void ObjectMgr::LoadPageTexts() ss << *itr << " "; ss << "create(s) a circular reference, which can cause the server to freeze. Changing Next_Page of page " << pageItr->Page_ID <<" to 0"; - sLog.outErrorDb("%s", ss.str().c_str()); + sLog->outErrorDb("%s", ss.str().c_str()); const_cast(pageItr)->Next_Page = 0; break; } } } - sLog.outString(">> Loaded %u page texts in %u ms", sPageTextStore.RecordCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u page texts in %u ms", sPageTextStore.RecordCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadPageTextLocales() @@ -5374,8 +5374,8 @@ void ObjectMgr::LoadPageTextLocales() } while (result->NextRow()); - sLog.outString(">> Loaded %lu PageText locale strings in %u ms", (unsigned long)mPageTextLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu PageText locale strings in %u ms", (unsigned long)mPageTextLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } struct SQLInstanceLoader : public SQLStorageLoaderBase @@ -5401,17 +5401,17 @@ void ObjectMgr::LoadInstanceTemplate() continue; if (!MapManager::IsValidMAP(temp->map)) - sLog.outErrorDb("ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", temp->map); + sLog->outErrorDb("ObjectMgr::LoadInstanceTemplate: bad mapid %d for template!", temp->map); if (!MapManager::IsValidMapCoord(temp->parent,temp->startLocX,temp->startLocY,temp->startLocZ,temp->startLocO)) { - sLog.outErrorDb("ObjectMgr::LoadInstanceTemplate: bad parent entrance coordinates for map id %d template!", temp->map); + sLog->outErrorDb("ObjectMgr::LoadInstanceTemplate: bad parent entrance coordinates for map id %d template!", temp->map); temp->parent = 0; // will have wrong continent 0 parent, at least existed } } - sLog.outString(">> Loaded %u Instance Template definitions in %u ms", sInstanceTemplate.RecordCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u Instance Template definitions in %u ms", sInstanceTemplate.RecordCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } GossipText const *ObjectMgr::GetGossipText(uint32 Text_ID) const @@ -5432,8 +5432,8 @@ void ObjectMgr::LoadGossipText() if (!result) { - sLog.outString(">> Loaded %u npc texts", count); - sLog.outString(); + sLog->outString(">> Loaded %u npc texts", count); + sLog->outString(); return; } @@ -5451,7 +5451,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->outErrorDb("Table `npc_text` has record wit reserved id 0, ignore."); continue; } @@ -5473,8 +5473,8 @@ void ObjectMgr::LoadGossipText() } } while (result->NextRow()); - sLog.outString(">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadNpcTextLocales() @@ -5520,8 +5520,8 @@ void ObjectMgr::LoadNpcTextLocales() } } while (result->NextRow()); - sLog.outString(">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)mNpcTextLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)mNpcTextLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } //not very fast function but it is called only once a day, or on starting-up @@ -5532,7 +5532,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) time_t curTime = time(NULL); tm* lt = localtime(&curTime); uint64 basetime(curTime); - sLog.outDebug("Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec); + sLog->outDebug("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) @@ -5546,8 +5546,8 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { - sLog.outString(">> No expired mails found or DB table `mail` is empty."); - sLog.outString(); + sLog->outString(">> No expired mails found or DB table `mail` is empty."); + sLog->outString(); return; // any mails need to be returned or deleted } @@ -5645,8 +5645,8 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) } while (result->NextRow()); - sLog.outString(">> Loaded %u mails in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u mails in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadQuestAreaTriggers() @@ -5659,8 +5659,8 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!result) { - sLog.outString(">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); + sLog->outString(); return; } @@ -5678,7 +5678,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->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",trigger_ID); continue; } @@ -5686,13 +5686,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->outErrorDb("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->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); // this will prevent quest completing without objective const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -5704,8 +5704,8 @@ void ObjectMgr::LoadQuestAreaTriggers() } while (result->NextRow()); - sLog.outString(">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadTavernAreaTriggers() @@ -5718,8 +5718,8 @@ void ObjectMgr::LoadTavernAreaTriggers() if (!result) { - sLog.outString(">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); + sLog->outString(); return; } @@ -5736,15 +5736,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->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",Trigger_ID); continue; } mTavernAreaTriggerSet.insert(Trigger_ID); } while (result->NextRow()); - sLog.outString(">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadAreaTriggerScripts() @@ -5756,8 +5756,8 @@ void ObjectMgr::LoadAreaTriggerScripts() if (!result) { - sLog.outString(">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); + sLog->outString(); return; } @@ -5775,14 +5775,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->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",Trigger_ID); continue; } mAreaTriggerScripts[Trigger_ID] = GetScriptId(scriptName); } while (result->NextRow()); - sLog.outString(">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team) @@ -5877,7 +5877,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->outErrorDb("No displayid found for the taxi mount with the entry %u! Can't load it!", mount_entry); return false; } } @@ -5900,8 +5900,8 @@ void ObjectMgr::LoadGraveyardZones() if (!result) { - sLog.outString(">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty."); + sLog->outString(); return; } @@ -5920,35 +5920,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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outString(">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) @@ -5959,7 +5959,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float if (!zoneId) { if (z > -500) - sLog.outError("ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z); + sLog->outError("ZoneId not found for map %u coords (%f, %f, %f)", MapId, x, y, z); return NULL; } @@ -5978,7 +5978,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->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team); return NULL; } @@ -6004,7 +6004,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->outErrorDb("Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.",data.safeLocId); continue; } @@ -6117,7 +6117,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool GraveYardMap::iterator graveUp = mGraveYardMap.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->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team); return; } @@ -6168,8 +6168,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->outString(">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty."); + sLog->outString(); return; } @@ -6195,20 +6195,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->outErrorDb("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->outErrorDb("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->outErrorDb("Area trigger (ID:%u) target coordinates not provided.",Trigger_ID); continue; } @@ -6216,8 +6216,8 @@ void ObjectMgr::LoadAreaTriggerTeleports() } while (result->NextRow()); - sLog.outString(">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadAccessRequirements() @@ -6230,8 +6230,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->outString(">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty."); + sLog->outString(); return; } @@ -6264,7 +6264,7 @@ void ObjectMgr::LoadAccessRequirements() ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(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("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty); ar.item = 0; } } @@ -6274,7 +6274,7 @@ void ObjectMgr::LoadAccessRequirements() ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(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("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty); ar.item2 = 0; } } @@ -6283,7 +6283,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->outErrorDb("Required Alliance Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_A, mapid, difficulty); ar.quest_A = 0; } } @@ -6292,7 +6292,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->outErrorDb("Required Horde Quest %u not exist for map %u difficulty %u, remove quest done requirement.", ar.quest_H, mapid, difficulty); ar.quest_H = 0; } } @@ -6301,7 +6301,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->outErrorDb("Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty); ar.achievement = 0; } } @@ -6309,8 +6309,8 @@ void ObjectMgr::LoadAccessRequirements() mAccessRequirements[requirement_ID] = ar; } while (result->NextRow()); - sLog.outString(">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } /* @@ -6424,7 +6424,7 @@ uint32 ObjectMgr::GenerateArenaTeamId() { if (m_arenaTeamId >= 0xFFFFFFFE) { - sLog.outError("Arena team ids overflow!! Can't continue, shutting down server. "); + sLog->outError("Arena team ids overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_arenaTeamId++; @@ -6434,7 +6434,7 @@ uint32 ObjectMgr::GenerateAuctionID() { if (m_auctionid >= 0xFFFFFFFE) { - sLog.outError("Auctions ids overflow!! Can't continue, shutting down server. "); + sLog->outError("Auctions ids overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_auctionid++; @@ -6444,7 +6444,7 @@ uint64 ObjectMgr::GenerateEquipmentSetGuid() { if (m_equipmentSetGuid >= 0xFFFFFFFFFFFFFFFEll) { - sLog.outError("EquipmentSet guid overflow!! Can't continue, shutting down server. "); + sLog->outError("EquipmentSet guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_equipmentSetGuid++; @@ -6454,7 +6454,7 @@ uint32 ObjectMgr::GenerateGuildId() { if (m_guildId >= 0xFFFFFFFE) { - sLog.outError("Guild ids overflow!! Can't continue, shutting down server. "); + sLog->outError("Guild ids overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_guildId++; @@ -6464,7 +6464,7 @@ uint32 ObjectMgr::GenerateMailID() { if (m_mailid >= 0xFFFFFFFE) { - sLog.outError("Mail ids overflow!! Can't continue, shutting down server. "); + sLog->outError("Mail ids overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_mailid++; @@ -6477,70 +6477,70 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) case HIGHGUID_ITEM: if (m_hiItemGuid >= 0xFFFFFFFE) { - sLog.outError("Item guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Item guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiItemGuid++; case HIGHGUID_UNIT: if (m_hiCreatureGuid >= 0x00FFFFFE) { - sLog.outError("Creature guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Creature guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiCreatureGuid++; case HIGHGUID_PET: if (m_hiPetGuid >= 0x00FFFFFE) { - sLog.outError("Pet guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Pet guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiPetGuid++; case HIGHGUID_VEHICLE: if (m_hiVehicleGuid >= 0x00FFFFFF) { - sLog.outError("Vehicle guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Vehicle guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiVehicleGuid++; case HIGHGUID_PLAYER: if (m_hiCharGuid >= 0xFFFFFFFE) { - sLog.outError("Players guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Players guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiCharGuid++; case HIGHGUID_GAMEOBJECT: if (m_hiGoGuid >= 0x00FFFFFE) { - sLog.outError("Gameobject guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Gameobject guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiGoGuid++; case HIGHGUID_CORPSE: if (m_hiCorpseGuid >= 0xFFFFFFFE) { - sLog.outError("Corpse guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Corpse guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiCorpseGuid++; case HIGHGUID_DYNAMICOBJECT: if (m_hiDoGuid >= 0xFFFFFFFE) { - sLog.outError("DynamicObject guid overflow!! Can't continue, shutting down server. "); + sLog->outError("DynamicObject guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiDoGuid++; case HIGHGUID_GROUP: if (m_hiGroupGuid >= 0xFFFFFFFE) { - sLog.outError("Group guid overflow!! Can't continue, shutting down server. "); + sLog->outError("Group guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiGroupGuid++; case HIGHGUID_MO_TRANSPORT: if (m_hiMoTransGuid >= 0xFFFFFFFE) { - sLog.outError("MO Transport guid overflow!! Can't continue, shutting down server. "); + sLog->outError("MO Transport guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); } return m_hiMoTransGuid++; @@ -6589,8 +6589,8 @@ void ObjectMgr::LoadGameObjectLocales() } while (result->NextRow()); - sLog.outString(">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)mGameObjectLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)mGameObjectLocaleMap.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } struct SQLGameObjectLoader : public SQLStorageLoaderBase @@ -6607,7 +6607,7 @@ inline void CheckGOLockId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N) if (sLockStore.LookupEntry(dataN)) return; - sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.", + sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.", goInfo->id,goInfo->type,N,goInfo->door.lockId,goInfo->door.lockId); } @@ -6616,7 +6616,7 @@ inline void CheckGOLinkedTrapId(GameObjectInfo const* goInfo,uint32 dataN,uint32 if (GameObjectInfo const* trapInfo = sGOStorage.LookupEntry(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->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.", goInfo->id,goInfo->type,N,dataN,dataN,GAMEOBJECT_TYPE_TRAP); } } @@ -6626,7 +6626,7 @@ inline void CheckGOSpellId(GameObjectInfo const* goInfo,uint32 dataN,uint32 N) if (sSpellStore.LookupEntry(dataN)) return; - sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.", + sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.", goInfo->id,goInfo->type,N,dataN,dataN); } @@ -6635,7 +6635,7 @@ inline void CheckAndFixGOChairHeightId(GameObjectInfo const* goInfo,uint32 const 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->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.", goInfo->id,goInfo->type,N,dataN,UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR); // prevent client and server unexpected work @@ -6648,7 +6648,7 @@ inline void CheckGONoDamageImmuneId(GameObjectInfo 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) noDamageImmune field value.", + sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goInfo->id,goInfo->type,N,dataN); } @@ -6658,7 +6658,7 @@ inline void CheckGOConsumable(GameObjectInfo const* goInfo,uint32 dataN,uint32 N if (dataN <= 1) return; - sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.", + sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.", goInfo->id,goInfo->type,N,dataN); } @@ -6726,7 +6726,7 @@ void ObjectMgr::LoadGameobjectInfo() if (goInfo->spellFocus.focusId) { if (!sSpellFocusObjectStore.LookupEntry(goInfo->spellFocus.focusId)) - sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.", + sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but SpellFocus (Id: %u) not exist.", id,goInfo->type,goInfo->spellFocus.focusId,goInfo->spellFocus.focusId); } @@ -6744,7 +6744,7 @@ void ObjectMgr::LoadGameobjectInfo() if (goInfo->goober.pageId) // pageId { if (!sPageTextStore.LookupEntry(goInfo->goober.pageId)) - sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.", + sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data7=%u but PageText (Entry %u) not exist.", id,goInfo->type,goInfo->goober.pageId,goInfo->goober.pageId); } CheckGONoDamageImmuneId(goInfo,goInfo->goober.noDamageImmune,11); @@ -6769,7 +6769,7 @@ void ObjectMgr::LoadGameobjectInfo() if (goInfo->moTransport.taxiPathId) { if (goInfo->moTransport.taxiPathId >= sTaxiPathNodesByPath.size() || sTaxiPathNodesByPath[goInfo->moTransport.taxiPathId].empty()) - sLog.outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.", + sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data0=%u but TaxiPath (Id: %u) not exist.", id,goInfo->type,goInfo->moTransport.taxiPathId,goInfo->moTransport.taxiPathId); } break; @@ -6808,8 +6808,8 @@ void ObjectMgr::LoadGameobjectInfo() } } - sLog.outString(">> Loaded %u game object templates in %u ms", sGOStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u game object templates in %u ms", sGOStorage.RecordCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadExplorationBaseXP() @@ -6820,8 +6820,8 @@ void ObjectMgr::LoadExplorationBaseXP() if (!result) { - sLog.outErrorDb(">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty."); + sLog->outString(); return; } @@ -6838,8 +6838,8 @@ void ObjectMgr::LoadExplorationBaseXP() } while (result->NextRow()); - sLog.outString(">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } uint32 ObjectMgr::GetBaseXP(uint8 level) @@ -6862,8 +6862,8 @@ void ObjectMgr::LoadPetNames() if (!result) { - sLog.outString(">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); + sLog->outString(); return; } @@ -6884,8 +6884,8 @@ void ObjectMgr::LoadPetNames() } while (result->NextRow()); - sLog.outString(">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadPetNumber() @@ -6899,8 +6899,8 @@ void ObjectMgr::LoadPetNumber() m_hiPetNumber = fields[0].GetUInt32()+1; } - sLog.outString(">> Loaded the max pet number: %d in %u ms", m_hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded the max pet number: %d in %u ms", m_hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } std::string ObjectMgr::GeneratePetName(uint32 entry) @@ -6911,7 +6911,7 @@ std::string ObjectMgr::GeneratePetName(uint32 entry) if (list0.empty() || list1.empty()) { CreatureInfo const *cinfo = GetCreatureTemplate(entry); - char* petname = GetPetName(cinfo->family, sWorld.GetDefaultDbcLocale()); + char* petname = GetPetName(cinfo->family, sWorld->GetDefaultDbcLocale()); if (!petname) petname = cinfo->Name; return std::string(petname); @@ -6936,8 +6936,8 @@ void ObjectMgr::LoadCorpses() if (!result) { - sLog.outString(">> Loaded 0 corpses. DB table `pet_name_generation` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 corpses. DB table `pet_name_generation` is empty."); + sLog->outString(); return; } @@ -6957,14 +6957,14 @@ void ObjectMgr::LoadCorpses() continue; } - sObjectAccessor.AddCorpse(corpse); + sObjectAccessor->AddCorpse(corpse); ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadReputationRewardRate() @@ -6978,8 +6978,8 @@ void ObjectMgr::LoadReputationRewardRate() if (!result) { - sLog.outErrorDb(">> Loaded `reputation_reward_rate`, table is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded `reputation_reward_rate`, table is empty!"); + sLog->outString(); return; } @@ -7000,25 +7000,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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Table reputation_reward_rate has spell_rate with invalid rate %f, skipping data for faction %u", repRate.spell_rate, factionId); continue; } @@ -7028,8 +7028,8 @@ void ObjectMgr::LoadReputationRewardRate() } while (result->NextRow()); - sLog.outString(">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadReputationOnKill() @@ -7049,8 +7049,8 @@ void ObjectMgr::LoadReputationOnKill() if (!result) { - sLog.outErrorDb(">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); + sLog->outString(); return; } @@ -7074,7 +7074,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->outErrorDb("Table `creature_onkill_reputation` have data for not existed creature entry (%u), skipped", creature_id); continue; } @@ -7083,7 +7083,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->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.repfaction1); continue; } } @@ -7093,7 +7093,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->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `creature_onkill_reputation`", repOnKill.repfaction2); continue; } } @@ -7103,8 +7103,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->outString(">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadReputationSpilloverTemplate() @@ -7118,8 +7118,8 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!result) { - sLog.outString(">> Loaded `reputation_spillover_template`, table is empty."); - sLog.outString(); + sLog->outString(">> Loaded `reputation_spillover_template`, table is empty."); + sLog->outString(); return; } @@ -7150,13 +7150,13 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!factionEntry) { - sLog.outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", factionId); + sLog->outErrorDb("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->outErrorDb("Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId); continue; } @@ -7168,19 +7168,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->outErrorDb("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->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); 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->outErrorDb("Rank %u used in `reputation_spillover_template` for spillover faction %u is not valid, skipping", repTemplate.faction_rank[i], repTemplate.faction[i]); continue; } } @@ -7189,25 +7189,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->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]); continue; } @@ -7217,8 +7217,8 @@ void ObjectMgr::LoadReputationSpilloverTemplate() } while (result->NextRow()); - sLog.outString(">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadPointsOfInterest() @@ -7234,8 +7234,8 @@ void ObjectMgr::LoadPointsOfInterest() if (!result) { - sLog.outErrorDb(">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); + sLog->outString(); return; } @@ -7256,7 +7256,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->outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.",point_id,POI.x,POI.y); continue; } @@ -7265,8 +7265,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->outString(">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadQuestPOI() @@ -7282,8 +7282,8 @@ void ObjectMgr::LoadQuestPOI() if (!result) { - sLog.outErrorDb(">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); + sLog->outString(); return; } @@ -7339,8 +7339,8 @@ void ObjectMgr::LoadQuestPOI() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadNPCSpellClickSpells() @@ -7353,8 +7353,8 @@ void ObjectMgr::LoadNPCSpellClickSpells() if (!result) { - sLog.outErrorDb(">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); + sLog->outString(); return; } @@ -7368,7 +7368,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() CreatureInfo const* cInfo = GetCreatureTemplate(npc_entry); if (!cInfo) { - sLog.outErrorDb("Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry); + sLog->outErrorDb("Table npc_spellclick_spells references unknown creature_template %u. Skipping entry.", npc_entry); continue; } @@ -7379,7 +7379,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() SpellEntry const *spellinfo = sSpellStore.LookupEntry(spellid); if (!spellinfo) { - sLog.outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid); + sLog->outErrorDb("Table npc_spellclick_spells references unknown spellid %u. Skipping entry.", spellid); continue; } @@ -7389,7 +7389,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() SpellEntry const *aurReqInfo = sSpellStore.LookupEntry(auraRequired); if (!aurReqInfo) { - sLog.outErrorDb("Table npc_spellclick_spells references unknown aura required %u. Skipping entry.", auraRequired); + sLog->outErrorDb("Table npc_spellclick_spells references unknown aura required %u. Skipping entry.", auraRequired); continue; } } @@ -7400,7 +7400,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() SpellEntry const *aurForInfo = sSpellStore.LookupEntry(auraForbidden); if (!aurForInfo) { - sLog.outErrorDb("Table npc_spellclick_spells references unknown aura forbidden %u. Skipping entry.", auraForbidden); + sLog->outErrorDb("Table npc_spellclick_spells references unknown aura forbidden %u. Skipping entry.", auraForbidden); continue; } } @@ -7412,7 +7412,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() { if (mQuestTemplates.find(quest_start) == mQuestTemplates.end()) { - sLog.outErrorDb("Table npc_spellclick_spells references unknown start quest %u. Skipping entry.", quest_start); + sLog->outErrorDb("Table npc_spellclick_spells references unknown start quest %u. Skipping entry.", quest_start); continue; } } @@ -7425,14 +7425,14 @@ void ObjectMgr::LoadNPCSpellClickSpells() { if (mQuestTemplates.find(quest_end) == mQuestTemplates.end()) { - sLog.outErrorDb("Table npc_spellclick_spells references unknown end quest %u. Skipping entry.", quest_end); + sLog->outErrorDb("Table npc_spellclick_spells references unknown end quest %u. Skipping entry.", quest_end); continue; } } uint8 userType = fields[8].GetUInt8(); if (userType >= SPELL_CLICK_USER_MAX) - sLog.outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); + sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); uint8 castFlags = fields[5].GetUInt8(); SpellClickInfo info; @@ -7453,8 +7453,8 @@ void ObjectMgr::LoadNPCSpellClickSpells() } while (result->NextRow()); - sLog.outString(">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t) @@ -7612,8 +7612,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->outErrorDb(">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str()); + sLog->outString(); return; } @@ -7631,7 +7631,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, if (mQuestTemplates.find(quest) == mQuestTemplates.end()) { - sLog.outErrorDb("Table `%s: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id); + sLog->outErrorDb("Table `%s: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id); continue; } @@ -7643,8 +7643,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->outString(">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadGameobjectQuestRelations() @@ -7655,9 +7655,9 @@ void ObjectMgr::LoadGameobjectQuestRelations() { GameObjectInfo const* goInfo = GetGameObjectInfo(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->outErrorDb("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->outErrorDb("Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER",itr->first,itr->second); } } @@ -7669,9 +7669,9 @@ void ObjectMgr::LoadGameobjectInvolvedRelations() { GameObjectInfo const* goInfo = GetGameObjectInfo(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->outErrorDb("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->outErrorDb("Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER",itr->first,itr->second); } } @@ -7683,9 +7683,9 @@ void ObjectMgr::LoadCreatureQuestRelations() { CreatureInfo 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->outErrorDb("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->outErrorDb("Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER",itr->first,itr->second); } } @@ -7697,9 +7697,9 @@ void ObjectMgr::LoadCreatureInvolvedRelations() { CreatureInfo 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->outErrorDb("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->outErrorDb("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER",itr->first,itr->second); } } @@ -7713,8 +7713,8 @@ void ObjectMgr::LoadReservedPlayersNames() if (!result) { - sLog.outString(">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); + sLog->outString(); return; } @@ -7729,7 +7729,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("Table `reserved_name` have invalid name: %s", name.c_str()); continue; } @@ -7740,8 +7740,8 @@ void ObjectMgr::LoadReservedPlayersNames() } while (result->NextRow()); - sLog.outString(">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool ObjectMgr::IsReservedName(const std::string& name) const @@ -7766,7 +7766,7 @@ enum LanguageType static LanguageType GetRealmLanguageType(bool create) { - switch(sWorld.getIntConfig(CONFIG_REALM_ZONE)) + switch(sWorld->getIntConfig(CONFIG_REALM_ZONE)) { case REALM_ZONE_UNKNOWN: // any language case REALM_ZONE_DEVELOPMENT: @@ -7837,11 +7837,11 @@ uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create) if (wname.size() > MAX_PLAYER_NAME) return CHAR_NAME_TOO_LONG; - uint32 minName = sWorld.getIntConfig(CONFIG_MIN_PLAYER_NAME); + uint32 minName = sWorld->getIntConfig(CONFIG_MIN_PLAYER_NAME); if (wname.size() < minName) return CHAR_NAME_TOO_SHORT; - uint32 strictMask = sWorld.getIntConfig(CONFIG_STRICT_PLAYER_NAMES); + uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_PLAYER_NAMES); if (!isValidString(wname,strictMask,false,create)) return CHAR_NAME_MIXED_LANGUAGES; @@ -7857,11 +7857,11 @@ bool ObjectMgr::IsValidCharterName(const std::string& name) if (wname.size() > MAX_CHARTER_NAME) return false; - uint32 minName = sWorld.getIntConfig(CONFIG_MIN_CHARTER_NAME); + uint32 minName = sWorld->getIntConfig(CONFIG_MIN_CHARTER_NAME); if (wname.size() < minName) return false; - uint32 strictMask = sWorld.getIntConfig(CONFIG_STRICT_CHARTER_NAMES); + uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_CHARTER_NAMES); return isValidString(wname,strictMask,true); } @@ -7875,11 +7875,11 @@ PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name) if (wname.size() > MAX_PET_NAME) return PET_NAME_TOO_LONG; - uint32 minName = sWorld.getIntConfig(CONFIG_MIN_PET_NAME); + uint32 minName = sWorld->getIntConfig(CONFIG_MIN_PET_NAME); if (wname.size() < minName) return PET_NAME_TOO_SHORT; - uint32 strictMask = sWorld.getIntConfig(CONFIG_STRICT_PET_NAMES); + uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_PET_NAMES); if (!isValidString(wname,strictMask,false)) return PET_NAME_MIXED_LANGUAGES; @@ -7894,8 +7894,8 @@ void ObjectMgr::LoadGameObjectForQuests() if (!sGOStorage.MaxEntry) { - sLog.outString(">> Loaded 0 GameObjects for quests"); - sLog.outString(); + sLog->outString(">> Loaded 0 GameObjects for quests"); + sLog->outString(); return; } @@ -7946,8 +7946,8 @@ void ObjectMgr::LoadGameObjectForQuests() } } - sLog.outString(">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max_value) @@ -7961,7 +7961,7 @@ bool ObjectMgr::LoadTrinityStrings(char const* 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->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.",table,min_value,max_value); return false; } @@ -7974,7 +7974,7 @@ bool ObjectMgr::LoadTrinityStrings(char const* 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->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.",table,min_value,max_value); return false; } } @@ -7995,10 +7995,10 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max 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->outErrorDb(">> 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->outString(">> Loaded 0 string templates. DB table `%s` is empty.",table); + sLog->outString(); return false; } @@ -8013,12 +8013,12 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (entry == 0) { - sLog.outErrorDb("Table `%s` contain reserved entry 0, ignored.",table); + sLog->outErrorDb("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->outErrorDb("Table `%s` contain entry %i out of allowed range (%d - %d), ignored.",table,entry,min_value,max_value); continue; } @@ -8026,7 +8026,7 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (data.Content.size() > 0) { - sLog.outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.",table,entry); + sLog->outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.",table,entry); continue; } @@ -8042,11 +8042,11 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (min_value == MIN_TRINITY_STRING_ID) - sLog.outString(">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outString(">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(); return true; } @@ -8061,9 +8061,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->outErrorDb("Entry %i not found in `trinity_string` table.",entry); else - sLog.outErrorDb("Trinity string entry %i not found in DB.",entry); + sLog->outErrorDb("Trinity string entry %i not found in DB.",entry); return ""; } @@ -8077,8 +8077,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->outErrorDb(">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty."); + sLog->outString(); return; } @@ -8094,7 +8094,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->outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist",entry); continue; } @@ -8103,8 +8103,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->outString(">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool ObjectMgr::CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names) @@ -8176,8 +8176,8 @@ void ObjectMgr::LoadGameTele() if (!result) { - sLog.outErrorDb(">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); + sLog->outString(); return; } @@ -8201,13 +8201,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->outErrorDb("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->outErrorDb("Wrong UTF8 name for id %u in `game_tele` table, ignoring.",id); continue; } @@ -8219,8 +8219,8 @@ void ObjectMgr::LoadGameTele() } while (result->NextRow()); - sLog.outString(">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } GameTele const* ObjectMgr::GetGameTele(const std::string& name) const @@ -8302,8 +8302,8 @@ void ObjectMgr::LoadMailLevelRewards() if (!result) { - sLog.outErrorDb(">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); + sLog->outString(); return; } @@ -8321,25 +8321,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->outErrorDb("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->outErrorDb("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->outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.",mailTemplateId,level); continue; } if (!GetCreatureTemplateStore(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->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); continue; } @@ -8349,8 +8349,8 @@ void ObjectMgr::LoadMailLevelRewards() } while (result->NextRow()); - sLog.outString(">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::AddSpellToTrainer( uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel) @@ -8361,32 +8361,32 @@ void ObjectMgr::AddSpellToTrainer( uint32 entry, uint32 spell, uint32 spellCost, CreatureInfo 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->outErrorDb("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->outErrorDb("Table `npc_trainer` contains an entry for a creature template (Entry: %u) without trainer flag, ignoring", entry); return; } SpellEntry const *spellinfo = sSpellStore.LookupEntry(spell); if (!spellinfo) { - sLog.outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u), ignoring", entry, spell); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("Table `npc_trainer` contains an entry (Entry: %u) for a non-existing spell (Spell: %u) which is a talent, ignoring", entry, spell); return; } @@ -8414,7 +8414,7 @@ void ObjectMgr::AddSpellToTrainer( uint32 entry, uint32 spell, uint32 spellCost, if (spellinfo->EffectImplicitTargetA[i] != 0 && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ALLY && spellinfo->EffectImplicitTargetA[i] != TARGET_UNIT_TARGET_ANY && spellinfo->EffectImplicitTargetA[i] != 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->outErrorDb("Table `npc_trainer` has spell %u for trainer entry %u with learn effect which has incorrect target type, ignoring learn effect!", spell, entry); continue; } @@ -8442,8 +8442,8 @@ void ObjectMgr::LoadTrainerSpell() if (!result) { - sLog.outErrorDb(">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); + sLog->outString(); return; } @@ -8468,8 +8468,8 @@ void ObjectMgr::LoadTrainerSpell() } while (result->NextRow()); - sLog.outString(">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *skip_vendors) @@ -8523,8 +8523,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->outString(); + sLog->outErrorDb(">> Loaded 0 Vendors. DB table `npc_vendor` is empty!"); return; } @@ -8558,8 +8558,8 @@ void ObjectMgr::LoadVendors() } while (result->NextRow()); - sLog.outString(">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadNpcTextId() @@ -8572,8 +8572,8 @@ void ObjectMgr::LoadNpcTextId() if (!result) { - sLog.outErrorDb(">> Loaded 0 NpcTextId. DB table `npc_gossip` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 NpcTextId. DB table `npc_gossip` is empty!"); + sLog->outString(); return; } @@ -8590,12 +8590,12 @@ void ObjectMgr::LoadNpcTextId() if (!GetCreatureData(guid)) { - sLog.outErrorDb("Table `npc_gossip` have not existed creature (GUID: %u) entry, ignore. ",guid); + sLog->outErrorDb("Table `npc_gossip` have not existed creature (GUID: %u) entry, ignore. ",guid); continue; } if (!GetGossipText(textid)) { - sLog.outErrorDb("Table `npc_gossip` for creature (GUID: %u) have wrong Textid (%u), ignore. ", guid, textid); + sLog->outErrorDb("Table `npc_gossip` for creature (GUID: %u) have wrong Textid (%u), ignore. ", guid, textid); continue; } @@ -8605,8 +8605,8 @@ void ObjectMgr::LoadNpcTextId() } while (result->NextRow()); - sLog.outString(">> Loaded %d NpcTextId in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %d NpcTextId in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadGossipMenu() @@ -8619,8 +8619,8 @@ void ObjectMgr::LoadGossipMenu() if (!result) { - sLog.outErrorDb(">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); + sLog->outString(); return; } @@ -8638,7 +8638,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->outErrorDb("Table gossip_menu entry %u are using non-existing text_id %u", gMenu.entry, gMenu.text_id); continue; } @@ -8648,8 +8648,8 @@ void ObjectMgr::LoadGossipMenu() } while (result->NextRow()); - sLog.outString(">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadGossipMenuItems() @@ -8665,8 +8665,8 @@ void ObjectMgr::LoadGossipMenuItems() if (!result) { - sLog.outErrorDb(">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!"); + sLog->outString(); return; } @@ -8699,16 +8699,16 @@ void ObjectMgr::LoadGossipMenuItems() if (gMenuItem.option_icon >= 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.menu_id, gMenuItem.id, gMenuItem.option_icon); + sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown icon id %u. Replacing with GOSSIP_ICON_CHAT", gMenuItem.menu_id, gMenuItem.id, gMenuItem.option_icon); gMenuItem.option_icon = GOSSIP_ICON_CHAT; } if (gMenuItem.option_id >= 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.menu_id, gMenuItem.id, gMenuItem.option_id); + sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u has unknown option id %u. Option will not be used", gMenuItem.menu_id, gMenuItem.id, gMenuItem.option_id); if (gMenuItem.action_poi_id && !GetPointOfInterest(gMenuItem.action_poi_id)) { - sLog.outErrorDb("Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_poi_id); + sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u use non-existing action_poi_id %u, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_poi_id); gMenuItem.action_poi_id = 0; } @@ -8716,13 +8716,13 @@ void ObjectMgr::LoadGossipMenuItems() { if (gMenuItem.option_id != GOSSIP_OPTION_GOSSIP) { - sLog.outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u but option_id is not GOSSIP_OPTION_GOSSIP, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_script_id); + sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u but option_id is not GOSSIP_OPTION_GOSSIP, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_script_id); continue; } if (sGossipScripts.find(gMenuItem.action_script_id) == sGossipScripts.end()) { - sLog.outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u that does not exist in `gossip_scripts`, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_script_id); + sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u that does not exist in `gossip_scripts`, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_script_id); continue; } @@ -8739,11 +8739,11 @@ void ObjectMgr::LoadGossipMenuItems() if (!gossipScriptSet.empty()) { for (std::set::const_iterator itr = gossipScriptSet.begin(); itr != gossipScriptSet.end(); ++itr) - sLog.outErrorDb("Table `gossip_scripts` contain unused script, id %u.", *itr); + sLog->outErrorDb("Table `gossip_scripts` contain unused script, id %u.", *itr); } - sLog.outString(">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::AddVendorItem(uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb) @@ -8776,7 +8776,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->outErrorDb("Table `(game_event_)npc_vendor` have data for not existed creature template (Entry: %u), ignore", vendor_entry); return false; } @@ -8787,7 +8787,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->outErrorDb("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); @@ -8800,7 +8800,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->outErrorDb("Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id); return false; } @@ -8809,7 +8809,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->outErrorDb("Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry); return false; } @@ -8818,7 +8818,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->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); return false; } else if (maxcount == 0 && incrtime > 0) @@ -8826,7 +8826,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->outErrorDb("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; } @@ -8839,7 +8839,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->outErrorDb( "Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry); return false; } @@ -8848,7 +8848,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (pl) ChatHandler(pl).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->outErrorDb("Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry); return false; } @@ -8887,8 +8887,8 @@ void ObjectMgr::LoadScriptNames() if (!result) { - sLog.outString(); - sLog.outErrorDb(">> Loaded empty set of Script Names!"); + sLog->outString(); + sLog->outErrorDb(">> Loaded empty set of Script Names!"); return; } @@ -8903,8 +8903,8 @@ void ObjectMgr::LoadScriptNames() while (result->NextRow()); std::sort(m_scriptNames.begin(), m_scriptNames.end()); - sLog.outString(">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } uint32 ObjectMgr::GetScriptId(const char *name) @@ -8932,7 +8932,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set& ids) case SCRIPT_COMMAND_TALK: { if (!GetTrinityStringLocale (itrM->second.Talk.TextID)) - sLog.outErrorDb("Table `db_script_string` not has string id %u used db script (ID: %u)", itrM->second.Talk.TextID, itrMM->first); + sLog->outErrorDb("Table `db_script_string` not has string id %u used db script (ID: %u)", itrM->second.Talk.TextID, itrMM->first); if (ids.find(itrM->second.Talk.TextID) != ids.end()) ids.erase(itrM->second.Talk.TextID); @@ -8958,7 +8958,7 @@ void ObjectMgr::LoadDbScriptStrings() CheckScripts(ScriptsType(type), ids); for (std::set::const_iterator itr = ids.begin(); itr != ids.end(); ++itr) - sLog.outErrorDb("Table `db_script_string` has unused string id %u", *itr); + sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr); } // Functions for scripting access @@ -8973,7 +8973,7 @@ bool LoadTrinityStrings(char const* 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->outErrorDb("Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.",table,start_value,end_value+1); return false; } @@ -9039,8 +9039,8 @@ void ObjectMgr::LoadCreatureClassLevelStats() if (!result) { - sLog.outString(">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); + sLog->outString(); return; } @@ -9060,14 +9060,14 @@ 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", + sLog->outErrorDb("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", + sLog->outErrorDb("Creature base stats for class %u, level %u has invalid zero base HP[%u] - set to 1", Class, Level, i); stats.BaseHealth[i] = 1; } @@ -9088,12 +9088,12 @@ void ObjectMgr::LoadCreatureClassLevelStats() for (uint16 lvl = info->minlevel; lvl <= info->maxlevel; ++lvl) { if (m_creatureBaseStatsMap.find(MAKE_PAIR16(lvl, info->unit_class)) == m_creatureBaseStatsMap.end()) - sLog.outErrorDb("Missing base stats for creature class %u level %u", info->unit_class, lvl); + sLog->outErrorDb("Missing base stats for creature class %u level %u", info->unit_class, lvl); } } - sLog.outString(">> Loaded %u creature base stats in %u ms", counter, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creature base stats in %u ms", counter, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadFactionChangeAchievements() @@ -9104,8 +9104,8 @@ void ObjectMgr::LoadFactionChangeAchievements() if (!result) { - sLog.outErrorDb(">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); + sLog->outString(); return; } @@ -9119,9 +9119,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->outErrorDb("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->outErrorDb("Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde); else factionchange_achievements[alliance] = horde; @@ -9129,8 +9129,8 @@ void ObjectMgr::LoadFactionChangeAchievements() } while (result->NextRow()); - sLog.outString(">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadFactionChangeItems() @@ -9141,8 +9141,8 @@ void ObjectMgr::LoadFactionChangeItems() if (!result) { - sLog.outString(">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); + sLog->outString(); return; } @@ -9156,9 +9156,9 @@ void ObjectMgr::LoadFactionChangeItems() uint32 horde = fields[1].GetUInt32(); if (!ObjectMgr::GetItemPrototype(alliance)) - sLog.outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance); + sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", alliance); else if (!ObjectMgr::GetItemPrototype(horde)) - sLog.outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde); + sLog->outErrorDb("Item %u referenced in `player_factionchange_items` does not exist, pair skipped!", horde); else factionchange_items[alliance] = horde; @@ -9166,8 +9166,8 @@ void ObjectMgr::LoadFactionChangeItems() } while (result->NextRow()); - sLog.outString(">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadFactionChangeSpells() @@ -9178,8 +9178,8 @@ void ObjectMgr::LoadFactionChangeSpells() if (!result) { - sLog.outErrorDb(">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); + sLog->outString(); return; } @@ -9193,9 +9193,9 @@ void ObjectMgr::LoadFactionChangeSpells() uint32 horde = fields[1].GetUInt32(); if (!sSpellStore.LookupEntry(alliance)) - sLog.outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance); + sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", alliance); else if (!sSpellStore.LookupEntry(horde)) - sLog.outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde); + sLog->outErrorDb("Spell %u referenced in `player_factionchange_spells` does not exist, pair skipped!", horde); else factionchange_spells[alliance] = horde; @@ -9203,8 +9203,8 @@ void ObjectMgr::LoadFactionChangeSpells() } while (result->NextRow()); - sLog.outString(">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ObjectMgr::LoadFactionChangeReputations() @@ -9215,8 +9215,8 @@ void ObjectMgr::LoadFactionChangeReputations() if (!result) { - sLog.outString(">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); + sLog->outString(); return; } @@ -9230,9 +9230,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->outErrorDb("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->outErrorDb("Reputation %u referenced in `player_factionchange_reputations` does not exist, pair skipped!", horde); else factionchange_reputations[alliance] = horde; @@ -9240,6 +9240,6 @@ void ObjectMgr::LoadFactionChangeReputations() } while (result->NextRow()); - sLog.outString(">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 09ceef4fc83..e45794ccc0d 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -595,7 +595,7 @@ class ObjectMgr typedef std::map CharacterConversionMap; - Player* GetPlayer(const char* name) const { return sObjectAccessor.FindPlayerByName(name);} + Player* GetPlayer(const char* name) const { return sObjectAccessor->FindPlayerByName(name);} Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); } Player* GetPlayerByLowGUID(uint32 lowguid) const; @@ -802,13 +802,13 @@ class ObjectMgr void LoadQuests(); void LoadQuestRelations() { - sLog.outString("Loading GO Start Quest Data..."); + sLog->outString("Loading GO Start Quest Data..."); LoadGameobjectQuestRelations(); - sLog.outString("Loading GO End Quest Data..."); + sLog->outString("Loading GO End Quest Data..."); LoadGameobjectInvolvedRelations(); - sLog.outString("Loading Creature Start Quest Data..."); + sLog->outString("Loading Creature Start Quest Data..."); LoadCreatureQuestRelations(); - sLog.outString("Loading Creature End Quest Data..."); + sLog->outString("Loading Creature End Quest Data..."); LoadCreatureInvolvedRelations(); } void LoadGameobjectQuestRelations(); diff --git a/src/server/game/Grids/GridStates.cpp b/src/server/game/Grids/GridStates.cpp index 517b943e10b..20c55be1a9b 100755 --- a/src/server/game/Grids/GridStates.cpp +++ b/src/server/game/Grids/GridStates.cpp @@ -38,7 +38,7 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 &x, c ObjectGridStoper stoper(grid); stoper.StopN(); grid.SetGridState(GRID_STATE_IDLE); - sLog.outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId()); + sLog->outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId()); } else { @@ -52,7 +52,7 @@ IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const ui { m.ResetGridExpiry(grid); grid.SetGridState(GRID_STATE_REMOVAL); - sLog.outDebug("Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId()); + sLog->outDebug("Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId()); } void @@ -65,7 +65,7 @@ RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 &x, c { if (!m.UnloadGrid(x, y, false)) { - sLog.outDebug("Grid[%u,%u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId()); + sLog->outDebug("Grid[%u,%u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId()); m.ResetGridExpiry(grid); } } diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h index 5f397440dcc..e209b1df895 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("!!! 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 4c0d2b0383c..a078c34d26a 100755 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -124,7 +124,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager & { T* obj = new T; uint32 guid = *i_guid; - //sLog.outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading",table,guid); + //sLog->outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading",table,guid); if (!obj->LoadFromDB(guid, map)) { delete obj; @@ -147,7 +147,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType uint32 player_guid = itr->first; - Corpse *obj = sObjectAccessor.GetCorpseForPlayerGUID(player_guid); + Corpse *obj = sObjectAccessor->GetCorpseForPlayerGUID(player_guid); if (!obj) continue; @@ -230,7 +230,7 @@ void ObjectGridLoader::LoadN(void) loader.Load(i_grid(x, y), *this); } } - sLog.outDebug("%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses,i_grid.GetGridId(), i_map->GetId()); + sLog->outDebug("%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses,i_grid.GetGridId(), i_map->GetId()); } void ObjectGridUnloader::MoveToRespawnN() @@ -260,7 +260,7 @@ ObjectGridUnloader::Visit(GridRefManager &m) { T *obj = m.getFirst()->getSource(); // if option set then object already saved at this moment - if (!sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) + if (!sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) obj->SaveRespawnTime(); ///- object will get delinked from the manager when deleted delete obj; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 836b4a98b5b..e9e0bd6cf47 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -67,10 +67,10 @@ Group::~Group() { if (m_bgGroup) { - sLog.outDebug("Group::~Group: battleground group being deleted."); + sLog->outDebug("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("Group::~Group: battleground group is not linked to the correct battleground."); } Rolls::iterator itr; while (!RollId.empty()) @@ -636,7 +636,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) item = ObjectMgr::GetItemPrototype(i->itemid); if (!item) { - //sLog.outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid); + //sLog->outDebug("Group::GroupLoot: missing item prototype for item with id: %d", i->itemid); continue; } @@ -654,7 +654,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) continue; if (i->AllowedForPlayer(member)) { - if (member->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (member->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) { r->totalPlayersRolling++; @@ -743,7 +743,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) bool allowedForPlayer = i->AllowedForPlayer(playerToRoll); if (playerToRoll->CanUseItem(item) == EQUIP_ERR_OK && allowedForPlayer) { - if (playerToRoll->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (playerToRoll->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) { r->totalPlayersRolling++; @@ -805,7 +805,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) { - sLog.outDebug("Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); + sLog->outDebug("Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); uint32 real_count = 0; @@ -818,7 +818,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) if (!looter->IsInWorld()) continue; - if (looter->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) { data << uint64(looter->GetGUID()); ++real_count; @@ -830,7 +830,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player *looter = itr->getSource(); - if (looter->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) looter->GetSession()->SendPacket(&data); } } @@ -1549,7 +1549,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) { // not update if only update if need and ok Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid); - if (looter && looter->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter && looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) return; } ++guid_itr; @@ -1560,7 +1560,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr) { if (Player* pl = ObjectAccessor::FindPlayer(itr->guid)) - if (pl->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (pl->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) { pNewLooter = pl; break; @@ -1573,7 +1573,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) for (member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr) { if (Player* pl = ObjectAccessor::FindPlayer(itr->guid)) - if (pl->IsWithinDistInMap(pLootedObject,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (pl->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) { pNewLooter = pl; break; @@ -1857,7 +1857,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, boo bind.save = save; bind.perm = permanent; if (!load) - sLog.outDebug("Group::BindToInstance: %d is now bound to map %d, instance %d, difficulty %d", GUID_LOPART(GetGUID()), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); + sLog->outDebug("Group::BindToInstance: %d is now bound to map %d, instance %d, difficulty %d", GUID_LOPART(GetGUID()), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); return &bind; } @@ -1891,7 +1891,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->outStaticDebug("-- Forced group value update for '%s'", pp->GetName()); } } } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 9b4c8672dc2..f0d1b8bf366 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -49,7 +49,7 @@ void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, Guil data << uint32(errCode); session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)"); } void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode) @@ -58,7 +58,7 @@ void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode data << uint32(errCode); session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)"); + sLog->outDebug("WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)"); } /////////////////////////////////////////////////////////////////////////////// @@ -334,21 +334,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("Invalid slot for item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry); return false; } ItemPrototype const* proto = ObjectMgr::GetItemPrototype(itemEntry); if (!proto) { - sLog.outError("Unknown item (GUID: %u, id: %u) in guild bank, skipped.", itemGuid, itemEntry); + sLog->outError("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("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); @@ -596,7 +596,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("Player (GUID: %u) has broken zone-data", GUID_LOPART(m_guid)); m_zoneId = Player::GetZoneIdFromDB(m_guid); } return true; @@ -607,12 +607,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("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("Player (GUID: %u) has a broken data in field `characters`.`class`, deleting him from guild!", GUID_LOPART(m_guid)); return false; } return true; @@ -912,7 +912,7 @@ Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) ItemPosCount pos(*itr); ++itr; - sLog.outDebug("GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", + sLog->outDebug("GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); } @@ -935,8 +935,8 @@ void Guild::BankMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData* void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const { MoveItemData::LogAction(pFrom); - if (!pFrom->IsBank() && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE) && m_pPlayer->GetSession()->GetSecurity() > SEC_PLAYER) // TODO: move to scripts - sLog.outCommand(m_pPlayer->GetSession()->GetAccountId(), + if (!pFrom->IsBank() && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE) && m_pPlayer->GetSession()->GetSecurity() > SEC_PLAYER) // TODO: move to scripts + sLog->outCommand(m_pPlayer->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)", m_pPlayer->GetName(), m_pPlayer->GetSession()->GetAccountId(), pFrom->GetItem()->GetProto()->Name1, pFrom->GetItem()->GetEntry(), pFrom->GetItem()->GetCount(), @@ -1021,7 +1021,7 @@ void Guild::BankMoveItemData::_CanStoreItemInTab(Item* pItem, uint8 skipSlotId, uint8 Guild::BankMoveItemData::_CanStore(Item* pItem, bool swap) { - sLog.outDebug("GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", + sLog->outDebug("GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); uint32 count = pItem->GetCount(); @@ -1107,7 +1107,7 @@ bool Guild::Create(Player* pLeader, const std::string& name) m_createdDate = ::time(NULL); _CreateLogHolders(); - sLog.outDebug("GUILD: creating guild [%s] for leader %s (%u)", + sLog->outDebug("GUILD: creating guild [%s] for leader %s (%u)", name.c_str(), pLeader->GetName(), GUID_LOPART(m_leaderGuid)); PreparedStatement* stmt = NULL; @@ -1217,7 +1217,7 @@ void Guild::HandleRoster(WorldSession *session /*= NULL*/) session->SendPacket(&data); else BroadcastPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_ROSTER)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_ROSTER)"); } void Guild::HandleQuery(WorldSession *session) @@ -1239,7 +1239,7 @@ void Guild::HandleQuery(WorldSession *session) data << uint32(0); // Something new in WotLK session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)"); } void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd) @@ -1363,7 +1363,7 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, const std::st SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else if (RankInfo* rankInfo = GetRankInfo(rankId)) { - sLog.outDebug("WORLD: Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); + sLog->outDebug("WORLD: Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); rankInfo->SetName(name); rankInfo->SetRights(rights); @@ -1403,7 +1403,7 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) void Guild::HandleInviteMember(WorldSession* session, const std::string& name) { - Player* pInvitee = sObjectAccessor.FindPlayerByName(name.c_str()); + Player* pInvitee = sObjectAccessor->FindPlayerByName(name.c_str()); if (!pInvitee) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PLAYER_NOT_FOUND_S, name); @@ -1414,7 +1414,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) // Do not show invitations from ignored players if (pInvitee->GetSocial()->HasIgnore(player->GetGUIDLow())) return; - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeam() != player->GetTeam()) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeam() != player->GetTeam()) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NOT_ALLIED, name); return; @@ -1438,7 +1438,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) return; } - sLog.outDebug("Player %s invited %s to join his Guild", player->GetName(), name.c_str()); + sLog->outDebug("Player %s invited %s to join his Guild", player->GetName(), name.c_str()); pInvitee->SetGuildIdInvited(m_id); _LogEvent(GUILD_EVENT_LOG_INVITE_PLAYER, player->GetGUIDLow(), pInvitee->GetGUIDLow()); @@ -1448,13 +1448,13 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) data << m_name; pInvitee->GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_INVITE)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_INVITE)"); } void Guild::HandleAcceptMember(WorldSession* session) { Player* player = session->GetPlayer(); - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(GetLeaderGUID())) return; @@ -1628,9 +1628,9 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) player->ModifyMoney(-int32(amount)); player->SaveGoldToDB(trans); // Log GM action (TODO: move to scripts) - if (player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(player->GetSession()->GetAccountId(), + sLog->outCommand(player->GetSession()->GetAccountId(), "GM %s (Account: %u) deposit money (Amount: %u) to pGuild bank (Guild ID %u)", player->GetName(), player->GetSession()->GetAccountId(), amount, m_id); } @@ -1712,7 +1712,7 @@ void Guild::HandleDisband(WorldSession* session) else { Disband(); - sLog.outDebug("WORLD: Guild Successfully Disbanded"); + sLog->outDebug("WORLD: Guild Successfully Disbanded"); } } @@ -1727,7 +1727,7 @@ void Guild::SendInfo(WorldSession* session) const data << m_accountsNumber; // Number of accounts session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_INFO)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_INFO)"); } void Guild::SendEventLog(WorldSession *session) const @@ -1735,7 +1735,7 @@ void Guild::SendEventLog(WorldSession *session) const WorldPacket data(MSG_GUILD_EVENT_LOG_QUERY, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); m_eventLog->WritePacket(data); session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)"); + sLog->outDebug("WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)"); } void Guild::SendBankLog(WorldSession *session, uint8 tabId) const @@ -1748,7 +1748,7 @@ void Guild::SendBankLog(WorldSession *session, uint8 tabId) const data << uint8(tabId); pLog->WritePacket(data); session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (MSG_GUILD_BANK_LOG_QUERY)"); + sLog->outDebug("WORLD: Sent (MSG_GUILD_BANK_LOG_QUERY)"); } } @@ -1777,7 +1777,7 @@ void Guild::SendBankTabsInfo(WorldSession *session) const data << uint8(0); // Do not send tab content session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } void Guild::SendBankTabText(WorldSession *session, uint8 tabId) const @@ -1803,7 +1803,7 @@ void Guild::SendPermissions(WorldSession *session) const data << uint32(_GetMemberRemainingSlots(guid, tabId)); } session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (MSG_GUILD_PERMISSIONS)"); + sLog->outDebug("WORLD: Sent (MSG_GUILD_PERMISSIONS)"); } void Guild::SendMoneyInfo(WorldSession *session) const @@ -1811,7 +1811,7 @@ void Guild::SendMoneyInfo(WorldSession *session) const WorldPacket data(MSG_GUILD_BANK_MONEY_WITHDRAWN, 4); data << uint32(_GetMemberRemainingMoney(session->GetPlayer()->GetGUID())); session->SendPacket(&data); - sLog.outDebug("WORLD: Sent MSG_GUILD_BANK_MONEY_WITHDRAWN"); + sLog->outDebug("WORLD: Sent MSG_GUILD_BANK_MONEY_WITHDRAWN"); } void Guild::SendLoginInfo(WorldSession* session) const @@ -1821,7 +1821,7 @@ void Guild::SendLoginInfo(WorldSession* session) const data << uint8(1); data << m_motd; session->SendPacket(&data); - sLog.outDebug("WORLD: Sent guild MOTD (SMSG_GUILD_EVENT)"); + sLog->outDebug("WORLD: Sent guild MOTD (SMSG_GUILD_EVENT)"); SendBankTabsInfo(session); @@ -1918,13 +1918,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("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("GuildBankEventLog ERROR: non-money event (LogGuid: %u, Guild: %u) belongs to money tab, ignoring...", guid, m_id); return false; } pLog->LoadEvent(new BankEventLogEntry( @@ -1947,7 +1947,7 @@ bool Guild::LoadBankTabFromDB(Field* fields) uint32 tabId = fields[1].GetUInt8(); if (tabId >= _GetPurchasedTabsSize()) { - sLog.outError("Invalid tab (tabId: %u) in guild bank, skipped.", tabId); + sLog->outError("Invalid tab (tabId: %u) in guild bank, skipped.", tabId); return false; } return m_bankTabs[tabId]->LoadFromDB(fields); @@ -1958,7 +1958,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("Invalid tab for item (GUID: %u, id: #%u) in guild bank, skipped.", fields[14].GetUInt32(), fields[15].GetUInt32()); return false; } @@ -1976,7 +1976,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("Guild %u has invalid number of ranks, creating new...", m_id); broken_ranks = true; } else @@ -1986,7 +1986,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("Guild %u has broken rank id %u, creating default set of ranks...", m_id, rankId); broken_ranks = true; } } @@ -2020,7 +2020,7 @@ bool Guild::Validate() _SetLeaderGUID(pLeader); // Check config if multiple guildmasters are allowed - if (!sConfig.GetBoolDefault("Guild.AllowMultipleGuildMaster", 0)) + if (!sConfig->GetBoolDefault("Guild.AllowMultipleGuildMaster", 0)) for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) if (itr->second->GetRankId() == GR_GUILDMASTER && !itr->second->IsSamePlayer(m_leaderGuid)) itr->second->ChangeRank(GR_OFFICER); @@ -2242,9 +2242,9 @@ void Guild::SetBankTabText(uint8 tabId, const std::string& text) // Private methods void Guild::_CreateLogHolders() { - m_eventLog = new LogHolder(m_id, sWorld.getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT)); + m_eventLog = new LogHolder(m_id, sWorld->getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT)); for (uint8 tabId = 0; tabId <= GUILD_BANK_MAX_TABS; ++tabId) - m_bankEventLog[tabId] = new LogHolder(m_id, sWorld.getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT)); + m_bankEventLog[tabId] = new LogHolder(m_id, sWorld->getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT)); } bool Guild::_CreateNewBankTab() @@ -2536,7 +2536,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->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!", 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!! } @@ -2646,7 +2646,7 @@ void Guild::_SendBankContent(WorldSession *session, uint8 tabId) const session->SendPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } } @@ -2661,7 +2661,7 @@ void Guild::_SendBankMoneyUpdate(WorldSession *session) const data << uint8(0); // No items BroadcastPacket(&data); - sLog.outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const @@ -2721,7 +2721,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const player->GetSession()->SendPacket(&data); } - sLog.outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } } @@ -2745,5 +2745,5 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, const uint64& guid, const ch BroadcastPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_GUILD_EVENT"); + sLog->outDebug("WORLD: Sent SMSG_GUILD_EVENT"); } diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 4822d425d54..011189953ca 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -76,19 +76,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("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("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("InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d, wrong dificalty %u!", mapId, instanceId, difficulty); return NULL; } @@ -106,7 +106,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance } } - sLog.outDebug("InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d", mapId, instanceId); + sLog->outDebug("InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d", mapId, instanceId); InstanceSave *save = new InstanceSave(mapId, instanceId, difficulty, resetTime, canReset); if (!load) @@ -292,8 +292,8 @@ void InstanceSaveManager::CleanupAndPackInstances() CharacterDatabase.DirectExecute("ALTER TABLE instance DROP COLUMN newid"); // Bake some cookies for click - sLog.outString(">> Cleaned up and packed instances in %u ms", GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Cleaned up and packed instances in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void InstanceSaveManager::LoadResetTimes() @@ -358,7 +358,7 @@ void InstanceSaveManager::LoadResetTimes() } // load the global respawn times for raid/heroic instances - uint32 diff = sWorld.getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; + uint32 diff = sWorld->getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; result = CharacterDatabase.Query("SELECT mapid, difficulty, resettime FROM instance_reset"); if (result) { @@ -372,7 +372,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("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; } @@ -404,7 +404,7 @@ void InstanceSaveManager::LoadResetTimes() continue; // the reset_delay must be at least one day - uint32 period = uint32(((mapDiff->resetTime * sWorld.getRate(RATE_INSTANCE_RESET_TIME))/DAY) * DAY); + uint32 period = uint32(((mapDiff->resetTime * sWorld->getRate(RATE_INSTANCE_RESET_TIME))/DAY) * DAY); if (period < DAY) period = DAY; @@ -470,7 +470,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("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d,%d,%d) was not found!", event.type, event.mapid, event.instanceId); } } else @@ -539,7 +539,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr) void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) { - sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); + sLog->outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); Map *map = (MapInstanced*)sMapMgr->CreateBaseMap(mapid); if (!map->Instanceable()) return; @@ -572,7 +572,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("InstanceSaveManager::ResetOrWarnAll: not valid difficulty or no reset delay for map %d", mapid); return; } @@ -593,9 +593,9 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b CharacterDatabase.CommitTransaction(trans); // calculate the next reset time - uint32 diff = sWorld.getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; + uint32 diff = sWorld->getIntConfig(CONFIG_INSTANCE_RESET_TIME_HOUR) * HOUR; - uint32 period = uint32(((mapDiff->resetTime * sWorld.getRate(RATE_INSTANCE_RESET_TIME))/DAY) * DAY); + uint32 period = uint32(((mapDiff->resetTime * sWorld->getRate(RATE_INSTANCE_RESET_TIME))/DAY) * DAY); if (period < DAY) period = DAY; diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index d9cbcf0d5b1..2e3d0ade6da 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -41,7 +41,7 @@ void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject *go) if (go) go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); else - sLog.outDebug("TSCR: InstanceScript: HandleGameObject failed"); + sLog->outDebug("TSCR: InstanceScript: HandleGameObject failed"); } bool InstanceScript::IsEncounterInProgress() const @@ -62,7 +62,7 @@ void InstanceScript::LoadMinionData(const MinionData *data) ++data; } - sLog.outDebug("InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size())); + sLog->outDebug("InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size())); } void InstanceScript::LoadDoorData(const DoorData *data) @@ -74,7 +74,7 @@ void InstanceScript::LoadDoorData(const DoorData *data) ++data; } - sLog.outDebug("InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size())); + sLog->outDebug("InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size())); } void InstanceScript::UpdateMinionState(Creature *minion, EncounterState state) @@ -127,7 +127,7 @@ void InstanceScript::UpdateDoorState(GameObject *door) } door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); - //sLog.outError("Door %u is %s.", door->GetEntry(), open ? "opened" : "closed"); + //sLog->outError("Door %u is %s.", door->GetEntry(), open ? "opened" : "closed"); } void InstanceScript::AddDoor(GameObject *door, bool add) @@ -193,7 +193,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("Inialize boss %u state as %u.", id, (uint32)state); return false; } else @@ -263,7 +263,7 @@ void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, pGo->ResetDoorOrButton(); } else - sLog.outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.",pGo->GetEntry(),pGo->GetGoType()); + sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.",pGo->GetEntry(),pGo->GetGoType()); } } @@ -294,7 +294,7 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) pPlayer->SendUpdateWorldState(uiStateId, uiStateData); } else - sLog.outDebug("TSCR: DoUpdateWorldState attempt send data but no players in map."); + sLog->outDebug("TSCR: DoUpdateWorldState attempt send data but no players in map."); } // Send Notify to all players in instance @@ -325,7 +325,7 @@ void InstanceScript::DoCompleteAchievement(uint32 achievement) if (!pAE) { - sLog.outError("TSCR: DoCompleteAchievement called for not existing achievement %u", achievement); + sLog->outError("TSCR: DoCompleteAchievement called for not existing achievement %u", achievement); return; } @@ -381,7 +381,7 @@ void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(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("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 3110207787c..e8496ea753b 100755 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -24,11 +24,11 @@ //#include "GameObject.h" //#include "Map.h" -#define OUT_SAVE_INST_DATA sLog.outDebug("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("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("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("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("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("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("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("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()) class Map; class Unit; @@ -174,7 +174,7 @@ class InstanceScript : public ZoneScript void DoRemoveAurasDueToSpellOnPlayers(uint32 spell); // Return wether server allow two side groups or not - bool ServerAllowsTwoSideGroups() { return sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP); } + bool ServerAllowsTwoSideGroups() { return sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP); } virtual bool SetBossState(uint32 id, EncounterState state); EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; } diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 083368d7e04..9a5255ed030 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::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::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::max()); continue; // error already printed to log/console. } @@ -226,12 +226,12 @@ void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const { // all still listed ids isn't referenced for (LootIdSet::const_iterator itr = ids_set.begin(); itr != ids_set.end(); ++itr) - sLog.outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr,GetEntryName()); + sLog->outErrorDb("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) not exist but used as loot id in DB.", GetName(), id,GetEntryName()); + sLog->outErrorDb("Table '%s' entry %d (%s) not exist but used as loot id in DB.", GetName(), id,GetEntryName()); } // @@ -246,11 +246,11 @@ bool LootStoreItem::Roll(bool rate) const return true; if (mincountOrRef < 0) // reference case - return roll_chance_f(chance* (rate ? sWorld.getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f)); + return roll_chance_f(chance* (rate ? sWorld->getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f)); ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid); - float qualityModifier = pProto && rate ? sWorld.getRate(qualityToRate[pProto->Quality]) : 1.0f; + float qualityModifier = pProto && rate ? sWorld->getRate(qualityToRate[pProto->Quality]) : 1.0f; return roll_chance_f(chance*qualityModifier); } @@ -260,13 +260,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->outErrorDb("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->outErrorDb("Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef); return false; } @@ -275,26 +275,26 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const ItemPrototype const *proto = ObjectMgr::GetItemPrototype(itemid); if (!proto) { - sLog.outErrorDb("Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("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->outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef); return false; } @@ -302,10 +302,10 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const 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->outErrorDb("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->outErrorDb("Table '%s' entry %d item %d: zero chance is specified for a reference, skipped", store.GetName(), entry, itemid); return false; } } @@ -419,7 +419,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->outErrorDb("Table '%s' loot id #%u used but it doesn't have records.", store.GetName(), lootId); return false; } @@ -651,11 +651,11 @@ void Loot::generateMoneyLoot(uint32 minAmount, uint32 maxAmount) if (maxAmount > 0) { if (maxAmount <= minAmount) - gold = uint32(maxAmount * sWorld.getRate(RATE_DROP_MONEY)); + gold = uint32(maxAmount * sWorld->getRate(RATE_DROP_MONEY)); else if ((maxAmount - minAmount) < 32700) - gold = uint32(urand(minAmount, maxAmount) * sWorld.getRate(RATE_DROP_MONEY)); + gold = uint32(urand(minAmount, maxAmount) * sWorld->getRate(RATE_DROP_MONEY)); else - gold = uint32(urand(minAmount >> 8, maxAmount >> 8) * sWorld.getRate(RATE_DROP_MONEY)) << 8; + gold = uint32(urand(minAmount >> 8, maxAmount >> 8) * sWorld->getRate(RATE_DROP_MONEY)) << 8; } } @@ -1128,12 +1128,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->outErrorDb("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->outErrorDb("Table '%s' entry %u group %d has items with chance=0%% but group total chance >= 100%% (%f)", lootstore.GetName(), id, group_id, chance); } } @@ -1233,7 +1233,7 @@ void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId if (!Referenced) continue; // Error message already printed at loading stage - uint32 maxcount = uint32(float(i->maxcount) * sWorld.getRate(RATE_DROP_ITEM_REFERENCED_AMOUNT)); + uint32 maxcount = uint32(float(i->maxcount) * sWorld->getRate(RATE_DROP_ITEM_REFERENCED_AMOUNT)); for (uint32 loop = 0; loop < maxcount; ++loop) // Ref multiplicator Referenced->Process(loot, rate, lootMode, i->group); } @@ -1341,7 +1341,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("LootTemplate::addConditionItem: condition is null"); return false; } if (!Entries.empty()) @@ -1400,7 +1400,7 @@ bool LootTemplate::isReference(uint32 id) void LoadLootTemplates_Creature() { - sLog.outString("Loading creature loot templates..."); + sLog->outString("Loading creature loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1428,16 +1428,16 @@ void LoadLootTemplates_Creature() LootTemplates_Creature.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Disenchant() { - sLog.outString("Loading disenchanting loot templates..."); + sLog->outString("Loading disenchanting loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1464,15 +1464,15 @@ void LoadLootTemplates_Disenchant() LootTemplates_Disenchant.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); + sLog->outString(); } void LoadLootTemplates_Fishing() { - sLog.outString("Loading fishing loot templates..."); + sLog->outString("Loading fishing loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1489,16 +1489,16 @@ void LoadLootTemplates_Fishing() LootTemplates_Fishing.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Gameobject() { - sLog.outString("Loading gameobject loot templates..."); + sLog->outString("Loading gameobject loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1526,16 +1526,16 @@ void LoadLootTemplates_Gameobject() LootTemplates_Gameobject.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Item() { - sLog.outString("Loading item loot templates..."); + sLog->outString("Loading item loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1552,16 +1552,16 @@ void LoadLootTemplates_Item() LootTemplates_Item.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog.outErrorDb(">> Loaded 0 prospecting loot templates. DB table `item_loot_template` is empty"); + sLog->outErrorDb(">> Loaded 0 prospecting loot templates. DB table `item_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Milling() { - sLog.outString("Loading milling loot templates..."); + sLog->outString("Loading milling loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1586,16 +1586,16 @@ void LoadLootTemplates_Milling() LootTemplates_Milling.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Pickpocketing() { - sLog.outString("Loading pickpocketing loot templates..."); + sLog->outString("Loading pickpocketing loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1623,16 +1623,16 @@ void LoadLootTemplates_Pickpocketing() LootTemplates_Pickpocketing.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Prospecting() { - sLog.outString("Loading prospecting loot templates..."); + sLog->outString("Loading prospecting loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1657,16 +1657,16 @@ void LoadLootTemplates_Prospecting() LootTemplates_Prospecting.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Mail() { - sLog.outString("Loading mail loot templates..."); + sLog->outString("Loading mail loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1683,16 +1683,16 @@ void LoadLootTemplates_Mail() LootTemplates_Mail.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Skinning() { - sLog.outString("Loading skinning loot templates..."); + sLog->outString("Loading skinning loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1720,16 +1720,16 @@ void LoadLootTemplates_Skinning() LootTemplates_Skinning.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty"); - sLog.outString(); + sLog->outString(); } void LoadLootTemplates_Spell() { - sLog.outString("Loading spell loot templates..."); + sLog->outString("Loading spell loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1764,15 +1764,15 @@ void LoadLootTemplates_Spell() LootTemplates_Spell.ReportUnusedIds(ids_set); if(count) - sLog.outString(">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> 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->outErrorDb(">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); + sLog->outString(); } void LoadLootTemplates_Reference() { - sLog.outString("Loading reference loot templates..."); + sLog->outString("Loading reference loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1795,6 +1795,6 @@ void LoadLootTemplates_Reference() // output error for any still listed ids (not referenced from any loot table) LootTemplates_Reference.ReportUnusedIds(ids_set); - sLog.outString(">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 0a92b5df6bc..287767723bd 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("MailSender::MailSender - Mail have unexpected sender typeid (%u)", sender->GetTypeId()); break; } } @@ -158,7 +158,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 } // If theres is an item, there is a one hour delivery delay. - uint32 deliver_delay = needItemDelay ? sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0; + uint32 deliver_delay = needItemDelay ? sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0; // will delete item or place to receiver mail list SendMailTo(trans,MailReceiver(receiver,receiver_guid), MailSender(MAIL_NORMAL, sender_guid), MAIL_CHECK_MASK_RETURNED, deliver_delay); @@ -181,7 +181,7 @@ void MailDraft::SendMailTo(SQLTransaction& trans, MailReceiver const& receiver, // auction mail without any items and money if (sender.GetMailMessageType() == MAIL_AUCTION && m_items.empty() && !m_money) - expire_delay = sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY); + expire_delay = sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY); // mail from battlemaster (rewardmarks) should last only one day else if (sender.GetMailMessageType() == MAIL_CREATURE && sBattlegroundMgr->GetBattleMasterBG(sender.GetSenderId()) != BATTLEGROUND_TYPE_NONE) expire_delay = DAY; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 36bc959c280..b2f7eee7baa 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -33,7 +33,7 @@ #define DEFAULT_GRID_EXPIRY 300 #define MAX_GRID_LOAD_TIME 50 -#define MAX_CREATURE_ATTACK_RADIUS (45.0f * sWorld.getRate(RATE_CREATURE_AGGRO)) +#define MAX_CREATURE_ATTACK_RADIUS (45.0f * sWorld->getRate(RATE_CREATURE_AGGRO)) GridState* si_GridStates[MAX_GRID_STATE]; @@ -53,27 +53,27 @@ Map::~Map() } if (!m_scriptSchedule.empty()) - sWorld.DecreaseScheduledScriptCount(m_scriptSchedule.size()); + sWorld->DecreaseScheduledScriptCount(m_scriptSchedule.size()); } bool Map::ExistMap(uint32 mapid,int gx,int gy) { - int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1; + int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1; char* tmp = new char[len]; - snprintf(tmp, len, (char *)(sWorld.GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,gx,gy); + snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,gx,gy); bool ret = false; FILE *pf=fopen(tmp,"rb"); if (!pf) - sLog.outError("Map file '%s': does not exist!",tmp); + sLog->outError("Map file '%s': does not exist!",tmp); else { map_fileheader header; if (fread(&header, sizeof(header), 1, pf) == 1) { if (header.mapMagic != uint32(MAP_MAGIC) || header.versionMagic != uint32(MAP_VERSION_MAGIC)) - sLog.outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.",tmp); + sLog->outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.",tmp); else ret = true; } @@ -89,11 +89,11 @@ bool Map::ExistVMap(uint32 mapid,int gx,int gy) { if (vmgr->isMapLoadingEnabled()) { - bool exists = vmgr->existsMap((sWorld.GetDataPath()+ "vmaps").c_str(), mapid, gx,gy); + bool exists = vmgr->existsMap((sWorld->GetDataPath()+ "vmaps").c_str(), mapid, gx,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("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; } } @@ -105,17 +105,17 @@ bool Map::ExistVMap(uint32 mapid,int gx,int gy) void Map::LoadVMap(int gx,int gy) { // x and y are swapped !! - int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld.GetDataPath()+ "vmaps").c_str(), GetId(), gx,gy); + int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld->GetDataPath()+ "vmaps").c_str(), GetId(), gx,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->outDetail("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->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); 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->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy); break; } } @@ -142,7 +142,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->outDetail("Unloading previously loaded map %u before reloading.",GetId()); sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy); delete (GridMaps[gx][gy]); @@ -151,15 +151,15 @@ void Map::LoadMap(int gx,int gy, bool reload) // map file name char *tmp=NULL; - int len = sWorld.GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1; + 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); + snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(),GetId(),gx,gy); + sLog->outDetail("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("Error loading map file: \n %s\n", tmp); } delete [] tmp; @@ -255,7 +255,7 @@ void Map::SwitchGridContainers(T* obj, bool on) CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) { - 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("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; } @@ -263,7 +263,7 @@ void Map::SwitchGridContainers(T* obj, bool on) if (!loaded(GridPair(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->outStaticDebug("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); @@ -305,7 +305,7 @@ void Map::DeleteFromWorld(T* obj) template<> void Map::DeleteFromWorld(Player* pl) { - sObjectAccessor.RemoveObject(pl); + sObjectAccessor->RemoveObject(pl); delete pl; } @@ -317,9 +317,9 @@ Map::EnsureGridCreated(const GridPair &p) ACE_GUARD(ACE_Thread_Mutex, Guard, Lock); if (!getNGrid(p.x_coord, p.y_coord)) { - sLog.outDebug("Creating grid[%u,%u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); + sLog->outDebug("Creating grid[%u,%u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); - setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld.getBoolConfig(CONFIG_GRID_UNLOAD)), + setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)), p.x_coord, p.y_coord); // build a linkage between this map and NGridType @@ -349,11 +349,11 @@ Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player) { if (player) { - sLog.outStaticDebug("Player %s enter cell[%u,%u] triggers loading of grid[%u,%u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), GetId()); + sLog->outStaticDebug("Player %s enter cell[%u,%u] triggers loading of grid[%u,%u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), GetId()); } else { - sLog.outStaticDebug("Active object nearby triggers loading of grid [%u,%u] on map %u", cell.GridX(), cell.GridY(), GetId()); + sLog->outStaticDebug("Active object nearby triggers loading of grid [%u,%u] on map %u", cell.GridX(), cell.GridY(), GetId()); } ResetGridExpiry(*grid, 0.1f); @@ -369,7 +369,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) ASSERT(grid != NULL); if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) { - sLog.outDebug("Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); + sLog->outDebug("Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); @@ -377,7 +377,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) loader.LoadN(); // Add resurrectable corpses to world object list in grid - sObjectAccessor.AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); + sObjectAccessor->AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); return true; } @@ -398,7 +398,7 @@ bool Map::Add(Player *player) CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) { - sLog.outError("Map::Add: Player (GUID: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), p.x_coord, p.y_coord); + sLog->outError("Map::Add: Player (GUID: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), p.x_coord, p.y_coord); return false; } @@ -429,7 +429,7 @@ Map::Add(T *obj) CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) { - sLog.outError("Map::Add: 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("Map::Add: 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; } @@ -455,7 +455,7 @@ Map::Add(T *obj) if (obj->isActiveObject()) AddToActive(obj); - sLog.outStaticDebug("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY()); + sLog->outStaticDebug("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY()); //something, such as vehicle, needs to be update immediately //also, trigger needs to cast spell, if not update, cannot see visual @@ -664,15 +664,15 @@ void Map::Remove(Player *player, bool remove) CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) - sLog.outCrash("Map::Remove: Player is in invalid cell!"); + sLog->outCrash("Map::Remove: Player is in invalid cell!"); else { Cell cell(p); if (!getNGrid(cell.data.Part.grid_x, cell.data.Part.grid_y)) - sLog.outError("Map::Remove() i_grids was NULL x:%d, y:%d",cell.data.Part.grid_x,cell.data.Part.grid_y); + sLog->outError("Map::Remove() i_grids was NULL x:%d, y:%d",cell.data.Part.grid_x,cell.data.Part.grid_y); else { - sLog.outStaticDebug("Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY()); + sLog->outStaticDebug("Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(grid != NULL); @@ -697,13 +697,13 @@ Map::Remove(T *obj, bool remove) CellPair p = Trinity::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY()); if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) - sLog.outError("Map::Remove: 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("Map::Remove: 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); else { Cell cell(p); if (loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y))) { - sLog.outStaticDebug("Remove object " UI64FMTD " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y); + sLog->outStaticDebug("Remove object " UI64FMTD " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(grid != NULL); @@ -717,7 +717,7 @@ Map::Remove(T *obj, bool remove) if (remove) { // if option set then object already saved at this moment - if (!sWorld.getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) + if (!sWorld->getBoolConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) obj->SaveRespawnTime(); DeleteFromWorld(obj); } @@ -738,7 +738,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati 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->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()); NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY()); RemoveFromGrid(player, oldGrid,old_cell); @@ -770,8 +770,8 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif AddCreatureToMoveList(creature, x, y, z, ang); // in diffcell/diffgrid case notifiers called at finishing move creature in Map::MoveAllCreaturesInMoveList @@ -823,8 +823,8 @@ void Map::MoveAllCreaturesInMoveList() { // ... or unload (if respawn grid also not loaded) #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Creature (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Creature (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry()); #endif AddObjectToRemoveList(c); } @@ -841,8 +841,8 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) if (old_cell.DiffCell(new_cell)) { #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); #endif RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); @@ -851,8 +851,8 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) else { #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Creature (GUID: %u Entry: %u) moved in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Creature (GUID: %u Entry: %u) moved in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); #endif } @@ -865,8 +865,8 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) EnsureGridLoadedAtEnter(new_cell); #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); @@ -879,8 +879,8 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) if (loaded(GridPair(new_cell.GridX(), new_cell.GridY()))) { #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); @@ -892,8 +892,8 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) // fail to move: normal creature attempt move to unloaded grid #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Creature (GUID: %u Entry: %u) attempted to move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Creature (GUID: %u Entry: %u) attempted to move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif return false; } @@ -910,8 +910,8 @@ bool Map::CreatureRespawnRelocation(Creature *c) c->GetMotionMaster()->Clear(); #ifdef TRINITY_DEBUG - if ((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog.outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); + if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) + sLog->outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); #endif // teleport it to respawn point (like normal respawn if player see) @@ -936,7 +936,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) if (!unloadAll && ActiveObjectsNearGrid(x, y)) return false; - sLog.outDebug("Unloading grid[%u,%u] for map %u", x,y, GetId()); + sLog->outDebug("Unloading grid[%u,%u] for map %u", x,y, GetId()); ObjectGridUnloader unloader(*grid); @@ -986,7 +986,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) GridMaps[gx][gy] = NULL; } - sLog.outStaticDebug("Unloading grid[%u,%u] for map %u finished", x,y, GetId()); + sLog->outStaticDebug("Unloading grid[%u,%u] for map %u finished", x,y, GetId()); return true; } @@ -1000,7 +1000,7 @@ void Map::RemoveAllPlayers() if (!plr->IsBeingTeleportedFar()) { // this is happening for bg - sLog.outError("Map::UnloadAll: player %s is still in map %u during unload, this should not happen!", plr->GetName(), GetId()); + sLog->outError("Map::UnloadAll: player %s is still in map %u during unload, this should not happen!", plr->GetName(), GetId()); plr->TeleportTo(plr->m_homebindMapId, plr->m_homebindX, plr->m_homebindY, plr->m_homebindZ, plr->GetOrientation()); } } @@ -1072,28 +1072,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("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("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("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("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", filename); fclose(in); return false; } @@ -1646,7 +1646,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->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId); atEntry = GetAreaEntryByAreaID(wmoEntry->areaId); } return IsOutdoorWMO(mogpFlags, adtId, rootId, groupId, wmoEntry, atEntry); @@ -1726,7 +1726,7 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp uint32 liquid_type; if (vmgr->GetLiquidLevel(GetId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type)) { - sLog.outDebug("getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); + sLog->outDebug("getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); // Check water level and ground level if (liquid_level > ground_level && z > ground_level - 2) { @@ -1834,7 +1834,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const Cell xy_cell(xy_val); if (xy_cell != cur_cell) { - sLog.outDebug("Creature (GUID: %u) X: %f Y: %f (%s) is in grid[%u,%u]cell[%u,%u] instead of grid[%u,%u]cell[%u,%u]", + sLog->outDebug("Creature (GUID: %u) X: %f Y: %f (%s) is in grid[%u,%u]cell[%u,%u] instead of grid[%u,%u]cell[%u,%u]", c->GetGUIDLow(), c->GetPositionX(),c->GetPositionY(),(moved ? "final" : "original"), cur_cell.GridX(), cur_cell.GridY(), cur_cell.CellX(), cur_cell.CellY(), @@ -1847,7 +1847,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const const char* Map::GetMapName() const { - return i_mapEntry ? i_mapEntry->name[sWorld.GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; + return i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; } void Map::UpdateObjectVisibility(WorldObject* obj, Cell cell, CellPair cellpair) @@ -1876,7 +1876,7 @@ void Map::UpdateObjectsVisibilityFor(Player* player, Cell cell, CellPair cellpai void Map::SendInitSelf(Player * player) { - sLog.outDetail("Creating player data for himself %u", player->GetGUIDLow()); + sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow()); UpdateData data; @@ -1960,7 +1960,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("map::setNGrid() Invalid grid coordinates found: %d, %d!",x,y); ASSERT(false); } i_grids[x][y] = grid; @@ -1992,7 +1992,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj) obj->CleanupsBeforeDelete(false); // remove or simplify at least cross referenced links i_objectsToRemove.insert(obj); - //sLog.outDebug("Object (GUID: %u TypeId: %u) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); + //sLog->outDebug("Object (GUID: %u TypeId: %u) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); } void Map::AddObjectToSwitchList(WorldObject *obj, bool on) @@ -2028,7 +2028,7 @@ void Map::RemoveAllObjectsInRemoveList() } } - //sLog.outDebug("Object remover 1 check."); + //sLog->outDebug("Object remover 1 check."); while (!i_objectsToRemove.empty()) { std::set::iterator itr = i_objectsToRemove.begin(); @@ -2038,9 +2038,9 @@ void Map::RemoveAllObjectsInRemoveList() { case TYPEID_CORPSE: { - Corpse* corpse = sObjectAccessor.GetCorpse(*obj, obj->GetGUID()); + 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("Tried to delete corpse/bones %u that is not in map.", obj->GetGUIDLow()); else Remove(corpse,true); break; @@ -2058,14 +2058,14 @@ void Map::RemoveAllObjectsInRemoveList() Remove(obj->ToCreature(),true); break; default: - sLog.outError("Non-grid object (TypeId: %u) is in grid object remove list, ignored.",obj->GetTypeId()); + sLog->outError("Non-grid object (TypeId: %u) is in grid object remove list, ignored.",obj->GetTypeId()); break; } i_objectsToRemove.erase(itr); } - //sLog.outDebug("Object remover 2 check."); + //sLog->outDebug("Object remover 2 check."); } uint32 Map::GetPlayersCountExceptGMs() const @@ -2138,7 +2138,7 @@ void Map::AddToActive(Creature* c) else { GridPair p2 = Trinity::ComputeGridPair(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("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); } } @@ -2159,7 +2159,7 @@ void Map::RemoveFromActive(Creature* c) else { GridPair p2 = Trinity::ComputeGridPair(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("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); } } @@ -2187,7 +2187,7 @@ InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 Spaw // the timer is started by default, and stopped when the first player joins // this make sure it gets unloaded if for some reason no player joins - m_unloadTimer = std::max(sWorld.getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); + m_unloadTimer = std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); } InstanceMap::~InstanceMap() @@ -2210,7 +2210,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("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode()); ASSERT(false); return false; } @@ -2223,7 +2223,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->outDetail("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; } @@ -2287,7 +2287,7 @@ bool InstanceMap::Add(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->outDetail("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); } @@ -2298,7 +2298,7 @@ bool InstanceMap::Add(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("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; } } @@ -2311,8 +2311,8 @@ bool InstanceMap::Add(Player *player) InstanceGroupBind *groupBind = pGroup->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(pGroup->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("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(pGroup->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()); //ASSERT(false); return false; } @@ -2324,15 +2324,15 @@ bool InstanceMap::Add(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(pGroup->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty()); + 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(pGroup->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("MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount()); else - sLog.outError("MapSave NULL"); + sLog->outError("MapSave NULL"); if (groupBind->save) - sLog.outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount()); + sLog->outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount()); else - sLog.outError("GroupBind save NULL"); + sLog->outError("GroupBind save NULL"); return false; } // if the group/leader is permanently bound to the instance @@ -2362,7 +2362,7 @@ bool InstanceMap::Add(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->outDetail("MAP: Player '%s' entered instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName()); // initialize unload state m_unloadTimer = 0; m_resetAfterUnload = false; @@ -2388,10 +2388,10 @@ void InstanceMap::Update(const uint32& t_diff) void InstanceMap::Remove(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->outDetail("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); + m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); Map::Remove(player, remove); // for normal instances schedule the reset after all players have left SetResetSchedule(true); @@ -2424,7 +2424,7 @@ void InstanceMap::CreateInstanceData(bool load) std::string data = fields[0].GetString(); if (data != "") { - sLog.outDebug("Loading instance data for `%s` with id %u", sObjectMgr->GetScriptName(i_script_id), i_InstanceId); + sLog->outDebug("Loading instance data for `%s` with id %u", sObjectMgr->GetScriptName(i_script_id), i_InstanceId); i_data->Load(data.c_str()); } } @@ -2478,7 +2478,7 @@ void InstanceMap::PermBindAllPlayers(Player *player) InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); if (!save) { - sLog.outError("Cannot bind players, no instance save available for map!"); + sLog->outError("Cannot bind players, no instance save available for map!"); return; } @@ -2528,7 +2528,7 @@ void InstanceMap::SetResetSchedule(bool on) if (IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon()) { InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); - if (!save) sLog.outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId()); + if (!save) sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId()); else sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId())); } } @@ -2584,7 +2584,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("BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow()); ASSERT(false); return false; } @@ -2612,7 +2612,7 @@ bool BattlegroundMap::Add(Player * player) void BattlegroundMap::Remove(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->outDetail("MAP: Removing player '%s' from bg '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName()); Map::Remove(player, remove); } diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 5d216f0b1d9..b2811b6902c 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -176,20 +176,20 @@ 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("CreateInstance: no entry for map %d", GetId()); ASSERT(false); } const InstanceTemplate * iTemplate = ObjectMgr::GetInstanceTemplate(GetId()); if (!iTemplate) { - sLog.outError("CreateInstance: no instance template for map %d", GetId()); + sLog->outError("CreateInstance: no instance template for map %d", GetId()); ASSERT(false); } // some instances only have one difficulty GetDownscaledMapDifficultyData(GetId(),difficulty); - sLog.outDebug("MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); + sLog->outDebug("MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); InstanceMap *map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this); ASSERT(map->IsDungeon()); @@ -206,7 +206,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun // load/create a map ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); - sLog.outDebug("MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); + sLog->outDebug("MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),bg->GetMinLevel()); @@ -238,7 +238,7 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr) itr->second->UnloadAll(); // should only unload VMaps if this is the last instance and grid unloading is enabled - if (m_InstancedMaps.size() <= 1 && sWorld.getBoolConfig(CONFIG_GRID_UNLOAD)) + if (m_InstancedMaps.size() <= 1 && sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)) { VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(itr->second->GetId()); // in that case, unload grids of the base map, too diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 35b73db145d..aaa1fd1454c 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -39,8 +39,8 @@ extern GridState* si_GridStates[]; // debugging code, s MapManager::MapManager() { - i_gridCleanUpDelay = sWorld.getIntConfig(CONFIG_INTERVAL_GRIDCLEAN); - i_timer.SetInterval(sWorld.getIntConfig(CONFIG_INTERVAL_MAPUPDATE)); + i_gridCleanUpDelay = sWorld->getIntConfig(CONFIG_INTERVAL_GRIDCLEAN); + i_timer.SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_MAPUPDATE)); } MapManager::~MapManager() @@ -68,7 +68,7 @@ void MapManager::Initialize() i_GridStateErrorCount = 0; } - int num_threads(sWorld.getIntConfig(CONFIG_NUMTHREADS)); + int num_threads(sWorld->getIntConfig(CONFIG_NUMTHREADS)); // Start mtmaps if needed. if (num_threads > 0 && m_updater.activate(num_threads) == -1) abort(); @@ -90,7 +90,7 @@ void MapManager::checkAndCorrectGridStatesArray() { if (i_GridStates[i] != si_GridStates[i]) { - sLog.outError("MapManager::checkGridStates(), GridState: si_GridStates is currupt !!!"); + sLog->outError("MapManager::checkGridStates(), GridState: si_GridStates is currupt !!!"); ok = false; si_GridStates[i] = i_GridStates[i]; } @@ -134,7 +134,7 @@ Map* MapManager::_createBaseMap(uint32 id) Map* MapManager::CreateMap(uint32 id, const WorldObject* obj, uint32 /*instanceId*/) { ASSERT(obj); - //if (!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); + //if (!obj->IsInWorld()) sLog->outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); Map *m = _createBaseMap(id); if (m && (obj->GetTypeId() == TYPEID_PLAYER) && m->Instanceable()) m = ((MapInstanced*)m)->CreateInstance(id, (Player*)obj); @@ -192,12 +192,12 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) if (entry->IsRaid()) { // can only enter in a raid group - if ((!pGroup || !pGroup->isRaidGroup()) && !sWorld.getBoolConfig(CONFIG_INSTANCE_IGNORE_RAID)) + if ((!pGroup || !pGroup->isRaidGroup()) && !sWorld->getBoolConfig(CONFIG_INSTANCE_IGNORE_RAID)) { // probably there must be special opcode, because client has this string constant in GlobalStrings.lua // TODO: this is not a good place to send the message player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_RAID_GROUP_ONLY), mapName); - sLog.outDebug("MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName(), mapName); + sLog->outDebug("MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName(), mapName); return false; } } @@ -222,13 +222,13 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) { WorldPacket data(SMSG_CORPSE_NOT_IN_INSTANCE); player->GetSession()->SendPacket(&data); - sLog.outDebug("MAP: Player '%s' does not have a corpse in instance '%s' and cannot enter.", player->GetName(), mapName); + sLog->outDebug("MAP: Player '%s' does not have a corpse in instance '%s' and cannot enter.", player->GetName(), mapName); return false; } - sLog.outDebug("MAP: Player '%s' has corpse in instance '%s' and can enter.", player->GetName(), mapName); + sLog->outDebug("MAP: Player '%s' has corpse in instance '%s' and can enter.", player->GetName(), mapName); } else - sLog.outDebug("Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName()); + sLog->outDebug("Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName()); } //Get instance where player's group is bound & its map @@ -275,7 +275,7 @@ void MapManager::Update(uint32 diff) for (iter = i_maps.begin(); iter != i_maps.end(); ++iter) iter->second->DelayedUpdate(uint32(i_timer.GetCurrent())); - sObjectAccessor.Update(uint32(i_timer.GetCurrent())); + sObjectAccessor->Update(uint32(i_timer.GetCurrent())); for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter) (*iter)->Update(uint32(i_timer.GetCurrent())); diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 05c92e2c4cd..237db06ed44 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -127,7 +127,7 @@ namespace Trinity nBaseExp = 580; break; default: - sLog.outError("BaseGain: Unsupported content level %u",content); + sLog->outError("BaseGain: Unsupported content level %u",content); nBaseExp = 45; break; } @@ -178,7 +178,7 @@ namespace Trinity gain *= 2; } - gain = uint32(gain * sWorld.getRate(RATE_XP_KILL)); + gain = uint32(gain * sWorld->getRate(RATE_XP_KILL)); } sScriptMgr->OnGainCalculation(gain, pl, u); diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 58e4fa1b804..c747c5aa3d7 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -189,7 +189,7 @@ MotionMaster::MoveRandom(float spawndist) { if (i_owner->GetTypeId() == TYPEID_UNIT) { - sLog.outStaticDebug("Creature (GUID: %u) start moving random", i_owner->GetGUIDLow()); + sLog->outStaticDebug("Creature (GUID: %u) start moving random", i_owner->GetGUIDLow()); Mutate(new RandomMovementGenerator(spawndist), MOTION_SLOT_IDLE); } } @@ -204,12 +204,12 @@ MotionMaster::MoveTargetedHome() if (i_owner->GetTypeId() == TYPEID_UNIT) { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow()); + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow()); Mutate(new HomeMovementGenerator(), MOTION_SLOT_ACTIVE); } else { - sLog.outError("Player (GUID: %u) attempt targeted home", i_owner->GetGUIDLow()); + sLog->outError("Player (GUID: %u) attempt targeted home", i_owner->GetGUIDLow()); } } @@ -218,12 +218,12 @@ MotionMaster::MoveConfused() { if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) move confused", i_owner->GetGUIDLow()); + sLog->outStaticDebug("Player (GUID: %u) move confused", i_owner->GetGUIDLow()); Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) move confused", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused", i_owner->GetEntry(), i_owner->GetGUIDLow()); Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); } @@ -239,7 +239,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle) i_owner->ClearUnitState(UNIT_STAT_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", + sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); @@ -247,7 +247,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle) } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)", i_owner->GetEntry(), i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); @@ -265,14 +265,14 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slo i_owner->AddUnitState(UNIT_STAT_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(), + sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); Mutate(new TargetedMovementGenerator(*target,dist,angle), slot); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)", i_owner->GetEntry(), i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); @@ -285,12 +285,12 @@ MotionMaster::MovePoint(uint32 id, float x, float y, float z) { if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), id, x, y, z); + sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), id, x, y, z); Mutate(new PointMovementGenerator(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->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", i_owner->GetEntry(), i_owner->GetGUIDLow(), id, x, y, z); Mutate(new PointMovementGenerator(id,x,y,z), MOTION_SLOT_ACTIVE); } @@ -333,12 +333,12 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee i_owner->m_TempSpeed = speedXY; if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z); + sLog->outStaticDebug("Player (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z); Mutate(new PointMovementGenerator(0,x,y,z), MOTION_SLOT_CONTROLLED); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) jump to point (X: %f Y: %f Z: %f)", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z); Mutate(new PointMovementGenerator(0,x,y,z), MOTION_SLOT_CONTROLLED); } @@ -356,12 +356,12 @@ MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id) i_owner->m_TempSpeed = speed; if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z); + sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z); Mutate(new PointMovementGenerator(id,x,y,z), MOTION_SLOT_CONTROLLED); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z); Mutate(new PointMovementGenerator(id,x,y,z), MOTION_SLOT_CONTROLLED); } @@ -380,11 +380,11 @@ MotionMaster::MoveSeekAssistance(float x, float y, float z) { if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outError("Player (GUID: %u) attempt to seek assistance",i_owner->GetGUIDLow()); + sLog->outError("Player (GUID: %u) attempt to seek assistance",i_owner->GetGUIDLow()); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z); i_owner->AttackStop(); i_owner->ToCreature()->SetReactState(REACT_PASSIVE); @@ -397,11 +397,11 @@ MotionMaster::MoveSeekAssistanceDistract(uint32 time) { if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outError("Player (GUID: %u) attempt to call distract after assistance",i_owner->GetGUIDLow()); + sLog->outError("Player (GUID: %u) attempt to call distract after assistance",i_owner->GetGUIDLow()); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", i_owner->GetEntry(), i_owner->GetGUIDLow(), time); Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE); } @@ -418,14 +418,14 @@ MotionMaster::MoveFleeing(Unit* enemy, uint32 time) if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", i_owner->GetGUIDLow(), + sLog->outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", i_owner->GetGUIDLow(), enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow()); Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s", i_owner->GetEntry(), i_owner->GetGUIDLow(), enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(), @@ -444,19 +444,19 @@ MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode) { if (path < sTaxiPathNodesByPath.size()) { - sLog.outStaticDebug("%s taxi to (Path %u node %u)", i_owner->GetName(), path, pathnode); + sLog->outStaticDebug("%s taxi to (Path %u node %u)", i_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("%s attempt taxi to (not existed Path %u node %u)", i_owner->GetName(), path, pathnode); } } else { - sLog.outError("Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)", + sLog->outError("Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)", i_owner->GetEntry(), i_owner->GetGUIDLow(), path, pathnode); } } @@ -469,11 +469,11 @@ MotionMaster::MoveDistract(uint32 timer) if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog.outStaticDebug("Player (GUID: %u) distracted (timer: %u)", i_owner->GetGUIDLow(), timer); + sLog->outStaticDebug("Player (GUID: %u) distracted (timer: %u)", i_owner->GetGUIDLow(), timer); } else { - sLog.outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)", + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)", i_owner->GetEntry(), i_owner->GetGUIDLow(), timer); } @@ -525,7 +525,7 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable) //Mutate(new WaypointMovementGenerator(path_id, repeatable)): Mutate(new WaypointMovementGenerator(path_id, repeatable), MOTION_SLOT_IDLE); - sLog.outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", + sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", i_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature", i_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO"); } @@ -584,7 +584,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)!", i_owner->GetEntry(), curr->GetMovementGeneratorType()); + sLog->outCrash("Unit (Entry %u) is trying to delete its updating MG (Type %u)!", i_owner->GetEntry(), curr->GetMovementGeneratorType()); if (isStatic(curr)) return; if (!m_expList) diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 8109ad2d8b1..f87526d1d89 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -76,7 +76,7 @@ HomeMovementGenerator::Update(Creature &owner, const uint32& time_diff // restore orientation of not moving creature at returning to home if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE) { - //sLog.outDebug("Entering HomeMovement::GetDestination(z,y,z)"); + //sLog->outDebug("Entering HomeMovement::GetDestination(z,y,z)"); owner.SetOrientation(ori); WorldPacket packet; owner.BuildHeartBeatMsg(&packet); diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index ad6cfc2011c..533e777967b 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -99,6 +99,6 @@ void AssistanceMovementGenerator::Finalize(Unit &unit) unit.ToCreature()->SetNoCallAssistance(false); unit.ToCreature()->CallAssistance(); if (unit.isAlive()) - unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)); + unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)); } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 38d03af39c0..c5b5e4ea88e 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -288,7 +288,7 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff) { DoEventIfAny(player,(*i_path)[i_currentNode], true); - sLog.outStaticDebug("loading node %u for player %s", i_currentNode, player.GetName()); + sLog->outStaticDebug("loading node %u for player %s", i_currentNode, player.GetName()); if ((*i_path)[i_currentNode].mapid == curMap) { // do not send movement, it was sent already @@ -350,18 +350,18 @@ void FlightPathMovementGenerator::PreloadEndGrid() // Load the grid if (endMap) { - sLog.outDetail("Preloading flightmaster at grid (%f, %f) for map %u", m_endGridX, m_endGridY, m_endMapId); + sLog->outDetail("Preloading flightmaster at grid (%f, %f) for map %u", m_endGridX, m_endGridY, m_endMapId); endMap->LoadGrid(m_endGridX, m_endGridY); } else - sLog.outDetail("Unable to determine map to preload flightmaster grid"); + sLog->outDetail("Unable to determine map to preload flightmaster grid"); } void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure) { if (uint32 eventid = departure ? node.departureEventID : node.arrivalEventID) { - sLog.outDebug("Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName()); + sLog->outDebug("Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName()); player.GetMap()->ScriptsStart(sEventScripts, eventid, &player, &player); } } diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index de29bc49c7c..5aaba6aeb4c 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -41,8 +41,8 @@ void WaypointStore::Load() if (!result) { - sLog.outErrorDb(">> Loaded 0 waypoints. DB table `waypoint_data` is empty!"); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 waypoints. DB table `waypoint_data` is empty!"); + sLog->outString(); return; } @@ -88,8 +88,8 @@ void WaypointStore::Load() } while (result->NextRow()) ; - sLog.outString(">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u waypoints in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void WaypointStore::UpdatePath(uint32 id) diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 9c6ff1f3f69..282b0127bba 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -117,13 +117,13 @@ bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 team, uint3 bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3) { - sLog.outDebug("Creating capture point %u", entry); + sLog->outDebug("Creating capture point %u", entry); // check info existence GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry); if (!goinfo || goinfo->type != GAMEOBJECT_TYPE_CAPTURE_POINT) { - sLog.outError("OutdoorPvP: GO %u is not capture point!", entry); + sLog->outError("OutdoorPvP: GO %u is not capture point!", entry); return false; } @@ -144,7 +144,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) { if (!m_Creatures[type]) { - sLog.outDebug("opvp creature type %u was already deleted",type); + sLog->outDebug("opvp creature type %u was already deleted",type); return false; } @@ -155,7 +155,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) m_Creatures[type] = 0; return false; } - sLog.outDebug("deleting opvp creature type %u",type); + sLog->outDebug("deleting opvp creature type %u",type); uint32 guid = cr->GetDBTableGUIDLow(); // Don't save respawn time cr->SetRespawnTime(0); @@ -250,7 +250,7 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player * plr, uint32 /*zone*/) if (!plr->GetSession()->PlayerLogout()) SendRemoveWorldStates(plr); m_players[plr->GetTeamId()].erase(plr); - sLog.outDebug("Player %s left an outdoorpvp zone", plr->GetName()); + sLog->outDebug("Player %s left an outdoorpvp zone", plr->GetName()); } void OutdoorPvP::HandlePlayerResurrects(Player * /*plr*/, uint32 /*zone*/) @@ -377,7 +377,7 @@ bool OPvPCapturePoint::Update(uint32 diff) if (m_OldState != m_State) { - //sLog.outError("%u->%u", m_OldState, m_State); + //sLog->outError("%u->%u", m_OldState, m_State); if (oldTeam != m_team) ChangeTeam(oldTeam); ChangeState(); @@ -558,7 +558,7 @@ bool OutdoorPvP::HandleAreaTrigger(Player * /*plr*/, uint32 /*trigger*/) void OutdoorPvP::BroadcastPacket(WorldPacket &data) const { - // This is faster than sWorld.SendZoneMessage + // This is faster than sWorld->SendZoneMessage for (uint32 team = 0; team < 2; ++team) for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) (*itr)->GetSession()->SendPacket(&data); diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 509ac86da6a..9e82b6d0a4c 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -24,12 +24,12 @@ OutdoorPvPMgr::OutdoorPvPMgr() { m_UpdateTimer = 0; - //sLog.outDebug("Instantiating OutdoorPvPMgr"); + //sLog->outDebug("Instantiating OutdoorPvPMgr"); } OutdoorPvPMgr::~OutdoorPvPMgr() { - //sLog.outDebug("Deleting OutdoorPvPMgr"); + //sLog->outDebug("Deleting OutdoorPvPMgr"); for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) delete *itr; @@ -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->outErrorDb(">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty."); + sLog->outString(); 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->outErrorDb("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->outErrorDb("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("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("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->outString(">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP *handle) @@ -125,7 +125,7 @@ void OutdoorPvPMgr::HandlePlayerEnterZone(Player *plr, uint32 zoneid) return; itr->second->HandlePlayerEnterZone(plr, zoneid); - sLog.outDebug("Player %u entered outdoorpvp id %u", plr->GetGUIDLow(), itr->second->GetTypeId()); + sLog->outDebug("Player %u entered outdoorpvp id %u", plr->GetGUIDLow(), itr->second->GetTypeId()); } void OutdoorPvPMgr::HandlePlayerLeaveZone(Player *plr, uint32 zoneid) @@ -139,7 +139,7 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player *plr, uint32 zoneid) return; itr->second->HandlePlayerLeaveZone(plr, zoneid); - sLog.outDebug("Player %u left outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId()); + sLog->outDebug("Player %u left outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId()); } OutdoorPvP * OutdoorPvPMgr::GetOutdoorPvPToZoneId(uint32 zoneid) diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index d79f7fc591e..35a5fa9230c 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -220,7 +220,7 @@ void PoolGroup::Despawn1Object(uint32 guid) { sObjectMgr->RemoveCreatureFromGrid(guid, data); - if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) + if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->AddObjectToRemoveList(); } } @@ -233,7 +233,7 @@ void PoolGroup::Despawn1Object(uint32 guid) { sObjectMgr->RemoveGameobjectFromGrid(guid, data); - if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) + if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->AddObjectToRemoveList(); } } @@ -364,7 +364,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { Creature* pCreature = new Creature; - //sLog.outDebug("Spawning creature %u",guid); + //sLog->outDebug("Spawning creature %u",guid); if (!pCreature->LoadFromDB(obj->guid, map)) { delete pCreature; @@ -390,7 +390,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { GameObject* pGameobject = new GameObject; - //sLog.outDebug("Spawning gameobject %u", guid); + //sLog->outDebug("Spawning gameobject %u", guid); if (!pGameobject->LoadFromDB(obj->guid, map)) { delete pGameobject; @@ -421,7 +421,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { - sLog.outDebug("PoolGroup: Adding quest %u to creature %u", itr->first, itr->second); + sLog->outDebug("PoolGroup: Adding quest %u to creature %u", itr->first, itr->second); questMap->insert(QuestRelations::value_type(itr->second, itr->first)); } @@ -430,7 +430,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) qr = sPoolMgr->mQuestGORelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { - sLog.outDebug("PoolGroup: Adding quest %u to GO %u", itr->first, itr->second); + sLog->outDebug("PoolGroup: Adding quest %u to GO %u", itr->first, itr->second); questMap->insert(QuestRelations::value_type(itr->second, itr->first)); } } @@ -438,7 +438,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) template <> void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 triggerFrom) { - sLog.outDebug("PoolGroup: Spawning pool %u", poolId); + sLog->outDebug("PoolGroup: Spawning pool %u", poolId); // load state from db if (!triggerFrom) { @@ -508,7 +508,7 @@ template <> void PoolGroup::ReSpawn1Object(PoolObject* obj) { if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid)) - if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) + if (Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL)) pCreature->GetMap()->Add(pCreature); } @@ -517,7 +517,7 @@ template <> void PoolGroup::ReSpawn1Object(PoolObject* obj) { if (GameObjectData const* data = sObjectMgr->GetGOData(obj->guid)) - if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) + if (GameObject* pGameobject = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL)) pGameobject->GetMap()->Add(pGameobject); } @@ -547,8 +547,8 @@ void PoolMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template"); if (!result) { - sLog.outString(">> Loaded 0 object pools. DB table `pool_template` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty."); + sLog->outString(); return; } else @@ -563,8 +563,8 @@ void PoolMgr::LoadFromDB() if (!result) { mPoolTemplate.clear(); - sLog.outString(">> Loaded 0 object pools. DB table `pool_template` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty."); + sLog->outString(); return; } @@ -583,12 +583,12 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); // Creatures - sLog.outString("Loading Creatures Pooling Data..."); + sLog->outString("Loading Creatures Pooling Data..."); oldMSTime = getMSTime(); mPoolCreatureGroups.resize(max_pool_id + 1); @@ -599,8 +599,8 @@ void PoolMgr::LoadFromDB() count = 0; if (!result) { - sLog.outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); + sLog->outString(); } else { @@ -617,17 +617,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->outErrorDb("`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->outErrorDb("`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->outErrorDb("`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]; @@ -643,13 +643,13 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Gameobjects - sLog.outString("Loading Gameobject Pooling Data..."); + sLog->outString("Loading Gameobject Pooling Data..."); mPoolGameobjectGroups.resize(max_pool_id + 1); mGameobjectSearchMap.clear(); @@ -659,8 +659,8 @@ void PoolMgr::LoadFromDB() count = 0; if (!result) { - sLog.outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); + sLog->outString(); } else { @@ -677,7 +677,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->outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); continue; } GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(data->id); @@ -685,17 +685,17 @@ 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->outErrorDb("`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->outErrorDb("`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->outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id); continue; } PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id]; @@ -711,13 +711,13 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog.outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Pool of pools - sLog.outString("Loading Mother Pooling Data..."); + sLog->outString("Loading Mother Pooling Data..."); oldMSTime = getMSTime(); mPoolPoolGroups.resize(max_pool_id + 1); @@ -727,8 +727,8 @@ void PoolMgr::LoadFromDB() count = 0; if (!result) { - sLog.outString(">> Loaded 0 pools in pools"); - sLog.outString(); + sLog->outString(">> Loaded 0 pools in pools"); + sLog->outString(); } else { @@ -744,22 +744,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->outErrorDb("`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->outErrorDb("`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->outErrorDb("`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->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); continue; } PoolTemplateData *pPoolTemplateMother = &mPoolTemplate[mother_pool_id]; @@ -790,7 +790,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->outErrorDb("%s", ss.str().c_str()); mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first); mPoolSearchMap.erase(poolItr); --count; @@ -799,8 +799,8 @@ void PoolMgr::LoadFromDB() } } - sLog.outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } } @@ -817,8 +817,8 @@ void PoolMgr::LoadQuestPools() uint32 count = 0; if (!result) { - sLog.outString(">> Loaded 0 quests in pools"); - sLog.outString(); + sLog->outString(">> Loaded 0 quests in pools"); + sLog->outString(); return; } @@ -845,19 +845,19 @@ void PoolMgr::LoadQuestPools() Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry); if (!pQuest) { - sLog.outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id); + sLog->outErrorDb("`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->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); continue; } if (!pQuest->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->outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id); continue; } @@ -868,7 +868,7 @@ void PoolMgr::LoadQuestPools() if (poolTypeMap[pool_id] != currType) { - sLog.outErrorDb("`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"); + sLog->outErrorDb("`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 +877,7 @@ void PoolMgr::LoadQuestPools() 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->outErrorDb("`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id); continue; } @@ -895,8 +895,8 @@ void PoolMgr::LoadQuestPools() } while (result->NextRow()); - sLog.outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // 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 @@ -917,9 +917,9 @@ void PoolMgr::Initialize() 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->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()); 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->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); continue; } @@ -932,7 +932,7 @@ void PoolMgr::Initialize() } while (result->NextRow()); } - sLog.outBasic("Pool handling system initialized, %u pools spawned.", count); + sLog->outBasic("Pool handling system initialized, %u pools spawned.", count); } void PoolMgr::SaveQuestsToDB() diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 64b9dc0bf34..37e76044a06 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -202,7 +202,7 @@ int32 Quest::GetRewOrReqMoney() const if (RewOrReqMoney <= 0) return RewOrReqMoney; - return int32(RewOrReqMoney * sWorld.getRate(RATE_DROP_MONEY)); + return int32(RewOrReqMoney * sWorld->getRate(RATE_DROP_MONEY)); } bool Quest::IsAllowedInRaid() const @@ -210,5 +210,5 @@ bool Quest::IsAllowedInRaid() const if (IsRaidQuest()) return true; - return sWorld.getBoolConfig(CONFIG_QUEST_IGNORE_RAID); + return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID); } diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index a827f1262ce..2e29fb8e373 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -45,7 +45,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.",m_player->GetName(), faction_id); + sLog->outError("ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.",m_player->GetName(), faction_id); return 0; } @@ -333,7 +333,7 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in if (incremental) { // int32 *= float cause one point loss? - standing = int32(floor((float)standing * sWorld.getRate(RATE_REPUTATION_GAIN) + 0.5)); + standing = int32(floor((float)standing * sWorld->getRate(RATE_REPUTATION_GAIN) + 0.5)); standing += itr->second.Standing + BaseRep; } diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 758275eeddc..ee191b3e534 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -53,11 +53,11 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O sa.ownerGUID = ownerGUID; sa.script = &iter->second; - m_scriptSchedule.insert(std::pair(time_t(sWorld.GetGameTime() + iter->first), sa)); + m_scriptSchedule.insert(std::pair(time_t(sWorld->GetGameTime() + iter->first), sa)); if (iter->first == 0) immedScript = true; - sWorld.IncreaseScheduledScriptsCount(); + sWorld->IncreaseScheduledScriptsCount(); } ///- If one of the effects should be immediate, launch the script execution if (/*start &&*/ immedScript && !i_scriptLock) @@ -83,9 +83,9 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou sa.ownerGUID = ownerGUID; sa.script = &script; - m_scriptSchedule.insert(std::pair(time_t(sWorld.GetGameTime() + delay), sa)); + m_scriptSchedule.insert(std::pair(time_t(sWorld->GetGameTime() + delay), sa)); - sWorld.IncreaseScheduledScriptsCount(); + sWorld->IncreaseScheduledScriptsCount(); ///- If effects should be immediate, launch the script execution if (delay == 0 && !i_scriptLock) @@ -101,7 +101,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe { Player *pPlayer = NULL; if (!source && !target) - sLog.outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); else { // Check target first, then source. @@ -111,7 +111,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe pPlayer = source->ToPlayer(); if (!pPlayer) - 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("%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); @@ -123,7 +123,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t { Creature *pCreature = NULL; if (!source && !target) - sLog.outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + sLog->outError("%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); else { if (bReverse) @@ -144,7 +144,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t } if (!pCreature) - 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("%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); @@ -156,15 +156,15 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s { Unit* pUnit = NULL; if (!obj) - sLog.outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + sLog->outError("%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("%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 { pUnit = dynamic_cast(obj); if (!pUnit) - sLog.outError("%s %s object could not be casted to unit.", + sLog->outError("%s %s object could not be casted to unit.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); } return pUnit; @@ -174,12 +174,12 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInf { Player* pPlayer = NULL; if (!obj) - sLog.outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); else { pPlayer = obj->ToPlayer(); if (!pPlayer) - sLog.outError("%s %s object is not a player (TypeId: %u, Entry: %u, GUID: %u).", + sLog->outError("%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 pPlayer; @@ -189,12 +189,12 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const Scrip { Creature* pCreature = NULL; if (!obj) - sLog.outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); else { pCreature = obj->ToCreature(); if (!pCreature) - sLog.outError("%s %s object is not a creature (TypeId: %u, Entry: %u, GUID: %u).", scriptInfo->GetDebugInfo().c_str(), + sLog->outError("%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 pCreature; @@ -204,13 +204,13 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const { WorldObject* pWorldObject = NULL; if (!obj) - sLog.outError("%s %s object is NULL.", + sLog->outError("%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); else { pWorldObject = dynamic_cast(obj); if (!pWorldObject) - sLog.outError("%s %s object is not a world object (TypeId: %u, Entry: %u, GUID: %u).", + sLog->outError("%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; @@ -226,29 +226,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("%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("%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("%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("%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 (source); if (!wSource) - sLog.outError("%s source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.", + sLog->outError("%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("%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("%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)) { @@ -291,7 +291,7 @@ void Map::ScriptsProcess() ///- Process overdue queued scripts std::multimap::iterator iter = m_scriptSchedule.begin(); // ok as multimap is a *sorted* associative container - while (!m_scriptSchedule.empty() && (iter->first <= sWorld.GetGameTime())) + while (!m_scriptSchedule.empty() && (iter->first <= sWorld->GetGameTime())) { ScriptAction const& step = iter->second; @@ -335,7 +335,7 @@ void Map::ScriptsProcess() } break; default: - sLog.outError("*_script source with unsupported high guid value %u",GUID_HIPART(step.sourceGUID)); + sLog->outError("*_script source with unsupported high guid value %u",GUID_HIPART(step.sourceGUID)); break; } } @@ -367,7 +367,7 @@ void Map::ScriptsProcess() target = HashMapHolder::Find(step.targetGUID); break; default: - sLog.outError("*_script source with unsupported high guid value %u",GUID_HIPART(step.targetGUID)); + sLog->outError("*_script source with unsupported high guid value %u",GUID_HIPART(step.targetGUID)); break; } } @@ -381,7 +381,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("%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) @@ -408,7 +408,7 @@ void Map::ScriptsProcess() case CHAT_MSG_RAID_BOSS_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("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); break; } pSource->Whisper(text, LANG_UNIVERSAL, targetGUID); @@ -441,7 +441,7 @@ void Map::ScriptsProcess() 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("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); break; } cSource->Whisper(step.script->Talk.TextID, targetGUID); @@ -449,7 +449,7 @@ void Map::ScriptsProcess() case CHAT_MSG_RAID_BOSS_WHISPER: //42 if (!targetGUID || !IS_PLAYER_GUID(targetGUID)) { - sLog.outError("%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); + sLog->outError("%s attempt to raidbosswhisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); break; } cSource->MonsterWhisper(step.script->Talk.TextID, targetGUID, true); @@ -478,7 +478,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("%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 @@ -501,7 +501,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("%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 @@ -515,7 +515,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("%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 @@ -542,12 +542,12 @@ void Map::ScriptsProcess() { if (!source) { - sLog.outError("%s source object is NULL.", step.script->GetDebugInfo().c_str()); + sLog->outError("%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("%s target object is NULL.", step.script->GetDebugInfo().c_str()); break; } @@ -558,7 +558,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("%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; } @@ -571,7 +571,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("%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; } @@ -579,7 +579,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("%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 ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0, target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0); @@ -611,7 +611,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("%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str()); break; } @@ -621,7 +621,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("%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid); break; } @@ -630,7 +630,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("%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; } @@ -653,7 +653,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("%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str()); else { float x = step.script->TempSummonCreature.PosX; @@ -662,7 +662,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("%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry); } } break; @@ -680,13 +680,13 @@ void Map::ScriptsProcess() // Target must be GameObject. if (!target) { - sLog.outError("%s target object is NULL.", step.script->GetDebugInfo().c_str()); + sLog->outError("%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("%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; } @@ -710,7 +710,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("%s source and target objects are NULL.", step.script->GetDebugInfo().c_str()); break; } @@ -743,13 +743,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("%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("%s no target unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID); break; } @@ -809,7 +809,7 @@ void Map::ScriptsProcess() if (Unit* pSource = _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("%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID); else pSource->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable); } @@ -819,12 +819,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("%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("%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str()); break; } @@ -851,7 +851,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("%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry); break; } @@ -860,7 +860,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("%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType); break; } @@ -874,7 +874,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("%s creature is already dead (Entry: %u, GUID: %u)", step.script->GetDebugInfo().c_str(), cSource->GetEntry(), cSource->GetGUIDLow()); else { @@ -930,12 +930,12 @@ void Map::ScriptsProcess() break; default: - sLog.outError("Unknown script command %s.", step.script->GetDebugInfo().c_str()); + sLog->outError("Unknown script command %s.", step.script->GetDebugInfo().c_str()); break; } m_scriptSchedule.erase(iter); - sWorld.DecreaseScheduledScriptCount(); + sWorld->DecreaseScheduledScriptCount(); iter = m_scriptSchedule.begin(); } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 3824abdfa72..8ac9e282815 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -60,13 +60,13 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) { if (!pSource) { - sLog.outError("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry); + sLog->outError("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("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; } @@ -74,18 +74,18 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) 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("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("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); + sLog->outDebug("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 (GetSoundEntriesStore()->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("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); } if (pData->uiEmote) @@ -93,7 +93,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) 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("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId()); } switch (pData->uiType) @@ -115,7 +115,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID()); else - sLog.outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); break; } @@ -124,7 +124,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true); else - sLog.outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + sLog->outError("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); break; } @@ -181,13 +181,13 @@ void ScriptMgr::Initialize() LoadDatabase(); - sLog.outString("Loading C++ scripts"); + sLog->outString("Loading C++ scripts"); FillSpellSummary(); AddScripts(); - sLog.outString(">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void ScriptMgr::LoadDatabase() @@ -1312,7 +1312,7 @@ WorldMapScript::WorldMapScript(const char* name, uint32 mapId) : ScriptObject(name), MapScript(mapId) { if (GetEntry() && !GetEntry()->IsContinent()) - sLog.outError("WorldMapScript for map %u is invalid.", mapId); + sLog->outError("WorldMapScript for map %u is invalid.", mapId); ScriptMgr::ScriptRegistry::AddScript(this); } @@ -1321,7 +1321,7 @@ InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId) : ScriptObject(name), MapScript(mapId) { if (GetEntry() && !GetEntry()->IsDungeon()) - sLog.outError("InstanceMapScript for map %u is invalid.", mapId); + sLog->outError("InstanceMapScript for map %u is invalid.", mapId); ScriptMgr::ScriptRegistry::AddScript(this); } @@ -1330,7 +1330,7 @@ BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId) : ScriptObject(name), MapScript(mapId) { if (GetEntry() && !GetEntry()->IsBattleground()) - sLog.outError("BattlegroundMapScript for map %u is invalid.", mapId); + sLog->outError("BattlegroundMapScript for map %u is invalid.", mapId); ScriptMgr::ScriptRegistry::AddScript(this); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index bb47304a979..378b9362c5a 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -310,7 +310,7 @@ template class MapScript : public UpdatableScript : _mapEntry(sMapStore.LookupEntry(mapId)) { if (!_mapEntry) - sLog.outError("Invalid MapScript for %u; no such map ID.", mapId); + sLog->outError("Invalid MapScript for %u; no such map ID.", mapId); } public: @@ -997,7 +997,7 @@ class ScriptMgr { if (it->second == script) { - sLog.outError("Script '%s' has same memory pointer as '%s'.", + sLog->outError("Script '%s' has same memory pointer as '%s'.", script->GetName().c_str(), it->second->GetName().c_str()); return; @@ -1033,7 +1033,7 @@ class ScriptMgr 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("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. @@ -1043,7 +1043,7 @@ class ScriptMgr { // 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->outErrorDb("Script named '%s' does not have a script name assigned in database.", script->GetName().c_str()); } } diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 672c0cca726..15e1701cba8 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -30,30 +30,30 @@ void SystemMgr::LoadVersion() { Field* pFields = Result->Fetch(); - sLog.outString("TSCR: Database version is: %s", pFields[0].GetCString()); - sLog.outString(); + sLog->outString("TSCR: Database version is: %s", pFields[0].GetCString()); + sLog->outString(); } else { - sLog.outError("TSCR: Missing `version`.`script_version` information."); - sLog.outString(); + sLog->outError("TSCR: Missing `version`.`script_version` information."); + sLog->outString(); } } void SystemMgr::LoadScriptTexts() { - sLog.outString("TSCR: Loading Script Texts..."); + sLog->outString("TSCR: Loading Script Texts..."); LoadTrinityStrings("script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2)); - sLog.outString("TSCR: Loading Script Texts additional data..."); + sLog->outString("TSCR: Loading Script Texts additional data..."); uint32 oldMSTime = getMSTime(); QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts"); if (!result) { - sLog.outString(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); + sLog->outString(); return; } @@ -72,49 +72,49 @@ void SystemMgr::LoadScriptTexts() if (iId >= 0) { - sLog.outErrorDb("TSCR: Entry %i in table `script_texts` is not a negative value.", iId); + sLog->outErrorDb("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->outErrorDb("TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId); continue; } if (pTemp.uiSoundId) { if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) - sLog.outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); } if (!GetLanguageDescByID(pTemp.uiLanguage)) - sLog.outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + sLog->outErrorDb("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); if (pTemp.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, pTemp.uiType); + sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); m_mTextDataMap[iId] = pTemp; ++uiCount; } while (result->NextRow()); - sLog.outString(">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SystemMgr::LoadScriptTextsCustom() { - sLog.outString("TSCR: Loading Custom Texts..."); + sLog->outString("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->outString("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->outString(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); + sLog->outString(); return; } @@ -133,34 +133,34 @@ void SystemMgr::LoadScriptTextsCustom() if (iId >= 0) { - sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` is not a negative value.", iId); + sLog->outErrorDb("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->outErrorDb("TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId); continue; } if (pTemp.uiSoundId) { if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) - sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); } if (!GetLanguageDescByID(pTemp.uiLanguage)) - sLog.outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); if (pTemp.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, pTemp.uiType); + sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); m_mTextDataMap[iId] = pTemp; ++uiCount; } while (result->NextRow()); - sLog.outString(">> Loaded %u additional Custom Texts data.", uiCount); - sLog.outString(); + sLog->outString(">> Loaded %u additional Custom Texts data.", uiCount); + sLog->outString(); } void SystemMgr::LoadScriptWaypoints() @@ -177,14 +177,14 @@ void SystemMgr::LoadScriptWaypoints() if (result) uiCreatureCount = result->GetRowCount(); - sLog.outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); + sLog->outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); 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->outString(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); + sLog->outString(); return; } @@ -207,17 +207,17 @@ void SystemMgr::LoadScriptWaypoints() if (!pCInfo) { - sLog.outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.uiCreatureEntry); + sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.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.", pTemp.uiCreatureEntry); + sLog->outErrorDb("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry); m_mPointMoveMap[uiEntry].push_back(pTemp); ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } diff --git a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp b/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp index 5b18154103c..96c4602182b 100755 --- a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp @@ -98,7 +98,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket *Source, WorldPacket *Target) AddOnPacked >> enabled >> crc >> unk2; - sLog.outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2); + sLog->outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2); uint8 state = (enabled ? 2 : 1); *Target << uint8(state); @@ -131,11 +131,11 @@ bool AddonHandler::BuildAddonPacket(WorldPacket *Source, WorldPacket *Target) *Target << uint32(count); if(AddOnPacked.rpos() != AddOnPacked.size()) - sLog.outDebug("packet under read!"); + sLog->outDebug("packet under read!"); } else { - sLog.outError("Addon packet uncompress error :("); + sLog->outError("Addon packet uncompress error :("); return false; } return true; diff --git a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp index 9a211d49acf..51ac64411c1 100755 --- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp @@ -29,11 +29,11 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data) { - sLog.outDebug("MSG_INSPECT_ARENA_TEAMS"); + sLog->outDebug("MSG_INSPECT_ARENA_TEAMS"); uint64 guid; recv_data >> guid; - sLog.outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); if (Player *plr = sObjectMgr->GetPlayer(guid)) { @@ -50,7 +50,7 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_ARENA_TEAM_QUERY"); + sLog->outDebug("WORLD: Received CMSG_ARENA_TEAM_QUERY"); uint32 ArenaTeamId; recv_data >> ArenaTeamId; @@ -64,7 +64,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_ARENA_TEAM_ROSTER"); + sLog->outDebug("WORLD: Received CMSG_ARENA_TEAM_ROSTER"); uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; @@ -75,7 +75,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_ARENA_TEAM_INVITE"); + sLog->outDebug("CMSG_ARENA_TEAM_INVITE"); uint32 ArenaTeamId; // arena team id std::string Invitedname; @@ -89,7 +89,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) if (!normalizePlayerName(Invitedname)) return; - player = sObjectAccessor.FindPlayerByName(Invitedname.c_str()); + player = sObjectAccessor->FindPlayerByName(Invitedname.c_str()); } if (!player) @@ -98,7 +98,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) return; } - if (player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S); return; @@ -115,7 +115,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) return; - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam()) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); return; @@ -139,7 +139,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) return; } - sLog.outDebug("Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName(), Invitedname.c_str()); + sLog->outDebug("Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName(), Invitedname.c_str()); player->SetArenaTeamIdInvited(arenateam->GetId()); @@ -148,12 +148,12 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) data << arenateam->GetName(); player->GetSession()->SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_INVITE"); + sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_INVITE"); } void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode + sLog->outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode ArenaTeam *at = sObjectMgr->GetArenaTeamById(_player->GetArenaTeamIdInvited()); if (!at) @@ -166,7 +166,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) return; } - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(at->GetCaptain())) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && _player->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(at->GetCaptain())) { // not let enemies sign petition SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_NOT_ALLIED); @@ -186,14 +186,14 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("CMSG_ARENA_TEAM_DECLINE"); // empty opcode + sLog->outDebug("CMSG_ARENA_TEAM_DECLINE"); // empty opcode _player->SetArenaTeamIdInvited(0); // no more invited } void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_ARENA_TEAM_LEAVE"); + sLog->outDebug("CMSG_ARENA_TEAM_LEAVE"); uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; @@ -228,7 +228,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_ARENA_TEAM_DISBAND"); + sLog->outDebug("CMSG_ARENA_TEAM_DISBAND"); uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; @@ -248,7 +248,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_ARENA_TEAM_REMOVE"); + sLog->outDebug("CMSG_ARENA_TEAM_REMOVE"); uint32 ArenaTeamId; std::string name; @@ -290,7 +290,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_ARENA_TEAM_LEADER"); + sLog->outDebug("CMSG_ARENA_TEAM_LEADER"); uint32 ArenaTeamId; std::string name; diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index dbb55094de3..fe8dbbe1b24 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -40,7 +40,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!unit) { - sLog.outDebug("WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -54,9 +54,9 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) //this void causes that auction window is opened void WorldSession::SendAuctionHello(uint64 guid, Creature* unit) { - if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_AUCTION_LEVEL_REQ)) + if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld.getIntConfig(CONFIG_AUCTION_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_AUCTION_REQ), sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ)); return; } @@ -132,23 +132,23 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog.outDebug("WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug("WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); return; } AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(pCreature->getFaction()); if (!auctionHouseEntry) { - sLog.outDebug("WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug("WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", uint32(GUID_LOPART(auctioneer))); return; } - sLog.outDebug("WORLD: HandleAuctionSellItem - ETIME: %u", etime); + sLog->outDebug("WORLD: HandleAuctionSellItem - ETIME: %u", etime); // client send time in minutes, convert to common used sec time etime *= MINUTE; - sLog.outDebug("WORLD: HandleAuctionSellItem - ETIME: %u", etime); + sLog->outDebug("WORLD: HandleAuctionSellItem - ETIME: %u", etime); // client understand only 3 auction time switch(etime) @@ -169,7 +169,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) //do not allow to sell already auctioned items if (sAuctionMgr->GetAItem(GUID_LOPART(item))) { - sLog.outError("AuctionError, player %s is sending item id: %u, but item is already in another auction", pl->GetName(), GUID_LOPART(item)); + sLog->outError("AuctionError, player %s is sending item id: %u, but item is already in another auction", pl->GetName(), GUID_LOPART(item)); SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); return; } @@ -208,19 +208,19 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) return; } - if (GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", + sLog->outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),count); } pl->ModifyMoney(-int32(deposit)); - uint32 auction_time = uint32(etime * sWorld.getRate(RATE_AUCTION_TIME)); + uint32 auction_time = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME)); AuctionEntry *AH = new AuctionEntry; AH->Id = sObjectMgr->GenerateAuctionID(); - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) AH->auctioneer = 23442; else AH->auctioneer = GUID_LOPART(auctioneer); @@ -235,7 +235,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) AH->deposit = deposit; AH->auctionHouseEntry = auctionHouseEntry; - sLog.outDetail("selling item %u to auctioneer %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", GUID_LOPART(item), AH->auctioneer, bid, buyout, auction_time, AH->GetHouseId()); + sLog->outDetail("selling item %u to auctioneer %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", GUID_LOPART(item), AH->auctioneer, bid, buyout, auction_time, AH->GetHouseId()); sAuctionMgr->AddAItem(it); auctionHouse->AddAuction(AH); @@ -268,7 +268,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog.outDebug("WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug("WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); return; } @@ -381,12 +381,12 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) uint32 auctionId; recv_data >> auctioneer; recv_data >> auctionId; - //sLog.outDebug("Cancel AUCTION AuctionID: %u", auctionId); + //sLog->outDebug("Cancel AUCTION AuctionID: %u", auctionId); Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog.outDebug("WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug("WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); return; } @@ -425,7 +425,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) } else { - sLog.outError("Auction id: %u has non-existed item (item guid : %u)!!!", auction->Id, auction->item_guidlow); + sLog->outError("Auction id: %u has non-existed item (item guid : %u)!!!", auction->Id, auction->item_guidlow); SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR); return; } @@ -434,7 +434,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) { SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR); //this code isn't possible ... maybe there should be assert - sLog.outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", pl->GetGUIDLow(), auctionId); + sLog->outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", pl->GetGUIDLow(), auctionId); return; } @@ -464,14 +464,14 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) recv_data >> outbiddedCount; if (recv_data.size() != (16 + outbiddedCount * 4)) { - sLog.outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(),(16 + outbiddedCount * 4)); + sLog->outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(),(16 + outbiddedCount * 4)); outbiddedCount = 0; } Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog.outDebug("WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -518,7 +518,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog.outDebug("WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -571,7 +571,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog.outDebug("WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -581,7 +581,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->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("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)); @@ -609,7 +609,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) void WorldSession::HandleAuctionListPendingSales(WorldPacket & recv_data) { - sLog.outDebug("CMSG_AUCTION_LIST_PENDING_SALES"); + sLog->outDebug("CMSG_AUCTION_LIST_PENDING_SALES"); recv_data.read_skip(); diff --git a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp index 700053d430d..63e9a6f72bb 100755 --- a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp @@ -39,7 +39,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) { uint64 guid; recv_data >> guid; - sLog.outDebug("WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug("WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) @@ -86,7 +86,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { - sLog.outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u",bgTypeId_,_player->GetGUIDLow()); + sLog->outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u",bgTypeId_,_player->GetGUIDLow()); return; } @@ -98,7 +98,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_); - sLog.outDebug("WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug("WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); // can do this, since it's battleground, not arena BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, 0); @@ -189,7 +189,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); SendPacket(&data); - sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); + sLog->outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } else { @@ -208,7 +208,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (err > 0) { - sLog.outDebug("Battleground: the following players are joining as group:"); + sLog->outDebug("Battleground: the following players are joining as group:"); ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); } @@ -235,9 +235,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) member->GetSession()->SendPacket(&data); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); - sLog.outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); + sLog->outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); } - sLog.outDebug("Battleground: group end"); + sLog->outDebug("Battleground: group end"); } sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); @@ -246,7 +246,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_data*/) { // empty opcode - sLog.outDebug("WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); + sLog->outDebug("WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); Battleground *bg = _player->GetBattleground(); if (!bg) // can't be received if player not in battleground @@ -313,7 +313,7 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: Recvd MSG_PVP_LOG_DATA Message"); + sLog->outDebug("WORLD: Recvd MSG_PVP_LOG_DATA Message"); Battleground *bg = _player->GetBattleground(); if (!bg) @@ -323,12 +323,12 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) sBattlegroundMgr->BuildPvpLogDataPacket(&data, bg); SendPacket(&data); - sLog.outDebug("WORLD: Sent MSG_PVP_LOG_DATA Message"); + sLog->outDebug("WORLD: Sent MSG_PVP_LOG_DATA Message"); } void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); + sLog->outDebug("WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); uint32 bgTypeId; recv_data >> bgTypeId; // id from DBC @@ -342,7 +342,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); if (!bl) { - sLog.outError("Battleground: invalid bgtype received."); + sLog->outError("Battleground: invalid bgtype received."); return; } @@ -353,7 +353,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); + sLog->outDebug("WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); uint8 type; // arenatype if arena uint8 unk2; // unk, can be 0x0 (may be if was invited?) and 0x1 @@ -365,12 +365,12 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { - sLog.outError("BattlegroundHandler: invalid bgtype (%u) received.", bgTypeId_); + sLog->outError("BattlegroundHandler: invalid bgtype (%u) received.", bgTypeId_); return; } if (!_player->InBattlegroundQueue()) { - sLog.outError("BattlegroundHandler: Invalid CMSG_BATTLEFIELD_PORT received from player (%u), he is not in bg_queue.", _player->GetGUIDLow()); + sLog->outError("BattlegroundHandler: Invalid CMSG_BATTLEFIELD_PORT received from player (%u), he is not in bg_queue.", _player->GetGUIDLow()); return; } @@ -382,13 +382,13 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) { - sLog.outError("BattlegroundHandler: itrplayerstatus not found."); + sLog->outError("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("BattlegroundHandler: instance not found."); return; } @@ -399,7 +399,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId); if (!bg) { - sLog.outError("BattlegroundHandler: bg_template not found for type id %u.", bgTypeId); + sLog->outError("BattlegroundHandler: bg_template not found for type id %u.", bgTypeId); return; } @@ -419,12 +419,12 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; - sLog.outDebug("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); + sLog->outDebug("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); } //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("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; } @@ -470,7 +470,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) sBattlegroundMgr->SendToBattleground(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId); // add only in HandleMoveWorldPortAck() // bg->AddPlayer(_player,team); - sLog.outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); + sLog->outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); break; case 0: // leave queue // if player leaves rated arena match before match start, it is counted as he played but he lost @@ -479,7 +479,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) ArenaTeam * at = sObjectMgr->GetArenaTeamById(ginfo.Team); if (at) { - sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating); + sLog->outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating); at->MemberLost(_player, ginfo.OpponentsMatchmakerRating); at->SaveToDB(); } @@ -491,17 +491,17 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) if (!ginfo.ArenaType) sBattlegroundMgr->ScheduleQueueUpdate(ginfo.ArenaMatchmakerRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); SendPacket(&data); - sLog.outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); + sLog->outDebug("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("Battleground port: unknown action %u", action); break; } } void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); + sLog->outDebug("WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); recv_data.read_skip(); // unk1 recv_data.read_skip(); // unk2 @@ -520,7 +520,7 @@ void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) { // empty opcode - sLog.outDebug("WORLD: Battleground status"); + sLog->outDebug("WORLD: Battleground status"); WorldPacket data; // we must update all queues here @@ -583,7 +583,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); + sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); Battleground *bg = _player->GetBattleground(); @@ -604,7 +604,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); + sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); Battleground *bg = _player->GetBattleground(); @@ -625,7 +625,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); + sLog->outDebug("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); //recv_data.hexlike(); uint64 guid; // arena Battlemaster guid @@ -663,7 +663,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) arenatype = ARENA_TYPE_5v5; break; default: - sLog.outError("Unknown arena slot %u at HandleBattlemasterJoinArena()", arenaslot); + sLog->outError("Unknown arena slot %u at HandleBattlemasterJoinArena()", arenaslot); return; } @@ -671,7 +671,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(BATTLEGROUND_AA); if (!bg) { - sLog.outError("Battleground: template bg (all arenas) not found"); + sLog->outError("Battleground: template bg (all arenas) not found"); return; } @@ -738,10 +738,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) if (err > 0) { - sLog.outDebug("Battleground: arena join as group start"); + sLog->outDebug("Battleground: arena join as group start"); if (isRated) { - sLog.outDebug("Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),matchmakerRating,arenatype); + sLog->outDebug("Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),matchmakerRating,arenatype); bg->SetRated(true); } else @@ -774,7 +774,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) member->GetSession()->SendPacket(&data); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); - sLog.outDebug("Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); + sLog->outDebug("Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); } } else @@ -787,7 +787,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); SendPacket(&data); - sLog.outDebug("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); + sLog->outDebug("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } @@ -800,11 +800,11 @@ void WorldSession::HandleReportPvPAFK(WorldPacket & recv_data) if (!reportedPlayer) { - sLog.outDebug("WorldSession::HandleReportPvPAFK: player not found"); + sLog->outDebug("WorldSession::HandleReportPvPAFK: player not found"); return; } - sLog.outDebug("WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName(), reportedPlayer->GetName()); + sLog->outDebug("WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName(), reportedPlayer->GetName()); reportedPlayer->ReportedAfkBy(_player); } diff --git a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp index 9c13aba4109..364a245145c 100755 --- a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp @@ -27,7 +27,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty + sLog->outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty time_t cur_time = time(NULL); @@ -126,21 +126,21 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket & /*recv_data*/) } */ - sLog.outDebug("Sending calendar"); + sLog->outDebug("Sending calendar"); data.hexlike(); SendPacket(&data); } void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_GET_EVENT"); + sLog->outDebug("WORLD: CMSG_CALENDAR_GET_EVENT"); recv_data.hexlike(); recv_data.read_skip(); // unk } void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER"); + sLog->outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER"); recv_data.hexlike(); recv_data.read_skip(); // unk1 recv_data.read_skip(); // unk2 @@ -149,14 +149,14 @@ void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data) void WorldSession::HandleCalendarArenaTeam(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM"); + sLog->outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM"); recv_data.hexlike(); recv_data.read_skip(); // unk } void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_ADD_EVENT"); + sLog->outDebug("WORLD: CMSG_CALENDAR_ADD_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -192,7 +192,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarUpdateEvent(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_UPDATE_EVENT"); + sLog->outDebug("WORLD: CMSG_CALENDAR_UPDATE_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -211,7 +211,7 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarRemoveEvent(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_REMOVE_EVENT"); + sLog->outDebug("WORLD: CMSG_CALENDAR_REMOVE_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -223,7 +223,7 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarCopyEvent(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_COPY_EVENT"); + sLog->outDebug("WORLD: CMSG_CALENDAR_COPY_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -235,7 +235,7 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarEventInvite(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_INVITE"); + sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_INVITE"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -249,7 +249,7 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket &recv_data) void WorldSession::HandleCalendarEventRsvp(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_RSVP"); + sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_RSVP"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -261,7 +261,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket &recv_data) void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE"); + sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -273,7 +273,7 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket &recv_data) void WorldSession::HandleCalendarEventStatus(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_STATUS"); + sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_STATUS"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -286,7 +286,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket &recv_data) void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS"); + sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -299,7 +299,7 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket &recv_data) void WorldSession::HandleCalendarComplain(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_CALENDAR_COMPLAIN"); + sLog->outDebug("WORLD: CMSG_CALENDAR_COMPLAIN"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -310,7 +310,7 @@ void WorldSession::HandleCalendarComplain(WorldPacket &recv_data) void WorldSession::HandleCalendarGetNumPending(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty + sLog->outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4); data << uint32(0); // 0 - no pending invites, 1 - some pending invites diff --git a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp index c956a7deaee..a3ff1bc5fe0 100755 --- a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp @@ -21,7 +21,7 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); uint32 channel_id; uint8 unknown1, unknown2; @@ -60,7 +60,7 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); uint32 unk; @@ -81,7 +81,7 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) void WorldSession::HandleChannelList(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -93,7 +93,7 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, pass; recvPacket >> channelname; @@ -107,7 +107,7 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, newp; recvPacket >> channelname; @@ -124,7 +124,7 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -135,7 +135,7 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -152,7 +152,7 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -169,7 +169,7 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) void WorldSession::HandleChannelMute(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -186,7 +186,7 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; @@ -204,7 +204,7 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -221,7 +221,7 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) void WorldSession::HandleChannelKick(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -237,7 +237,7 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) void WorldSession::HandleChannelBan(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -254,7 +254,7 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket) void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; @@ -272,7 +272,7 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -289,7 +289,7 @@ void WorldSession::HandleChannelDisplayListQuery(WorldPacket &recvPacket) void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -308,7 +308,7 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) void WorldSession::HandleSetChannelWatch(WorldPacket &recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 1873de650f2..ec1ace4fffc 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -127,7 +127,7 @@ bool LoginQueryHolder::Initialize() stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADSPELLCOOLDOWNS, stmt); - if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED)) + if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_DECLINEDNAMES); stmt->setUInt32(0, lowGuid); @@ -202,7 +202,7 @@ void WorldSession::HandleCharEnum(QueryResult result) do { uint32 guidlow = (*result)[0].GetUInt32(); - sLog.outDetail("Loading char guid %u from account %u.",guidlow,GetAccountId()); + sLog->outDetail("Loading char guid %u from account %u.",guidlow,GetAccountId()); if (Player::BuildEnumData(result, &data)) ++num; } @@ -223,7 +223,7 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/) /// get all the data necessary for loading all characters (along with their pets) on the account m_charEnumCallback = CharacterDatabase.AsyncPQuery( - !sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) ? + !sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) ? // ------- Query Without Declined Names -------- // 0 1 2 3 4 5 6 7 "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, " @@ -266,7 +266,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) if (GetSecurity() == SEC_PLAYER) { - if (uint32 mask = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED)) + if (uint32 mask = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED)) { bool disabled = false; @@ -293,7 +293,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) { data << (uint8)CHAR_CREATE_FAILED; SendPacket(&data); - sLog.outError("Class: %u or Race %u not found in DBC (Wrong DBC files?) or Cheater?", class_, race_); + sLog->outError("Class: %u or Race %u not found in DBC (Wrong DBC files?) or Cheater?", class_, race_); return; } @@ -301,7 +301,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) 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("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)",Expansion(),GetAccountId(),raceEntry->expansion,race_); SendPacket(&data); return; } @@ -310,14 +310,14 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) 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("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)",Expansion(),GetAccountId(),classEntry->expansion,class_); SendPacket(&data); return; } if (GetSecurity() == SEC_PLAYER) { - uint32 raceMaskDisabled = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK); + uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK); if ((1 << (race_ - 1)) & raceMaskDisabled) { data << uint8(CHAR_CREATE_DISABLED); @@ -325,7 +325,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) return; } - uint32 classMaskDisabled = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK); + uint32 classMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK); if ((1 << (class_ - 1)) & classMaskDisabled) { data << uint8(CHAR_CREATE_DISABLED); @@ -339,7 +339,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) { data << (uint8)CHAR_NAME_NO_NAME; SendPacket(&data); - sLog.outError("Account:[%d] but tried to Create character with empty [name] ",GetAccountId()); + sLog->outError("Account:[%d] but tried to Create character with empty [name] ",GetAccountId()); return; } @@ -372,7 +372,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) Field *fields = resultacct->Fetch(); uint32 acctcharcount = fields[0].GetUInt32(); - if (acctcharcount >= sWorld.getIntConfig(CONFIG_CHARACTERS_PER_ACCOUNT)) + if (acctcharcount >= sWorld->getIntConfig(CONFIG_CHARACTERS_PER_ACCOUNT)) { data << (uint8)CHAR_CREATE_ACCOUNT_LIMIT; SendPacket(&data); @@ -387,7 +387,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) Field *fields=result->Fetch(); charcount = fields[0].GetUInt8(); - if (charcount >= sWorld.getIntConfig(CONFIG_CHARACTERS_PER_REALM)) + if (charcount >= sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM)) { data << (uint8)CHAR_CREATE_SERVER_LIMIT; SendPacket(&data); @@ -396,7 +396,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) } // speedup check for heroic class disabled case - uint32 heroic_free_slots = sWorld.getIntConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM); + uint32 heroic_free_slots = sWorld->getIntConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM); if (heroic_free_slots == 0 && GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT) { data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT; @@ -405,16 +405,16 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) } // speedup check for heroic class disabled case - uint32 req_level_for_heroic = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER); - if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + uint32 req_level_for_heroic = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER); + if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT; SendPacket(&data); return; } - bool AllowTwoSideAccounts = !sWorld.IsPvPRealm() || sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER; - uint32 skipCinematics = sWorld.getIntConfig(CONFIG_SKIP_CINEMATICS); + bool AllowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER; + uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS); bool have_same_race = false; @@ -528,7 +528,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) { uint8 unk; recv_data >> unk; - sLog.outDebug("Character creation %s (account %u) has unhandled tail data: [%u]", name.c_str(), GetAccountId(), unk); + sLog->outDebug("Character creation %s (account %u) has unhandled tail data: [%u]", name.c_str(), GetAccountId(), unk); } Player * pNewChar = new Player(this); @@ -562,8 +562,8 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) SendPacket(&data); std::string IP_str = GetRemoteAddress(); - sLog.outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow()); - sLog.outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow()); + sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), pNewChar->GetGUIDLow()); sScriptMgr->OnPlayerCreate(pNewChar); delete pNewChar; // created only to call SaveToDB() @@ -612,15 +612,15 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) 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->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)); sScriptMgr->OnPlayerDelete(guid); - if (sLog.IsOutCharDump()) // optimize GetPlayerDump call + if (sLog->IsOutCharDump()) // 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->outCharDump(dump.c_str(),GetAccountId(),GUID_LOPART(guid),name.c_str()); } Player::DeleteFromDB(guid, GetAccountId()); @@ -634,14 +634,14 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) { if (PlayerLoading() || GetPlayer() != NULL) { - sLog.outError("Player tryes to login again, AccountId = %d",GetAccountId()); + sLog->outError("Player tryes to login again, AccountId = %d",GetAccountId()); return; } m_playerLoading = true; uint64 playerGuid = 0; - sLog.outStaticDebug("WORLD: Recvd Player Logon Message"); + sLog->outStaticDebug("WORLD: Recvd Player Logon Message"); recv_data >> playerGuid; @@ -703,7 +703,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) data << (uint32)0; uint32 linecount=0; - std::string str_motd = sWorld.GetMotd(); + std::string str_motd = sWorld->GetMotd(); std::string::size_type pos, nextpos; pos = 0; @@ -726,13 +726,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) data.put(0, linecount); SendPacket(&data); - sLog.outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); + sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); // send server info - if (sWorld.getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) + if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) chH.PSendSysMessage(_FULLVERSION); - sLog.outStaticDebug("WORLD: Sent server info"); + sLog->outStaticDebug("WORLD: Sent server info"); } //QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow()); @@ -755,7 +755,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("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); } } @@ -780,8 +780,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) pCurrChar->SendCinematicStart(rEntry->CinematicSequence); // send new char string if not empty - if (!sWorld.GetNewCharString().empty()) - chH.PSendSysMessage("%s", sWorld.GetNewCharString().c_str()); + if (!sWorld->GetNewCharString().empty()) + chH.PSendSysMessage("%s", sWorld->GetNewCharString().c_str()); } } @@ -794,8 +794,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation()); } - sObjectAccessor.AddObject(pCurrChar); - //sLog.outDebug("Player %s added to Map.",pCurrChar->GetName()); + sObjectAccessor->AddObject(pCurrChar); + //sLog->outDebug("Player %s added to Map.",pCurrChar->GetName()); pCurrChar->SendInitialPacketsAfterAddToMap(); @@ -838,7 +838,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) pCurrChar->LoadPet(); // Set FFA PvP for non GM in non-rest mode - if (sWorld.IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_RESTING)) + if (sWorld->IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_RESTING)) pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); if (pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) @@ -862,17 +862,17 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST); // show time before shutdown if shutdown planned. - if (sWorld.IsShutdowning()) - sWorld.ShutdownMsg(true,pCurrChar); + if (sWorld->IsShutdowning()) + sWorld->ShutdownMsg(true,pCurrChar); - if (sWorld.getBoolConfig(CONFIG_ALL_TAXI_PATHS)) + if (sWorld->getBoolConfig(CONFIG_ALL_TAXI_PATHS)) pCurrChar->SetTaxiCheater(true); if (pCurrChar->isGameMaster()) SendNotification(LANG_GM_ON); std::string IP_str = GetRemoteAddress(); - sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", + sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUIDLow()); if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STAT_STUNNED)) @@ -886,7 +886,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data) { - sLog.outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR"); + sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR"); uint32 repListID; uint8 flag; @@ -900,7 +900,7 @@ void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data) //I think this function is never used :/ I dunno, but i guess this opcode not exists void WorldSession::HandleSetFactionCheat(WorldPacket & /*recv_data*/) { - sLog.outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report."); + sLog->outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report."); /* uint32 FactionID; uint32 Standing; @@ -925,7 +925,7 @@ void WorldSession::HandleSetFactionCheat(WorldPacket & /*recv_data*/) void WorldSession::HandleMeetingStoneInfo(WorldPacket & /*recv_data*/) { - sLog.outStaticDebug("WORLD: Received CMSG_MEETING_STONE_INFO"); + sLog->outStaticDebug("WORLD: Received CMSG_MEETING_STONE_INFO"); //SendLfgUpdate(0, 0, 0); } @@ -938,7 +938,7 @@ void WorldSession::HandleTutorialFlag(WorldPacket & recv_data) uint32 wInt = (iFlag / 32); if (wInt >= 8) { - //sLog.outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID()); + //sLog->outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID()); return; } uint32 rInt = (iFlag % 32); @@ -947,7 +947,7 @@ void WorldSession::HandleTutorialFlag(WorldPacket & recv_data) tutflag |= (1 << rInt); SetTutorialInt(wInt, tutflag); - //sLog.outDebug("Received Tutorial Flag Set {%u}.", iFlag); + //sLog->outDebug("Received Tutorial Flag Set {%u}.", iFlag); } void WorldSession::HandleTutorialClear(WorldPacket & /*recv_data*/) @@ -964,7 +964,7 @@ void WorldSession::HandleTutorialReset(WorldPacket & /*recv_data*/) void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data) { - sLog.outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION"); + sLog->outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION"); uint32 fact; recv_data >> fact; GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact); @@ -972,7 +972,7 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data) void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data) { - sLog.outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE"); + sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE"); uint32 replistid; uint8 inactive; recv_data >> replistid >> inactive; @@ -982,13 +982,13 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data) void WorldSession::HandleShowingHelmOpcode(WorldPacket & /*recv_data*/) { - sLog.outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName()); + sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName()); _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM); } void WorldSession::HandleShowingCloakOpcode(WorldPacket & /*recv_data*/) { - sLog.outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName()); + sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName()); _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK); } @@ -1058,7 +1058,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult result, std: CharacterDatabase.PExecute("UPDATE characters set name = '%s', at_login = at_login & ~ %u WHERE guid ='%u'", newname.c_str(), uint32(AT_LOGIN_RENAME), guidLow); CharacterDatabase.PExecute("DELETE FROM character_declinedname WHERE guid ='%u'", guidLow); - 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->outChar("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); @@ -1156,7 +1156,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) { - sLog.outDebug("CMSG_ALTER_APPEARANCE"); + sLog->outDebug("CMSG_ALTER_APPEARANCE"); uint32 Hair, Color, FacialHair, SkinColor; recv_data >> Hair >> Color >> FacialHair >> SkinColor; @@ -1216,7 +1216,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data) if (slot >= MAX_GLYPH_SLOT_INDEX) { - sLog.outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); + sLog->outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); return; } @@ -1306,7 +1306,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) { std::string oldname = result->Fetch()[0].GetString(); std::string IP_str = GetRemoteAddress(); - sLog.outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), IP_str.c_str(), oldname.c_str(), GUID_LOPART(guid), newname.c_str()); + sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), IP_str.c_str(), oldname.c_str(), GUID_LOPART(guid), newname.c_str()); } Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair); CharacterDatabase.PExecute("UPDATE characters set name = '%s', at_login = at_login & ~ %u WHERE guid ='%u'", newname.c_str(), uint32(AT_LOGIN_CUSTOMIZE), GUID_LOPART(guid)); @@ -1327,7 +1327,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) { - sLog.outDebug("CMSG_EQUIPMENT_SET_SAVE"); + sLog->outDebug("CMSG_EQUIPMENT_SET_SAVE"); uint64 setGuid; recv_data.readPackGUID(setGuid); @@ -1371,7 +1371,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data) { - sLog.outDebug("CMSG_EQUIPMENT_SET_DELETE"); + sLog->outDebug("CMSG_EQUIPMENT_SET_DELETE"); uint64 setGuid; recv_data.readPackGUID(setGuid); @@ -1381,7 +1381,7 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) { - sLog.outDebug("CMSG_EQUIPMENT_SET_USE"); + sLog->outDebug("CMSG_EQUIPMENT_SET_USE"); recv_data.hexlike(); for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) @@ -1392,7 +1392,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) uint8 srcbag, srcslot; recv_data >> srcbag >> srcslot; - sLog.outDebug("Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); + sLog->outDebug("Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); Item *item = _player->GetItemByGuid(itemGuid); @@ -1472,7 +1472,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (GetSecurity() == SEC_PLAYER) { - uint32 raceMaskDisabled = sWorld.getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK); + uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK); if ((1 << (race - 1)) & raceMaskDisabled) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); @@ -1671,13 +1671,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) trans->PAppend("DELETE FROM `character_queststatus` WHERE guid='%u' AND quest IN (%s)", lowGuid, questsStr.c_str()); } - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) { // Reset guild trans->PAppend("DELETE FROM `guild_member` WHERE `guid`= '%u'", lowGuid); } - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND)) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND)) { // Delete Friend List trans->PAppend("DELETE FROM `character_social` WHERE `guid`= '%u'", lowGuid); @@ -1746,7 +1746,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) CharacterDatabase.CommitTransaction(trans); std::string IP_str = GetRemoteAddress(); - sLog.outDebug("Account: %d (IP: %s), Character guid: %u Change Race/Faction to: %s", GetAccountId(), IP_str.c_str(), lowGuid, newname.c_str()); + sLog->outDebug("Account: %d (IP: %s), Character guid: %u Change Race/Faction to: %s", GetAccountId(), IP_str.c_str(), lowGuid, newname.c_str()); WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1 + 8 + (newname.size() + 1) + 1 + 1 + 1 + 1 + 1 + 1 + 1); data << uint8(RESPONSE_SUCCESS); diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index d236c7f0196..cb1969c5b32 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -44,15 +44,15 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg if (lang != LANG_ADDON) { // strip invisible characters for non-addon messages - if (sWorld.getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING)) + if (sWorld->getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING)) stripLineInvisibleChars(msg); - if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR + if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR && !ChatHandler(this).isValidChatMessage(msg.c_str())) { - sLog.outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(), + sLog->outError("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)) + if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_KICK)) KickPlayer(); return false; } @@ -71,11 +71,11 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (type >= MAX_CHAT_MSG_TYPE) { - sLog.outError("CHAT: Wrong message type received: %u", type); + sLog->outError("CHAT: Wrong message type received: %u", type); return; } - //sLog.outDebug("CHAT: packet received. type %u, lang %u", type, lang); + //sLog->outDebug("CHAT: packet received. type %u, lang %u", type, lang); // prevent talking at unknown language (cheating) LanguageDesc const* langDesc = GetLanguageDescByID(lang); @@ -106,14 +106,14 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (lang == LANG_ADDON) { - if (sWorld.getBoolConfig(CONFIG_CHATLOG_ADDON)) + if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) { std::string msg = ""; recv_data >> msg; if (msg.empty()) { - sLog.outDebug("Player %s send empty addon msg", GetPlayer()->GetName()); + sLog->outDebug("Player %s send empty addon msg", GetPlayer()->GetName()); return; } @@ -121,7 +121,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) } // Disabled addon channel? - if (!sWorld.getBoolConfig(CONFIG_ADDON_CHANNEL)) + if (!sWorld->getBoolConfig(CONFIG_ADDON_CHANNEL)) return; } // LANG_ADDON should not be changed nor be affected by flood control @@ -133,7 +133,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) else { // send in universal language in two side iteration allowed mode - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) lang = LANG_UNIVERSAL; else { @@ -145,13 +145,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) case CHAT_MSG_RAID_LEADER: case CHAT_MSG_RAID_WARNING: // allow two side chat at group channel if two side group allowed - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) lang = LANG_UNIVERSAL; break; case CHAT_MSG_GUILD: case CHAT_MSG_OFFICER: // allow two side chat at guild channel if two side guild allowed - if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) lang = LANG_UNIVERSAL; break; } @@ -237,9 +237,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) case CHAT_MSG_EMOTE: case CHAT_MSG_YELL: { - if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)) + if (_player->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld.getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ)); return; } @@ -252,9 +252,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) } break; case CHAT_MSG_WHISPER: { - if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)) + if (_player->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld.getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ)); return; } @@ -273,7 +273,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) return; } - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER) { uint32 sidea = GetPlayer()->GetTeam(); uint32 sideb = player->GetTeam(); @@ -412,9 +412,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) } break; case CHAT_MSG_CHANNEL: { - if (_player->getLevel() < sWorld.getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) + if (_player->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld.getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ)); return; } @@ -466,7 +466,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) } } break; default: - sLog.outError("CHAT: unknown message type %u, lang: %u", type, lang); + sLog->outError("CHAT: unknown message type %u, lang: %u", type, lang); break; } } @@ -566,9 +566,9 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) Trinity::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit); Trinity::LocalizedPacketDo emote_do(emote_builder); - Trinity::PlayerDistWorker > emote_worker(GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); + Trinity::PlayerDistWorker > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do); TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); - cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); + cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); @@ -581,7 +581,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data) { uint64 iguid; uint8 unk; - //sLog.outDebug("WORLD: Received CMSG_CHAT_IGNORED"); + //sLog->outDebug("WORLD: Received CMSG_CHAT_IGNORED"); recv_data >> iguid; recv_data >> unk; // probably related to spam reporting @@ -597,7 +597,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data) void WorldSession::HandleChannelDeclineInvite(WorldPacket &recvPacket) { - sLog.outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); } void WorldSession::SendPlayerNotFoundNotice(std::string name) diff --git a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp b/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp index 146255493e3..8c8faf80b60 100755 --- a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp @@ -29,16 +29,16 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - sLog.outStaticDebug("WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid)); + sLog->outStaticDebug("WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid)); Unit *pEnemy = ObjectAccessor::GetUnit(*_player, guid); if (!pEnemy) { if (!IS_UNIT_GUID(guid)) - sLog.outError("WORLD: Object %u (TypeID: %u) isn't player, pet or creature",GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outError("WORLD: Object %u (TypeID: %u) isn't player, pet or creature",GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); else - sLog.outError("WORLD: Enemy %s %u not found",GetLogNameForGuid(guid),GUID_LOPART(guid)); + sLog->outError("WORLD: Enemy %s %u not found",GetLogNameForGuid(guid),GUID_LOPART(guid)); // stop attack state at client SendAttackStop(NULL); @@ -47,7 +47,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket & recv_data) if (!_player->canAttack(pEnemy)) { - sLog.outError("WORLD: Enemy %s %u is friendly",(IS_PLAYER_GUID(guid) ? "player" : "creature"),GUID_LOPART(guid)); + sLog->outError("WORLD: Enemy %s %u is friendly",(IS_PLAYER_GUID(guid) ? "player" : "creature"),GUID_LOPART(guid)); // stop attack state at client SendAttackStop(pEnemy); @@ -67,11 +67,11 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket & recv_data) uint32 sheathed; recv_data >> sheathed; - //sLog.outDebug("WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); + //sLog->outDebug("WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); if (sheathed >= MAX_SHEATH_STATE) { - sLog.outError("Unknown sheath state %u ??",sheathed); + sLog->outError("Unknown sheath state %u ??",sheathed); return; } diff --git a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp b/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp index 580ccbca660..bbc646f55e3 100755 --- a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp @@ -41,9 +41,9 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) if (pl == pl->duel->initiator || !plTarget || pl == plTarget || pl->duel->startTime != 0 || plTarget->duel->startTime != 0) return; - //sLog.outDebug("WORLD: received CMSG_DUEL_ACCEPTED"); - sLog.outStaticDebug("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName()); - sLog.outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName()); + //sLog->outDebug("WORLD: received CMSG_DUEL_ACCEPTED"); + sLog->outStaticDebug("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName()); + sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName()); time_t now = time(NULL); pl->duel->startTimer = now; @@ -55,7 +55,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) { - //sLog.outDebug("WORLD: received CMSG_DUEL_CANCELLED"); + //sLog->outDebug("WORLD: received CMSG_DUEL_CANCELLED"); // no duel requested if (!GetPlayer()->duel) diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index cc395d4e5b7..0064181d2d0 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -80,11 +80,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) } // restrict invite to GMs - if (!sWorld.getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster()) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster()) return; // can't group with - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) { SendPartyResult(PARTY_OP_INVITE, membername, ERR_PLAYER_WRONG_FACTION); return; @@ -197,7 +197,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) 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("HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); return; } @@ -262,7 +262,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data) //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("WorldSession::HandleGroupUninviteGuidOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); return; } @@ -304,7 +304,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data) // 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("WorldSession::HandleGroupUninviteOpcode: leader %s(%d) tried to uninvite himself from the group.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); return; } @@ -410,7 +410,7 @@ void WorldSession::HandleLootRoll(WorldPacket &recv_data) recv_data >> NumberOfPlayers; recv_data >> rollType; //0: pass, 1: need, 2: greed - //sLog.outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise); + //sLog->outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise); Group* group = GetPlayer()->GetGroup(); if (!group) @@ -439,7 +439,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) recv_data >> x; recv_data >> y; - //sLog.outDebug("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y); + //sLog->outDebug("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y); /** error handling **/ /********************/ @@ -466,7 +466,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) // everything's fine, do it roll = urand(minimum, maximum); - //sLog.outDebug("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll); + //sLog->outDebug("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll); WorldPacket data(MSG_RANDOM_ROLL, 4+4+4+8); data << uint32(minimum); @@ -586,7 +586,7 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) { - sLog.outDebug("MSG_PARTY_ASSIGNMENT"); + sLog->outDebug("MSG_PARTY_ASSIGNMENT"); Group *group = GetPlayer()->GetGroup(); if (!group) @@ -828,7 +828,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke /*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); + sLog->outDebug("WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); uint64 Guid; recv_data >> Guid; @@ -924,12 +924,12 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) /*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: got CMSG_GROUP_CANCEL."); + sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL."); }*/ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_OPT_OUT_OF_LOOT"); + sLog->outDebug("WORLD: Received CMSG_OPT_OUT_OF_LOOT"); uint32 passOnLoot; recv_data >> passOnLoot; // 1 always pass, 0 do not pass @@ -938,7 +938,7 @@ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data) if (!GetPlayer()) // needed because STATUS_AUTHED { if (passOnLoot != 0) - sLog.outError("CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!"); + sLog->outError("CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!"); return; } diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index cbd443ec4fe..a6edee2701e 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -41,7 +41,7 @@ inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false) void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_QUERY"); + sLog->outDebug("WORLD: Received CMSG_GUILD_QUERY"); uint32 guildId; recvPacket >> guildId; @@ -54,7 +54,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_CREATE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_CREATE"); std::string name; recvPacket >> name; @@ -71,7 +71,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_INVITE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_INVITE"); std::string invitedName; recvPacket >> invitedName; @@ -83,7 +83,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_REMOVE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_REMOVE"); std::string playerName; recvPacket >> playerName; @@ -95,7 +95,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_GUILD_ACCEPT"); + sLog->outDebug("WORLD: Received CMSG_GUILD_ACCEPT"); // Player cannot be in guild if (!GetPlayer()->GetGuildId()) // Guild where player was invited must exist @@ -105,7 +105,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_GUILD_DECLINE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_DECLINE"); GetPlayer()->SetGuildIdInvited(0); GetPlayer()->SetInGuild(0); @@ -113,7 +113,7 @@ void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_GUILD_INFO"); + sLog->outDebug("WORLD: Received CMSG_GUILD_INFO"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->SendInfo(this); @@ -121,7 +121,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_GUILD_ROSTER"); + sLog->outDebug("WORLD: Received CMSG_GUILD_ROSTER"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->HandleRoster(this); @@ -129,7 +129,7 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_PROMOTE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_PROMOTE"); std::string playerName; recvPacket >> playerName; @@ -141,7 +141,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_DEMOTE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_DEMOTE"); std::string playerName; recvPacket >> playerName; @@ -153,7 +153,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_LEAVE"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->HandleLeaveMember(this); @@ -161,7 +161,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_GUILD_DISBAND"); + sLog->outDebug("WORLD: Received CMSG_GUILD_DISBAND"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->HandleDisband(this); @@ -169,7 +169,7 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_LEADER"); + sLog->outDebug("WORLD: Received CMSG_GUILD_LEADER"); std::string name; recvPacket >> name; @@ -181,7 +181,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_MOTD"); + sLog->outDebug("WORLD: Received CMSG_GUILD_MOTD"); std::string motd; // Empty by default if (!recvPacket.empty()) @@ -193,7 +193,7 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE"); std::string playerName; recvPacket >> playerName; @@ -208,7 +208,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_SET_OFFICER_NOTE"); + sLog->outDebug("WORLD: Received CMSG_GUILD_SET_OFFICER_NOTE"); std::string playerName; recvPacket >> playerName; @@ -223,7 +223,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_RANK"); + sLog->outDebug("WORLD: Received CMSG_GUILD_RANK"); Guild* pGuild = _GetPlayerGuild(this, true); if (!pGuild) @@ -261,7 +261,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_ADD_RANK"); + sLog->outDebug("WORLD: Received CMSG_GUILD_ADD_RANK"); std::string rankName; recvPacket >> rankName; @@ -272,7 +272,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_GUILD_DEL_RANK"); + sLog->outDebug("WORLD: Received CMSG_GUILD_DEL_RANK"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->HandleRemoveLowestRank(this); @@ -280,7 +280,7 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received CMSG_GUILD_INFO_TEXT"); + sLog->outDebug("WORLD: Received CMSG_GUILD_INFO_TEXT"); std::string info; recvPacket >> info; @@ -291,7 +291,7 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: Received MSG_SAVE_GUILD_EMBLEM"); + sLog->outDebug("WORLD: Received MSG_SAVE_GUILD_EMBLEM"); uint64 vendorGuid; recvPacket >> vendorGuid; @@ -315,13 +315,13 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) { // "That's not an emblem vendor!" Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_INVALIDVENDOR); - sLog.outDebug("WORLD: HandleSaveGuildEmblemOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(vendorGuid)); + sLog->outDebug("WORLD: HandleSaveGuildEmblemOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(vendorGuid)); } } void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) { - sLog.outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)"); + sLog->outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->SendEventLog(this); @@ -329,7 +329,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) { - sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); + sLog->outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->SendMoneyInfo(this); @@ -337,7 +337,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) { - sLog.outDebug("WORLD: Received (MSG_GUILD_PERMISSIONS)"); + sLog->outDebug("WORLD: Received (MSG_GUILD_PERMISSIONS)"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->SendPermissions(this); @@ -346,7 +346,7 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) // Called when clicking on Guild bank gameobject void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)"); + sLog->outDebug("WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)"); uint64 GoGuid; recv_data >> GoGuid; @@ -366,7 +366,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) // Called when opening pGuild bank tab only (first one) void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)"); + sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)"); uint64 GoGuid; recv_data >> GoGuid; @@ -384,7 +384,7 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)"); + sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)"); uint64 GoGuid; recv_data >> GoGuid; @@ -400,7 +400,7 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_WITHDRAW_MONEY)"); + sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_WITHDRAW_MONEY)"); uint64 GoGuid; recv_data >> GoGuid; @@ -416,7 +416,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data) void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_SWAP_ITEMS)"); + sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_SWAP_ITEMS)"); uint64 GoGuid; recv_data >> GoGuid; @@ -497,7 +497,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_BUY_TAB)"); + sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_BUY_TAB)"); uint64 GoGuid; recv_data >> GoGuid; @@ -512,7 +512,7 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (CMSG_GUILD_BANK_UPDATE_TAB)"); + sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_UPDATE_TAB)"); uint64 GoGuid; recv_data >> GoGuid; @@ -534,7 +534,7 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)"); + sLog->outDebug("WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)"); uint8 tabId; recv_data >> tabId; @@ -545,7 +545,7 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data) void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Received MSG_QUERY_GUILD_BANK_TEXT"); + sLog->outDebug("WORLD: Received MSG_QUERY_GUILD_BANK_TEXT"); uint8 tabId; recv_data >> tabId; @@ -556,7 +556,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Received CMSG_SET_GUILD_BANK_TEXT"); + sLog->outDebug("WORLD: Received CMSG_SET_GUILD_BANK_TEXT"); uint8 tabId; recv_data >> tabId; diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index c3a1f66012c..b1aec467db5 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -29,12 +29,12 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_SPLIT_ITEM"); + //sLog->outDebug("WORLD: CMSG_SPLIT_ITEM"); uint8 srcbag, srcslot, dstbag, dstslot; uint32 count; recv_data >> srcbag >> srcslot >> dstbag >> dstslot >> count; - //sLog.outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); + //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); uint16 src = ((srcbag << 8) | srcslot); uint16 dst = ((dstbag << 8) | dstslot); @@ -62,11 +62,11 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_SWAP_INV_ITEM"); + //sLog->outDebug("WORLD: CMSG_SWAP_INV_ITEM"); uint8 srcslot, dstslot; recv_data >> dstslot >> srcslot; - //sLog.outDebug("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot); + //sLog->outDebug("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot); // prevent attempt swap same item to current position generated by client at special checting sequence if (srcslot == dstslot) @@ -111,11 +111,11 @@ void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleSwapItem(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_SWAP_ITEM"); + //sLog->outDebug("WORLD: CMSG_SWAP_ITEM"); uint8 dstbag, dstslot, srcbag, srcslot; recv_data >> dstbag >> dstslot >> srcbag >> srcslot ; - //sLog.outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); + //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); uint16 src = ((srcbag << 8) | srcslot); uint16 dst = ((dstbag << 8) | dstslot); @@ -141,11 +141,11 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data) void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_AUTOEQUIP_ITEM"); + //sLog->outDebug("WORLD: CMSG_AUTOEQUIP_ITEM"); uint8 srcbag, srcslot; recv_data >> srcbag >> srcslot; - //sLog.outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); + //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); Item *pSrcItem = _player->GetItemByPos(srcbag, srcslot); if (!pSrcItem) @@ -235,11 +235,11 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_DESTROYITEM"); + //sLog->outDebug("WORLD: CMSG_DESTROYITEM"); uint8 bag, slot, count, data1, data2, data3; recv_data >> bag >> slot >> count >> data1 >> data2 >> data3; - //sLog.outDebug("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count); + //sLog->outDebug("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count); uint16 pos = (bag << 8) | slot; @@ -279,11 +279,11 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) // Only _static_ data send in this packet !!! void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_ITEM_QUERY_SINGLE"); + //sLog->outDebug("WORLD: CMSG_ITEM_QUERY_SINGLE"); uint32 item; recv_data >> item; - sLog.outDetail("STORAGE: Item Query = %u", item); + sLog->outDetail("STORAGE: Item Query = %u", item); ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item); if (pProto) @@ -429,7 +429,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) } else { - sLog.outDebug("WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); + sLog->outDebug("WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); WorldPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4); data << uint32(item | 0x80000000); SendPacket(&data); @@ -438,12 +438,12 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) void WorldSession::HandleReadItem(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_READ_ITEM"); + //sLog->outDebug("WORLD: CMSG_READ_ITEM"); uint8 bag, slot; recv_data >> bag >> slot; - //sLog.outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); + //sLog->outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); Item *pItem = _player->GetItemByPos(bag, slot); if (pItem && pItem->GetProto()->PageText) @@ -454,12 +454,12 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) if (msg == EQUIP_ERR_OK) { data.Initialize (SMSG_READ_ITEM_OK, 8); - sLog.outDetail("STORAGE: Item page sent"); + sLog->outDetail("STORAGE: Item page sent"); } else { data.Initialize(SMSG_READ_ITEM_FAILED, 8); - sLog.outDetail("STORAGE: Unable to read item"); + sLog->outDetail("STORAGE: Unable to read item"); _player->SendEquipError(msg, pItem, NULL); } data << pItem->GetGUID(); @@ -471,20 +471,20 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_PAGE_TEXT_QUERY"); + sLog->outDebug("WORLD: Received CMSG_PAGE_TEXT_QUERY"); uint32 itemid; uint64 guid; recv_data >> itemid >> guid; - sLog.outDetail("Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u", + sLog->outDetail("Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u", itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid)); } void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_SELL_ITEM"); + sLog->outDebug("WORLD: Received CMSG_SELL_ITEM"); uint64 vendorguid, itemguid; uint32 count; @@ -496,7 +496,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog.outDebug("WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug("WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0); return; } @@ -554,7 +554,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) 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("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count); _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0); return; } @@ -592,7 +592,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) void WorldSession::HandleBuybackItem(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_BUYBACK_ITEM"); + sLog->outDebug("WORLD: Received CMSG_BUYBACK_ITEM"); uint64 vendorguid; uint32 slot; @@ -601,7 +601,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog.outDebug("WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug("WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); return; } @@ -640,7 +640,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); + sLog->outDebug("WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); uint64 vendorguid, bagguid; uint32 item, slot, count; uint8 bagslot; @@ -682,7 +682,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_BUY_ITEM"); + sLog->outDebug("WORLD: Received CMSG_BUY_ITEM"); uint64 vendorguid; uint32 item, slot, count; uint8 unk1; @@ -707,19 +707,19 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog.outDebug("WORLD: Recvd CMSG_LIST_INVENTORY"); + sLog->outDebug("WORLD: Recvd CMSG_LIST_INVENTORY"); SendListInventory(guid); } void WorldSession::SendListInventory(uint64 vendorguid) { - sLog.outDebug("WORLD: Sent SMSG_LIST_INVENTORY"); + sLog->outDebug("WORLD: Sent SMSG_LIST_INVENTORY"); Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog.outDebug("WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug("WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); return; } @@ -796,11 +796,11 @@ void WorldSession::SendListInventory(uint64 vendorguid) void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) { - //sLog.outDebug("WORLD: CMSG_AUTOSTORE_BAG_ITEM"); + //sLog->outDebug("WORLD: CMSG_AUTOSTORE_BAG_ITEM"); uint8 srcbag, srcslot, dstbag; recv_data >> srcbag >> srcslot >> dstbag; - //sLog.outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); + //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); Item *pItem = _player->GetItemByPos(srcbag, srcslot); if (!pItem) @@ -847,7 +847,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: CMSG_BUY_BANK_SLOT"); + sLog->outDebug("WORLD: CMSG_BUY_BANK_SLOT"); uint64 guid; recvPacket >> guid; @@ -857,7 +857,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER); if (!pCreature) { - sLog.outDebug("WORLD: HandleBuyBankSlotOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleBuyBankSlotOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } */ @@ -867,7 +867,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) // next slot ++slot; - sLog.outDetail("PLAYER: Buy bank bag slot, slot number = %u", slot); + sLog->outDetail("PLAYER: Buy bank bag slot, slot number = %u", slot); BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot); @@ -900,11 +900,11 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: CMSG_AUTOBANK_ITEM"); + sLog->outDebug("WORLD: CMSG_AUTOBANK_ITEM"); uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; - sLog.outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); + sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); Item *pItem = _player->GetItemByPos(srcbag, srcslot); if (!pItem) @@ -930,11 +930,11 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) { - sLog.outDebug("WORLD: CMSG_AUTOSTORE_BANK_ITEM"); + sLog->outDebug("WORLD: CMSG_AUTOSTORE_BANK_ITEM"); uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; - sLog.outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); + sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); Item *pItem = _player->GetItemByPos(srcbag, srcslot); if (!pItem) @@ -976,7 +976,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data) return; } - sLog.outDebug("WORLD: CMSG_SET_AMMO"); + sLog->outDebug("WORLD: CMSG_SET_AMMO"); uint32 item; recv_data >> item; @@ -1015,7 +1015,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) recv_data >> itemid; recv_data.read_skip(); // guid - sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); + sLog->outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); ItemSetNameEntry const *pName = sObjectMgr->GetItemSetNameEntry(itemid); if (pName) { @@ -1035,7 +1035,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) { - sLog.outDebug("Received opcode CMSG_WRAP_ITEM"); + sLog->outDebug("Received opcode CMSG_WRAP_ITEM"); uint8 gift_bag, gift_slot, item_bag, item_slot; //recv_data.hexlike(); @@ -1043,7 +1043,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) recv_data >> gift_bag >> gift_slot; // paper recv_data >> item_bag >> item_slot; // item - sLog.outDebug("WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); + sLog->outDebug("WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); Item *gift = _player->GetItemByPos(gift_bag, gift_slot); if (!gift) @@ -1140,7 +1140,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) { - sLog.outDebug("WORLD: CMSG_SOCKET_GEMS"); + sLog->outDebug("WORLD: CMSG_SOCKET_GEMS"); uint64 item_guid; uint64 gem_guids[MAX_GEM_SOCKETS]; @@ -1334,7 +1334,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) { - sLog.outDebug("WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); + sLog->outDebug("WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); uint32 eslot; @@ -1358,7 +1358,7 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) { - sLog.outDebug("WORLD: CMSG_ITEM_REFUND_INFO"); + sLog->outDebug("WORLD: CMSG_ITEM_REFUND_INFO"); uint64 guid; recv_data >> guid; // item guid @@ -1366,7 +1366,7 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) Item *item = _player->GetItemByGuid(guid); if (!item) { - sLog.outDebug("Item refund: item not found!"); + sLog->outDebug("Item refund: item not found!"); return; } @@ -1375,14 +1375,14 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) void WorldSession::HandleItemRefund(WorldPacket &recv_data) { - sLog.outDebug("WORLD: CMSG_ITEM_REFUND"); + sLog->outDebug("WORLD: CMSG_ITEM_REFUND"); uint64 guid; recv_data >> guid; // item guid Item *item = _player->GetItemByGuid(guid); if (!item) { - sLog.outDebug("Item refund: item not found!"); + sLog->outDebug("Item refund: item not found!"); return; } @@ -1399,7 +1399,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recv_data ) uint64 itemGuid; recv_data >> itemGuid; - sLog.outDebug("CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); + sLog->outDebug("CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index 8400ec30646..35c9cf894f6 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -46,7 +46,7 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMa void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) { - if (!sWorld.getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE) || + if (!sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE) || (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID())) { recv_data.rpos(recv_data.wpos()); @@ -62,7 +62,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) recv_data >> numDungeons; if (!numDungeons) { - sLog.outDebug("CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); + sLog->outDebug("CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); recv_data.rpos(recv_data.wpos()); return; } @@ -78,7 +78,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) std::string comment; recv_data >> comment; - sLog.outDebug("CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); + sLog->outDebug("CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); sLFGMgr->Join(GetPlayer(), uint8(roles), newDungeons, comment); } @@ -86,7 +86,7 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) { Group* grp = GetPlayer()->GetGroup(); - sLog.outDebug("CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", GetPlayer()->GetGUID(), grp ? 1 : 0); + sLog->outDebug("CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", GetPlayer()->GetGUID(), grp ? 1 : 0); // Check cheating - only leader can leave the queue if (!grp || grp->GetLeaderGUID() == GetPlayer()->GetGUID()) @@ -100,7 +100,7 @@ void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recv_data) recv_data >> lfgGroupID; recv_data >> accept; - sLog.outDebug("CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); + sLog->outDebug("CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); sLFGMgr->UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept); } @@ -112,11 +112,11 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data) Group* grp = GetPlayer()->GetGroup(); if (!grp) { - sLog.outDebug("CMSG_LFG_SET_ROLES [" UI64FMTD "] Not in group", guid); + sLog->outDebug("CMSG_LFG_SET_ROLES [" UI64FMTD "] Not in group", guid); return; } uint64 gguid = grp->GetGUID(); - sLog.outDebug("CMSG_LFG_SET_ROLES: Group [" UI64FMTD "], Player [" UI64FMTD "], Roles: %u", gguid, guid, roles); + sLog->outDebug("CMSG_LFG_SET_ROLES: Group [" UI64FMTD "], Player [" UI64FMTD "], Roles: %u", gguid, guid, roles); sLFGMgr->UpdateRoleCheck(gguid, guid, roles); } @@ -125,7 +125,7 @@ void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recv_data) std::string comment; recv_data >> comment; uint64 guid = GetPlayer()->GetGUID(); - sLog.outDebug("CMSG_SET_LFG_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); + sLog->outDebug("CMSG_SET_LFG_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); sLFGMgr->SetComment(guid, comment); } @@ -135,7 +135,7 @@ void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recv_data) bool agree; // Agree to kick player recv_data >> agree; - sLog.outDebug("CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", GetPlayer()->GetGUID(), agree ? 1 : 0); + sLog->outDebug("CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", GetPlayer()->GetGUID(), agree ? 1 : 0); sLFGMgr->UpdateBoot(GetPlayer(), agree); } @@ -144,14 +144,14 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recv_data) bool out; recv_data >> out; - sLog.outDebug("CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); + sLog->outDebug("CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); sLFGMgr->TeleportPlayer(GetPlayer(), out, true); } void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data*/) { uint64 guid = GetPlayer()->GetGUID(); - sLog.outDebug("CMSG_LFD_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); + sLog->outDebug("CMSG_LFD_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); // Get Random dungeons that can be done at a certain level and expansion // FIXME - Should return seasonals (when not disabled) @@ -171,7 +171,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data uint32 rsize = uint32(randomDungeons.size()); uint32 lsize = uint32(lock.size()); - sLog.outDebug("SMSG_LFG_PLAYER_INFO [" UI64FMTD "]", guid); + sLog->outDebug("SMSG_LFG_PLAYER_INFO [" UI64FMTD "]", guid); WorldPacket data(SMSG_LFG_PLAYER_INFO, 1 + rsize * (4 + 1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4) + 4 + lsize * (1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4)); data << uint8(randomDungeons.size()); // Random Dungeon count @@ -232,7 +232,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data*/) { uint64 guid = GetPlayer()->GetGUID(); - sLog.outDebug("CMSG_LFD_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); + sLog->outDebug("CMSG_LFD_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); Group* grp = GetPlayer()->GetGroup(); if (!grp) @@ -257,7 +257,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); - sLog.outDebug("SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); + sLog->outDebug("SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size); BuildPartyLockDungeonBlock(data, lockMap); SendPacket(&data); @@ -267,7 +267,7 @@ void WorldSession::HandleLfrSearchOpcode(WorldPacket& recv_data) { uint32 entry; // Raid id to search recv_data >> entry; - sLog.outDebug("CMSG_SEARCH_LFG_JOIN [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), entry); + sLog->outDebug("CMSG_SEARCH_LFG_JOIN [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), entry); //SendLfrUpdateListOpcode(entry); } @@ -275,7 +275,7 @@ void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recv_data) { uint32 dungeonId; // Raid id queue to leave recv_data >> dungeonId; - sLog.outDebug("CMSG_SEARCH_LFG_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId); + sLog->outDebug("CMSG_SEARCH_LFG_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId); //sLFGMgr->LeaveLfr(GetPlayer(), dungeonId); } @@ -302,7 +302,7 @@ void WorldSession::SendLfgUpdatePlayer(const LfgUpdateData& updateData) uint64 guid = GetPlayer()->GetGUID(); uint8 size = uint8(updateData.dungeons.size()); - sLog.outDebug("SMSG_LFG_UPDATE_PLAYER [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); + sLog->outDebug("SMSG_LFG_UPDATE_PLAYER [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (extrainfo ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(extrainfo); // Extra info @@ -352,7 +352,7 @@ void WorldSession::SendLfgUpdateParty(const LfgUpdateData& updateData) uint64 guid = GetPlayer()->GetGUID(); uint8 size = uint8(updateData.dungeons.size()); - sLog.outDebug("SMSG_LFG_UPDATE_PARTY [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); + sLog->outDebug("SMSG_LFG_UPDATE_PARTY [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (extrainfo ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(extrainfo); // Extra info @@ -376,7 +376,7 @@ void WorldSession::SendLfgUpdateParty(const LfgUpdateData& updateData) void WorldSession::SendLfgRoleChosen(uint64 guid, uint8 roles) { - sLog.outDebug("SMSG_LFG_ROLE_CHOSEN [" UI64FMTD "] guid: [" UI64FMTD "] roles: %u", GetPlayer()->GetGUID(), guid, roles); + sLog->outDebug("SMSG_LFG_ROLE_CHOSEN [" UI64FMTD "] guid: [" UI64FMTD "] roles: %u", GetPlayer()->GetGUID(), guid, roles); WorldPacket data(SMSG_LFG_ROLE_CHOSEN, 8 + 1 + 4); data << uint64(guid); // Guid @@ -394,7 +394,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck* pRoleCheck) else dungeons = pRoleCheck->dungeons; - sLog.outDebug("SMSG_LFG_ROLE_CHECK_UPDATE [" UI64FMTD "]", GetPlayer()->GetGUID()); + sLog->outDebug("SMSG_LFG_ROLE_CHECK_UPDATE [" UI64FMTD "]", GetPlayer()->GetGUID()); WorldPacket data(SMSG_LFG_ROLE_CHECK_UPDATE, 4 + 1 + 1 + dungeons.size() * 4 + 1 + pRoleCheck->roles.size() * (8 + 1 + 4 + 1)); data << uint32(pRoleCheck->state); // Check result @@ -444,7 +444,7 @@ void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) for (LfgLockPartyMap::const_iterator it = joinData.lockmap.begin(); it != joinData.lockmap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); - sLog.outDebug("SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); + sLog->outDebug("SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); WorldPacket data(SMSG_LFG_JOIN_RESULT, 4 + 4 + size); data << uint32(joinData.result); // Check Result data << uint32(joinData.state); // Check Value @@ -455,7 +455,7 @@ void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) void WorldSession::SendLfgQueueStatus(uint32 dungeon, int32 waitTime, int32 avgWaitTime, int32 waitTimeTanks, int32 waitTimeHealer, int32 waitTimeDps, uint32 queuedTime, uint8 tanks, uint8 healers, uint8 dps) { - sLog.outDebug("SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", GetPlayer()->GetGUID(), dungeon, waitTime, avgWaitTime, waitTimeTanks, waitTimeHealer, waitTimeDps, queuedTime, tanks, healers, dps); + sLog->outDebug("SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", GetPlayer()->GetGUID(), dungeon, waitTime, avgWaitTime, waitTimeTanks, waitTimeHealer, waitTimeDps, queuedTime, tanks, healers, dps); WorldPacket data(SMSG_LFG_QUEUE_STATUS, 4 + 4 + 4 + 4 + 4 +4 + 1 + 1 + 1 + 4); data << uint32(dungeon); // Dungeon @@ -478,7 +478,7 @@ void WorldSession::SendLfgPlayerReward(uint32 rdungeonEntry, uint32 sdungeonEntr uint8 itemNum = uint8(qRew ? qRew->GetRewItemsCount() : 0); - sLog.outDebug("SMSG_LFG_PLAYER_REWARD [" UI64FMTD "] rdungeonEntry: %u - sdungeonEntry: %u - done: %u", GetPlayer()->GetGUID(), rdungeonEntry, sdungeonEntry, done); + sLog->outDebug("SMSG_LFG_PLAYER_REWARD [" UI64FMTD "] rdungeonEntry: %u - sdungeonEntry: %u - done: %u", GetPlayer()->GetGUID(), rdungeonEntry, sdungeonEntry, done); WorldPacket data(SMSG_LFG_PLAYER_REWARD, 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 + 1 + itemNum * (4 + 4 + 4)); data << uint32(rdungeonEntry); // Random Dungeon Finished data << uint32(sdungeonEntry); // Dungeon Finished @@ -523,7 +523,7 @@ void WorldSession::SendLfgBootPlayer(const LfgPlayerBoot* pBoot) ++agreeNum; } } - sLog.outDebug("SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", + sLog->outDebug("SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", guid, uint8(pBoot->inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), pBoot->victim, votesNum, agreeNum, secsleft, pBoot->votedNeeded, pBoot->reason.c_str()); WorldPacket data(SMSG_LFG_BOOT_PLAYER, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); data << uint8(pBoot->inProgress); // Vote in progress @@ -562,7 +562,7 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, const LfgProposal* p isSameDungeon = GetPlayer()->GetGroup() == grp && isContinue; } - sLog.outDebug("SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", GetPlayer()->GetGUID(), pProp->state); + sLog->outDebug("SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", GetPlayer()->GetGUID(), pProp->state); WorldPacket data(SMSG_LFG_PROPOSAL_UPDATE, 4 + 1 + 4 + 4 + 1 + 1 + pProp->players.size() * (4 + 1 + 1 + 1 + 1 +1)); if (!isContinue) // Only show proposal dungeon if it's continue @@ -603,7 +603,7 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, const LfgProposal* p void WorldSession::SendLfgUpdateSearch(bool update) { - sLog.outDebug("SMSG_LFG_UPDATE_SEARCH [" UI64FMTD "] update: %u", GetPlayer()->GetGUID(), update ? 1 : 0); + sLog->outDebug("SMSG_LFG_UPDATE_SEARCH [" UI64FMTD "] update: %u", GetPlayer()->GetGUID(), update ? 1 : 0); WorldPacket data(SMSG_LFG_UPDATE_SEARCH, 1); data << uint8(update); // In Lfg Queue? SendPacket(&data); @@ -611,14 +611,14 @@ void WorldSession::SendLfgUpdateSearch(bool update) void WorldSession::SendLfgDisabled() { - sLog.outDebug("SMSG_LFG_DISABLED [" UI64FMTD "]", GetPlayer()->GetGUID()); + sLog->outDebug("SMSG_LFG_DISABLED [" UI64FMTD "]", GetPlayer()->GetGUID()); WorldPacket data(SMSG_LFG_DISABLED, 0); SendPacket(&data); } void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) { - sLog.outDebug("SMSG_LFG_OFFER_CONTINUE [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); + sLog->outDebug("SMSG_LFG_OFFER_CONTINUE [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); WorldPacket data(SMSG_LFG_OFFER_CONTINUE, 4); data << uint32(dungeonEntry); SendPacket(&data); @@ -626,7 +626,7 @@ void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) void WorldSession::SendLfgTeleportError(uint8 err) { - sLog.outDebug("SMSG_LFG_TELEPORT_DENIED [" UI64FMTD "] reason: %u", GetPlayer()->GetGUID(), err); + sLog->outDebug("SMSG_LFG_TELEPORT_DENIED [" UI64FMTD "] reason: %u", GetPlayer()->GetGUID(), err); WorldPacket data(SMSG_LFG_TELEPORT_DENIED, 4); data << uint32(err); // Error SendPacket(&data); @@ -635,7 +635,7 @@ void WorldSession::SendLfgTeleportError(uint8 err) /* void WorldSession::SendLfrUpdateListOpcode(uint32 dungeonEntry) { - sLog.outDebug("SMSG_UPDATE_LFG_LIST [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); + sLog->outDebug("SMSG_UPDATE_LFG_LIST [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); WorldPacket data(SMSG_UPDATE_LFG_LIST); SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp index ac9ec8e5b82..2eb954228aa 100755 --- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp @@ -32,7 +32,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); + sLog->outDebug("WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); Player* player = GetPlayer(); uint64 lguid = player->GetLootGUID(); Loot* loot = NULL; @@ -96,7 +96,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: CMSG_LOOT_MONEY"); + sLog->outDebug("WORLD: CMSG_LOOT_MONEY"); Player *player = GetPlayer(); uint64 guid = player->GetLootGUID(); @@ -159,7 +159,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) Player* playerGroup = itr->getSource(); if (!playerGroup) continue; - if (player->IsWithinDistInMap(playerGroup,sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (player->IsWithinDistInMap(playerGroup,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) playersNear.push_back(playerGroup); } @@ -187,7 +187,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleLootOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_LOOT"); + sLog->outDebug("WORLD: CMSG_LOOT"); uint64 guid; recv_data >> guid; @@ -205,7 +205,7 @@ void WorldSession::HandleLootOpcode(WorldPacket & recv_data) void WorldSession::HandleLootReleaseOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_LOOT_RELEASE"); + sLog->outDebug("WORLD: CMSG_LOOT_RELEASE"); // cheaters can modify lguid to prevent correct apply loot release code and re-loot // use internal stored guid @@ -254,7 +254,7 @@ void WorldSession::DoLootRelease(uint64 lguid) // only vein pass this check if (go_min != 0 && go_max > go_min) { - float amount_rate = sWorld.getRate(RATE_MINING_AMOUNT); + float amount_rate = sWorld->getRate(RATE_MINING_AMOUNT); float min_amount = go_min*amount_rate; float max_amount = go_max*amount_rate; @@ -265,7 +265,7 @@ void WorldSession::DoLootRelease(uint64 lguid) { if (uses >= min_amount) { - float chance_rate = sWorld.getRate(RATE_MINING_NEXT); + float chance_rate = sWorld->getRate(RATE_MINING_NEXT); int32 ReqValue = 175; LockEntry const *lockInfo = sLockStore.LookupEntry(go->GetGOInfo()->chest.lockId); @@ -426,7 +426,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!target) return; - sLog.outDebug("WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName()); + sLog->outDebug("WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName()); if (_player->GetLootGUID() != lootguid) return; @@ -455,7 +455,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (slotid > pLoot->items.size()) { - sLog.outDebug("MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)",GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); + sLog->outDebug("MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)",GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); return; } diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp index f9718b8a4d4..986de94dd98 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp @@ -76,9 +76,9 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) Player* pl = _player; - if (pl->getLevel() < sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ)) + if (pl->getLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_MAIL_SENDER_REQ), sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_MAIL_SENDER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ)); return; } @@ -88,13 +88,13 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) if (!rc) { - sLog.outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", + sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", pl->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); pl->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, %u copper and %u COD copper with unk1 = %u, unk2 = %u", pl->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); + sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", pl->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); if (pl->GetGUID() == rc) { @@ -160,15 +160,15 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) } } - if (!accountBound && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && GetSecurity() == SEC_PLAYER) + if (!accountBound && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && GetSecurity() == SEC_PLAYER) { pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_YOUR_TEAM); return; } - if (receiveLevel < sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ)) + if (receiveLevel < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_MAIL_RECEIVER_REQ), sWorld.getIntConfig(CONFIG_MAIL_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_MAIL_RECEIVER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ)); return; } @@ -246,9 +246,9 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) for (uint8 i = 0; i < items_count; ++i) { Item* item = items[i]; - if (GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)", + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)", GetPlayerName(), GetAccountId(), item->GetProto()->Name1, item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account); } @@ -270,15 +270,15 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) needItemDelay = pl->GetSession()->GetAccountId() != rc_account; } - if (money > 0 && GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (money > 0 && GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(GetAccountId(),"GM %s (Account: %u) mail money: %u to player: %s (Account: %u)", + sLog->outCommand(GetAccountId(),"GM %s (Account: %u) mail money: %u to player: %s (Account: %u)", GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account); } } // If theres is an item, there is a one hour delivery delay if sent to another account's character. - uint32 deliver_delay = needItemDelay ? sWorld.getIntConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0; + uint32 deliver_delay = needItemDelay ? sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0; // will delete item or place to receiver mail list draft @@ -443,7 +443,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) uint32 sender_accId = 0; - if (GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { std::string sender_name; if (receive) @@ -459,7 +459,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) if (!sObjectMgr->GetPlayerNameByGUID(sender_guid,sender_name)) sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } - sLog.outCommand(GetAccountId(),"GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)", + sLog->outCommand(GetAccountId(),"GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)", GetPlayerName(),GetAccountId(),it->GetProto()->Name1,it->GetEntry(),it->GetCount(),m->COD,sender_name.c_str(),sender_accId); } else if (!receive) @@ -694,7 +694,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK); - sLog.outDetail("HandleMailCreateTextItem mailid=%u",mailId); + sLog->outDetail("HandleMailCreateTextItem mailid=%u",mailId); ItemPosCountVec dest; uint8 msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, bodyItem, false); diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 1b53e009346..f9e0dce2e89 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -52,7 +52,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_REPOP_REQUEST Message"); + sLog->outDebug("WORLD: Recvd CMSG_REPOP_REQUEST Message"); recv_data.read_skip(); @@ -66,7 +66,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) // release spirit after he's killed but before he is updated if (GetPlayer()->getDeathState() == JUST_DIED) { - sLog.outDebug("HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); + sLog->outDebug("HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); GetPlayer()->KillPlayer(); } @@ -78,7 +78,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION"); + sLog->outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION"); uint32 gossipListId; uint32 menuId; @@ -90,9 +90,9 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if (_player->PlayerTalkClass->GossipOptionCoded(gossipListId)) { // recheck - sLog.outBasic("reading string"); + sLog->outBasic("reading string"); recv_data >> code; - sLog.outBasic("string read: %s", code.c_str()); + sLog->outBasic("string read: %s", code.c_str()); } Creature *unit = NULL; @@ -102,7 +102,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - sLog.outDebug("WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } } @@ -111,13 +111,13 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) go = _player->GetMap()->GetGameObject(guid); if (!go) { - sLog.outDebug("WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid))); return; } } else { - sLog.outDebug("WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); return; } @@ -127,7 +127,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) { - sLog.outDebug("WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); + sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); if (unit) unit->LastUsedScriptID = unit->GetCreatureInfo()->ScriptID; if (go) @@ -167,7 +167,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_WHO Message"); + sLog->outDebug("WORLD: Recvd CMSG_WHO Message"); //recv_data.hexlike(); uint32 matchcount = 0; @@ -194,7 +194,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) uint32 temp; recv_data >> temp; // zone id, 0 if zone is unknown... zoneids[i] = temp; - sLog.outDebug("Zone %u: %u", i, zoneids[i]); + sLog->outDebug("Zone %u: %u", i, zoneids[i]); } recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10) @@ -202,7 +202,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) if (str_count > 4) return; // can't be received from real client or broken packet - sLog.outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count); + sLog->outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count); std::wstring str[4]; // 4 is client limit for (uint32 i = 0; i < str_count; ++i) @@ -215,7 +215,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) wstrToLower(str[i]); - sLog.outDebug("String %u: %s", i, temp.c_str()); + sLog->outDebug("String %u: %s", i, temp.c_str()); } std::wstring wplayer_name; @@ -232,8 +232,8 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) uint32 team = _player->GetTeam(); uint32 security = GetSecurity(); - bool allowTwoSideWhoList = sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); - uint32 gmLevelInWhoList = sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); + bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST); + uint32 gmLevelInWhoList = sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); uint32 displaycount = 0; WorldPacket data(SMSG_WHO, 50); // guess size @@ -241,7 +241,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) data << uint32(displaycount); // placeholder, count of players displayed ACE_GUARD(ACE_Thread_Mutex, g, *HashMapHolder::GetLock()); - HashMapHolder::MapType& m = sObjectAccessor.GetPlayers(); + HashMapHolder::MapType& m = sObjectAccessor->GetPlayers(); for (HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { if (security == SEC_PLAYER) @@ -337,7 +337,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) // 49 is maximum player count sent to client - can be overridden // through config, but is unstable - if ((matchcount++) >= sWorld.getIntConfig(CONFIG_MAX_WHO)) + if ((matchcount++) >= sWorld->getIntConfig(CONFIG_MAX_WHO)) continue; data << pname; // player name @@ -355,12 +355,12 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) data.put(4, matchcount); // insert right count, count of matches SendPacket(&data); - sLog.outDebug("WORLD: Send SMSG_WHO Message"); + sLog->outDebug("WORLD: Send SMSG_WHO Message"); } void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); + sLog->outDebug("WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); if (uint64 lguid = GetPlayer()->GetLootGUID()) DoLootRelease(lguid); @@ -386,7 +386,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || - GetSecurity() >= AccountTypes(sWorld.getIntConfig(CONFIG_INSTANT_LOGOUT))) + GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT))) { WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); data << uint8(0); @@ -417,12 +417,12 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); + sLog->outDebug("WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); } void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); + sLog->outDebug("WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); LogoutRequest(0); @@ -445,7 +445,7 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } - sLog.outDebug("WORLD: sent SMSG_LOGOUT_CANCEL_ACK Message"); + sLog->outDebug("WORLD: sent SMSG_LOGOUT_CANCEL_ACK Message"); } void WorldSession::HandleTogglePvP(WorldPacket & recv_data) @@ -484,7 +484,7 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data) uint32 newZone; recv_data >> newZone; - sLog.outDetail("WORLD: Recvd ZONE_UPDATE: %u", newZone); + sLog->outDetail("WORLD: Recvd ZONE_UPDATE: %u", newZone); // use server size data uint32 newzone, newarea; @@ -527,7 +527,7 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) { - // sLog.outDebug("WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop + // sLog->outDebug("WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop uint32 animstate; recv_data >> animstate; @@ -536,16 +536,16 @@ void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) void WorldSession::HandleContactListOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_CONTACT_LIST"); + sLog->outDebug("WORLD: Received CMSG_CONTACT_LIST"); uint32 unk; recv_data >> unk; - sLog.outDebug("unk value is %u", unk); + sLog->outDebug("unk value is %u", unk); _player->GetSocial()->SendSocialList(_player); } void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_ADD_FRIEND"); + sLog->outDebug("WORLD: Received CMSG_ADD_FRIEND"); std::string friendName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); std::string friendNote; @@ -559,7 +559,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) CharacterDatabase.escape_string(friendName); // prevent SQL injection - normal name don't must changed by this call - sLog.outDebug("WORLD: %s asked to add friend : '%s'", + sLog->outDebug("WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName(), friendName.c_str()); m_addFriendCallback.SetParam(friendNote); @@ -587,13 +587,13 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string team = Player::TeamForRace((*result)[1].GetUInt8()); friendAcctid = (*result)[2].GetUInt32(); - if (GetSecurity() >= SEC_MODERATOR || sWorld.getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr->GetSecurity(friendAcctid) < SEC_MODERATOR) + if (GetSecurity() >= SEC_MODERATOR || sWorld->getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || sAccountMgr->GetSecurity(friendAcctid) < SEC_MODERATOR) { if (friendGuid) { if (friendGuid == GetPlayer()->GetGUID()) friendResult = FRIEND_SELF; - else if (GetPlayer()->GetTeam() != team && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && GetSecurity() < SEC_MODERATOR) + else if (GetPlayer()->GetTeam() != team && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && GetSecurity() < SEC_MODERATOR) friendResult = FRIEND_ENEMY; else if (GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid))) friendResult = FRIEND_ALREADY; @@ -607,7 +607,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string if (!GetPlayer()->GetSocial()->AddToSocialList(GUID_LOPART(friendGuid), false)) { friendResult = FRIEND_LIST_FULL; - sLog.outDebug("WORLD: %s's friend list is full.", GetPlayer()->GetName()); + sLog->outDebug("WORLD: %s's friend list is full.", GetPlayer()->GetName()); } } GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote); @@ -617,14 +617,14 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, GUID_LOPART(friendGuid), false); - sLog.outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); + sLog->outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) { uint64 FriendGUID; - sLog.outDebug("WORLD: Received CMSG_DEL_FRIEND"); + sLog->outDebug("WORLD: Received CMSG_DEL_FRIEND"); recv_data >> FriendGUID; @@ -632,12 +632,12 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_REMOVED, GUID_LOPART(FriendGUID), false); - sLog.outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); + sLog->outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_ADD_IGNORE"); + sLog->outDebug("WORLD: Received CMSG_ADD_IGNORE"); std::string IgnoreName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); @@ -648,7 +648,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) CharacterDatabase.escape_string(IgnoreName); // prevent SQL injection - normal name don't must changed by this call - sLog.outDebug("WORLD: %s asked to Ignore: '%s'", + sLog->outDebug("WORLD: %s asked to Ignore: '%s'", GetPlayer()->GetName(), IgnoreName.c_str()); m_addIgnoreCallback = CharacterDatabase.AsyncPQuery("SELECT guid FROM characters WHERE name = '%s'", IgnoreName.c_str()); @@ -688,14 +688,14 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult result) sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, GUID_LOPART(IgnoreGuid), false); - sLog.outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); + sLog->outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) { uint64 IgnoreGUID; - sLog.outDebug("WORLD: Received CMSG_DEL_IGNORE"); + sLog->outDebug("WORLD: Received CMSG_DEL_IGNORE"); recv_data >> IgnoreGUID; @@ -703,12 +703,12 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, GUID_LOPART(IgnoreGUID), false); - sLog.outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); + sLog->outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_SET_CONTACT_NOTES"); + sLog->outDebug("CMSG_SET_CONTACT_NOTES"); uint64 guid; std::string note; recv_data >> guid >> note; @@ -725,12 +725,12 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) recv_data >> typelen >> type; if (suggestion == 0) - sLog.outDebug("WORLD: Received CMSG_BUG [Bug Report]"); + sLog->outDebug("WORLD: Received CMSG_BUG [Bug Report]"); else - sLog.outDebug("WORLD: Received CMSG_BUG [Suggestion]"); + sLog->outDebug("WORLD: Received CMSG_BUG [Suggestion]"); - sLog.outDebug("%s", type.c_str()); - sLog.outDebug("%s", content.c_str()); + sLog->outDebug("%s", type.c_str()); + sLog->outDebug("%s", content.c_str()); CharacterDatabase.escape_string(type); CharacterDatabase.escape_string(content); @@ -739,7 +739,7 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) { - sLog.outDetail("WORLD: Received CMSG_RECLAIM_CORPSE"); + sLog->outDetail("WORLD: Received CMSG_RECLAIM_CORPSE"); uint64 guid; recv_data >> guid; @@ -776,7 +776,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data) { - sLog.outDetail("WORLD: Received CMSG_RESURRECT_RESPONSE"); + sLog->outDetail("WORLD: Received CMSG_RESURRECT_RESPONSE"); uint64 guid; uint8 status; @@ -817,29 +817,29 @@ void WorldSession::SendAreaTriggerMessage(const char* Text, ...) void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_AREATRIGGER"); + sLog->outDebug("WORLD: Received CMSG_AREATRIGGER"); uint32 Trigger_ID; recv_data >> Trigger_ID; - sLog.outDebug("Trigger ID:%u",Trigger_ID); + sLog->outDebug("Trigger ID:%u",Trigger_ID); if (GetPlayer()->isInFlight()) { - sLog.outDebug("Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug("Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); return; } AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog.outDebug("Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug("Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); return; } if (GetPlayer()->GetMapId() != atEntry->mapid) { - sLog.outDebug("Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", GetPlayer()->GetName(), atEntry->mapid, GetPlayer()->GetMapId(), GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug("Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", GetPlayer()->GetName(), atEntry->mapid, GetPlayer()->GetMapId(), GetPlayer()->GetGUIDLow(), Trigger_ID); return; } @@ -854,7 +854,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) float dist = pl->GetDistance(atEntry->x,atEntry->y,atEntry->z); if (dist > atEntry->radius + delta) { - sLog.outDebug("Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", + sLog->outDebug("Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", pl->GetName(), pl->GetGUIDLow(), atEntry->radius, dist, Trigger_ID); return; } @@ -885,7 +885,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) (fabs(dy) > atEntry->box_y/2 + delta) || (fabs(dz) > atEntry->box_z/2 + delta)) { - sLog.outDebug("Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", + sLog->outDebug("Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", pl->GetName(), pl->GetGUIDLow(), atEntry->box_x/2, atEntry->box_y/2, atEntry->box_z/2, rotPlayerX, rotPlayerY, dz, Trigger_ID); return; } @@ -915,7 +915,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) GetPlayer()->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z); GetPlayer()->SetRestType(REST_TYPE_IN_TAVERN); - if (sWorld.IsFFAPvPRealm()) + if (sWorld->IsFFAPvPRealm()) GetPlayer()->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); return; @@ -956,12 +956,12 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) { - sLog.outDetail("WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); + sLog->outDetail("WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); uint32 type, timestamp, decompressedSize; recv_data >> type >> timestamp >> decompressedSize; - sLog.outDebug("UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); + sLog->outDebug("UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); if (type > NUM_ACCOUNT_DATA_TYPES) return; @@ -981,7 +981,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) if (decompressedSize > 0xFFFF) { recv_data.rpos(recv_data.wpos()); // unnneded warning spam in this case - sLog.outError("UAD: Account data packet too big, size %u", decompressedSize); + sLog->outError("UAD: Account data packet too big, size %u", decompressedSize); return; } @@ -992,7 +992,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) if (uncompress(const_cast(dest.contents()), &realSize, const_cast(recv_data.contents() + recv_data.rpos()), recv_data.size() - recv_data.rpos()) != Z_OK) { recv_data.rpos(recv_data.wpos()); // unnneded warning spam in this case - sLog.outError("UAD: Failed to decompress account data"); + sLog->outError("UAD: Failed to decompress account data"); return; } @@ -1011,12 +1011,12 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) { - sLog.outDetail("WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); + sLog->outDetail("WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); uint32 type; recv_data >> type; - sLog.outDebug("RAD: type %u", type); + sLog->outDebug("RAD: type %u", type); if (type > NUM_ACCOUNT_DATA_TYPES) return; @@ -1032,7 +1032,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) if (size && compress(const_cast(dest.contents()), &destSize, (uint8*)adata->Data.c_str(), size) != Z_OK) { - sLog.outDebug("RAD: Failed to compress account data"); + sLog->outDebug("RAD: Failed to compress account data"); return; } @@ -1049,7 +1049,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { - sLog.outDebug("WORLD: Received CMSG_SET_ACTION_BUTTON"); + sLog->outDebug("WORLD: Received CMSG_SET_ACTION_BUTTON"); uint8 button; uint32 packetData; recv_data >> button >> packetData; @@ -1057,10 +1057,10 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) uint32 action = ACTION_BUTTON_ACTION(packetData); uint8 type = ACTION_BUTTON_TYPE(packetData); - sLog.outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type); + sLog->outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type); if (!packetData) { - sLog.outDetail("MISC: Remove action from button %u", button); + sLog->outDetail("MISC: Remove action from button %u", button); GetPlayer()->removeActionButton(button); } else @@ -1069,19 +1069,19 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { case ACTION_BUTTON_MACRO: case ACTION_BUTTON_CMACRO: - sLog.outDetail("MISC: Added Macro %u into button %u", action, button); + sLog->outDetail("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->outDetail("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->outDetail("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->outDetail("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", type, action, button); + sLog->outError("MISC: Unknown action button type %u for action %u into button %u", type, action, button); return; } GetPlayer()->addActionButton(button, action, type); @@ -1090,18 +1090,18 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/) { - sLog.outStaticDebug("WORLD: Player is watching cinema"); + sLog->outStaticDebug("WORLD: Player is watching cinema"); } void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/) { - sLog.outStaticDebug("WORLD: Which movie to play"); + sLog->outStaticDebug("WORLD: Which movie to play"); } void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) { /* WorldSession::Update(getMSTime());*/ - sLog.outStaticDebug("WORLD: Time Lag/Synchronization Resent/Update"); + sLog->outStaticDebug("WORLD: Time Lag/Synchronization Resent/Update"); uint64 guid; recv_data.readPackGUID(guid); @@ -1111,7 +1111,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) uint32 time_skipped; recv_data >> guid; recv_data >> time_skipped; - sLog.outDebug("WORLD: CMSG_MOVE_TIME_SKIPPED"); + sLog->outDebug("WORLD: CMSG_MOVE_TIME_SKIPPED"); /// TODO must be need use in Trinity @@ -1123,7 +1123,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data) { - sLog.outStaticDebug("WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); + sLog->outStaticDebug("WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); // no used recv_data.rpos(recv_data.wpos()); // prevent warnings spam @@ -1144,7 +1144,7 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data) return; } - sLog.outDebug("WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); + sLog->outDebug("WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); recv_data.read_skip(); // unk @@ -1170,7 +1170,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recv_data) return; } - sLog.outDebug("WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); + sLog->outDebug("WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); recv_data.read_skip(); // unk @@ -1188,7 +1188,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data) 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("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored",uint32(ActionBar)); return; } @@ -1201,7 +1201,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recv_data) /* uint8 tmp; recv_data >> tmp; - sLog.outDebug("Received opcode CMSG_WARDEN_DATA, not resolve.uint8 = %u",tmp); + sLog->outDebug("Received opcode CMSG_WARDEN_DATA, not resolve.uint8 = %u",tmp); */ } @@ -1221,7 +1221,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) { uint64 guid; recv_data >> guid; - sLog.outStaticDebug("Inspected guid is " UI64FMTD, guid); + sLog->outStaticDebug("Inspected guid is " UI64FMTD, guid); _player->SetSelection(guid); @@ -1234,7 +1234,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points); data.append(plr->GetPackGUID()); - if (sWorld.getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster()) + if (sWorld->getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster()) { plr->BuildPlayerTalentsInfoData(&data); } @@ -1258,7 +1258,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) if (!player) { - sLog.outError("InspectHonorStats: WTF, player not found..."); + sLog->outError("InspectHonorStats: WTF, player not found..."); return; } @@ -1292,25 +1292,25 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) recv_data >> PositionZ; recv_data >> Orientation; // o (3.141593 = 180 degrees) - //sLog.outDebug("Received opcode CMSG_WORLD_TELEPORT"); + //sLog->outDebug("Received opcode CMSG_WORLD_TELEPORT"); if (GetPlayer()->isInFlight()) { - sLog.outDebug("Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow()); + sLog->outDebug("Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow()); return; } - sLog.outStaticDebug("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation); + sLog->outStaticDebug("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation); if (GetSecurity() >= SEC_ADMINISTRATOR) GetPlayer()->TeleportTo(mapid,PositionX,PositionY,PositionZ,Orientation); else SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); - sLog.outDebug("Received worldport command from player %s", GetPlayer()->GetName()); + sLog->outDebug("Received worldport command from player %s", GetPlayer()->GetName()); } void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) { - sLog.outDebug("Received opcode CMSG_WHOIS"); + sLog->outDebug("Received opcode CMSG_WHOIS"); std::string charname; recv_data >> charname; @@ -1360,12 +1360,12 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) data << msg; _player->GetSession()->SendPacket(&data); - sLog.outDebug("Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); + sLog->outDebug("Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); } void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_COMPLAIN"); + sLog->outDebug("WORLD: CMSG_COMPLAIN"); recv_data.hexlike(); uint8 spam_type; // 0 - mail, 1 - chat @@ -1401,12 +1401,12 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) data << uint8(0); SendPacket(&data); - sLog.outDebug("REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); + sLog->outDebug("REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); } void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_REALM_SPLIT"); + sLog->outDebug("CMSG_REALM_SPLIT"); uint32 unk; std::string split_date = "01/01/01"; @@ -1421,12 +1421,12 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) // 0x2 realm split pending data << split_date; SendPacket(&data); - //sLog.outDebug("response sent %u", unk); + //sLog->outDebug("response sent %u", unk); } void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_FAR_SIGHT"); + sLog->outDebug("WORLD: CMSG_FAR_SIGHT"); //recv_data.hexlike(); uint8 apply; @@ -1435,18 +1435,18 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) switch(apply) { case 0: - sLog.outDebug("Player %u set vision to self", _player->GetGUIDLow()); + sLog->outDebug("Player %u set vision to self", _player->GetGUIDLow()); _player->SetSeer(_player); break; case 1: - sLog.outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); + sLog->outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); if (WorldObject *target = _player->GetViewpoint()) _player->SetSeer(target); else - sLog.outError("Player %s requests non-existing seer", _player->GetName()); + sLog->outError("Player %s requests non-existing seer", _player->GetName()); break; default: - sLog.outDebug("Unhandled mode in CMSG_FAR_SIGHT: %u", apply); + sLog->outDebug("Unhandled mode in CMSG_FAR_SIGHT: %u", apply); return; } @@ -1455,7 +1455,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) { - sLog.outDebug("CMSG_SET_TITLE"); + sLog->outDebug("CMSG_SET_TITLE"); int32 title; recv_data >> title; @@ -1474,27 +1474,27 @@ void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) { - sLog.outDebug("CMSG_TIME_SYNC_RESP"); + sLog->outDebug("CMSG_TIME_SYNC_RESP"); uint32 counter, clientTicks; recv_data >> counter >> clientTicks; if (counter != _player->m_timeSyncCounter - 1) - sLog.outDebug("Wrong time sync counter from player %s (cheater?)", _player->GetName()); + sLog->outDebug("Wrong time sync counter from player %s (cheater?)", _player->GetName()); - sLog.outDebug("Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient); + sLog->outDebug("Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient); uint32 ourTicks = clientTicks + (getMSTime() - _player->m_timeSyncServer); // diff should be small - sLog.outDebug("Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency()); + sLog->outDebug("Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency()); _player->m_timeSyncClient = clientTicks; } void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: CMSG_RESET_INSTANCES"); + sLog->outDebug("WORLD: CMSG_RESET_INSTANCES"); Group *pGroup = _player->GetGroup(); if (pGroup) { @@ -1513,14 +1513,14 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) { - sLog.outDebug("MSG_SET_DUNGEON_DIFFICULTY"); + sLog->outDebug("MSG_SET_DUNGEON_DIFFICULTY"); uint32 mode; recv_data >> mode; if (mode >= MAX_DUNGEON_DIFFICULTY) { - sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode); + sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode); return; } @@ -1531,7 +1531,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) Map *map = _player->GetMap(); if (map && map->IsDungeon()) { - sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); return; } @@ -1555,7 +1555,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) map = pGroupGuy->GetMap(); if (map && map->IsNonRaidDungeon()) { - sLog.outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); return; } } @@ -1574,14 +1574,14 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) { - sLog.outDebug("MSG_SET_RAID_DIFFICULTY"); + sLog->outDebug("MSG_SET_RAID_DIFFICULTY"); uint32 mode; recv_data >> mode; if (mode >= MAX_RAID_DIFFICULTY) { - sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode); + sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d sent an invalid instance mode %d!", _player->GetGUIDLow(), mode); return; } @@ -1589,7 +1589,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) Map *map = _player->GetMap(); if (map && map->IsDungeon()) { - sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); return; } @@ -1616,7 +1616,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) map = pGroupGuy->GetMap(); if (map && map->IsRaid()) { - sLog.outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); + sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); return; } } @@ -1635,7 +1635,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: CMSG_CANCEL_MOUNT_AURA"); + sLog->outDebug("WORLD: CMSG_CANCEL_MOUNT_AURA"); //If player is not mounted, so go out :) if (!_player->IsMounted()) // not blizz like; no any messages on blizz @@ -1657,7 +1657,7 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) { // fly mode on/off - sLog.outDebug("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); + sLog->outDebug("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); //recv_data.hexlike(); uint64 guid; // guid - unused @@ -1678,7 +1678,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) void WorldSession::HandleRequestPetInfoOpcode(WorldPacket & /*recv_data */) { /* - sLog.outDebug("WORLD: CMSG_REQUEST_PET_INFO"); + sLog->outDebug("WORLD: CMSG_REQUEST_PET_INFO"); recv_data.hexlike(); */ } @@ -1688,7 +1688,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket & recv_data) uint8 mode; recv_data >> mode; - sLog.outDebug("Client used \"/timetest %d\" command", mode); + sLog->outDebug("Client used \"/timetest %d\" command", mode); } void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) @@ -1706,7 +1706,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) { // empty opcode - sLog.outDebug("WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); + sLog->outDebug("WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4); data << uint32(time(NULL)); @@ -1716,7 +1716,7 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recv_data*/) { // empty opcode - sLog.outDebug("WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); + sLog->outDebug("WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); SendAccountDataTimes(GLOBAL_CACHE_MASK); } diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index dc66f0399d8..08828f541d1 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -34,7 +34,7 @@ void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: got MSG_MOVE_WORLDPORT_ACK."); + sLog->outDebug("WORLD: got MSG_MOVE_WORLDPORT_ACK."); HandleMoveWorldportAckOpcode(); } @@ -68,7 +68,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() ASSERT(oldMap); if (GetPlayer()->IsInWorld()) { - sLog.outCrash("Player is still in world when teleported from map %u! to new map %u", oldMap->GetId(), loc.GetMapId()); + sLog->outCrash("Player is still in world when teleported from map %u! to new map %u", oldMap->GetId(), loc.GetMapId()); oldMap->Remove(GetPlayer(), false); } @@ -78,7 +78,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("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; } @@ -91,7 +91,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SendInitialPacketsBeforeAddToMap(); if (!GetPlayer()->GetMap()->Add(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("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()); @@ -191,15 +191,15 @@ void WorldSession::HandleMoveWorldportAckOpcode() void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) { - sLog.outDebug("MSG_MOVE_TELEPORT_ACK"); + sLog->outDebug("MSG_MOVE_TELEPORT_ACK"); uint64 guid; recv_data.readPackGUID(guid); uint32 flags, time; recv_data >> flags >> time; - sLog.outStaticDebug("Guid " UI64FMTD, guid); - sLog.outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); + sLog->outStaticDebug("Guid " UI64FMTD, guid); + sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); Unit *mover = _player->m_mover; Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; @@ -395,7 +395,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) { uint32 opcode = recv_data.GetOpcode(); - sLog.outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); + sLog->outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); /* extract packet */ uint64 guid; @@ -441,7 +441,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break; case CMSG_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("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode); return; } @@ -458,13 +458,13 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) { 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("%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->outBasic("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(); } @@ -473,7 +473,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); + sLog->outDebug("WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); uint64 guid; recv_data >> guid; @@ -493,7 +493,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) } else { - sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID()); + sLog->outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID()); GetPlayer()->SetMover(GetPlayer()); } } @@ -501,7 +501,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); + sLog->outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); uint64 old_mover_guid; recv_data.readPackGUID(old_mover_guid); @@ -515,7 +515,7 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); + sLog->outDebug("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); recv_data.hexlike(); uint64 vehicleGUID = _player->GetCharmGUID(); @@ -541,7 +541,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); + sLog->outDebug("WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); recv_data.hexlike(); Unit* vehicle_base = GetPlayer()->GetVehicleBase(); @@ -639,7 +639,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data) void WorldSession::HandleRequestVehicleExit(WorldPacket &recv_data) { - sLog.outDebug("WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); + sLog->outDebug("WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); recv_data.hexlike(); GetPlayer()->ExitVehicle(); } @@ -654,7 +654,7 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) { - sLog.outDebug("CMSG_MOVE_KNOCK_BACK_ACK"); + sLog->outDebug("CMSG_MOVE_KNOCK_BACK_ACK"); uint64 guid; // guid - unused recv_data.readPackGUID(guid); @@ -667,7 +667,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data) { - sLog.outDebug("CMSG_MOVE_HOVER_ACK"); + sLog->outDebug("CMSG_MOVE_HOVER_ACK"); uint64 guid; // guid - unused recv_data.readPackGUID(guid); @@ -682,7 +682,7 @@ void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data) void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recv_data) { - sLog.outDebug("CMSG_MOVE_WATER_WALK_ACK"); + sLog->outDebug("CMSG_MOVE_WATER_WALK_ACK"); uint64 guid; // guid - unused recv_data.readPackGUID(guid); diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index cc1f1ea6d78..33555f7ea35 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -54,7 +54,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TABARDDESIGNER); if (!unit) { - sLog.outDebug("WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -76,14 +76,14 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) { uint64 guid; - sLog.outDebug("WORLD: Received CMSG_BANKER_ACTIVATE"); + sLog->outDebug("WORLD: Received CMSG_BANKER_ACTIVATE"); recv_data >> guid; Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_BANKER); if (!unit) { - sLog.outDebug("WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -117,12 +117,12 @@ void WorldSession::SendTrainerList(uint64 guid) void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) { - sLog.outDebug("WORLD: SendTrainerList"); + sLog->outDebug("WORLD: SendTrainerList"); Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TRAINER); if (!unit) { - sLog.outDebug("WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -138,14 +138,14 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) if (!ci) { - sLog.outDebug("WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!",GUID_LOPART(guid)); + sLog->outDebug("WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!",GUID_LOPART(guid)); return; } TrainerSpellData const* trainer_spells = unit->GetTrainerSpells(); if (!trainer_spells) { - sLog.outDebug("WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", + sLog->outDebug("WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", GUID_LOPART(guid), unit->GetEntry()); return; } @@ -241,12 +241,12 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) uint32 spellId = 0; recv_data >> guid >> spellId; - sLog.outDebug("WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u",uint32(GUID_LOPART(guid)), spellId); + sLog->outDebug("WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u",uint32(GUID_LOPART(guid)), spellId); Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { - sLog.outDebug("WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -304,7 +304,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_GOSSIP_HELLO"); + sLog->outDebug("WORLD: Received CMSG_GOSSIP_HELLO"); uint64 guid; recv_data >> guid; @@ -312,7 +312,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - sLog.outDebug("WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -349,7 +349,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) /*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION"); + sLog->outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION"); uint32 option; uint32 unk; @@ -360,15 +360,15 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) if (_player->PlayerTalkClass->GossipOptionCoded(option)) { - sLog.outDebug("reading string"); + sLog->outDebug("reading string"); recv_data >> code; - sLog.outDebug("string read: %s", code.c_str()); + sLog->outDebug("string read: %s", code.c_str()); } Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - sLog.outDebug("WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -390,7 +390,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); + sLog->outDebug("WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); uint64 guid; @@ -399,7 +399,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER); if (!unit) { - sLog.outDebug("WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -454,7 +454,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID,UNIT_NPC_FLAG_INNKEEPER); if (!unit) { - sLog.outDebug("WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); + sLog->outDebug("WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); return; } @@ -495,7 +495,7 @@ void WorldSession::SendBindPoint(Creature *npc) void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recv MSG_LIST_STABLED_PETS"); + sLog->outDebug("WORLD: Recv MSG_LIST_STABLED_PETS"); uint64 npcGUID; recv_data >> npcGUID; @@ -528,7 +528,7 @@ void WorldSession::SendStablePetCallback(QueryResult result, uint64 guid) if (!GetPlayer()) return; - sLog.outDebug("WORLD: Recv MSG_LIST_STABLED_PETS Send."); + sLog->outDebug("WORLD: Recv MSG_LIST_STABLED_PETS Send."); WorldPacket data(MSG_LIST_STABLED_PETS, 200); // guess size @@ -585,7 +585,7 @@ void WorldSession::SendStableResult(uint8 res) void WorldSession::HandleStablePet(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recv CMSG_STABLE_PET"); + sLog->outDebug("WORLD: Recv CMSG_STABLE_PET"); uint64 npcGUID; recv_data >> npcGUID; @@ -656,7 +656,7 @@ void WorldSession::HandleStablePetCallback(QueryResult result) void WorldSession::HandleUnstablePet(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recv CMSG_UNSTABLE_PET."); + sLog->outDebug("WORLD: Recv CMSG_UNSTABLE_PET."); uint64 npcGUID; uint32 petnumber; @@ -733,7 +733,7 @@ void WorldSession::HandleUnstablePetCallback(QueryResult result, uint32 petnumbe void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recv CMSG_BUY_STABLE_SLOT."); + sLog->outDebug("WORLD: Recv CMSG_BUY_STABLE_SLOT."); uint64 npcGUID; recv_data >> npcGUID; @@ -766,12 +766,12 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) void WorldSession::HandleStableRevivePet(WorldPacket &/* recv_data */) { - sLog.outDebug("HandleStableRevivePet: Not implemented"); + sLog->outDebug("HandleStableRevivePet: Not implemented"); } void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recv CMSG_STABLE_SWAP_PET."); + sLog->outDebug("WORLD: Recv CMSG_STABLE_SWAP_PET."); uint64 npcGUID; uint32 pet_number; @@ -854,7 +854,7 @@ void WorldSession::HandleStableSwapPetCallback(QueryResult result, uint32 petnum void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_REPAIR_ITEM"); + sLog->outDebug("WORLD: CMSG_REPAIR_ITEM"); uint64 npcGUID, itemGUID; uint8 guildBank; // new in 2.3.2, bool that means from guild bank money @@ -864,7 +864,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR); if (!unit) { - sLog.outDebug("WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); + sLog->outDebug("WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); return; } @@ -878,7 +878,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) uint32 TotalCost = 0; if (itemGUID) { - sLog.outDebug("ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID)); + sLog->outDebug("ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID)); Item* item = _player->GetItemByGuid(itemGUID); if (item) @@ -886,7 +886,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) } else { - sLog.outDebug("ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID)); + sLog->outDebug("ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID)); TotalCost = _player->DurabilityRepairAll(true, discountMod, guildBank); } } diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index f099cd9c51d..a4ea46d071e 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -36,13 +36,13 @@ void WorldSession::HandleDismissCritter(WorldPacket &recv_data) uint64 guid; recv_data >> guid; - sLog.outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD "", guid); + sLog->outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD "", guid); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - sLog.outError("Vanitypet %u does not exist", uint32(GUID_LOPART(guid))); + sLog->outError("Vanitypet %u does not exist", uint32(GUID_LOPART(guid))); return; } @@ -67,16 +67,16 @@ void WorldSession::HandlePetAction(WorldPacket & recv_data) // used also for charmed creature Unit* pet= ObjectAccessor::GetUnit(*_player, guid1); - sLog.outDetail("HandlePetAction.Pet %u flag is %u, spellid is %u, target %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2))); + sLog->outDetail("HandlePetAction.Pet %u flag is %u, spellid is %u, target %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2))); if (!pet) { - sLog.outError("Pet %u not exist.", uint32(GUID_LOPART(guid1))); + sLog->outError("Pet %u not exist.", uint32(GUID_LOPART(guid1))); return; } if (pet != GetPlayer()->GetFirstControlled()) { - sLog.outError("HandlePetAction.Pet %u isn't pet of player %s.", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName()); + sLog->outError("HandlePetAction.Pet %u isn't pet of player %s.", uint32(GUID_LOPART(guid1)), GetPlayer()->GetName()); return; } @@ -112,19 +112,19 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recv_data) uint64 guid; recv_data >> guid; - sLog.outDebug("WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); + sLog->outDebug("WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - sLog.outError("HandlePetStopAttack: Pet %u does not exist", uint32(GUID_LOPART(guid))); + sLog->outError("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("HandlePetStopAttack: Pet GUID %u isn't a pet or charmed creature of player %s", uint32(GUID_LOPART(guid)), GetPlayer()->GetName()); return; } @@ -139,7 +139,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid CharmInfo *charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - sLog.outError("WorldSession::HandlePetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); + sLog->outError("WorldSession::HandlePetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); return; } @@ -191,7 +191,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid return; // Not let attack through obstructions - if (sWorld.getBoolConfig(CONFIG_PET_LOS)) + if (sWorld->getBoolConfig(CONFIG_PET_LOS)) { if (!pet->IsWithinLOSInMap(TargetUnit)) return; @@ -259,7 +259,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("WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid); } break; case ACT_REACTION: // 0x6 @@ -288,7 +288,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid); if (!spellInfo) { - sLog.outError("WORLD: unknown PET spell id %i", spellid); + sLog->outError("WORLD: unknown PET spell id %i", spellid); return; } @@ -391,13 +391,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("WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid); } } void WorldSession::HandlePetNameQuery(WorldPacket & recv_data) { - sLog.outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY"); + sLog->outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY"); uint32 petnumber; uint64 petguid; @@ -448,7 +448,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->outStaticDebug("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid)); return false; } } @@ -457,7 +457,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->outStaticDebug("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid)); return false; } } @@ -466,7 +466,7 @@ bool WorldSession::CheckStableMaster(uint64 guid) void WorldSession::HandlePetSetAction(WorldPacket & recv_data) { - sLog.outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION"); + sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION"); uint64 petguid; uint8 count; @@ -477,14 +477,14 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data) if (!pet || pet != _player->GetFirstControlled()) { - sLog.outError("HandlePetSetAction: Unknown pet or pet owner."); + sLog->outError("HandlePetSetAction: Unknown pet or pet owner."); 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("WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); return; } @@ -546,7 +546,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data) 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->outDetail("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))) @@ -576,7 +576,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data) void WorldSession::HandlePetRename(WorldPacket & recv_data) { - sLog.outDetail("HandlePetRename. CMSG_PET_RENAME"); + sLog->outDetail("HandlePetRename. CMSG_PET_RENAME"); uint64 petguid; uint8 isdeclined; @@ -653,7 +653,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recv_data) { uint64 guid; recv_data >> guid; //pet guid - sLog.outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); + sLog->outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); if (!_player->IsInWorld()) return; @@ -679,7 +679,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recv_data) void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) { - sLog.outDetail("CMSG_PET_SPELL_AUTOCAST"); + sLog->outDetail("CMSG_PET_SPELL_AUTOCAST"); uint64 guid; uint32 spellid; uint8 state; //1 for on, 0 for off @@ -695,7 +695,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("HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)),GetPlayer()->GetName()); return; } @@ -706,7 +706,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("WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); return; } @@ -720,7 +720,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) { - sLog.outDetail("WORLD: CMSG_PET_CAST_SPELL"); + sLog->outDetail("WORLD: CMSG_PET_CAST_SPELL"); uint64 guid; uint8 castCount; @@ -729,7 +729,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) recvPacket >> guid >> castCount >> spellId >> castFlags; - sLog.outDebug("WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); + sLog->outDebug("WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); // This opcode is also sent from charmed and possessed units (players and creatures) if (!_player->GetGuardianPet() && !_player->GetCharm()) @@ -739,14 +739,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("HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)),GetPlayer()->GetName()); return; } SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { - sLog.outError("WORLD: unknown PET spell id %i", spellId); + sLog->outError("WORLD: unknown PET spell id %i", spellId); return; } @@ -834,7 +834,7 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec void WorldSession::HandlePetLearnTalent(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_PET_LEARN_TALENT"); + sLog->outDebug("WORLD: CMSG_PET_LEARN_TALENT"); uint64 guid; uint32 talent_id, requested_rank; @@ -846,7 +846,7 @@ void WorldSession::HandlePetLearnTalent(WorldPacket & recv_data) void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recv_data) { - sLog.outDebug("CMSG_LEARN_PREVIEW_TALENTS_PET"); + sLog->outDebug("CMSG_LEARN_PREVIEW_TALENTS_PET"); uint64 guid; recv_data >> guid; diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index 01421e34a66..a6a4321ab58 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -56,7 +56,7 @@ enum CharterCosts void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received opcode CMSG_PETITION_BUY"); + sLog->outDebug("Received opcode CMSG_PETITION_BUY"); recv_data.hexlike(); uint64 guidNPC; @@ -86,13 +86,13 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) recv_data >> clientIndex; // index recv_data.read_skip(); // 0 - sLog.outDebug("Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); + sLog->outDebug("Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); // prevent cheating Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC,UNIT_NPC_FLAG_PETITIONER); if (!pCreature) { - sLog.outDebug("WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); + sLog->outDebug("WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); return; } @@ -117,9 +117,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) else { // TODO: find correct opcode - if (_player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (_player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); + SendNotification(LANG_ARENA_ONE_TOOLOW, sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); return; } @@ -141,7 +141,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) type = ARENA_TEAM_CHARTER_5v5_TYPE; break; default: - sLog.outDebug("unknown selection at buy arena petition: %u", clientIndex); + sLog->outDebug("unknown selection at buy arena petition: %u", clientIndex); return; } @@ -230,7 +230,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) // delete petitions with the same guid as this one ssInvalidPetitionGUIDs << "'" << charter->GetGUIDLow() << "'"; - sLog.outDebug("Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); + sLog->outDebug("Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); CharacterDatabase.escape_string(name); SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM petition WHERE petitionguid IN (%s)", ssInvalidPetitionGUIDs.str().c_str()); @@ -243,7 +243,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) { // ok - sLog.outDebug("Received opcode CMSG_PETITION_SHOW_SIGNATURES"); + sLog->outDebug("Received opcode CMSG_PETITION_SHOW_SIGNATURES"); //recv_data.hexlike(); uint8 signs = 0; @@ -256,7 +256,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", petitionguid_low); if (!result) { - sLog.outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName()); + sLog->outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName()); return; } Field *fields = result->Fetch(); @@ -272,7 +272,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) if (result) signs = uint8(result->GetRowCount()); - sLog.outDebug("CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); + sLog->outDebug("CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12)); data << uint64(petitionguid); // petition guid @@ -295,14 +295,14 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received opcode CMSG_PETITION_QUERY"); // ok + sLog->outDebug("Received opcode CMSG_PETITION_QUERY"); // ok //recv_data.hexlike(); uint32 guildguid; uint64 petitionguid; recv_data >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid) recv_data >> petitionguid; // petition guid - sLog.outDebug("CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); + sLog->outDebug("CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); SendPetitionQueryOpcode(petitionguid); } @@ -330,7 +330,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) } else { - sLog.outDebug("CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); + sLog->outDebug("CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); return; } @@ -375,7 +375,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received opcode MSG_PETITION_RENAME"); // ok + sLog->outDebug("Received opcode MSG_PETITION_RENAME"); // ok //recv_data.hexlike(); uint64 petitionguid; @@ -398,7 +398,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) } else { - sLog.outDebug("CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); + sLog->outDebug("CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); return; } @@ -434,7 +434,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) CharacterDatabase.PExecute("UPDATE petition SET name = '%s' WHERE petitionguid = '%u'", db_newname.c_str(), GUID_LOPART(petitionguid)); - sLog.outDebug("Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionguid), newname.c_str()); + sLog->outDebug("Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionguid), newname.c_str()); WorldPacket data(MSG_PETITION_RENAME, (8+newname.size()+1)); data << uint64(petitionguid); data << newname; @@ -443,7 +443,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received opcode CMSG_PETITION_SIGN"); // ok + sLog->outDebug("Received opcode CMSG_PETITION_SIGN"); // ok //recv_data.hexlike(); Field *fields; @@ -460,7 +460,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) if (!result) { - sLog.outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName()); + sLog->outError("Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName()); return; } @@ -474,7 +474,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) return; // not let enemies sign guild charter - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(ownerguid)) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(ownerguid)) { if (type != GUILD_CHARTER_TYPE) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); @@ -485,7 +485,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) if (type != GUILD_CHARTER_TYPE) { - if (_player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (_player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", _player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S); return; @@ -546,7 +546,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) CharacterDatabase.PExecute("INSERT INTO petition_sign (ownerguid,petitionguid, playerguid, player_account) VALUES ('%u', '%u', '%u','%u')", GUID_LOPART(ownerguid),GUID_LOPART(petitionguid), plguidlo,GetAccountId()); - sLog.outDebug("PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionguid), _player->GetName(),plguidlo,GetAccountId()); + sLog->outDebug("PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionguid), _player->GetName(),plguidlo,GetAccountId()); WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); data << uint64(petitionguid); @@ -568,13 +568,13 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received opcode MSG_PETITION_DECLINE"); // ok + sLog->outDebug("Received opcode MSG_PETITION_DECLINE"); // ok //recv_data.hexlike(); uint64 petitionguid; uint64 ownerguid; recv_data >> petitionguid; // petition guid - sLog.outDebug("Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); + sLog->outDebug("Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); if (!result) @@ -594,7 +594,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received opcode CMSG_OFFER_PETITION"); // ok + sLog->outDebug("Received opcode CMSG_OFFER_PETITION"); // ok //recv_data.hexlike(); uint8 signs = 0; @@ -616,9 +616,9 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) Field *fields = result->Fetch(); type = fields[0].GetUInt32(); - sLog.outDebug("OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid)); + sLog->outDebug("OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid)); - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam()) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam()) { if (type != GUILD_CHARTER_TYPE) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); @@ -629,7 +629,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) if (type != GUILD_CHARTER_TYPE) { - if (player->getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) + if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { // player is too low level to join an arena team SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, player->GetName(), "", ERR_ARENA_TEAM_TARGET_TOO_LOW_S); @@ -695,7 +695,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received opcode CMSG_TURN_IN_PETITION"); // ok + sLog->outDebug("Received opcode CMSG_TURN_IN_PETITION"); // ok //recv_data.hexlike(); WorldPacket data; @@ -707,7 +707,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) recv_data >> petitionguid; - sLog.outDebug("Petition %u turned in by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); + sLog->outDebug("Petition %u turned in by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); // data QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid, name, type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); @@ -720,7 +720,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) } else { - sLog.outError("petition table has broken data!"); + sLog->outError("petition table has broken data!"); return; } @@ -762,9 +762,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) signs = 0; uint32 count; - //if (signs < sWorld.getIntConfig(CONFIG_MIN_PETITION_SIGNS)) + //if (signs < sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS)) if (type == GUILD_CHARTER_TYPE) - count = sWorld.getIntConfig(CONFIG_MIN_PETITION_SIGNS); + count = sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS); else count = type-1; if (signs < count) @@ -827,7 +827,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) ArenaTeam* at = new ArenaTeam; if (!at->Create(_player->GetGUID(), type, name)) { - sLog.outError("PetitionsHandler: arena team create failed."); + sLog->outError("PetitionsHandler: arena team create failed."); delete at; return; } @@ -839,14 +839,14 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) // register team and add captain sObjectMgr->AddArenaTeam(at); - sLog.outDebug("PetitonsHandler: arena team added to objmrg"); + sLog->outDebug("PetitonsHandler: arena team added to objmrg"); // add members for (uint8 i = 0; i < signs; ++i) { Field* fields = result->Fetch(); uint64 memberGUID = fields[0].GetUInt64(); - sLog.outDebug("PetitionsHandler: adding arena member %u", GUID_LOPART(memberGUID)); + sLog->outDebug("PetitionsHandler: adding arena member %u", GUID_LOPART(memberGUID)); at->AddMember(memberGUID); result->NextRow(); } @@ -858,7 +858,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) CharacterDatabase.CommitTransaction(trans); // created - sLog.outDebug("TURN IN PETITION GUID %u", GUID_LOPART(petitionguid)); + sLog->outDebug("TURN IN PETITION GUID %u", GUID_LOPART(petitionguid)); data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4); data << (uint32)PETITION_TURN_OK; @@ -867,7 +867,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recv_data) { - sLog.outDebug("Received CMSG_PETITION_SHOWLIST"); // ok + sLog->outDebug("Received CMSG_PETITION_SHOWLIST"); // ok //recv_data.hexlike(); uint64 guid; @@ -881,7 +881,7 @@ void WorldSession::SendPetitionShowList(uint64 guid) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER); if (!pCreature) { - sLog.outDebug("WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -941,5 +941,5 @@ void WorldSession::SendPetitionShowList(uint64 guid) // data << uint32(9); // required signs? //} SendPacket(&data); - sLog.outDebug("Sent SMSG_PETITION_SHOWLIST"); + sLog->outDebug("Sent SMSG_PETITION_SHOWLIST"); } diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index 5e2ac1e0ccc..4ac24c843df 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -60,7 +60,7 @@ void WorldSession::SendNameQueryOpcodeFromDB(uint64 guid) { ACE_Future lFutureResult = CharacterDatabase.AsyncPQuery( - !sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) ? + !sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) ? // ------- Query Without Declined Names -------- // 0 1 2 3 4 "SELECT guid, name, race, gender, class " @@ -108,7 +108,7 @@ void WorldSession::SendNameQueryOpcodeFromDBCallBack(QueryResult result) data << uint8(pClass); // class // if the first declined name field (5) is empty, the rest must be too - if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED) && fields[5].GetString() != "") + if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) && fields[5].GetString() != "") { data << uint8(1); // is declined for (int i = 5; i < MAX_DECLINED_NAME_CASES+5; ++i) @@ -143,7 +143,7 @@ void WorldSession::SendQueryTimeResponse() { WorldPacket data(SMSG_QUERY_TIME_RESPONSE, 4+4); data << uint32(time(NULL)); - data << uint32(sWorld.GetNextDailyQuestsResetTime() - time(NULL)); + data << uint32(sWorld->GetNextDailyQuestsResetTime() - time(NULL)); SendPacket(&data); } @@ -172,7 +172,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) sObjectMgr->GetLocaleString(cl->SubName, loc_idx, SubName); } } - sLog.outDetail("WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name, entry); + sLog->outDetail("WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name, entry); // guess size WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 100); data << uint32(entry); // creature entry @@ -197,16 +197,16 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) data << uint32(ci->questItems[i]); // itemId[6], quest drop data << uint32(ci->movementId); // CreatureMovementInfo.dbc SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); + sLog->outDebug("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); } else { - sLog.outDebug("WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", + sLog->outDebug("WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", GUID_LOPART(guid), entry); WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); + sLog->outDebug("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); } } @@ -238,7 +238,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) sObjectMgr->GetLocaleString(gl->CastBarCaption, loc_idx, CastBarCaption); } } - sLog.outDetail("WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name, entryID); + sLog->outDetail("WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name, entryID); WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 150); data << uint32(entryID); data << uint32(info->type); @@ -253,22 +253,22 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) for (uint32 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) data << uint32(info->questItems[i]); // itemId[6], quest drop SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); + sLog->outDebug("WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); } else { - sLog.outDebug("WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", + sLog->outDebug("WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", GUID_LOPART(guid), entryID); WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4); data << uint32(entryID | 0x80000000); SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); + sLog->outDebug("WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); } } void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) { - sLog.outDetail("WORLD: Received MSG_CORPSE_QUERY"); + sLog->outDetail("WORLD: Received MSG_CORPSE_QUERY"); Corpse *corpse = GetPlayer()->GetCorpse(); @@ -323,7 +323,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> textID; - sLog.outDetail("WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); + sLog->outDetail("WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); recv_data >> guid; GetPlayer()->SetUInt64Value(UNIT_FIELD_TARGET, guid); @@ -397,12 +397,12 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE"); + sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE"); } void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) { - sLog.outDetail("WORLD: Received CMSG_PAGE_TEXT_QUERY"); + sLog->outDetail("WORLD: Received CMSG_PAGE_TEXT_QUERY"); recv_data.hexlike(); uint32 pageID; @@ -437,13 +437,13 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) } SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE"); + sLog->outDebug("WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE"); } } void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); + sLog->outDebug("WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); uint32 unk; recv_data >> unk; diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index be73fd32003..d55d1ba4293 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) 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->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)",GuidHigh2TypeId(GUID_HIPART(guid)),GUID_LOPART(guid)); return; } @@ -54,7 +54,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) { case TYPEID_UNIT: { - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u",uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u",uint32(GUID_LOPART(guid))); Creature* cr_questgiver=questgiver->ToCreature(); if (!cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies { @@ -66,7 +66,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) } case TYPEID_GAMEOBJECT: { - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u",uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u",uint32(GUID_LOPART(guid))); GameObject* go_questgiver=(GameObject*)questgiver; questStatus = sScriptMgr->GetDialogStatus(_player, go_questgiver); if (questStatus > 6) @@ -74,7 +74,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) break; } default: - sLog.outError("QuestGiver called for unexpected type %u", questgiver->GetTypeId()); + sLog->outError("QuestGiver called for unexpected type %u", questgiver->GetTypeId()); break; } @@ -87,12 +87,12 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - sLog.outDebug ("WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); + sLog->outDebug ("WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_NONE); if (!pCreature) { - sLog.outDebug ("WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", + sLog->outDebug ("WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guid)); return; } @@ -122,7 +122,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); @@ -239,7 +239,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) uint32 quest; uint8 unk1; recv_data >> guid >> quest >> unk1; - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); // Verify that the guid is valid and is a questgiver or involved in the requested quest Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM); @@ -273,7 +273,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) uint32 quest; recv_data >> quest; - sLog.outDebug("WORLD: Received CMSG_QUEST_QUERY quest = %u",quest); + sLog->outDebug("WORLD: Received CMSG_QUEST_QUERY quest = %u",quest); Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) @@ -290,14 +290,14 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) 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("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; } if (!GetPlayer()->isAlive()) return; - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u",uint32(GUID_LOPART(guid)),quest,reward); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u",uint32(GUID_LOPART(guid)),quest,reward); Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!pObject) @@ -352,7 +352,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!pObject||!pObject->hasInvolvedQuest(quest)) @@ -370,7 +370,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recv_data*/) { - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_CANCEL"); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_CANCEL"); _player->PlayerTalkClass->CloseGossip(); } @@ -383,7 +383,7 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data) if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE) return; - sLog.outDebug("WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); + sLog->outDebug("WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); GetPlayer()->SwapQuestSlot(slot1,slot2); } @@ -393,7 +393,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) uint8 slot; recv_data >> slot; - sLog.outDebug("WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u",slot); + sLog->outDebug("WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u",slot); if (slot < MAX_QUEST_LOG_SIZE) { @@ -424,7 +424,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) uint32 quest; recv_data >> quest; - sLog.outDebug("WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); + sLog->outDebug("WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); if (const Quest* pQuest = sObjectMgr->GetQuestTemplate(quest)) { @@ -463,14 +463,14 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) if (!_player->isAlive()) return; - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) { if (!_player->CanSeeStartQuest(pQuest) && _player->GetQuestStatus(quest)==QUEST_STATUS_NONE) { - sLog.outError("Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!", + sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!", _player->GetName(), _player->GetGUIDLow(), quest); return; } @@ -499,7 +499,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) void WorldSession::HandleQuestgiverQuestAutoLaunch(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH"); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH"); } void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) @@ -507,7 +507,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) uint32 questId; recvPacket >> questId; - sLog.outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); + sLog->outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); if (Quest const *pQuest = sObjectMgr->GetQuestTemplate(questId)) { @@ -565,7 +565,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) uint8 msg; recvPacket >> guid >> msg; - sLog.outDebug("WORLD: Received MSG_QUEST_PUSH_RESULT"); + sLog->outDebug("WORLD: Received MSG_QUEST_PUSH_RESULT"); if (_player->GetDivider() != 0) { @@ -604,7 +604,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 } default: //its imposible, but check ^) - sLog.outError("Warning: GetDialogStatus called for unexpected type %u", questgiver->GetTypeId()); + sLog->outError("Warning: GetDialogStatus called for unexpected type %u", questgiver->GetTypeId()); return DIALOG_STATUS_NONE; } @@ -656,7 +656,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 { if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && pPlayer->getQuestStatusMap()[quest_id].m_rewarded)) result2 = DIALOG_STATUS_REWARD_REP; - else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld.getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) + else if (pPlayer->getLevel() <= ((pPlayer->GetQuestLevel(pQuest) == -1) ? pPlayer->getLevel() : pPlayer->GetQuestLevel(pQuest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) { if (pQuest->HasFlag(QUEST_FLAGS_DAILY) || pQuest->HasFlag(QUEST_FLAGS_WEEKLY)) result2 = DIALOG_STATUS_AVAILABLE_REP; @@ -680,7 +680,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY"); + sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY"); uint32 count = 0; diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 9f4780a6aa7..ba8ea70ab45 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -37,7 +37,7 @@ void WorldSession::HandleLearnTalentOpcode(WorldPacket & recv_data) void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { - sLog.outDebug("CMSG_LEARN_PREVIEW_TALENTS"); + sLog->outDebug("CMSG_LEARN_PREVIEW_TALENTS"); uint32 talentsCount; recvPacket >> talentsCount; @@ -56,14 +56,14 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) { - sLog.outDetail("MSG_TALENT_WIPE_CONFIRM"); + sLog->outDetail("MSG_TALENT_WIPE_CONFIRM"); uint64 guid; recv_data >> guid; Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TRAINER); if (!unit) { - sLog.outDebug("WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index b84ee549fdc..ec4da619a4f 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -93,7 +93,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); + sLog->outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); ItemPrototype const *proto = pItem->GetProto(); if (!proto) @@ -193,7 +193,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { - sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",(uint32)recvPacket.size()); + sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",(uint32)recvPacket.size()); Player* pUser = _player; @@ -205,7 +205,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) recvPacket >> bagIndex >> slot; - sLog.outDetail("bagIndex: %u, slot: %u",bagIndex,slot); + sLog->outDetail("bagIndex: %u, slot: %u",bagIndex,slot); Item *pItem = pUser->GetItemByPos(bagIndex, slot); if (!pItem) @@ -225,7 +225,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) if(!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE) && !pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); - sLog.outError("Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!", + sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!", pUser->GetName(), pUser->GetGUIDLow(), pItem->GetGUIDLow(), proto->ItemId); return; } @@ -239,7 +239,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) if (!lockInfo) { pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, pItem, NULL); - sLog.outError("WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", pItem->GetGUIDLow(), lockId); + sLog->outError("WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", pItem->GetGUIDLow(), lockId); return; } @@ -267,7 +267,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) } else { - sLog.outError("Wrapped item %u don't have record in character_gifts table and will deleted", pItem->GetGUIDLow()); + sLog->outError("Wrapped item %u don't have record in character_gifts table and will deleted", pItem->GetGUIDLow()); pUser->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); return; } @@ -283,7 +283,7 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data) recv_data >> guid; - sLog.outDebug("WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); + sLog->outDebug("WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); // ignore for remote control state if (_player->m_mover != _player) @@ -307,7 +307,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) uint64 guid; recvPacket >> guid; - sLog.outDebug("WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid)); + sLog->outDebug("WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid)); // ignore for remote control state if (_player->m_mover != _player) @@ -331,7 +331,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) uint8 castCount, castFlags; recvPacket >> castCount >> spellId >> castFlags; - sLog.outDebug("WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); + sLog->outDebug("WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); // ignore for remote control state (for player case) Unit* mover = _player->m_mover; @@ -345,7 +345,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) if (!spellInfo) { - sLog.outError("WORLD: unknown spell id %u", spellId); + sLog->outError("WORLD: unknown spell id %u", spellId); recvPacket.rfinish(); // prevent spam at ignore packet return; } @@ -460,7 +460,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket) SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { - sLog.outError("WORLD: unknown PET spell id %u", spellId); + sLog->outError("WORLD: unknown PET spell id %u", spellId); return; } @@ -468,13 +468,13 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket) if (!pet) { - sLog.outError("Pet %u not exist.", uint32(GUID_LOPART(guid))); + sLog->outError("Pet %u not exist.", uint32(GUID_LOPART(guid))); return; } if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm()) { - sLog.outError("HandlePetCancelAura.Pet %u isn't pet of player %s", uint32(GUID_LOPART(guid)),GetPlayer()->GetName()); + sLog->outError("HandlePetCancelAura.Pet %u isn't pet of player %s", uint32(GUID_LOPART(guid)),GetPlayer()->GetName()); return; } @@ -537,7 +537,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/) { - sLog.outDebug("WORLD: CMSG_SELF_RES"); // empty opcode + sLog->outDebug("WORLD: CMSG_SELF_RES"); // empty opcode if (_player->GetUInt32Value(PLAYER_SELF_RES_SPELL)) { @@ -587,7 +587,7 @@ void WorldSession::HandleSpellClick(WorldPacket & recv_data) void WorldSession::HandleMirrrorImageDataRequest(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA"); + sLog->outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA"); uint64 guid; recv_data >> guid; diff --git a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp index cbf980e3245..7b7c42a3ef5 100755 --- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp @@ -31,7 +31,7 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); + sLog->outDebug("WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); uint64 guid; @@ -45,7 +45,7 @@ void WorldSession::SendTaxiStatus(uint64 guid) Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) { - sLog.outDebug("WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid))); return; } @@ -55,18 +55,18 @@ void WorldSession::SendTaxiStatus(uint64 guid) if (curloc == 0) return; - sLog.outDebug("WORLD: current location %u ",curloc); + sLog->outDebug("WORLD: current location %u ",curloc); WorldPacket data(SMSG_TAXINODE_STATUS, 9); data << guid; data << uint8(GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0); SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_TAXINODE_STATUS"); + sLog->outDebug("WORLD: Sent SMSG_TAXINODE_STATUS"); } void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); + sLog->outDebug("WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); uint64 guid; recv_data >> guid; @@ -75,7 +75,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!unit) { - sLog.outDebug("WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -102,7 +102,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater(); if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. - sLog.outDebug("WORLD: CMSG_TAXINODE_STATUS_QUERY %u ",curloc); + sLog->outDebug("WORLD: CMSG_TAXINODE_STATUS_QUERY %u ",curloc); WorldPacket data(SMSG_SHOWTAXINODES, (4+8+4+8*4)); data << uint32(1); @@ -111,7 +111,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) GetPlayer()->m_taxi.AppendTaximaskTo(data,GetPlayer()->isTaxiCheater()); SendPacket(&data); - sLog.outDebug("WORLD: Sent SMSG_SHOWTAXINODES"); + sLog->outDebug("WORLD: Sent SMSG_SHOWTAXINODES"); GetPlayer()->SetTaxiCheater(lastTaxiCheaterState); } @@ -166,7 +166,7 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid) void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); + sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); uint64 guid; uint32 node_count; @@ -176,7 +176,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) Creature *npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { - sLog.outDebug("WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); return; } std::vector nodes; @@ -191,14 +191,14 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) if (nodes.empty()) return; - sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" ,nodes.front(),nodes.back()); + sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" ,nodes.front(),nodes.back()); GetPlayer()->ActivateTaxiPathTo(nodes, npc); } void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) { - sLog.outDebug("WORLD: Received CMSG_MOVE_SPLINE_DONE"); + sLog->outDebug("WORLD: Received CMSG_MOVE_SPLINE_DONE"); uint64 guid; // used only for proper packet read recv_data.readPackGUID(guid); @@ -252,7 +252,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) } } - sLog.outDebug("WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode); + sLog->outDebug("WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode); uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam()); @@ -276,18 +276,18 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXI"); + sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXI"); uint64 guid; std::vector nodes; nodes.resize(2); recv_data >> guid >> nodes[0] >> nodes[1]; - sLog.outDebug("WORLD: Received CMSG_ACTIVATETAXI from %d to %d" ,nodes[0],nodes[1]); + sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXI from %d to %d" ,nodes[0],nodes[1]); Creature *npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { - sLog.outDebug("WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); + sLog->outDebug("WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); return; } diff --git a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp index 4ece09a7588..372b5ae0672 100755 --- a/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TicketHandler.cpp @@ -32,9 +32,9 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) if (sTicketMgr->GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED) return; - if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_TICKET_LEVEL_REQ)) + if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld.getIntConfig(CONFIG_TICKET_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_TICKET_REQ), sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ)); return; } @@ -85,7 +85,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) data << uint32(GMTICKET_RESPONSE_SUCCESS); SendPacket(&data); - sWorld.SendGMText(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName(), ticket->guid); + sWorld->SendGMText(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName(), ticket->guid); } void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) @@ -111,7 +111,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) data << uint32(GMTICKET_RESPONSE_SUCCESS); SendPacket(&data); - sWorld.SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->guid); + sWorld->SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->guid); } void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/) @@ -124,7 +124,7 @@ void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/) data << uint32(GMTICKET_RESPONSE_TICKET_DELETED); SendPacket(&data); - sWorld.SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid); + sWorld->SendGMText(LANG_COMMAND_TICKETPLAYERABANDON, GetPlayer()->GetName(), ticket->guid); sTicketMgr->RemoveGMTicket(ticket, GetPlayer()->GetGUID(), false); SendGMTicketGetTicket(GMTICKET_STATUS_DEFAULT, NULL); } @@ -302,7 +302,7 @@ void WorldSession::HandleGMResponseResolve(WorldPacket& /*recvPacket*/) if (ticket) { uint8 getSurvey = 0; - if ((float)rand_chance() < sWorld.getFloatConfig(CONFIG_CHANCE_OF_GM_SURVEY)) + if ((float)rand_chance() < sWorld->getFloatConfig(CONFIG_CHANCE_OF_GM_SURVEY)) getSurvey = 1; WorldPacket data(SMSG_GMRESPONSE_STATUS_UPDATE, 4); diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index 19e59978d8e..bba7a404993 100755 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -69,13 +69,13 @@ void WorldSession::SendTradeStatus(TradeStatus status) void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Ignore Trade %u",_player->GetGUIDLow()); + sLog->outDebug("WORLD: Ignore Trade %u",_player->GetGUIDLow()); // recvPacket.print_storage(); } void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) { - sLog.outDebug("WORLD: Busy Trade %u",_player->GetGUIDLow()); + sLog->outDebug("WORLD: Busy Trade %u",_player->GetGUIDLow()); // recvPacket.print_storage(); } @@ -150,10 +150,10 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { // logging - sLog.outDebug("partner storing: %u",myItems[i]->GetGUIDLow()); - if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + sLog->outDebug("partner storing: %u",myItems[i]->GetGUIDLow()); + if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", + sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", _player->GetName(), _player->GetSession()->GetAccountId(), myItems[i]->GetProto()->Name1, myItems[i]->GetEntry(), myItems[i]->GetCount(), trader->GetName(), trader->GetSession()->GetAccountId()); @@ -168,10 +168,10 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (hisItems[i]) { // logging - sLog.outDebug("player storing: %u",hisItems[i]->GetGUIDLow()); - if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + sLog->outDebug("player storing: %u",hisItems[i]->GetGUIDLow()); + if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", + sLog->outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", trader->GetName(), trader->GetSession()->GetAccountId(), hisItems[i]->GetProto()->Name1, hisItems[i]->GetEntry(), hisItems[i]->GetCount(), _player->GetName(), _player->GetSession()->GetAccountId()); @@ -191,21 +191,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("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("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("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("trader can't take item back: %u",hisItems[i]->GetGUIDLow()); } } } @@ -223,7 +223,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->outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); //Can return NULL myItems[i] = item; myItems[i]->SetInTrade(); @@ -231,7 +231,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->outStaticDebug("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); hisItems[i] = item; hisItems[i]->SetInTrade(); } @@ -457,18 +457,18 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) moveItems(myItems, hisItems); // logging money - if (sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { if (_player->GetSession()->GetSecurity() > SEC_PLAYER && my_trade->GetMoney() > 0) { - sLog.outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", + sLog->outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", _player->GetName(), _player->GetSession()->GetAccountId(), my_trade->GetMoney(), trader->GetName(), trader->GetSession()->GetAccountId()); } if (trader->GetSession()->GetSecurity() > SEC_PLAYER && his_trade->GetMoney() > 0) { - sLog.outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", + sLog->outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", trader->GetName(), trader->GetSession()->GetAccountId(), his_trade->GetMoney(), _player->GetName(), _player->GetSession()->GetAccountId()); @@ -574,9 +574,9 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (GetPlayer()->getLevel() < sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)) + if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)); return; } @@ -626,7 +626,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (!sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam()) + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_TRADE) && pOther->GetTeam() !=_player->GetTeam()) { SendTradeStatus(TRADE_STATUS_WRONG_FACTION); return; @@ -638,9 +638,9 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (pOther->getLevel() < sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)) + if (pOther->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)) { - SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld.getIntConfig(CONFIG_TRADE_LEVEL_REQ)); + SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ)); return; } diff --git a/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp index 0abc7148d58..db8e5ae96d1 100755 --- a/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp @@ -24,7 +24,7 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_VOICE_SESSION_ENABLE"); + sLog->outDebug("WORLD: CMSG_VOICE_SESSION_ENABLE"); // uint8 isVoiceEnabled, uint8 isMicrophoneEnabled recv_data.read_skip(); recv_data.read_skip(); @@ -33,14 +33,14 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket & recv_data) void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_CHANNEL_VOICE_ON"); + sLog->outDebug("WORLD: CMSG_CHANNEL_VOICE_ON"); // Enable Voice button in channel context menu recv_data.hexlike(); } void WorldSession::HandleSetActiveVoiceChannel(WorldPacket & recv_data) { - sLog.outDebug("WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); + sLog->outDebug("WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); recv_data.read_skip(); recv_data.read_skip(); recv_data.hexlike(); diff --git a/src/server/game/Server/Protocol/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp index 63ab829c8c4..45c4fd79eed 100755 --- a/src/server/game/Server/Protocol/WorldLog.cpp +++ b/src/server/game/Server/Protocol/WorldLog.cpp @@ -40,7 +40,7 @@ WorldLog::~WorldLog() /// Open the log file (if specified so in the configuration file) void WorldLog::Initialize() { - std::string logsDir = sConfig.GetStringDefault("LogsDir",""); + std::string logsDir = sConfig->GetStringDefault("LogsDir",""); if (!logsDir.empty()) { @@ -48,13 +48,13 @@ void WorldLog::Initialize() logsDir.append("/"); } - std::string logname = sConfig.GetStringDefault("WorldLogFile", ""); + std::string logname = sConfig->GetStringDefault("WorldLogFile", ""); if (!logname.empty()) { i_file = fopen((logsDir+logname).c_str(), "w"); } - m_dbWorld = sConfig.GetBoolDefault("LogDB.World", false); // can be VERY heavy if enabled + m_dbWorld = sConfig->GetBoolDefault("LogDB.World", false); // can be VERY heavy if enabled } void WorldLog::outTimestampLog(char const *fmt, ...) @@ -74,13 +74,13 @@ void WorldLog::outTimestampLog(char const *fmt, ...) fflush(i_file); } - if (sLog.GetLogDB() && m_dbWorld) + if (sLog->GetLogDB() && m_dbWorld) { va_list ap2; va_start(ap2, fmt); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, fmt, ap2); - sLog.outDB(LOG_TYPE_WORLD, nnew_str); + sLog->outDB(LOG_TYPE_WORLD, nnew_str); va_end(ap2); } } @@ -101,13 +101,13 @@ void WorldLog::outLog(char const *fmt, ...) fflush(i_file); } - if (sLog.GetLogDB() && m_dbWorld) + if (sLog->GetLogDB() && m_dbWorld) { va_list ap2; va_start(ap2, fmt); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, fmt, ap2); - sLog.outDB(LOG_TYPE_WORLD, nnew_str); + sLog->outDB(LOG_TYPE_WORLD, nnew_str); va_end(ap2); } } diff --git a/src/server/game/Server/Protocol/WorldLog.h b/src/server/game/Server/Protocol/WorldLog.h index e4c0ee7cbc9..92f43d3252a 100755 --- a/src/server/game/Server/Protocol/WorldLog.h +++ b/src/server/game/Server/Protocol/WorldLog.h @@ -55,7 +55,7 @@ class WorldLog bool m_dbWorld; }; -#define sWorldLog (*ACE_Singleton::instance()) +#define sWorldLog ACE_Singleton::instance() #endif /// @} diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 81e9f5c7ed7..f76f67b7c08 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -89,7 +89,7 @@ m_muteTime(mute_time), m_timeOutTime(0), _player(NULL), m_Socket(sock), _security(sec), _accountId(id), m_expansion(expansion), _logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false), -m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), +m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(locale), m_latency(0), m_TutorialsChanged(false), recruiterId(recruiter) { @@ -127,7 +127,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 crash server?), skipped", + sLog->outError("Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt crash server?), skipped", GetAccountId(),LookupOpcodeName(packet.GetOpcode()),packet.GetOpcode(),packet.size(),size); } @@ -169,8 +169,8 @@ void WorldSession::SendPacket(WorldPacket const* packet) { 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->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); lastTime = cur_time; sendLastPacketCount = 1; @@ -192,7 +192,7 @@ void WorldSession::QueuePacket(WorldPacket* new_packet) /// Logging helper for unexpected opcodes void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char *reason) { - sLog.outError("SESSION: received unexpected opcode %s (0x%.4X) %s", + sLog->outError("SESSION: received unexpected opcode %s (0x%.4X) %s", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), reason); @@ -201,7 +201,7 @@ void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char *reason) /// Logging helper for unexpected opcodes void WorldSession::LogUnprocessedTail(WorldPacket *packet) { - sLog.outError("SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)", + sLog->outError("SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), uint32(packet->rpos()), uint32(packet->wpos())); @@ -226,14 +226,14 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) while (m_Socket && !m_Socket->IsClosed() && _recvQueue.next(packet, updater)) { /*#if 1 - sLog.outError("MOEP: %s (0x%.4X)", + sLog->outError("MOEP: %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); #endif*/ if (packet->GetOpcode() >= NUM_MSG_TYPES) { - sLog.outError("SESSION: received non-existed opcode %s (0x%.4X)", + sLog->outError("SESSION: received non-existed opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); @@ -257,7 +257,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->IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); } // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer @@ -270,7 +270,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->IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); } break; @@ -283,7 +283,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->IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); } break; @@ -302,16 +302,16 @@ 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->IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); break; case STATUS_NEVER: - sLog.outError("SESSION: received not allowed opcode %s (0x%.4X)", + sLog->outError("SESSION: received not allowed opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); break; case STATUS_UNHANDLED: - sLog.outDebug("SESSION: received not handled opcode %s (0x%.4X)", + sLog->outDebug("SESSION: received not handled opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); break; @@ -319,11 +319,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("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->IsOutDebug()) { - sLog.outDebug("Dumping error causing packet:"); + sLog->outDebug("Dumping error causing packet:"); packet->hexlike(); } } @@ -500,7 +500,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)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName() ,_player->GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName() ,_player->GetGUIDLow()); Map* _map = _player->GetMap(); _map->Remove(_player, true); SetPlayer(NULL); // deleted in Remove call @@ -513,7 +513,7 @@ void WorldSession::LogoutPlayer(bool Save) //No SQL injection as AccountId is uint32 CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'", GetAccountId()); - sLog.outDebug("SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); + sLog->outDebug("SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); } m_playerLogout = false; @@ -571,28 +571,28 @@ const char * WorldSession::GetTrinityString(int32 entry) const void WorldSession::Handle_NULL(WorldPacket& recvPacket) { - sLog.outError("SESSION: received unhandled opcode %s (0x%.4X)", + sLog->outError("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", + sLog->outError("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)", + sLog->outError("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)", + sLog->outError("SESSION: received deprecated opcode %s (0x%.4X)", LookupOpcodeName(recvPacket.GetOpcode()), recvPacket.GetOpcode()); } @@ -637,14 +637,14 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask) uint32 type = fields[0].GetUInt32(); if (type >= NUM_ACCOUNT_DATA_TYPES) { - sLog.outError("Table `%s` have invalid account data type (%u), ignore.", + sLog->outError("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.", + sLog->outError("Table `%s` have non appropriate for table account data type (%u), ignore.", mask == GLOBAL_CACHE_MASK ? "account_data" : "character_account_data", type); continue; } @@ -843,7 +843,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) if (size > 0xFFFFF) { - sLog.outError("WorldSession::ReadAddonsInfo addon info too big, size %u", size); + sLog->outError("WorldSession::ReadAddonsInfo addon info too big, size %u", size); return; } @@ -873,7 +873,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->outDetail("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); @@ -886,15 +886,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->outDetail("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->outDetail("ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC); } else { sAddonMgr->SaveAddon(addon); - sLog.outDetail("ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC); + sLog->outDetail("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. @@ -903,13 +903,13 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) uint32 currentTime; addonInfo >> currentTime; - sLog.outDebug("ADDON: CurrentTime: %u", currentTime); + sLog->outDebug("ADDON: CurrentTime: %u", currentTime); if (addonInfo.rpos() != addonInfo.size()) - sLog.outDebug("packet under-read!"); + sLog->outDebug("packet under-read!"); } else - sLog.outError("Addon packet uncompress error!"); + sLog->outError("Addon packet uncompress error!"); } void WorldSession::SendAddonsInfo() @@ -948,7 +948,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->outDetail("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/WorldSession.h b/src/server/game/Server/WorldSession.h index 809d48e5a6b..3a631ac5bcb 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -348,7 +348,7 @@ class WorldSession } void ResetTimeOutTime() { - m_timeOutTime = sWorld.getIntConfig(CONFIG_SOCKET_TIMEOUTTIME); + m_timeOutTime = sWorld->getIntConfig(CONFIG_SOCKET_TIMEOUTTIME); } bool IsConnectionIdle() const { diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 986a8c74d12..341f2b51f59 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -61,7 +61,7 @@ struct ServerPktHeader uint8 headerIndex=0; if (isLargePacket()) { - sLog.outDebug("initializing large server to client packet. Size: %u, cmd: %u", size, cmd); + sLog->outDebug("initializing large server to client packet. Size: %u, cmd: %u", size, cmd); header[headerIndex++] = 0x80|(0xFF &(size>>16)); } header[headerIndex++] = 0xFF &(size>>8); @@ -159,9 +159,9 @@ int WorldSocket::SendPacket (const WorldPacket& pct) return -1; // Dump outgoing packet. - if (sWorldLog.LogWorld()) + if (sWorldLog->LogWorld()) { - sWorldLog.outTimestampLog ("SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", + sWorldLog->outTimestampLog ("SERVER:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", (uint32) get_handle(), pct.size(), LookupOpcodeName (pct.GetOpcode()), @@ -171,11 +171,11 @@ int WorldSocket::SendPacket (const WorldPacket& pct) while (p < pct.size()) { for (uint32 j = 0; j < 16 && p < pct.size(); j++) - sWorldLog.outLog("%.2X ", const_cast(pct)[p++]); + sWorldLog->outLog("%.2X ", const_cast(pct)[p++]); - sWorldLog.outLog("\n"); + sWorldLog->outLog("\n"); } - sWorldLog.outLog("\n"); + sWorldLog->outLog("\n"); } // Create a copy of the original packet; this is to avoid issues if a hook modifies it. @@ -208,7 +208,7 @@ int WorldSocket::SendPacket (const WorldPacket& pct) if (msg_queue()->enqueue_tail(mb,(ACE_Time_Value*)&ACE_Time_Value::zero) == -1) { - sLog.outError("WorldSocket::SendPacket enqueue_tail failed"); + sLog->outError("WorldSocket::SendPacket enqueue_tail failed"); mb->release(); return -1; } @@ -251,7 +251,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 ("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -276,7 +276,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 ("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -312,14 +312,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->outStaticDebug("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->outStaticDebug("WorldSocket::handle_input: Peer has closed connection"); errno = ECONNRESET; return -1; @@ -388,7 +388,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("WorldSocket::handle_output_queue dequeue_head"); return -1; } @@ -423,7 +423,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("WorldSocket::handle_output_queue enqueue_head"); mblk->release(); return -1; } @@ -493,7 +493,7 @@ int WorldSocket::handle_input_header (void) if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240)) { - sLog.outError ("WorldSocket::handle_input_header: client sent malformed packet size = %d , cmd = %d", + sLog->outError ("WorldSocket::handle_input_header: client sent malformed packet size = %d , cmd = %d", header.size, header.cmd); errno = EINVAL; @@ -596,7 +596,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 ("Forcing close on input m_RecvWPct = NULL"); errno = EINVAL; return -1; } @@ -642,7 +642,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 ("WorldSocket::cancel_wakeup_output"); return -1; } @@ -661,7 +661,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 ("WorldSocket::schedule_wakeup_output"); return -1; } @@ -681,9 +681,9 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) return -1; // Dump received packet. - if (sWorldLog.LogWorld()) + if (sWorldLog->LogWorld()) { - sWorldLog.outTimestampLog ("CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", + sWorldLog->outTimestampLog ("CLIENT:\nSOCKET: %u\nLENGTH: %u\nOPCODE: %s (0x%.4X)\nDATA:\n", (uint32) get_handle(), new_pct->size(), LookupOpcodeName (new_pct->GetOpcode()), @@ -693,11 +693,11 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) while (p < new_pct->size()) { for (uint32 j = 0; j < 16 && p < new_pct->size(); j++) - sWorldLog.outLog ("%.2X ", (*new_pct)[p++]); + sWorldLog->outLog ("%.2X ", (*new_pct)[p++]); - sWorldLog.outLog ("\n"); + sWorldLog->outLog ("\n"); } - sWorldLog.outLog ("\n"); + sWorldLog->outLog ("\n"); } try @@ -709,14 +709,14 @@ 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 ("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->outStaticDebug ("CMSG_KEEP_ALIVE ,size: " UI64FMTD, uint64(new_pct->size())); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; default: @@ -738,7 +738,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) } else { - sLog.outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + sLog->outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); return -1; } } @@ -746,11 +746,11 @@ 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.", + 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()) + if (sLog->IsOutDebug()) { - sLog.outDebug("Dumping error causing packet:"); + sLog->outDebug("Dumping error causing packet:"); new_pct->hexlike(); } @@ -778,13 +778,13 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) BigNumber K; - if (sWorld.IsClosed()) + if (sWorld->IsClosed()) { packet.Initialize(SMSG_AUTH_RESPONSE, 1); packet << uint8(AUTH_REJECT); SendPacket (packet); - sLog.outError ("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); + sLog->outError ("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); return -1; } @@ -798,7 +798,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) recvPacket >> unk4; recvPacket.read (digest, 20); - sLog.outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", + sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", BuiltNumberClient, unk2, account.c_str(), @@ -834,17 +834,17 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) SendPacket (packet); - sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); + sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); return -1; } Field* fields = result->Fetch(); uint8 expansion = fields[6].GetUInt8(); - uint32 world_expansion = sWorld.getIntConfig(CONFIG_EXPANSION); + uint32 world_expansion = sWorld->getIntConfig(CONFIG_EXPANSION); if (expansion > world_expansion) expansion = world_expansion; - //expansion = ((sWorld.getIntConfig(CONFIG_EXPANSION) > fields[6].GetUInt8()) ? fields[6].GetUInt8() : sWorld.getIntConfig(CONFIG_EXPANSION)); + //expansion = ((sWorld->getIntConfig(CONFIG_EXPANSION) > fields[6].GetUInt8()) ? fields[6].GetUInt8() : sWorld->getIntConfig(CONFIG_EXPANSION)); N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); g.SetDword (7); @@ -855,7 +855,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free() const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free() - sLog.outStaticDebug ("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", + sLog->outStaticDebug ("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", sStr, vStr); @@ -871,7 +871,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) packet << uint8 (AUTH_FAILED); SendPacket (packet); - sLog.outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); + sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); return -1; } } @@ -923,13 +923,13 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) packet << uint8 (AUTH_BANNED); SendPacket (packet); - sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); + sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); return -1; } // Check locked state for server - AccountTypes allowedAccountType = sWorld.GetPlayerSecurityLimit(); - sLog.outDebug("Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); + AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); + sLog->outDebug("Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType) { WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); @@ -937,7 +937,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) SendPacket (packet); - sLog.outDetail ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); + sLog->outDetail ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); return -1; } @@ -961,13 +961,13 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) SendPacket (packet); - sLog.outError ("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed)."); + sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed)."); return -1; } std::string address = GetRemoteAddress(); - sLog.outStaticDebug ("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", + sLog->outStaticDebug ("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", account.c_str(), address.c_str()); @@ -991,10 +991,10 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) m_Session->ReadAddonsInfo(recvPacket); // Sleep this Network thread for - uint32 sleepTime = sWorld.getIntConfig(CONFIG_SESSION_ADD_DELAY); + uint32 sleepTime = sWorld->getIntConfig(CONFIG_SESSION_ADD_DELAY); ACE_OS::sleep (ACE_Time_Value (0, sleepTime)); - sWorld.AddSession (m_Session); + sWorld->AddSession (m_Session); return 0; } @@ -1021,7 +1021,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) { ++m_OverSpeedPings; - uint32 max_count = sWorld.getIntConfig (CONFIG_MAX_OVERSPEED_PINGS); + uint32 max_count = sWorld->getIntConfig (CONFIG_MAX_OVERSPEED_PINGS); if (max_count && m_OverSpeedPings > max_count) { @@ -1029,7 +1029,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) if (m_Session && m_Session->GetSecurity() == SEC_PLAYER) { - sLog.outError ("WorldSocket::HandlePing: Player kicked for " + sLog->outError ("WorldSocket::HandlePing: Player kicked for " "over-speed pings address = %s", GetRemoteAddress().c_str()); @@ -1049,7 +1049,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) m_Session->SetLatency (latency); else { - sLog.outError ("WorldSocket::HandlePing: peer sent CMSG_PING, " + sLog->outError ("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/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index 33dd8f7b8d2..3445ecb54b4 100755 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -154,7 +154,7 @@ class ReactorRunnable : protected ACE_Task_Base virtual int svc() { - sLog.outStaticDebug ("Network Thread Starting"); + sLog->outStaticDebug ("Network Thread Starting"); ACE_ASSERT (m_Reactor); @@ -191,7 +191,7 @@ class ReactorRunnable : protected ACE_Task_Base } } - sLog.outStaticDebug ("Network Thread Exitting"); + sLog->outStaticDebug ("Network Thread Exitting"); return 0; } @@ -229,13 +229,13 @@ WorldSocketMgr::~WorldSocketMgr() int WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) { - m_UseNoDelay = sConfig.GetBoolDefault ("Network.TcpNodelay", true); + m_UseNoDelay = sConfig->GetBoolDefault ("Network.TcpNodelay", true); - int num_threads = sConfig.GetIntDefault ("Network.Threads", 1); + int num_threads = sConfig->GetIntDefault ("Network.Threads", 1); if (num_threads <= 0) { - sLog.outError ("Network.Threads is wrong in your config file"); + sLog->outError ("Network.Threads is wrong in your config file"); return -1; } @@ -243,16 +243,16 @@ 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->outBasic ("Max allowed socket connections %d", ACE::max_handles()); // -1 means use default - m_SockOutKBuff = sConfig.GetIntDefault ("Network.OutKBuff", -1); + m_SockOutKBuff = sConfig->GetIntDefault ("Network.OutKBuff", -1); - m_SockOutUBuff = sConfig.GetIntDefault ("Network.OutUBuff", 65536); + m_SockOutUBuff = sConfig->GetIntDefault ("Network.OutUBuff", 65536); if (m_SockOutUBuff <= 0) { - sLog.outError ("Network.OutUBuff is wrong in your config file"); + sLog->outError ("Network.OutUBuff is wrong in your config file"); return -1; } @@ -263,7 +263,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (acc->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1) { - sLog.outError ("Failed to open acceptor ,check if the port is free"); + sLog->outError ("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->IsOutDebug()) ACE_Log_Msg::instance()->priority_mask (LM_ERROR, ACE_Log_Msg::PROCESS); if (StartReactiveIO(port, address) == -1) @@ -330,7 +330,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock) (void*) & m_SockOutKBuff, sizeof (int)) == -1 && errno != ENOTSUP) { - sLog.outError ("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF"); + sLog->outError ("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF"); return -1; } } @@ -345,7 +345,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 ("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 139393bcc15..82ea9592ac0 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -54,8 +54,8 @@ void LoadSkillDiscoveryTable() if (!result) { - sLog.outErrorDb(">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty."); + sLog->outString(); return; } @@ -87,7 +87,7 @@ void LoadSkillDiscoveryTable() { if (reportedReqSpells.find(reqSkillOrSpell) == reportedReqSpells.end()) { - sLog.outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table",spellId,reqSkillOrSpell); + sLog->outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table",spellId,reqSkillOrSpell); reportedReqSpells.insert(reqSkillOrSpell); } continue; @@ -100,7 +100,7 @@ void LoadSkillDiscoveryTable() { if (reportedReqSpells.find(reqSkillOrSpell) == reportedReqSpells.end()) { - sLog.outErrorDb("Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc" + sLog->outErrorDb("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", reqSkillOrSpell,spellId); reportedReqSpells.insert(reqSkillOrSpell); @@ -116,7 +116,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->outErrorDb("Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table",spellId); continue; } @@ -125,7 +125,7 @@ void LoadSkillDiscoveryTable() } else { - sLog.outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table",spellId); + sLog->outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table",spellId); continue; } @@ -133,7 +133,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->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()); // report about empty data for explicit discovery spells for (uint32 spell_id = 1; spell_id < sSpellStore.GetNumRows(); ++spell_id) @@ -147,11 +147,11 @@ void LoadSkillDiscoveryTable() continue; if (SkillDiscoveryStore.find(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->outErrorDb("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->outString(">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) @@ -202,7 +202,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player) { for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) { - if (roll_chance_f(item_iter->chance * sWorld.getRate(RATE_SKILL_DISCOVERY)) && + if (roll_chance_f(item_iter->chance * sWorld->getRate(RATE_SKILL_DISCOVERY)) && item_iter->reqSkillValue <= skillvalue && !player->HasSpell(item_iter->spellId)) return item_iter->spellId; @@ -220,7 +220,7 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player) { for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) { - if (roll_chance_f(item_iter->chance * sWorld.getRate(RATE_SKILL_DISCOVERY)) && + if (roll_chance_f(item_iter->chance * sWorld->getRate(RATE_SKILL_DISCOVERY)) && item_iter->reqSkillValue <= skillvalue && !player->HasSpell(item_iter->spellId)) return item_iter->spellId; diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index 4687e6624a7..25955752987 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->outErrorDb(">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty."); + sLog->outString(); return; } @@ -75,28 +75,28 @@ void LoadSkillExtraItemTable() if (!sSpellStore.LookupEntry(spellId)) { - sLog.outError("Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId); + sLog->outError("Skill specialization %u has non-existent spell id in `skill_extra_item_template`!", spellId); continue; } uint32 requiredSpecialization = fields[1].GetUInt32(); if (!sSpellStore.LookupEntry(requiredSpecialization)) { - sLog.outError("Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId,requiredSpecialization); + sLog->outError("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("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("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->outString(">> Loaded %u spell specialization definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } 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 9acb142f2d9..1026f3dc417 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1127,7 +1127,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("Aura %d structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId()); } else { @@ -1379,7 +1379,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const caster->CalcAbsorbResist(target, GetSpellSchoolMask(GetSpellProto()), DOT, damage, &absorb, &resist, m_spellProto); - sLog.outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", + sLog->outDetail("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); @@ -1461,7 +1461,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const 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->outDetail("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, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0, crit); @@ -1513,7 +1513,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const //donator->SendSpellNonMeleeDamageLog(donator, GetId(), damage, GetSpellSchoolMask(spellProto), 0, 0, false, 0); caster->ModifyHealth(-(int32)damage); - sLog.outDebug("PeriodicTick: donator %u target %u damage %u.", target->GetEntry(), target->GetEntry(), damage); + sLog->outDebug("PeriodicTick: donator %u target %u damage %u.", target->GetEntry(), target->GetEntry(), damage); float gainMultiplier = SpellMgr::CalculateSpellEffectValueMultiplier(GetSpellProto(), GetEffIndex(), caster); @@ -1594,7 +1594,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (crit) damage = caster->SpellCriticalHealingBonus(m_spellProto, damage, target); - sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u", + sLog->outDetail("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; @@ -1680,7 +1680,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const damage = maxmana; } - sLog.outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u", + sLog->outDetail("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(), damage, GetId()); int32 drain_amount = std::min(target->GetPower(power), damage); @@ -1772,7 +1772,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const return; uint32 amount = m_amount * target->GetMaxPower(power) /100; - sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", + sLog->outDetail("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); @@ -1812,7 +1812,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const 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->outDetail("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(power,amount); @@ -2413,14 +2413,14 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const { Unit * triggerCaster = GetTriggeredSpellCaster(triggeredSpellInfo, caster, triggerTarget); triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this); - sLog.outDebug("AuraEffect::TriggerSpell: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); + sLog->outDebug("AuraEffect::TriggerSpell: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); } else { Creature* c = triggerTarget->ToCreature(); if (!c || (c && !sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature())) || (c && !c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex())))) - sLog.outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex()); + sLog->outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex()); } } @@ -2442,7 +2442,7 @@ void AuraEffect::TriggerSpellWithValue(Unit * target, Unit * caster) const triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, 0, 0, true, 0, this); } else - sLog.outError("AuraEffect::TriggerSpellWithValue: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex()); + sLog->outError("AuraEffect::TriggerSpellWithValue: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex()); } bool AuraEffect::IsAffectedOnSpell(SpellEntry const *spell) const @@ -3017,7 +3017,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const * aurApp, uint8 m case FORM_SPIRITOFREDEMPTION: break; default: - sLog.outError("Auras: Unknown Shapeshift Type: %u", GetMiscValue()); + sLog->outError("Auras: Unknown Shapeshift Type: %u", GetMiscValue()); } modelid = target->GetModelForForm(form); @@ -3264,7 +3264,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("Auras: unknown creature id = %d (only need its modelid) From Spell Aura Transform in Spell ID = %d", GetMiscValue(), GetId()); } else { @@ -3781,7 +3781,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(creatureEntry); if (!ci) { - sLog.outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need its modelid)",GetMiscValue()); + sLog->outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need its modelid)",GetMiscValue()); return; } @@ -4658,7 +4658,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const * aurApp, uint8 mode, b 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("WARNING: Spell %u effect %u has an unsupported misc value (%i) for SPELL_AURA_MOD_STAT ",GetId(),GetEffIndex(),GetMiscValue()); return; } @@ -4684,7 +4684,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("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid"); return; } @@ -4782,7 +4782,7 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const * aurApp, uint8 if (GetMiscValue() < -1 || GetMiscValue() > 4) { - sLog.outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid"); + sLog->outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid"); return; } @@ -4822,7 +4822,7 @@ void AuraEffect::HandleAuraModResistenceOfStatPercent(AuraApplication const * au { // 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("Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!"); return; } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 6257db65ade..aada5edc5fc 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -72,10 +72,10 @@ m_effectsToApply(effMask), m_removeMode(AURA_REMOVE_NONE), m_needClientUpdate(fa m_slot = slot; GetTarget()->SetVisibleAura(slot, this); SetNeedClientUpdate(); - sLog.outDebug("Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); + sLog->outDebug("Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); } else - sLog.outDebug("Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); + sLog->outDebug("Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); } m_isNeedManyNegativeEffects = false; @@ -140,7 +140,7 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) ASSERT(aurEff); ASSERT(HasEffect(effIndex) == (!apply)); ASSERT((1<GetAuraType(), apply, aurEff->GetAmount()); + sLog->outDebug("AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); Unit * caster = GetBase()->GetCaster(); m_flags &= ~(AFLAG_POSITIVE | AFLAG_NEGATIVE); @@ -181,7 +181,7 @@ void AuraApplication::ClientUpdate(bool remove) { ASSERT(!m_target->GetVisibleAura(m_slot)); data << uint32(0); - sLog.outDebug("Aura %u removed slot %u",GetBase()->GetId(), m_slot); + sLog->outDebug("Aura %u removed slot %u",GetBase()->GetId(), m_slot); m_target->SendMessageToSet(&data, true); return; } @@ -429,7 +429,7 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur // 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("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!", target->GetGUIDLow(), caster->GetGUIDLow(), auraApp->GetBase()->GetSpellProto()->Id); ASSERT(false); } @@ -962,7 +962,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, 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("Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId()); } if (spellId) caster->CastSpell(caster, spellId, true); @@ -1076,7 +1076,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, 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("Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId()); } caster->CastSpell(target, spellId, true, 0, GetEffect(0)); } @@ -1219,7 +1219,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, 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("Aura::HandleAuraSpecificMods: Unknown rank of Improved Fear (%d) found", aurEff->GetId()); } if (spellId) caster->CastSpell(target, spellId, true); @@ -1633,7 +1633,7 @@ void Aura::_DeleteRemovedApplications() void Aura::LoadScripts() { - sLog.outDebug("Aura::LoadScripts"); + sLog->outDebug("Aura::LoadScripts"); sScriptMgr->CreateAuraScripts(m_spellProto->Id, m_loadedScripts); for(std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 05211e602cb..235b052c0b7 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -258,50 +258,50 @@ void SpellCastTargets::Update(Unit* caster) void SpellCastTargets::OutDebug() { if (!m_targetMask) - sLog.outString("TARGET_FLAG_SELF"); + sLog->outString("TARGET_FLAG_SELF"); if (m_targetMask & TARGET_FLAG_UNIT) { - sLog.outString("TARGET_FLAG_UNIT: " UI64FMTD, m_unitTargetGUID); + sLog->outString("TARGET_FLAG_UNIT: " UI64FMTD, m_unitTargetGUID); } if (m_targetMask & TARGET_FLAG_UNK17) { - sLog.outString("TARGET_FLAG_UNK17: " UI64FMTD, m_unitTargetGUID); + sLog->outString("TARGET_FLAG_UNK17: " UI64FMTD, m_unitTargetGUID); } if (m_targetMask & TARGET_FLAG_OBJECT) { - sLog.outString("TARGET_FLAG_OBJECT: " UI64FMTD, m_GOTargetGUID); + sLog->outString("TARGET_FLAG_OBJECT: " UI64FMTD, m_GOTargetGUID); } if (m_targetMask & TARGET_FLAG_CORPSE) { - sLog.outString("TARGET_FLAG_CORPSE: " UI64FMTD, m_CorpseTargetGUID); + sLog->outString("TARGET_FLAG_CORPSE: " UI64FMTD, m_CorpseTargetGUID); } if (m_targetMask & TARGET_FLAG_PVP_CORPSE) { - sLog.outString("TARGET_FLAG_PVP_CORPSE: " UI64FMTD, m_CorpseTargetGUID); + sLog->outString("TARGET_FLAG_PVP_CORPSE: " UI64FMTD, m_CorpseTargetGUID); } if (m_targetMask & TARGET_FLAG_ITEM) { - sLog.outString("TARGET_FLAG_ITEM: " UI64FMTD, m_itemTargetGUID); + sLog->outString("TARGET_FLAG_ITEM: " UI64FMTD, m_itemTargetGUID); } if (m_targetMask & TARGET_FLAG_TRADE_ITEM) { - sLog.outString("TARGET_FLAG_TRADE_ITEM: " UI64FMTD, m_itemTargetGUID); + sLog->outString("TARGET_FLAG_TRADE_ITEM: " UI64FMTD, m_itemTargetGUID); } if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) { - sLog.outString("TARGET_FLAG_SOURCE_LOCATION: transport guid:" UI64FMTD " trans offset: %s position: %s", m_srcTransGUID, m_srcTransOffset.ToString().c_str(), m_srcPos.ToString().c_str()); + sLog->outString("TARGET_FLAG_SOURCE_LOCATION: transport guid:" UI64FMTD " trans offset: %s position: %s", m_srcTransGUID, m_srcTransOffset.ToString().c_str(), m_srcPos.ToString().c_str()); } if (m_targetMask & TARGET_FLAG_DEST_LOCATION) { - sLog.outString("TARGET_FLAG_DEST_LOCATION: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dstTransGUID, m_dstTransOffset.ToString().c_str(), m_dstPos.ToString().c_str()); + sLog->outString("TARGET_FLAG_DEST_LOCATION: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dstTransGUID, m_dstTransOffset.ToString().c_str(), m_dstPos.ToString().c_str()); } if (m_targetMask & TARGET_FLAG_STRING) { - sLog.outString("TARGET_FLAG_STRING: %s", m_strTarget.c_str()); + sLog->outString("TARGET_FLAG_STRING: %s", m_strTarget.c_str()); } - sLog.outString("speed: %f", m_speed); - sLog.outString("elevation: %f", m_elevation); + sLog->outString("speed: %f", m_speed); + sLog->outString("elevation: %f", m_elevation); } void SpellCastTargets::read (ByteBuffer & data, Unit * caster) @@ -549,7 +549,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("SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id); *m_selfContainer = NULL; } @@ -1564,7 +1564,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) if (roll_chance_i(i->second)) { m_caster->CastSpell(unit, i->first, true); - sLog.outDebug("Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->first->Id); + sLog->outDebug("Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->first->Id); } if (GetSpellDuration(i->first) == -1) { @@ -1829,7 +1829,7 @@ void Spell::SearchAreaTarget(std::list &TagUnitMap, float radius, SpellNo Unit *target = m_targets.getUnitTarget(); if (!target) { - sLog.outError("SPELL: cannot find unit target for spell ID %u\n", m_spellInfo->Id); + sLog->outError("SPELL: cannot find unit target for spell ID %u\n", m_spellInfo->Id); return; } pos = target; @@ -1887,7 +1887,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, Spe ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (conditions.empty()) { - sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 13)", m_spellInfo->Id, m_caster->GetEntry()); + sLog->outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 13)", m_spellInfo->Id, m_caster->GetEntry()); if (IsPositiveSpell(m_spellInfo->Id)) return SearchNearbyTarget(range, SPELL_TARGETS_ALLY, effIndex); else @@ -2044,7 +2044,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) Unit *target = m_targets.getUnitTarget(); if (!target) { - sLog.outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id); + sLog->outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id); break; } @@ -2195,7 +2195,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) Unit *target = m_targets.getUnitTarget(); if (!target) { - sLog.outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id); + sLog->outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id); break; } @@ -2238,7 +2238,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) { if (!m_targets.HasDst()) { - sLog.outError("SPELL: no destination for spell ID %u", m_spellInfo->Id); + sLog->outError("SPELL: no destination for spell ID %u", m_spellInfo->Id); break; } @@ -2293,7 +2293,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) } else { - sLog.outDebug("SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); + sLog->outDebug("SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); Unit *target = NULL; if (uint64 guid = m_caster->GetUInt64Value(UNIT_FIELD_TARGET)) target = ObjectAccessor::GetUnit(*m_caster, guid); @@ -2321,7 +2321,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) { if (!m_originalCaster || !m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) { - sLog.outError("SPELL: no current channeled spell for spell ID %u", m_spellInfo->Id); + sLog->outError("SPELL: no current channeled spell for spell ID %u", m_spellInfo->Id); break; } @@ -2332,7 +2332,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) if (Unit* target = Unit::GetUnit(*m_caster, m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_targets.getUnitTargetGUID())) AddUnitTarget(target, i); else - sLog.outError("SPELL: cannot find channel spell target for spell ID %u", m_spellInfo->Id); + sLog->outError("SPELL: cannot find channel spell target for spell ID %u", m_spellInfo->Id); break; case TARGET_DEST_CHANNEL_TARGET: if (m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_targets.HasDst()) @@ -2340,7 +2340,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) else if (Unit* target = Unit::GetUnit(*m_caster, m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->m_targets.getUnitTargetGUID())) m_targets.setDst(*target); else - sLog.outError("SPELL: cannot find channel spell destination for spell ID %u", m_spellInfo->Id); + sLog->outError("SPELL: cannot find channel spell destination for spell ID %u", m_spellInfo->Id); break; case TARGET_DEST_CHANNEL_CASTER: m_targets.setDst(*m_originalCaster->GetCurrentSpell(CURRENT_CHANNELED_SPELL)->GetCaster()); @@ -2369,7 +2369,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) AddUnitTarget(driver, i); break; default: - sLog.outError("Unhandled spell target %u", cur); + sLog->outError("Unhandled spell target %u", cur); break; } break; @@ -2381,7 +2381,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) Unit *target = m_targets.getUnitTarget(); if (!target) { - sLog.outError("SPELL: no chain unit target for spell ID %u", m_spellInfo->Id); + sLog->outError("SPELL: no chain unit target for spell ID %u", m_spellInfo->Id); return; } @@ -2559,7 +2559,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) break; default: - sLog.outDebug("Spell (ID: %u) (caster Entry: %u) does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); + sLog->outDebug("Spell (ID: %u) (caster Entry: %u) does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); if (m_spellInfo->Effect[i] == SPELL_EFFECT_TELEPORT_UNITS) SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENTRY, 0); @@ -2589,7 +2589,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) else { if (m_spellInfo->Effect[i] == SPELL_EFFECT_ACTIVATE_OBJECT) - sLog.outDebug("Spell (ID: %u) (caster Entry: %u) with SPELL_EFFECT_ACTIVATE_OBJECT does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); + sLog->outDebug("Spell (ID: %u) (caster Entry: %u) with SPELL_EFFECT_ACTIVATE_OBJECT does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); SearchGOAreaTarget(gobjectList, radius, pushType, SPELL_TARGETS_GO); } break; @@ -3050,11 +3050,11 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere // set timer base at cast time ReSetTimer(); - sLog.outDebug("Spell::prepare: spell id %u source %u caster %d triggered %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, m_IsTriggeredSpell ? 1 : 0, m_targets.getTargetMask()); + sLog->outDebug("Spell::prepare: spell id %u source %u caster %d triggered %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, m_IsTriggeredSpell ? 1 : 0, m_targets.getTargetMask()); //if (m_targets.getUnitTarget()) - // sLog.outError("Spell::prepare: unit target %u", m_targets.getUnitTarget()->GetEntry()); + // sLog->outError("Spell::prepare: unit target %u", m_targets.getUnitTarget()->GetEntry()); //if (m_targets.HasDst()) - // sLog.outError("Spell::prepare: pos target %f %f %f", m_targets.m_dstPos.m_positionX, m_targets.m_dstPos.m_positionY, m_targets.m_dstPos.m_positionZ); + // sLog->outError("Spell::prepare: pos target %f %f %f", m_targets.m_dstPos.m_positionX, m_targets.m_dstPos.m_positionY, m_targets.m_dstPos.m_positionZ); //Containers for channeled spells have to be set //TODO:Apply this to all casted spells if needed @@ -3634,7 +3634,7 @@ void Spell::update(uint32 difftime) if (m_targets.getUnitTargetGUID() && !m_targets.getUnitTarget()) { - sLog.outDebug("Spell %u is cancelled due to removal of target.", m_spellInfo->Id); + sLog->outDebug("Spell %u is cancelled due to removal of target.", m_spellInfo->Id); cancel(); return; } @@ -3671,7 +3671,7 @@ void Spell::update(uint32 difftime) // check if there are alive targets left if (!UpdateChanneledTargetList()) { - sLog.outDebug("Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); + sLog->outDebug("Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); SendChannelUpdate(0); finish(); } @@ -3763,7 +3763,7 @@ void Spell::finish(bool ok) SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell); if (spellInfo && spellInfo->SpellIconID == 2056) { - sLog.outDebug("Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id); + sLog->outDebug("Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id); m_caster->setDeathState(JUST_DIED); return; } @@ -3901,7 +3901,7 @@ void Spell::SendSpellStart() if (!IsNeedSendToClient()) return; - //sLog.outDebug("Sending SMSG_SPELL_START id=%u", m_spellInfo->Id); + //sLog->outDebug("Sending SMSG_SPELL_START id=%u", m_spellInfo->Id); uint32 castFlags = CAST_FLAG_UNKNOWN_2; if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO) @@ -3949,7 +3949,7 @@ void Spell::SendSpellGo() if (!IsNeedSendToClient()) return; - //sLog.outDebug("Sending SMSG_SPELL_GO id=%u", m_spellInfo->Id); + //sLog->outDebug("Sending SMSG_SPELL_GO id=%u", m_spellInfo->Id); uint32 castFlags = CAST_FLAG_UNKNOWN_9; @@ -4389,7 +4389,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("Cast item has no item prototype highId=%d, lowId=%d",m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow()); return; } @@ -4481,7 +4481,7 @@ void Spell::TakePower() if (m_spellInfo->powerType >= MAX_POWERS) { - sLog.outError("Spell::TakePower: Unknown power type '%d'", m_spellInfo->powerType); + sLog->outError("Spell::TakePower: Unknown power type '%d'", m_spellInfo->powerType); return; } @@ -4635,7 +4635,7 @@ void Spell::TakeRunePower() // you can gain some runic power when use runes float rp = (float)src->runePowerGain; - rp *= sWorld.getRate(RATE_POWER_RUNICPOWER_INCOME); + rp *= sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME); plr->ModifyPower(POWER_RUNIC_POWER, (int32)rp); } @@ -4712,7 +4712,7 @@ void Spell::HandleThreatSpells(uint32 spellId) m_targets.getUnitTarget()->AddThreat(m_caster, float(threat)); - sLog.outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr->GetSpellRank(spellId), threat); + sLog->outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr->GetSpellRank(spellId), threat); } void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i) @@ -4727,7 +4727,7 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar uint8 eff = m_spellInfo->Effect[i]; - sLog.outDebug("Spell: %u Effect : %u", m_spellInfo->Id, eff); + sLog->outDebug("Spell: %u Effect : %u", m_spellInfo->Id, eff); //we do not need DamageMultiplier here. damage = CalculateDamage(i, NULL); @@ -5260,7 +5260,7 @@ SpellCastResult Spell::CheckCast(bool strict) // chance for fail at orange skinning attempt if ((m_selfContainer && (*m_selfContainer) == this) && - skillValue < sWorld.GetConfigMaxSkillValue() && + skillValue < sWorld->GetConfigMaxSkillValue() && (ReqValue < 0 ? 0 : ReqValue) > irand(skillValue - 25, skillValue + 37)) return SPELL_FAILED_TRY_AGAIN; @@ -5325,7 +5325,7 @@ SpellCastResult Spell::CheckCast(bool strict) bool canFailAtMax = skillId != SKILL_HERBALISM && skillId != SKILL_MINING; // chance for failure in orange gather / lockpick (gathering skill can't fail at maxskill) - if ((canFailAtMax || skillValue < sWorld.GetConfigMaxSkillValue()) && reqSkillValue > irand(skillValue - 25, skillValue + 37)) + if ((canFailAtMax || skillValue < sWorld->GetConfigMaxSkillValue()) && reqSkillValue > irand(skillValue - 25, skillValue + 37)) return SPELL_FAILED_TRY_AGAIN; } break; @@ -5915,7 +5915,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("Spell::CheckPower: Unknown power type '%d'", m_spellInfo->powerType); return SPELL_FAILED_UNKNOWN; } @@ -6469,7 +6469,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->outDetail("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()); @@ -6504,7 +6504,7 @@ void Spell::DelayedChannel() else m_timer -= delaytime; - sLog.outDebug("Spell %u partially interrupted for %i ms, new duration: %u ms", m_spellInfo->Id, delaytime, m_timer); + sLog->outDebug("Spell %u partially interrupted for %i ms, new duration: %u ms", m_spellInfo->Id, delaytime, m_timer); for (std::list::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if ((*ihit).missCondition == SPELL_MISS_NONE) @@ -6729,7 +6729,7 @@ SpellEvent::~SpellEvent() } else { - sLog.outError("~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.", + sLog->outError("~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); } @@ -6859,7 +6859,7 @@ bool Spell::IsValidSingleTargetSpell(Unit const* target) const { if (target->GetMapId() == MAPID_INVALID) { - sLog.outDebug("Spell::IsValidSingleTargetSpell - a spell was cast on '%s' (GUIDLow: %u), but they have an invalid map id!", target->GetName(), target->GetGUIDLow()); + sLog->outDebug("Spell::IsValidSingleTargetSpell - a spell was cast on '%s' (GUIDLow: %u), but they have an invalid map id!", target->GetName(), target->GetGUIDLow()); return false; } for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -7123,7 +7123,7 @@ void Spell::SelectTrajTargets() float b = tangent(m_targets.m_elevation); float a = (dz - 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("Spell::SelectTrajTargets: a %f b %f", a, b);) float bestDist = GetSpellMaxRange(m_spellInfo, false); @@ -7138,11 +7138,11 @@ void Spell::SelectTrajTargets() const float objDist2d = m_targets.m_srcPos.GetExactDist2d(*itr) * cos(m_targets.m_srcPos.GetRelativeAngle(*itr)); const float dz = (*itr)->GetPositionZ() - m_targets.m_srcPos.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("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("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);) if (dist < bestDist && height < dz + size && height > dz - size) { bestDist = dist > 0 ? dist : 0; @@ -7150,7 +7150,7 @@ void Spell::SelectTrajTargets() } #define CHECK_DIST {\ - DEBUG_TRAJ(sLog.outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\ + DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: dist %f, height %f.", dist, height);)\ if (dist > bestDist) continue;\ if (dist < objDist2d + size && dist > objDist2d - size) { bestDist = dist; break; }\ } @@ -7207,7 +7207,7 @@ void Spell::SelectTrajTargets() 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("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);) if (distSq > sizeSq) { float factor = 1 - sqrt(sizeSq / distSq); @@ -7216,7 +7216,7 @@ void Spell::SelectTrajTargets() 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("Initial %f %f %f %f %f", x, y, z, distSq, sizeSq);) } } @@ -7267,7 +7267,7 @@ void Spell::CheckEffectExecuteData() void Spell::LoadScripts() { - sLog.outDebug("Spell::LoadScripts"); + sLog->outDebug("Spell::LoadScripts"); sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); for(std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 1218aaa1ee3..f87d9ef140f 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -233,7 +233,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= void Spell::EffectNULL(SpellEffIndex /*effIndex*/) { - sLog.outDebug("WORLD: Spell Effect DUMMY"); + sLog->outDebug("WORLD: Spell Effect DUMMY"); } void Spell::EffectUnused(SpellEffIndex /*effIndex*/) @@ -282,7 +282,7 @@ void Spell::EffectInstaKill(SpellEffIndex /*effIndex*/) case 1863: spellID = 18791; break; //succubus case 17252: spellID = 35701; break; //fellguard default: - sLog.outError("EffectInstaKill: Unhandled creature entry (%u) case.", entry); + sLog->outError("EffectInstaKill: Unhandled creature entry (%u) case.", entry); return; } @@ -818,7 +818,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) case 12850: damage *= 0.32f; break; // Rank 2 case 12868: damage *= 0.48f; break; // Rank 3 default: - sLog.outError("Spell::EffectDummy: Spell %u not handled in DW",m_spellInfo->Id); + sLog->outError("Spell::EffectDummy: Spell %u not handled in DW",m_spellInfo->Id); return; }; @@ -847,7 +847,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) m_caster->CastCustomSpell(unitTarget, 26470, &damage, NULL, NULL, true); break; default: - sLog.outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u",m_triggeredByAuraSpell->Id); + sLog->outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u",m_triggeredByAuraSpell->Id); break; } return; @@ -877,7 +877,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) Creature* creatureTarget = unitTarget->ToCreature(); m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, uint32(creatureTarget->GetRespawnTime()-time(NULL))); - sLog.outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019"); + sLog->outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019"); creatureTarget->ForcedDespawn(); @@ -1499,7 +1499,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("EffectDummy of spell %u: triggering unknown spell id %i\n", m_spellInfo->Id, spell_id); return; } @@ -1517,7 +1517,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } // normal DB scripted effect - sLog.outDebug("Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex); + sLog->outDebug("Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex); m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); // Script based implementation. Must be used only for not good for implementation in core spell effects @@ -1539,7 +1539,7 @@ void Spell::EffectTriggerSpellWithValue(SpellEffIndex effIndex) if (!spellInfo) { - sLog.outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); return; } @@ -1556,7 +1556,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("EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); return; } @@ -1577,7 +1577,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) if (!spellInfo) { - sLog.outError("EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); return; } @@ -1616,7 +1616,7 @@ void Spell::EffectForceCastWithValue(SpellEffIndex effIndex) if (!spellInfo) { - sLog.outError("EffectForceCastWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectForceCastWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); return; } int32 bp = damage; @@ -1632,7 +1632,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) if (!unitTarget) { if (gameObjTarget || itemTarget) - sLog.outError("Spell::EffectTriggerSpell (Spell: %u): Unsupported non-unit case!",m_spellInfo->Id); + sLog->outError("Spell::EffectTriggerSpell (Spell: %u): Unsupported non-unit case!",m_spellInfo->Id); return; } @@ -1761,7 +1761,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) SpellEntry const *spellInfo = sSpellStore.LookupEntry(triggered_spell_id); if (!spellInfo) { - sLog.outError("EffectTriggerSpell of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectTriggerSpell of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); return; } @@ -1787,13 +1787,13 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) if (!spellInfo) { - sLog.outError("EffectTriggerMissileSpell of spell %u (eff: %u): triggering unknown spell id %u", + sLog->outError("EffectTriggerMissileSpell of spell %u (eff: %u): triggering unknown spell id %u", m_spellInfo->Id,effIndex,triggered_spell_id); return; } if (m_CastItem) - sLog.outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); + sLog->outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id); // Remove spell cooldown (not category) if spell triggering spell with cooldown and same category // Needed by freezing arrow and few other spells @@ -1824,7 +1824,7 @@ void Spell::EffectJump(SpellEffIndex effIndex) } else { - sLog.outError("Spell::EffectJump - unsupported target mode for spell ID %u", m_spellInfo->Id); + sLog->outError("Spell::EffectJump - unsupported target mode for spell ID %u", m_spellInfo->Id); return; } @@ -1863,7 +1863,7 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) } else { - sLog.outError("Spell::EffectJumpDest - unsupported target mode for spell ID %u", m_spellInfo->Id); + sLog->outError("Spell::EffectJumpDest - unsupported target mode for spell ID %u", m_spellInfo->Id); return; } @@ -1912,7 +1912,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("Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id); return; } @@ -1924,7 +1924,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) m_targets.m_dstPos.GetPosition(x, y, z, orientation); if (!orientation && m_targets.getUnitTarget()) orientation = m_targets.getUnitTarget()->GetOrientation(); - sLog.outDebug("Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); + sLog->outDebug("Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); if (mapid == unitTarget->GetMapId()) unitTarget->NearTeleportTo(x, y, z, orientation, unitTarget == m_caster); @@ -2054,7 +2054,7 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex) _player->removeSpell(spellToUnlearn); - sLog.outDebug("Spell: Player %u has unlearned spell %u from NpcGUID: %u", _player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow()); + sLog->outDebug("Spell: Player %u has unlearned spell %u from NpcGUID: %u", _player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow()); } void Spell::EffectPowerDrain(SpellEffIndex effIndex) @@ -2096,7 +2096,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) /* we do not handle a flag dropping or clicking on flag in battleground by sendevent system */ - sLog.outDebug("Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->EffectMiscValue[effIndex], m_spellInfo->Id); + sLog->outDebug("Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->EffectMiscValue[effIndex], m_spellInfo->Id); Object *pTarget; if (focusObject) @@ -2195,7 +2195,7 @@ void Spell::SpellDamageHeal(SpellEffIndex /*effIndex*/) if (!targetAura) { - sLog.outError("Target(GUID:" UI64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID()); + sLog->outError("Target(GUID:" UI64FMTD ") has aurastate AURA_STATE_SWIFTMEND but no matching aura.", unitTarget->GetGUID()); return; } @@ -2298,7 +2298,7 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (!unitTarget || !unitTarget->isAlive() || damage < 0) return; - sLog.outDebug("HealthLeech :%i", damage); + sLog->outDebug("HealthLeech :%i", damage); float healMultiplier = SpellMgr::CalculateSpellEffectValueMultiplier(m_spellInfo, effIndex, m_originalCaster, this); @@ -2670,7 +2670,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) // TODO: possible must be moved to loot release (in different from linked triggering) if (gameObjTarget->GetGOInfo()->chest.eventId) { - sLog.outDebug("Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId,gameObjTarget->GetDBTableGUIDLow()); + sLog->outDebug("Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId,gameObjTarget->GetDBTableGUIDLow()); player->GetMap()->ScriptsStart(sEventScripts, gameObjTarget->GetGOInfo()->chest.eventId, player, gameObjTarget); } @@ -2692,7 +2692,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) { if (m_caster->GetTypeId() != TYPEID_PLAYER) { - sLog.outDebug("WORLD: Open Lock - No Player Caster!"); + sLog->outDebug("WORLD: Open Lock - No Player Caster!"); return; } @@ -2747,7 +2747,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) } else { - sLog.outDebug("WORLD: Open Lock - No GameObject/Item Target!"); + sLog->outDebug("WORLD: Open Lock - No GameObject/Item Target!"); return; } @@ -2917,7 +2917,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) SummonPropertiesEntry const *properties = sSummonPropertiesStore.LookupEntry(m_spellInfo->EffectMiscValueB[effIndex]); if (!properties) { - sLog.outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->EffectMiscValueB[effIndex]); + sLog->outError("EffectSummonType: Unhandled summon type %u", m_spellInfo->EffectMiscValueB[effIndex]); return; } @@ -3105,7 +3105,7 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex) uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : m_spellInfo->EffectTriggerSpell[effIndex]; player->learnSpell(spellToLearn, false); - sLog.outDebug("Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow()); + sLog->outDebug("Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow()); } typedef std::list< std::pair > DispelList; @@ -3365,7 +3365,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) if (m_CastItem) { unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10); - sLog.outDebug("SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),unitTarget->ToPlayer()->GetGUIDLow()); + sLog->outDebug("SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),unitTarget->ToPlayer()->GetGUIDLow()); return; } @@ -3374,13 +3374,13 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) { uint32 honor_reward = Trinity::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage)); unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward); - sLog.outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); + sLog->outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); } else { //maybe we have correct honor_gain in damage already unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage); - sLog.outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); + sLog->outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); } } @@ -3433,9 +3433,9 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", + sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName(),p_caster->GetSession()->GetAccountId(), itemTarget->GetProto()->Name1,itemTarget->GetEntry(), item_owner->GetName(),item_owner->GetSession()->GetAccountId()); @@ -3483,7 +3483,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("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; } @@ -3494,9 +3494,9 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", + sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName(),p_caster->GetSession()->GetAccountId(), itemTarget->GetProto()->Name1,itemTarget->GetEntry(), item_owner->GetName(),item_owner->GetSession()->GetAccountId()); @@ -3545,14 +3545,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) case 10: spell_id = 36758; break; // 14% case 11: spell_id = 36760; break; // 20% default: - sLog.outError("Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW",damage); + sLog->outError("Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW",damage); return; } SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); if (!spellInfo) { - sLog.outError("Spell::EffectEnchantItemTmp: unknown spell id %i", spell_id); + sLog->outError("Spell::EffectEnchantItemTmp: unknown spell id %i", spell_id); return; } @@ -3579,14 +3579,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("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("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ",m_spellInfo->Id,effIndex,enchant_id); return; } @@ -3624,9 +3624,9 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) if (!item_owner) return; - if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld.getBoolConfig(CONFIG_GM_LOG_TRADE)) + if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog.outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", + sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName(), p_caster->GetSession()->GetAccountId(), itemTarget->GetProto()->Name1, itemTarget->GetEntry(), item_owner->GetName(), item_owner->GetSession()->GetAccountId()); @@ -5092,7 +5092,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("Unknown Lightwell spell caster %u", m_caster->GetEntry()); return; } Aura * chargesaura = m_caster->GetAura(59907); @@ -5209,7 +5209,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("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect",m_spellInfo->Id); return; } // all seals have aura dummy in 2 effect @@ -5340,7 +5340,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } // normal DB scripted effect - sLog.outDebug("Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex); + sLog->outDebug("Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex); m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); } @@ -5485,13 +5485,13 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - if (!sWorld.getBoolConfig(CONFIG_CAST_UNSTUCK)) + if (!sWorld->getBoolConfig(CONFIG_CAST_UNSTUCK)) return; Player* pTarget = (Player*)unitTarget; - sLog.outDebug("Spell Effect: Stuck"); - sLog.outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", pTarget->GetName(), pTarget->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); + sLog->outDebug("Spell Effect: Stuck"); + sLog->outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", pTarget->GetName(), pTarget->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); if (pTarget->isInFlight()) return; @@ -6303,7 +6303,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->outErrorDb("Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast",name_id, m_spellInfo->Id); return; } @@ -6407,7 +6407,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) ExecuteLogEffectSummonObject(effIndex, pGameObj); - sLog.outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted"); + sLog->outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted"); //m_caster->AddGameObject(pGameObj); //m_ObjToDel.push_back(pGameObj); @@ -6449,7 +6449,7 @@ void Spell::EffectProspecting(SpellEffIndex /*effIndex*/) if (itemTarget->GetCount() < 5) return; - if (sWorld.getBoolConfig(CONFIG_SKILL_PROSPECTING)) + if (sWorld->getBoolConfig(CONFIG_SKILL_PROSPECTING)) { uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_JEWELCRAFTING); uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank; @@ -6471,7 +6471,7 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/) if (itemTarget->GetCount() < 5) return; - if (sWorld.getBoolConfig(CONFIG_SKILL_MILLING)) + if (sWorld->getBoolConfig(CONFIG_SKILL_MILLING)) { uint32 SkillValue = p_caster->GetPureSkillValue(SKILL_INSCRIPTION); uint32 reqSkillValue = itemTarget->GetProto()->RequiredSkillRank; @@ -6483,7 +6483,7 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/) void Spell::EffectSkill(SpellEffIndex /*effIndex*/) { - sLog.outDebug("WORLD: SkillEFFECT"); + sLog->outDebug("WORLD: SkillEFFECT"); } /* There is currently no need for this effect. We handle it in Battleground.cpp @@ -6510,7 +6510,7 @@ void Spell::EffectSpiritHeal(SpellEffIndex /*effIndex*/) // remove insignia spell effect void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) { - sLog.outDebug("Effect: SkinPlayerCorpse"); + sLog->outDebug("Effect: SkinPlayerCorpse"); if ((m_caster->GetTypeId() != TYPEID_PLAYER) || (unitTarget->GetTypeId() != TYPEID_PLAYER) || (unitTarget->isAlive())) return; @@ -6519,7 +6519,7 @@ void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) { - sLog.outDebug("Effect: StealBeneficialBuff"); + sLog->outDebug("Effect: StealBeneficialBuff"); if (!unitTarget || unitTarget == m_caster) // can't steal from self return; @@ -6946,7 +6946,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("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.",soundid,m_spellInfo->Id); return; } @@ -7068,7 +7068,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("Spell::EffectBind - unknown teleport coordinates for spell ID %u", m_spellInfo->Id); return; } @@ -7096,11 +7096,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->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); // zone update data.Initialize(SMSG_PLAYERBOUND, 8+4); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 22379b1db68..550dafc449d 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -373,7 +373,7 @@ uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, Spe // Else drain all power if (spellInfo->powerType < MAX_POWERS) return caster->GetPower(Powers(spellInfo->powerType)); - sLog.outError("CalculateManaCost: Unknown power type '%d' in spell %d", spellInfo->powerType, spellInfo->Id); + sLog->outError("CalculateManaCost: Unknown power type '%d' in spell %d", spellInfo->powerType, spellInfo->Id); return 0; } @@ -399,10 +399,10 @@ uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, Spe break; case POWER_RUNE: case POWER_RUNIC_POWER: - sLog.outDebug("CalculateManaCost: Not implemented yet!"); + sLog->outDebug("CalculateManaCost: Not implemented yet!"); break; default: - sLog.outError("CalculateManaCost: Unknown power type '%d' in spell %d", spellInfo->powerType, spellInfo->Id); + sLog->outError("CalculateManaCost: Unknown power type '%d' in spell %d", spellInfo->powerType, spellInfo->Id); return 0; } } @@ -1074,7 +1074,7 @@ SpellCastResult GetErrorAtShapeshiftedCast (SpellEntry const *spellInfo, uint32 shapeInfo = sSpellShapeshiftStore.LookupEntry(form); if (!shapeInfo) { - sLog.outError("GetErrorAtShapeshiftedCast: unknown shapeshift %u", form); + sLog->outError("GetErrorAtShapeshiftedCast: unknown shapeshift %u", form); return SPELL_CAST_OK; } actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells @@ -1116,8 +1116,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->outString(">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty."); + sLog->outString(); return; } @@ -1141,20 +1141,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->outErrorDb("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->outErrorDb("Spell (ID:%u) target coordinates not provided.",Spell_ID); continue; } SpellEntry const* spellInfo = sSpellStore.LookupEntry(Spell_ID); if (!spellInfo) { - sLog.outErrorDb("Spell (ID:%u) listed in `spell_target_position` does not exist.",Spell_ID); + sLog->outErrorDb("Spell (ID:%u) listed in `spell_target_position` does not exist.",Spell_ID); continue; } @@ -1169,7 +1169,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->EffectMiscValue[i])) { - sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], area_id); + sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], area_id); break; } } @@ -1180,7 +1180,7 @@ void SpellMgr::LoadSpellTargetPositions() } if (!found) { - sLog.outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DST_DB (17).",Spell_ID); + sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DST_DB (17).",Spell_ID); continue; } @@ -1219,12 +1219,12 @@ void SpellMgr::LoadSpellTargetPositions() if (found) { // if (!sSpellMgr->GetSpellTargetPosition(i)) -// sLog.outDebug("Spell (ID: %u) does not have record in `spell_target_position`", i); +// sLog->outDebug("Spell (ID: %u) does not have record in `spell_target_position`", i); } } - sLog.outString(">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool SpellMgr::IsAffectedByMod(SpellEntry const *spellInfo, SpellModifier *mod) const @@ -1257,8 +1257,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 %u spell proc event conditions", count); - sLog.outString(); + sLog->outString(">> Loaded %u spell proc event conditions", count); + sLog->outString(); return; } @@ -1273,7 +1273,7 @@ void SpellMgr::LoadSpellProcEvents() const SpellEntry *spell = sSpellStore.LookupEntry(entry); if (!spell) { - sLog.outErrorDb("Spell %u listed in `spell_proc_event` does not exist", entry); + sLog->outErrorDb("Spell %u listed in `spell_proc_event` does not exist", entry); continue; } @@ -1296,7 +1296,7 @@ void SpellMgr::LoadSpellProcEvents() { if (spe.procFlags == 0) { - sLog.outErrorDb("Spell %u listed in `spell_proc_event` probally not triggered spell", entry); + sLog->outErrorDb("Spell %u listed in `spell_proc_event` probally not triggered spell", entry); continue; } customProc++; @@ -1305,10 +1305,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->outString(">> 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->outString(">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellBonusess() @@ -1321,8 +1321,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 %u spell bonus data", count); - sLog.outString(); + sLog->outString(">> Loaded %u spell bonus data", count); + sLog->outString(); return; } @@ -1334,7 +1334,7 @@ void SpellMgr::LoadSpellBonusess() const SpellEntry *spell = sSpellStore.LookupEntry(entry); if (!spell) { - sLog.outErrorDb("Spell %u listed in `spell_bonus_data` does not exist", entry); + sLog->outErrorDb("Spell %u listed in `spell_bonus_data` does not exist", entry); continue; } @@ -1349,8 +1349,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->outString(">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active) @@ -1498,8 +1498,8 @@ void SpellMgr::LoadSpellGroups() - sLog.outString(); - sLog.outString(">> Loaded %u spell group definitions", count); + sLog->outString(); + sLog->outString(">> Loaded %u spell group definitions", count); return; } @@ -1514,7 +1514,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_groups` is in core range, but is not defined in core!", group_id); + sLog->outErrorDb("SpellGroup id %u listed in `spell_groups` is in core range, but is not defined in core!", group_id); continue; } int32 spell_id = fields[1].GetInt32(); @@ -1530,7 +1530,7 @@ void SpellMgr::LoadSpellGroups() { if (groups.find(abs(itr->second)) == groups.end()) { - sLog.outErrorDb("SpellGroup id %u listed in `spell_groups` does not exist", abs(itr->second)); + sLog->outErrorDb("SpellGroup id %u listed in `spell_groups` does not exist", abs(itr->second)); mSpellGroupSpell.erase(itr++); } else @@ -1542,12 +1542,12 @@ void SpellMgr::LoadSpellGroups() if (!spellInfo) { - sLog.outErrorDb("Spell %u listed in `spell_group` does not exist", itr->second); + sLog->outErrorDb("Spell %u listed in `spell_group` does not exist", itr->second); mSpellGroupSpell.erase(itr++); } else if (GetSpellRank(itr->second) > 1) { - sLog.outErrorDb("Spell %u listed in `spell_group` is not first rank of spell", itr->second); + sLog->outErrorDb("Spell %u listed in `spell_group` is not first rank of spell", itr->second); mSpellGroupSpell.erase(itr++); } else @@ -1567,8 +1567,8 @@ void SpellMgr::LoadSpellGroups() } } - sLog.outString(">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellGroupStackRules() @@ -1585,8 +1585,8 @@ void SpellMgr::LoadSpellGroupStackRules() { - sLog.outString(">> Loaded 0 spell group stack rules"); - sLog.outString(); + sLog->outString(">> Loaded 0 spell group stack rules"); + sLog->outString(); return; } @@ -1600,7 +1600,7 @@ void SpellMgr::LoadSpellGroupStackRules() uint8 stack_rule = fields[1].GetUInt32(); if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX) { - sLog.outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule); + sLog->outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule); continue; } @@ -1608,7 +1608,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->outErrorDb("SpellGroup id %u listed in `spell_group_stack_rules` does not exist", group_id); continue; } @@ -1617,8 +1617,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->outString(">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellThreats() @@ -1636,8 +1636,8 @@ void SpellMgr::LoadSpellThreats() - sLog.outString(">> Loaded %u aggro generating spells", count); - sLog.outString(); + sLog->outString(">> Loaded %u aggro generating spells", count); + sLog->outString(); return; } @@ -1652,7 +1652,7 @@ void SpellMgr::LoadSpellThreats() if (!sSpellStore.LookupEntry(entry)) { - sLog.outErrorDb("Spell %u listed in `spell_threat` does not exist", entry); + sLog->outErrorDb("Spell %u listed in `spell_threat` does not exist", entry); continue; } @@ -1661,8 +1661,8 @@ void SpellMgr::LoadSpellThreats() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u aggro generating spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u aggro generating spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellId_2) const @@ -1971,8 +1971,8 @@ void SpellMgr::LoadSpellLearnSkills() } } - sLog.outString(">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellLearnSpells() @@ -1986,9 +1986,9 @@ void SpellMgr::LoadSpellLearnSpells() if (!result) { - sLog.outString(">> Loaded 0 spell learn spells"); - sLog.outString(); - sLog.outErrorDb("`spell_learn_spell` table is empty!"); + sLog->outString(">> Loaded 0 spell learn spells"); + sLog->outString(); + sLog->outErrorDb("`spell_learn_spell` table is empty!"); return; } @@ -2007,19 +2007,19 @@ void SpellMgr::LoadSpellLearnSpells() if (!sSpellStore.LookupEntry(spell_id)) { - sLog.outErrorDb("Spell %u listed in `spell_learn_spell` does not exist", spell_id); + sLog->outErrorDb("Spell %u listed in `spell_learn_spell` does not exist", spell_id); continue; } if (!sSpellStore.LookupEntry(node.spell)) { - sLog.outErrorDb("Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.spell); + sLog->outErrorDb("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->outErrorDb("Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.spell); continue; } @@ -2061,7 +2061,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->outErrorDb("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; @@ -2077,8 +2077,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->outString(">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellPetAuras() @@ -2091,8 +2091,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->outString(">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty."); + sLog->outString(); return; } @@ -2116,21 +2116,21 @@ void SpellMgr::LoadSpellPetAuras() SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell); if (!spellInfo) { - sLog.outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell); + sLog->outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell); continue; } if (spellInfo->Effect[eff] != SPELL_EFFECT_DUMMY && (spellInfo->Effect[eff] != SPELL_EFFECT_APPLY_AURA || spellInfo->EffectApplyAuraName[eff] != SPELL_AURA_DUMMY)) { - sLog.outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell); + sLog->outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell); continue; } SpellEntry const* spellInfo2 = sSpellStore.LookupEntry(aura); if (!spellInfo2) { - sLog.outErrorDb("Aura %u listed in `spell_pet_auras` does not exist", aura); + sLog->outErrorDb("Aura %u listed in `spell_pet_auras` does not exist", aura); continue; } @@ -2141,8 +2141,8 @@ void SpellMgr::LoadSpellPetAuras() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadPetLevelupSpellMap() @@ -2200,8 +2200,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->outString(">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } bool LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefaultSpellsEntry& petDefSpells) @@ -2289,10 +2289,10 @@ void SpellMgr::LoadPetDefaultSpells() } } - sLog.outString(">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); - sLog.outString("Loading summonable creature templates..."); + sLog->outString("Loading summonable creature templates..."); oldMSTime = getMSTime(); @@ -2336,8 +2336,8 @@ void SpellMgr::LoadPetDefaultSpells() } - sLog.outString(">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } /// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc @@ -2371,7 +2371,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) if (pl) ChatHandler(pl).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->outErrorDb("Craft spell %u not have create item entry.",spellInfo->Id); } return false; } @@ -2385,7 +2385,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) if (pl) ChatHandler(pl).PSendSysMessage("Craft spell %u create not-exist in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->EffectItemType[i]); else - sLog.outErrorDb("Craft spell %u create not-exist in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->EffectItemType[i]); + sLog->outErrorDb("Craft spell %u create not-exist in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->EffectItemType[i]); } return false; } @@ -2403,7 +2403,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) if (pl) ChatHandler(pl).PSendSysMessage("Spell %u learn to broken spell %u, and then...",spellInfo->Id,spellInfo->EffectTriggerSpell[i]); else - sLog.outErrorDb("Spell %u learn to invalid spell %u, and then...",spellInfo->Id,spellInfo->EffectTriggerSpell[i]); + sLog->outErrorDb("Spell %u learn to invalid spell %u, and then...",spellInfo->Id,spellInfo->EffectTriggerSpell[i]); } return false; } @@ -2423,7 +2423,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) if (pl) ChatHandler(pl).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->outErrorDb("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->Reagent[j]); } return false; } @@ -2448,8 +2448,8 @@ void SpellMgr::LoadSpellAreas() if (!result) { - sLog.outString(">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); + sLog->outString(); return; } @@ -2479,7 +2479,7 @@ void SpellMgr::LoadSpellAreas() } else { - sLog.outErrorDb("Spell %u listed in `spell_area` does not exist", spell); + sLog->outErrorDb("Spell %u listed in `spell_area` does not exist", spell); continue; } @@ -2508,20 +2508,20 @@ void SpellMgr::LoadSpellAreas() if (!ok) { - sLog.outErrorDb("Spell %u listed in `spell_area` already listed with similar requirements.", spell); + sLog->outErrorDb("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->outErrorDb("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->outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart); continue; } @@ -2529,13 +2529,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->outErrorDb("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->outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd); continue; } } @@ -2545,13 +2545,13 @@ void SpellMgr::LoadSpellAreas() SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(spellArea.auraSpell)); if (!spellInfo) { - sLog.outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell,abs(spellArea.auraSpell)); + sLog->outErrorDb("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->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell,abs(spellArea.auraSpell)); continue; } @@ -2571,7 +2571,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->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell); continue; } @@ -2587,7 +2587,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->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell); continue; } } @@ -2595,13 +2595,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->outErrorDb("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->outErrorDb("Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.gender); continue; } @@ -2631,8 +2631,8 @@ void SpellMgr::LoadSpellAreas() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spellInfo, uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player) @@ -2786,8 +2786,8 @@ void SpellMgr::LoadSkillLineAbilityMap() ++count; } - sLog.outString(">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto, bool triggered) @@ -3215,8 +3215,8 @@ void SpellMgr::LoadSpellEnchantProcData() { - sLog.outString(">> Loaded %u spell enchant proc event conditions", count); - sLog.outString(); + sLog->outString(">> Loaded %u spell enchant proc event conditions", count); + sLog->outString(); return; } @@ -3230,7 +3230,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->outErrorDb("Enchancment %u listed in `spell_enchant_proc_data` does not exist", enchantId); continue; } @@ -3245,8 +3245,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->outString(">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellRequired() @@ -3261,9 +3261,9 @@ void SpellMgr::LoadSpellRequired() if (!result) { - sLog.outString(">> Loaded 0 spell required records"); - sLog.outString(); - sLog.outErrorDb("`spell_required` table is empty!"); + sLog->outString(">> Loaded 0 spell required records"); + sLog->outString(); + sLog->outErrorDb("`spell_required` table is empty!"); return; } uint32 rows = 0; @@ -3278,23 +3278,23 @@ void SpellMgr::LoadSpellRequired() SpellEntry const * spell = sSpellStore.LookupEntry(spell_id); if (!spell) { - sLog.outErrorDb("spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id); + sLog->outErrorDb("spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id); continue; } SpellEntry const * req_spell = sSpellStore.LookupEntry(spell_req); if (!req_spell) { - sLog.outErrorDb("req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req); + sLog->outErrorDb("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->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); 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->outErrorDb("duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id); continue; } @@ -3303,8 +3303,8 @@ void SpellMgr::LoadSpellRequired() ++rows; } while (result->NextRow()); - sLog.outString(">> Loaded %u spell required records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spell required records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellRanks() @@ -3318,9 +3318,9 @@ void SpellMgr::LoadSpellRanks() if (!result) { - sLog.outString(">> Loaded 0 spell rank records"); - sLog.outString(); - sLog.outErrorDb("`spell_ranks` table is empty!"); + sLog->outString(">> Loaded 0 spell rank records"); + sLog->outString(); + sLog->outErrorDb("`spell_ranks` table is empty!"); return; } @@ -3360,13 +3360,13 @@ void SpellMgr::LoadSpellRanks() SpellEntry const * first = sSpellStore.LookupEntry(lastSpell); if (!first) { - sLog.outErrorDb("Spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell); + sLog->outErrorDb("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->outErrorDb("There is only 1 spell rank for identifier(first_spell_id) %u in `spell_ranks`, entry is not needed!", lastSpell); continue; } int32 curRank = 0; @@ -3377,14 +3377,14 @@ void SpellMgr::LoadSpellRanks() SpellEntry const * spell = sSpellStore.LookupEntry(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->outErrorDb("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->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); valid = false; break; } @@ -3415,8 +3415,8 @@ void SpellMgr::LoadSpellRanks() while (true); } while (!finished); - sLog.outString(">> Loaded %u spell rank records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u spell rank records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // set data in core for now @@ -4007,8 +4007,8 @@ void SpellMgr::LoadSpellCustomAttr() CreatureAI::FillAISpellInfo(); - sLog.outString(">> Loaded %u custom spell attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u custom spell attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Fill custom data about enchancments @@ -4051,8 +4051,8 @@ void SpellMgr::LoadEnchantCustomAttr() } } - sLog.outString(">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void SpellMgr::LoadSpellLinked() @@ -4065,8 +4065,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->outString(">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty."); + sLog->outString(); return; } @@ -4084,13 +4084,13 @@ void SpellMgr::LoadSpellLinked() SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(trigger)); if (!spellInfo) { - sLog.outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(trigger)); + sLog->outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(trigger)); continue; } spellInfo = sSpellStore.LookupEntry(abs(effect)); if (!spellInfo) { - sLog.outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(effect)); + sLog->outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(effect)); continue; } @@ -4120,6 +4120,6 @@ void SpellMgr::LoadSpellLinked() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 27741b82080..fa618657202 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -1070,7 +1070,7 @@ class SpellMgr uint32 mode = uint32(Caster->GetMap()->GetSpawnMode()); if (mode >= MAX_DIFFICULTY) { - sLog.outError("GetSpellForDifficultyFromSpell: Incorrect Difficulty for spell %u.", spell->Id); + sLog->outError("GetSpellForDifficultyFromSpell: Incorrect Difficulty for spell %u.", spell->Id); return spell;//return source spell } uint32 SpellDiffId = GetSpellDifficultyId(spell->Id); @@ -1080,27 +1080,27 @@ class SpellMgr SpellDifficultyEntry const *SpellDiff = sSpellDifficultyStore.LookupEntry(SpellDiffId); if (!SpellDiff) { - sLog.outDebug("GetSpellForDifficultyFromSpell: SpellDifficultyEntry not found for spell %u. This Should never happen.", spell->Id); + sLog->outDebug("GetSpellForDifficultyFromSpell: SpellDifficultyEntry not found for spell %u. This Should never happen.", spell->Id); return spell;//return source spell } if (SpellDiff->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC) { uint8 baseMode = mode; mode -= 2; - sLog.outDebug("GetSpellForDifficultyFromSpell: spell %u mode %u spell is NULL, using mode %u", spell->Id, baseMode, mode); + sLog->outDebug("GetSpellForDifficultyFromSpell: spell %u mode %u spell is NULL, using mode %u", spell->Id, baseMode, mode); } if (SpellDiff->SpellID[mode] <= 0) { - sLog.outErrorDb("GetSpellForDifficultyFromSpell: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spell->Id, mode); + sLog->outErrorDb("GetSpellForDifficultyFromSpell: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spell->Id, mode); return spell; } SpellEntry const* newSpell = sSpellStore.LookupEntry(SpellDiff->SpellID[mode]); if (!newSpell) { - sLog.outDebug("GetSpellForDifficultyFromSpell: spell %u not found in SpellStore. Check spelldifficulty_dbc!", SpellDiff->SpellID[mode]); + sLog->outDebug("GetSpellForDifficultyFromSpell: spell %u not found in SpellStore. Check spelldifficulty_dbc!", SpellDiff->SpellID[mode]); return spell; } - sLog.outDebug("GetSpellForDifficultyFromSpell: spellid for spell %u in mode %u is %u ", spell->Id, mode, newSpell->Id); + sLog->outDebug("GetSpellForDifficultyFromSpell: spellid for spell %u in mode %u is %u ", spell->Id, mode, newSpell->Id); return newSpell; } diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index baaeaa3c1fc..ade0c63b2b8 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -24,7 +24,7 @@ bool _SpellScript::_Validate(SpellEntry 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("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; @@ -183,7 +183,7 @@ bool SpellScript::_Validate(SpellEntry const * entry) { if (!(*itr).GetAffectedEffectsMask(entry)) { - sLog.outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); } } return _SpellScript::_Validate(entry); @@ -255,7 +255,7 @@ Unit * SpellScript::GetHitUnit() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitUnit was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->unitTarget; @@ -265,7 +265,7 @@ Creature * SpellScript::GetHitCreature() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitCreature was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } if (m_spell->unitTarget) @@ -278,7 +278,7 @@ Player * SpellScript::GetHitPlayer() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitPlayer was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } if (m_spell->unitTarget) @@ -291,7 +291,7 @@ Item * SpellScript::GetHitItem() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitItem was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->itemTarget; @@ -301,7 +301,7 @@ GameObject * SpellScript::GetHitGObj() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->gameObjTarget; @@ -311,7 +311,7 @@ int32 SpellScript::GetHitDamage() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitDamage was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->m_damage; @@ -321,7 +321,7 @@ void SpellScript::SetHitDamage(int32 damage) { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitDamage was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return; } m_spell->m_damage = damage; @@ -331,7 +331,7 @@ int32 SpellScript::GetHitHeal() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitHeal was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } return m_spell->m_healing; @@ -341,7 +341,7 @@ void SpellScript::SetHitHeal(int32 heal) { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetHitHeal was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return; } m_spell->m_healing = heal; @@ -351,7 +351,7 @@ Aura* SpellScript::GetHitAura() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitAura was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return NULL; } if (!m_spell->m_spellAura) @@ -365,7 +365,7 @@ void SpellScript::PreventHitAura() { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitAura was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return; } if (m_spell->m_spellAura) @@ -376,7 +376,7 @@ void SpellScript::PreventHitEffect(SpellEffIndex effIndex) { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitEffect was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return; } m_hitPreventEffectMask |= 1 << effIndex; @@ -387,7 +387,7 @@ void SpellScript::PreventHitDefaultEffect(SpellEffIndex effIndex) { if (!IsInHitPhase()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return; } m_hitPreventDefaultEffectMask |= 1 << effIndex; @@ -397,7 +397,7 @@ int32 SpellScript::GetEffectValue() { if (!IsInEffectHook()) { - sLog.outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::PreventHitDefaultEffect was called while spell not in hit phase!", m_scriptName->c_str(), m_scriptSpellId); return 0; } return m_spell->damage; @@ -417,31 +417,31 @@ bool AuraScript::_Validate(SpellEntry const * entry) { for (std::list::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 - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list::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 - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list::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 - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list::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 - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list::iterator itr = OnEffectCalcAmount.begin(); itr != OnEffectCalcAmount.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - sLog.outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list::iterator itr = OnEffectCalcPeriodic.begin(); itr != OnEffectCalcPeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - sLog.outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); for (std::list::iterator itr = OnEffectCalcSpellMod.begin(); itr != OnEffectCalcSpellMod.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - sLog.outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); + sLog->outError("TSCR: Spell `%u` Effect `%s` of script`%s` did not match dbc effect data - bound handler won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); return _SpellScript::_Validate(entry); } @@ -583,7 +583,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("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; } } diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index b4dc9f60971..5f8d2d2c4e9 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -33,8 +33,8 @@ void CreatureTextMgr::LoadCreatureTexts() if (!result) { - sLog.outString(">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); - sLog.outString(); + sLog->outString(">> Loaded 0 ceature texts. DB table `creature_texts` is empty."); + sLog->outString(); return; } @@ -60,25 +60,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->outErrorDb("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->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)); temp.lang = LANG_UNIVERSAL; } if (temp.type >= CHAT_TYPE_ZONE_YELL)//CHAT_TYPE_ZONE_YELL and more will be used later { - 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->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)); temp.type = CHAT_TYPE_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->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)); temp.emote = EMOTE_ONESHOT_NONE; } } @@ -101,8 +101,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->outString(">> Loaded %u creature texts for %u creatures in %u ms", textCount, creatureCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid, ChatType msgtype, Language language, TextRange range, uint32 sound, Team team, bool gmOnly, Player* srcPlr) @@ -112,14 +112,14 @@ 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->outErrorDb("CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.",source->GetName(), source->GetEntry()); return 0; } CreatureTextHolder TextHolder = (*sList).second; 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->outErrorDb("CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.",uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry()); return 0; } CreatureTextGroup TextGroup = (*itr).second;//has all texts in the group @@ -226,7 +226,7 @@ void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id) mTextRepeatMap[source->GetGUID()][textGroup].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->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)); } CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup) @@ -278,7 +278,7 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C sendType = CHAT_MSG_MONSTER_WHISPER; else { - sLog.outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_WHISPER with targetGuid 0. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); + sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_WHISPER with targetGuid 0. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); return; } break; @@ -287,7 +287,7 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C sendType = CHAT_MSG_RAID_BOSS_WHISPER; else { - sLog.outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_BOSS_WHISPER with targetGuid 0. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); + sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_BOSS_WHISPER with targetGuid 0. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); return; } break; @@ -304,7 +304,7 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C *data << (uint64)whisperGuid; // Unit Target if (whisperGuid && !IS_PLAYER_GUID(whisperGuid)) //can only whisper players { - sLog.outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); + sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); return; //*data << (uint32)1; // target name length //*data << (uint8)0; // target name @@ -319,16 +319,16 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha if (!source) return; - float dist = sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY); + float dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY); switch (msgtype) { case CHAT_TYPE_YELL: - dist = sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL); + dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL); break; case CHAT_TYPE_BOSS_EMOTE: case CHAT_TYPE_TEXT_EMOTE: - dist = sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE); + dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE); break; case CHAT_TYPE_WHISPER: case CHAT_TYPE_BOSS_WHISPER: @@ -390,7 +390,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha return; case TEXT_RANGE_WORLD: { - const SessionMap smap = sWorld.GetAllSessions(); + const SessionMap smap = sWorld->GetAllSessions(); for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) { if (Player* plr = (*iter).second->GetPlayer()) @@ -417,14 +417,14 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) CreatureTextMap::const_iterator sList = mTextMap.find(sourceEntry); if (sList == mTextMap.end()) { - sLog.outDebug("CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); + sLog->outDebug("CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); return false; } CreatureTextHolder TextHolder = (*sList).second; CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); if (itr == TextHolder.end()) { - sLog.outDebug("CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).",uint32(textGroup), sourceEntry); + sLog->outDebug("CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).",uint32(textGroup), sourceEntry); return false; } return true; diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index fdc11a1df72..8a61bdd10e6 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -55,8 +55,8 @@ void TicketMgr::LoadGMTickets() if (!result) { - sLog.outString(">> Loaded 0 GM tickets. DB table `gm_tickets` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 GM tickets. DB table `gm_tickets` is empty!"); + sLog->outString(); return; } @@ -98,8 +98,8 @@ void TicketMgr::LoadGMTickets() m_GMticketid = fields[0].GetUInt64(); } - sLog.outString(">> Loaded %u GM tickets in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u GM tickets in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void TicketMgr::LoadGMSurveys() @@ -116,8 +116,8 @@ void TicketMgr::LoadGMSurveys() else m_GMSurveyID = 0; - sLog.outString(">> Loaded GM Survey count from database in %u ms", GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded GM Survey count from database in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void TicketMgr::AddOrUpdateGMTicket(GM_Ticket &ticket, bool create) diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index a9d1a9334d0..f7361847bba 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -137,7 +137,7 @@ public: void Initialize() { - SetStatus(sWorld.getBoolConfig(CONFIG_ALLOW_TICKETS)); + SetStatus(sWorld->getBoolConfig(CONFIG_ALLOW_TICKETS)); } GM_Ticket *GetOldestOpenGMTicket() diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index 2a949c03db8..ed85d8cb062 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -25,10 +25,10 @@ void CharacterDatabaseCleaner::CleanDatabase() { // config to disable - if(!sWorld.getBoolConfig(CONFIG_CLEAN_CHARACTER_DB)) + if(!sWorld->getBoolConfig(CONFIG_CLEAN_CHARACTER_DB)) return; - sLog.outString("Cleaning character database..."); + sLog->outString("Cleaning character database..."); uint32 oldMSTime = getMSTime(); @@ -49,8 +49,8 @@ void CharacterDatabaseCleaner::CleanDatabase() CleanCharacterTalent(); CharacterDatabase.Query("UPDATE worldstates SET value = 0 WHERE entry=20004"); - sLog.outString(">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void CharacterDatabaseCleaner::CheckUnique(const char* column, const @@ -59,7 +59,7 @@ char* table, bool (*check)(uint32)) QueryResult result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table); if(!result) { - sLog.outString( "Table %s is empty.", table ); + sLog->outString( "Table %s is empty.", table ); return; } diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 30ca207bd4d..821e5e6afe4 100755 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -471,7 +471,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("LoadPlayerDump: Can't extract table name from line: '%s'!", line.c_str()); ROLLBACK(DUMP_FILE_BROKEN); } @@ -488,7 +488,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("LoadPlayerDump: Unknown table: '%s'!", tn.c_str()); ROLLBACK(DUMP_FILE_BROKEN); } @@ -634,7 +634,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s break; } default: - sLog.outError("Unknown dump table type: %u",type); + sLog->outError("Unknown dump table type: %u",type); break; } diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index c35a9dbbf06..3e021a76f61 100755 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -33,11 +33,11 @@ Weather::Weather(uint32 zone, WeatherData const* weatherChances) : m_zone(zone), m_weatherChances(weatherChances) { - m_timer.SetInterval(sWorld.getIntConfig(CONFIG_INTERVAL_CHANGEWEATHER)); + m_timer.SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_CHANGEWEATHER)); 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->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS))); } /// Launch a weather update @@ -91,13 +91,13 @@ bool Weather::ReGenerate() //78 days between January 1st and March 20nd; 365/4=91 days by season // season source http://aa.usno.navy.mil/data/docs/EarthSeasons.html - time_t gtime = sWorld.GetGameTime(); + time_t gtime = sWorld->GetGameTime(); struct tm * ltime = localtime(>ime); uint32 season = ((ltime->tm_yday - 78 + 365)/91)%4; static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" }; - sLog.outDebug("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); + sLog->outDebug("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); if ((u < 60) && (m_grade < 0.33333334f)) // Get fair { @@ -208,7 +208,7 @@ void Weather::SendFineWeatherUpdateToPlayer(Player *player) /// Send the new weather to all players in the zone bool Weather::UpdateWeather() { - Player* player = sWorld.FindPlayerInZone(m_zone); + Player* player = sWorld->FindPlayerInZone(m_zone); if (!player) return false; @@ -266,7 +266,7 @@ bool Weather::UpdateWeather() wthstr = "fine"; break; } - sLog.outDetail("Change the weather of zone %u to %s.", m_zone, wthstr); + sLog->outDetail("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 0108c2dcc35..107219c9591 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -84,8 +84,8 @@ void WeatherMgr::LoadWeatherData() if (!result) { - sLog.outErrorDb(">> Loaded 0 weather definitions. DB table `game_weather` is empty."); - sLog.outString(); + sLog->outErrorDb(">> Loaded 0 weather definitions. DB table `game_weather` is empty."); + sLog->outString(); return; } @@ -107,19 +107,19 @@ void WeatherMgr::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->outErrorDb("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->outErrorDb("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->outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%%",zone_id,season); } } @@ -129,8 +129,8 @@ void WeatherMgr::LoadWeatherData() } while (result->NextRow()); - sLog.outString(">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u weather definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } void WeatherMgr::Update(uint32 diff) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index fb9ee0787ae..b9fcee7b1a2 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -260,7 +260,7 @@ World::AddSession_(WorldSession* s) { AddQueuedPlayer (s); UpdateMaxSessionCounters(); - sLog.outDetail ("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); + sLog->outDetail ("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); return; } @@ -268,7 +268,7 @@ World::AddSession_(WorldSession* s) s->SendAddonsInfo(); - s->SendClientCacheVersion(sWorld.getIntConfig(CONFIG_CLIENTCACHE_VERSION)); + s->SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION)); s->SendTutorialsData(); @@ -280,7 +280,7 @@ 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->outDetail ("Server Population (%f).", popu); } } @@ -365,7 +365,7 @@ bool World::RemoveQueuedPlayer(WorldSession* sess) pop_sess->SendAuthWaitQue(0); pop_sess->SendAddonsInfo(); - pop_sess->SendClientCacheVersion(sWorld.getIntConfig(CONFIG_CLIENTCACHE_VERSION)); + pop_sess->SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION)); pop_sess->SendAccountDataTimes(GLOBAL_CACHE_MASK); pop_sess->SendTutorialsData(); @@ -389,493 +389,493 @@ void World::LoadConfigSettings(bool reload) { if (reload) { - if (!sConfig.Reload()) + if (!sConfig->Reload()) { - sLog.outError("World settings reload fail: can't read settings from %s.",sConfig.GetFilename().c_str()); + sLog->outError("World settings reload fail: can't read settings from %s.",sConfig->GetFilename().c_str()); return; } } ///- Read the player limit and the Message of the day from the config file - SetPlayerAmountLimit(sConfig.GetIntDefault("PlayerLimit", 100)); - SetMotd(sConfig.GetStringDefault("Motd", "Welcome to a Trinity Core Server.")); + SetPlayerAmountLimit(sConfig->GetIntDefault("PlayerLimit", 100)); + SetMotd(sConfig->GetStringDefault("Motd", "Welcome to a Trinity Core Server.")); ///- Read ticket system setting from the config file - m_bool_configs[CONFIG_ALLOW_TICKETS] = sConfig.GetBoolDefault("AllowTickets", true); + m_bool_configs[CONFIG_ALLOW_TICKETS] = sConfig->GetBoolDefault("AllowTickets", true); ///- Get string for new logins (newly created characters) - SetNewCharString(sConfig.GetStringDefault("PlayerStart.String", "")); + SetNewCharString(sConfig->GetStringDefault("PlayerStart.String", "")); ///- Send server info on login? - m_int_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfig.GetIntDefault("Server.LoginInfo", 0); + m_int_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfig->GetIntDefault("Server.LoginInfo", 0); ///- Read all rates from the config file - rate_values[RATE_HEALTH] = sConfig.GetFloatDefault("Rate.Health", 1); + rate_values[RATE_HEALTH] = sConfig->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("Rate.Health (%f) must be > 0. Using 1 instead.",rate_values[RATE_HEALTH]); rate_values[RATE_HEALTH] = 1; } - rate_values[RATE_POWER_MANA] = sConfig.GetFloatDefault("Rate.Mana", 1); + rate_values[RATE_POWER_MANA] = sConfig->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("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] = sConfig.GetFloatDefault("Rate.Rage.Income", 1); - rate_values[RATE_POWER_RAGE_LOSS] = sConfig.GetFloatDefault("Rate.Rage.Loss", 1); + rate_values[RATE_POWER_RAGE_INCOME] = sConfig->GetFloatDefault("Rate.Rage.Income", 1); + rate_values[RATE_POWER_RAGE_LOSS] = sConfig->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("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] = sConfig.GetFloatDefault("Rate.RunicPower.Income", 1); - rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfig.GetFloatDefault("Rate.RunicPower.Loss", 1); + rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfig->GetFloatDefault("Rate.RunicPower.Income", 1); + rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfig->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("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] = sConfig.GetFloatDefault("Rate.Focus", 1.0f); - rate_values[RATE_POWER_ENERGY] = sConfig.GetFloatDefault("Rate.Energy", 1.0f); - - rate_values[RATE_SKILL_DISCOVERY] = sConfig.GetFloatDefault("Rate.Skill.Discovery", 1.0f); - - rate_values[RATE_DROP_ITEM_POOR] = sConfig.GetFloatDefault("Rate.Drop.Item.Poor", 1.0f); - rate_values[RATE_DROP_ITEM_NORMAL] = sConfig.GetFloatDefault("Rate.Drop.Item.Normal", 1.0f); - rate_values[RATE_DROP_ITEM_UNCOMMON] = sConfig.GetFloatDefault("Rate.Drop.Item.Uncommon", 1.0f); - rate_values[RATE_DROP_ITEM_RARE] = sConfig.GetFloatDefault("Rate.Drop.Item.Rare", 1.0f); - rate_values[RATE_DROP_ITEM_EPIC] = sConfig.GetFloatDefault("Rate.Drop.Item.Epic", 1.0f); - rate_values[RATE_DROP_ITEM_LEGENDARY] = sConfig.GetFloatDefault("Rate.Drop.Item.Legendary", 1.0f); - rate_values[RATE_DROP_ITEM_ARTIFACT] = sConfig.GetFloatDefault("Rate.Drop.Item.Artifact", 1.0f); - rate_values[RATE_DROP_ITEM_REFERENCED] = sConfig.GetFloatDefault("Rate.Drop.Item.Referenced", 1.0f); - rate_values[RATE_DROP_ITEM_REFERENCED_AMOUNT] = sConfig.GetFloatDefault("Rate.Drop.Item.ReferencedAmount", 1.0f); - rate_values[RATE_DROP_MONEY] = sConfig.GetFloatDefault("Rate.Drop.Money", 1.0f); - rate_values[RATE_XP_KILL] = sConfig.GetFloatDefault("Rate.XP.Kill", 1.0f); - rate_values[RATE_XP_QUEST] = sConfig.GetFloatDefault("Rate.XP.Quest", 1.0f); - rate_values[RATE_XP_EXPLORE] = sConfig.GetFloatDefault("Rate.XP.Explore", 1.0f); - rate_values[RATE_REPAIRCOST] = sConfig.GetFloatDefault("Rate.RepairCost", 1.0f); + rate_values[RATE_POWER_FOCUS] = sConfig->GetFloatDefault("Rate.Focus", 1.0f); + rate_values[RATE_POWER_ENERGY] = sConfig->GetFloatDefault("Rate.Energy", 1.0f); + + rate_values[RATE_SKILL_DISCOVERY] = sConfig->GetFloatDefault("Rate.Skill.Discovery", 1.0f); + + rate_values[RATE_DROP_ITEM_POOR] = sConfig->GetFloatDefault("Rate.Drop.Item.Poor", 1.0f); + rate_values[RATE_DROP_ITEM_NORMAL] = sConfig->GetFloatDefault("Rate.Drop.Item.Normal", 1.0f); + rate_values[RATE_DROP_ITEM_UNCOMMON] = sConfig->GetFloatDefault("Rate.Drop.Item.Uncommon", 1.0f); + rate_values[RATE_DROP_ITEM_RARE] = sConfig->GetFloatDefault("Rate.Drop.Item.Rare", 1.0f); + rate_values[RATE_DROP_ITEM_EPIC] = sConfig->GetFloatDefault("Rate.Drop.Item.Epic", 1.0f); + rate_values[RATE_DROP_ITEM_LEGENDARY] = sConfig->GetFloatDefault("Rate.Drop.Item.Legendary", 1.0f); + rate_values[RATE_DROP_ITEM_ARTIFACT] = sConfig->GetFloatDefault("Rate.Drop.Item.Artifact", 1.0f); + rate_values[RATE_DROP_ITEM_REFERENCED] = sConfig->GetFloatDefault("Rate.Drop.Item.Referenced", 1.0f); + rate_values[RATE_DROP_ITEM_REFERENCED_AMOUNT] = sConfig->GetFloatDefault("Rate.Drop.Item.ReferencedAmount", 1.0f); + rate_values[RATE_DROP_MONEY] = sConfig->GetFloatDefault("Rate.Drop.Money", 1.0f); + rate_values[RATE_XP_KILL] = sConfig->GetFloatDefault("Rate.XP.Kill", 1.0f); + rate_values[RATE_XP_QUEST] = sConfig->GetFloatDefault("Rate.XP.Quest", 1.0f); + rate_values[RATE_XP_EXPLORE] = sConfig->GetFloatDefault("Rate.XP.Explore", 1.0f); + rate_values[RATE_REPAIRCOST] = sConfig->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("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] = sConfig.GetFloatDefault("Rate.Reputation.Gain", 1.0f); - rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = sConfig.GetFloatDefault("Rate.Reputation.LowLevel.Kill", 1.0f); - rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = sConfig.GetFloatDefault("Rate.Reputation.LowLevel.Quest", 1.0f); - rate_values[RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS] = sConfig.GetFloatDefault("Rate.Reputation.RecruitAFriendBonus", 0.1f); - rate_values[RATE_CREATURE_NORMAL_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Normal.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.Elite.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.RAREELITE.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_DAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.RARE.Damage", 1.0f); - rate_values[RATE_CREATURE_NORMAL_HP] = sConfig.GetFloatDefault("Rate.Creature.Normal.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_HP] = sConfig.GetFloatDefault("Rate.Creature.Elite.Elite.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_HP] = sConfig.GetFloatDefault("Rate.Creature.Elite.RAREELITE.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_HP] = sConfig.GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_HP] = sConfig.GetFloatDefault("Rate.Creature.Elite.RARE.HP", 1.0f); - rate_values[RATE_CREATURE_NORMAL_SPELLDAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Normal.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.Elite.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.RAREELITE.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_SPELLDAMAGE] = sConfig.GetFloatDefault("Rate.Creature.Elite.RARE.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_AGGRO] = sConfig.GetFloatDefault("Rate.Creature.Aggro", 1.0f); - rate_values[RATE_REST_INGAME] = sConfig.GetFloatDefault("Rate.Rest.InGame", 1.0f); - rate_values[RATE_REST_OFFLINE_IN_TAVERN_OR_CITY] = sConfig.GetFloatDefault("Rate.Rest.Offline.InTavernOrCity", 1.0f); - rate_values[RATE_REST_OFFLINE_IN_WILDERNESS] = sConfig.GetFloatDefault("Rate.Rest.Offline.InWilderness", 1.0f); - rate_values[RATE_DAMAGE_FALL] = sConfig.GetFloatDefault("Rate.Damage.Fall", 1.0f); - rate_values[RATE_AUCTION_TIME] = sConfig.GetFloatDefault("Rate.Auction.Time", 1.0f); - rate_values[RATE_AUCTION_DEPOSIT] = sConfig.GetFloatDefault("Rate.Auction.Deposit", 1.0f); - rate_values[RATE_AUCTION_CUT] = sConfig.GetFloatDefault("Rate.Auction.Cut", 1.0f); - rate_values[RATE_HONOR] = sConfig.GetFloatDefault("Rate.Honor",1.0f); - rate_values[RATE_MINING_AMOUNT] = sConfig.GetFloatDefault("Rate.Mining.Amount",1.0f); - rate_values[RATE_MINING_NEXT] = sConfig.GetFloatDefault("Rate.Mining.Next",1.0f); - rate_values[RATE_INSTANCE_RESET_TIME] = sConfig.GetFloatDefault("Rate.InstanceResetTime",1.0f); - rate_values[RATE_TALENT] = sConfig.GetFloatDefault("Rate.Talent",1.0f); + rate_values[RATE_REPUTATION_GAIN] = sConfig->GetFloatDefault("Rate.Reputation.Gain", 1.0f); + rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = sConfig->GetFloatDefault("Rate.Reputation.LowLevel.Kill", 1.0f); + rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = sConfig->GetFloatDefault("Rate.Reputation.LowLevel.Quest", 1.0f); + rate_values[RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS] = sConfig->GetFloatDefault("Rate.Reputation.RecruitAFriendBonus", 0.1f); + rate_values[RATE_CREATURE_NORMAL_DAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Normal.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.Elite.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.RAREELITE.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.Damage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RARE_DAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.RARE.Damage", 1.0f); + rate_values[RATE_CREATURE_NORMAL_HP] = sConfig->GetFloatDefault("Rate.Creature.Normal.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_ELITE_HP] = sConfig->GetFloatDefault("Rate.Creature.Elite.Elite.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_RAREELITE_HP] = sConfig->GetFloatDefault("Rate.Creature.Elite.RAREELITE.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_WORLDBOSS_HP] = sConfig->GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.HP", 1.0f); + rate_values[RATE_CREATURE_ELITE_RARE_HP] = sConfig->GetFloatDefault("Rate.Creature.Elite.RARE.HP", 1.0f); + rate_values[RATE_CREATURE_NORMAL_SPELLDAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Normal.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.Elite.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.RAREELITE.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.WORLDBOSS.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_ELITE_RARE_SPELLDAMAGE] = sConfig->GetFloatDefault("Rate.Creature.Elite.RARE.SpellDamage", 1.0f); + rate_values[RATE_CREATURE_AGGRO] = sConfig->GetFloatDefault("Rate.Creature.Aggro", 1.0f); + rate_values[RATE_REST_INGAME] = sConfig->GetFloatDefault("Rate.Rest.InGame", 1.0f); + rate_values[RATE_REST_OFFLINE_IN_TAVERN_OR_CITY] = sConfig->GetFloatDefault("Rate.Rest.Offline.InTavernOrCity", 1.0f); + rate_values[RATE_REST_OFFLINE_IN_WILDERNESS] = sConfig->GetFloatDefault("Rate.Rest.Offline.InWilderness", 1.0f); + rate_values[RATE_DAMAGE_FALL] = sConfig->GetFloatDefault("Rate.Damage.Fall", 1.0f); + rate_values[RATE_AUCTION_TIME] = sConfig->GetFloatDefault("Rate.Auction.Time", 1.0f); + rate_values[RATE_AUCTION_DEPOSIT] = sConfig->GetFloatDefault("Rate.Auction.Deposit", 1.0f); + rate_values[RATE_AUCTION_CUT] = sConfig->GetFloatDefault("Rate.Auction.Cut", 1.0f); + rate_values[RATE_HONOR] = sConfig->GetFloatDefault("Rate.Honor",1.0f); + rate_values[RATE_MINING_AMOUNT] = sConfig->GetFloatDefault("Rate.Mining.Amount",1.0f); + rate_values[RATE_MINING_NEXT] = sConfig->GetFloatDefault("Rate.Mining.Next",1.0f); + rate_values[RATE_INSTANCE_RESET_TIME] = sConfig->GetFloatDefault("Rate.InstanceResetTime",1.0f); + rate_values[RATE_TALENT] = sConfig->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("Rate.Talent (%f) must be > 0. Using 1 instead.",rate_values[RATE_TALENT]); rate_values[RATE_TALENT] = 1.0f; } - rate_values[RATE_MOVESPEED] = sConfig.GetFloatDefault("Rate.MoveSpeed",1.0f); + rate_values[RATE_MOVESPEED] = sConfig->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("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]; - rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig.GetFloatDefault("Rate.Corpse.Decay.Looted",0.5f); + rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig->GetFloatDefault("Rate.Corpse.Decay.Looted",0.5f); - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig.GetFloatDefault("TargetPosRecalculateRange",1.5f); + rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig->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("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("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; } - rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfig.GetFloatDefault("DurabilityLoss.OnDeath", 10.0f); + rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfig->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("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("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; - rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfig.GetFloatDefault("DurabilityLossChance.Damage",0.5f); + rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfig->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("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] = sConfig.GetFloatDefault("DurabilityLossChance.Absorb",0.5f); + rate_values[RATE_DURABILITY_LOSS_ABSORB] = sConfig->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("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] = sConfig.GetFloatDefault("DurabilityLossChance.Parry",0.05f); + rate_values[RATE_DURABILITY_LOSS_PARRY] = sConfig->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("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] = sConfig.GetFloatDefault("DurabilityLossChance.Block",0.05f); + rate_values[RATE_DURABILITY_LOSS_BLOCK] = sConfig->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("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 - m_bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfig.GetBoolDefault("DurabilityLoss.InPvP", false); + m_bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfig->GetBoolDefault("DurabilityLoss.InPvP", false); - m_int_configs[CONFIG_COMPRESSION] = sConfig.GetIntDefault("Compression", 1); + m_int_configs[CONFIG_COMPRESSION] = sConfig->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("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] = sConfig.GetBoolDefault("AddonChannel", true); - m_bool_configs[CONFIG_CLEAN_CHARACTER_DB] = sConfig.GetBoolDefault("CleanCharacterDB", false); - m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfig.GetIntDefault("ChatLevelReq.Channel", 1); - m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfig.GetIntDefault("ChatLevelReq.Whisper", 1); - m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfig.GetIntDefault("ChatLevelReq.Say", 1); - m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfig.GetIntDefault("LevelReq.Trade", 1); - m_int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfig.GetIntDefault("LevelReq.Ticket", 1); - m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfig.GetIntDefault("LevelReq.Auction", 1); - m_int_configs[CONFIG_MAIL_LEVEL_REQ] = sConfig.GetIntDefault("LevelReq.Mail", 1); - m_bool_configs[CONFIG_ALLOW_PLAYER_COMMANDS] = sConfig.GetBoolDefault("AllowPlayerCommands", 1); - m_bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = sConfig.GetBoolDefault("PreserveCustomChannels", false); - m_int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = sConfig.GetIntDefault("PreserveCustomChannelDuration", 14); - m_bool_configs[CONFIG_GRID_UNLOAD] = sConfig.GetBoolDefault("GridUnload", true); - m_int_configs[CONFIG_INTERVAL_SAVE] = sConfig.GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfig.GetIntDefault("DisconnectToleranceInterval", 0); - m_bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfig.GetBoolDefault("PlayerSave.Stats.SaveOnlyOnLogout", true); - - m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = sConfig.GetIntDefault("PlayerSave.Stats.MinLevel", 0); + m_bool_configs[CONFIG_ADDON_CHANNEL] = sConfig->GetBoolDefault("AddonChannel", true); + m_bool_configs[CONFIG_CLEAN_CHARACTER_DB] = sConfig->GetBoolDefault("CleanCharacterDB", false); + m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfig->GetIntDefault("ChatLevelReq.Channel", 1); + m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfig->GetIntDefault("ChatLevelReq.Whisper", 1); + m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfig->GetIntDefault("ChatLevelReq.Say", 1); + m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfig->GetIntDefault("LevelReq.Trade", 1); + m_int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfig->GetIntDefault("LevelReq.Ticket", 1); + m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfig->GetIntDefault("LevelReq.Auction", 1); + m_int_configs[CONFIG_MAIL_LEVEL_REQ] = sConfig->GetIntDefault("LevelReq.Mail", 1); + m_bool_configs[CONFIG_ALLOW_PLAYER_COMMANDS] = sConfig->GetBoolDefault("AllowPlayerCommands", 1); + m_bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = sConfig->GetBoolDefault("PreserveCustomChannels", false); + m_int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = sConfig->GetIntDefault("PreserveCustomChannelDuration", 14); + m_bool_configs[CONFIG_GRID_UNLOAD] = sConfig->GetBoolDefault("GridUnload", true); + m_int_configs[CONFIG_INTERVAL_SAVE] = sConfig->GetIntDefault("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfig->GetIntDefault("DisconnectToleranceInterval", 0); + m_bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfig->GetBoolDefault("PlayerSave.Stats.SaveOnlyOnLogout", true); + + m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = sConfig->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("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] = sConfig.GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig->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("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) sMapMgr->SetGridCleanUpDelay(m_int_configs[CONFIG_INTERVAL_GRIDCLEAN]); - m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100); + m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig->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("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) sMapMgr->SetMapUpdateInterval(m_int_configs[CONFIG_INTERVAL_MAPUPDATE]); - m_int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig->GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); if (reload) { - uint32 val = sConfig.GetIntDefault("WorldServerPort", 8085); + uint32 val = sConfig->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("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] = sConfig.GetIntDefault("WorldServerPort", 8085); + m_int_configs[CONFIG_PORT_WORLD] = sConfig->GetIntDefault("WorldServerPort", 8085); - m_int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfig.GetIntDefault("SocketTimeOutTime", 900000); - m_int_configs[CONFIG_SESSION_ADD_DELAY] = sConfig.GetIntDefault("SessionAddDelay", 10000); + m_int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfig->GetIntDefault("SocketTimeOutTime", 900000); + m_int_configs[CONFIG_SESSION_ADD_DELAY] = sConfig->GetIntDefault("SessionAddDelay", 10000); - m_float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig.GetFloatDefault("MaxGroupXPDistance", 74.0f); - m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfig.GetFloatDefault("MaxRecruitAFriendBonusDistance", 100.0f); + m_float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfig->GetFloatDefault("MaxGroupXPDistance", 74.0f); + m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfig->GetFloatDefault("MaxRecruitAFriendBonusDistance", 100.0f); /// \todo Add MonsterSight and GuarderSight (with meaning) in worldserver.conf or put them as define - m_float_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetFloatDefault("MonsterSight", 50); - m_float_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetFloatDefault("GuarderSight", 50); + m_float_configs[CONFIG_SIGHT_MONSTER] = sConfig->GetFloatDefault("MonsterSight", 50); + m_float_configs[CONFIG_SIGHT_GUARDER] = sConfig->GetFloatDefault("GuarderSight", 50); if (reload) { - uint32 val = sConfig.GetIntDefault("GameType", 0); + uint32 val = sConfig->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("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] = sConfig.GetIntDefault("GameType", 0); + m_int_configs[CONFIG_GAME_TYPE] = sConfig->GetIntDefault("GameType", 0); if (reload) { - uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); + uint32 val = sConfig->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("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] = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); - - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfig.GetBoolDefault("AllowTwoSide.Accounts", true); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Chat",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Channel",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Group",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Guild",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Auction",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfig.GetBoolDefault("AllowTwoSide.Interaction.Mail",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfig.GetBoolDefault("AllowTwoSide.WhoList", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfig.GetBoolDefault("AllowTwoSide.AddFriend", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfig.GetBoolDefault("AllowTwoSide.trade", false); - m_int_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfig.GetIntDefault ("StrictPlayerNames", 0); - m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault ("StrictCharterNames", 0); - m_int_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault ("StrictPetNames", 0); - - m_int_configs[CONFIG_MIN_PLAYER_NAME] = sConfig.GetIntDefault ("MinPlayerName", 2); + m_int_configs[CONFIG_REALM_ZONE] = sConfig->GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); + + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfig->GetBoolDefault("AllowTwoSide.Accounts", true); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Chat",false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Channel",false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Group",false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Guild",false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Auction",false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Mail",false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfig->GetBoolDefault("AllowTwoSide.WhoList", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfig->GetBoolDefault("AllowTwoSide.AddFriend", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfig->GetBoolDefault("AllowTwoSide.trade", false); + m_int_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfig->GetIntDefault ("StrictPlayerNames", 0); + m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig->GetIntDefault ("StrictCharterNames", 0); + m_int_configs[CONFIG_STRICT_PET_NAMES] = sConfig->GetIntDefault ("StrictPetNames", 0); + + m_int_configs[CONFIG_MIN_PLAYER_NAME] = sConfig->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("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] = sConfig.GetIntDefault ("MinCharterName", 2); + m_int_configs[CONFIG_MIN_CHARTER_NAME] = sConfig->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("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] = sConfig.GetIntDefault ("MinPetName", 2); + m_int_configs[CONFIG_MIN_PET_NAME] = sConfig->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("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; } - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED] = sConfig.GetIntDefault("CharacterCreating.Disabled", 0); - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK] = sConfig.GetIntDefault("CharacterCreating.Disabled.RaceMask", 0); - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK] = sConfig.GetIntDefault("CharacterCreating.Disabled.ClassMask", 0); + m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED] = sConfig->GetIntDefault("CharacterCreating.Disabled", 0); + m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK] = sConfig->GetIntDefault("CharacterCreating.Disabled.RaceMask", 0); + m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK] = sConfig->GetIntDefault("CharacterCreating.Disabled.ClassMask", 0); - m_int_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10); + m_int_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig->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("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; } // must be after CONFIG_CHARACTERS_PER_REALM - m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfig.GetIntDefault("CharactersPerAccount", 50); + m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfig->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("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] = sConfig.GetIntDefault("HeroicCharactersPerRealm", 1); + m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfig->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("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; } - m_int_configs[CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER] = sConfig.GetIntDefault("CharacterCreating.MinLevelForHeroicCharacter", 55); + m_int_configs[CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER] = sConfig->GetIntDefault("CharacterCreating.MinLevelForHeroicCharacter", 55); - m_int_configs[CONFIG_SKIP_CINEMATICS] = sConfig.GetIntDefault("SkipCinematics", 0); + m_int_configs[CONFIG_SKIP_CINEMATICS] = sConfig->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("SkipCinematics (%i) must be in range 0..2. Set to 0.",m_int_configs[CONFIG_SKIP_CINEMATICS]); m_int_configs[CONFIG_SKIP_CINEMATICS] = 0; } if (reload) { - uint32 val = sConfig.GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); + uint32 val = sConfig->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("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] = sConfig.GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); + m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfig->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("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; } - m_int_configs[CONFIG_MIN_DUALSPEC_LEVEL] = sConfig.GetIntDefault("MinDualSpecLevel", 40); + m_int_configs[CONFIG_MIN_DUALSPEC_LEVEL] = sConfig->GetIntDefault("MinDualSpecLevel", 40); - m_int_configs[CONFIG_START_PLAYER_LEVEL] = sConfig.GetIntDefault("StartPlayerLevel", 1); + m_int_configs[CONFIG_START_PLAYER_LEVEL] = sConfig->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("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("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] = sConfig.GetIntDefault("StartHeroicPlayerLevel", 55); + m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfig->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("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("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]; } - m_int_configs[CONFIG_START_PLAYER_MONEY] = sConfig.GetIntDefault("StartPlayerMoney", 0); + m_int_configs[CONFIG_START_PLAYER_MONEY] = sConfig->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("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] > MAX_MONEY_AMOUNT) { - sLog.outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", + sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY],MAX_MONEY_AMOUNT,MAX_MONEY_AMOUNT); m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT; } - m_int_configs[CONFIG_MAX_HONOR_POINTS] = sConfig.GetIntDefault("MaxHonorPoints", 75000); + m_int_configs[CONFIG_MAX_HONOR_POINTS] = sConfig->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("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] = sConfig.GetIntDefault("StartHonorPoints", 0); + m_int_configs[CONFIG_START_HONOR_POINTS] = sConfig->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("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("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]; } - m_int_configs[CONFIG_MAX_ARENA_POINTS] = sConfig.GetIntDefault("MaxArenaPoints", 10000); + m_int_configs[CONFIG_MAX_ARENA_POINTS] = sConfig->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("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] = sConfig.GetIntDefault("StartArenaPoints", 0); + m_int_configs[CONFIG_START_ARENA_POINTS] = sConfig->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("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("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]; } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfig.GetIntDefault("RecruitAFriend.MaxLevel", 60); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfig->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("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; } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = sConfig.GetIntDefault("RecruitAFriend.MaxDifference", 3); - m_bool_configs[CONFIG_ALL_TAXI_PATHS] = sConfig.GetBoolDefault("AllFlightPaths", false); - m_bool_configs[CONFIG_INSTANT_TAXI] = sConfig.GetBoolDefault("InstantFlightPaths", false); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = sConfig->GetIntDefault("RecruitAFriend.MaxDifference", 3); + m_bool_configs[CONFIG_ALL_TAXI_PATHS] = sConfig->GetBoolDefault("AllFlightPaths", false); + m_bool_configs[CONFIG_INSTANT_TAXI] = sConfig->GetBoolDefault("InstantFlightPaths", false); - m_bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfig.GetBoolDefault("Instance.IgnoreLevel", false); - m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfig.GetBoolDefault("Instance.IgnoreRaid", false); + m_bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfig->GetBoolDefault("Instance.IgnoreLevel", false); + m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfig->GetBoolDefault("Instance.IgnoreRaid", false); - m_bool_configs[CONFIG_CAST_UNSTUCK] = sConfig.GetBoolDefault("CastUnstuck", true); - m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfig.GetIntDefault("Instance.ResetTimeHour", 4); - m_int_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig.GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS); + m_bool_configs[CONFIG_CAST_UNSTUCK] = sConfig->GetBoolDefault("CastUnstuck", true); + m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfig->GetIntDefault("Instance.ResetTimeHour", 4); + m_int_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfig->GetIntDefault("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfig.GetIntDefault("MaxPrimaryTradeSkill", 2); - m_int_configs[CONFIG_MIN_PETITION_SIGNS] = sConfig.GetIntDefault("MinPetitionSigns", 9); + m_int_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfig->GetIntDefault("MaxPrimaryTradeSkill", 2); + m_int_configs[CONFIG_MIN_PETITION_SIGNS] = sConfig->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("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; } - m_int_configs[CONFIG_GM_LOGIN_STATE] = sConfig.GetIntDefault("GM.LoginState", 2); - m_int_configs[CONFIG_GM_VISIBLE_STATE] = sConfig.GetIntDefault("GM.Visible", 2); - m_int_configs[CONFIG_GM_CHAT] = sConfig.GetIntDefault("GM.Chat", 2); - m_int_configs[CONFIG_GM_WHISPERING_TO] = sConfig.GetIntDefault("GM.WhisperingTo", 2); + m_int_configs[CONFIG_GM_LOGIN_STATE] = sConfig->GetIntDefault("GM.LoginState", 2); + m_int_configs[CONFIG_GM_VISIBLE_STATE] = sConfig->GetIntDefault("GM.Visible", 2); + m_int_configs[CONFIG_GM_CHAT] = sConfig->GetIntDefault("GM.Chat", 2); + m_int_configs[CONFIG_GM_WHISPERING_TO] = sConfig->GetIntDefault("GM.WhisperingTo", 2); - m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfig.GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR); - m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfig.GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR); - m_bool_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false); - m_int_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1); + m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfig->GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR); + m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfig->GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR); + m_bool_configs[CONFIG_GM_LOG_TRADE] = sConfig->GetBoolDefault("GM.LogTrade", false); + m_int_configs[CONFIG_START_GM_LEVEL] = sConfig->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("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("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] = sConfig.GetBoolDefault("GM.AllowInvite", false); - m_bool_configs[CONFIG_ALLOW_GM_FRIEND] = sConfig.GetBoolDefault("GM.AllowFriend", false); - m_bool_configs[CONFIG_GM_LOWER_SECURITY] = sConfig.GetBoolDefault("GM.LowerSecurity", false); - m_bool_configs[CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS] = sConfig.GetBoolDefault("GM.AllowAchievementGain", true); - m_float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = sConfig.GetFloatDefault("GM.TicketSystem.ChanceOfGMSurvey", 50.0f); + m_bool_configs[CONFIG_ALLOW_GM_GROUP] = sConfig->GetBoolDefault("GM.AllowInvite", false); + m_bool_configs[CONFIG_ALLOW_GM_FRIEND] = sConfig->GetBoolDefault("GM.AllowFriend", false); + m_bool_configs[CONFIG_GM_LOWER_SECURITY] = sConfig->GetBoolDefault("GM.LowerSecurity", false); + m_bool_configs[CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS] = sConfig->GetBoolDefault("GM.AllowAchievementGain", true); + m_float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = sConfig->GetFloatDefault("GM.TicketSystem.ChanceOfGMSurvey", 50.0f); - m_int_configs[CONFIG_GROUP_VISIBILITY] = sConfig.GetIntDefault("Visibility.GroupMode", 1); + m_int_configs[CONFIG_GROUP_VISIBILITY] = sConfig->GetIntDefault("Visibility.GroupMode", 1); - m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfig.GetIntDefault("MailDeliveryDelay",HOUR); + m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfig->GetIntDefault("MailDeliveryDelay",HOUR); - m_int_configs[CONFIG_UPTIME_UPDATE] = sConfig.GetIntDefault("UpdateUptimeInterval", 10); + m_int_configs[CONFIG_UPTIME_UPDATE] = sConfig->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("UpdateUptimeInterval (%i) must be > 0, set to default 10.",m_int_configs[CONFIG_UPTIME_UPDATE]); m_int_configs[CONFIG_UPTIME_UPDATE] = 10; } if (reload) @@ -885,10 +885,10 @@ void World::LoadConfigSettings(bool reload) } // log db cleanup interval - m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfig.GetIntDefault("LogDB.Opt.ClearInterval", 10); + m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfig->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("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) @@ -896,285 +896,285 @@ void World::LoadConfigSettings(bool reload) m_timers[WUPDATE_CLEANDB].SetInterval(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILLISECONDS); m_timers[WUPDATE_CLEANDB].Reset(); } - m_int_configs[CONFIG_LOGDB_CLEARTIME] = sConfig.GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default - sLog.outString("Will clear `logs` table of entries older than %i seconds every %u minutes.", + m_int_configs[CONFIG_LOGDB_CLEARTIME] = sConfig->GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default + sLog->outString("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] = sConfig.GetIntDefault("SkillChance.Orange",100); - m_int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfig.GetIntDefault("SkillChance.Yellow",75); - m_int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfig.GetIntDefault("SkillChance.Green",25); - m_int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfig.GetIntDefault("SkillChance.Grey",0); + m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfig->GetIntDefault("SkillChance.Orange",100); + m_int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfig->GetIntDefault("SkillChance.Yellow",75); + m_int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfig->GetIntDefault("SkillChance.Green",25); + m_int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfig->GetIntDefault("SkillChance.Grey",0); - m_int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfig.GetIntDefault("SkillChance.MiningSteps",75); - m_int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfig.GetIntDefault("SkillChance.SkinningSteps",75); + m_int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfig->GetIntDefault("SkillChance.MiningSteps",75); + m_int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfig->GetIntDefault("SkillChance.SkinningSteps",75); - m_bool_configs[CONFIG_SKILL_PROSPECTING] = sConfig.GetBoolDefault("SkillChance.Prospecting",false); - m_bool_configs[CONFIG_SKILL_MILLING] = sConfig.GetBoolDefault("SkillChance.Milling",false); + m_bool_configs[CONFIG_SKILL_PROSPECTING] = sConfig->GetBoolDefault("SkillChance.Prospecting",false); + m_bool_configs[CONFIG_SKILL_MILLING] = sConfig->GetBoolDefault("SkillChance.Milling",false); - m_int_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfig.GetIntDefault("SkillGain.Crafting", 1); + m_int_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfig->GetIntDefault("SkillGain.Crafting", 1); - m_int_configs[CONFIG_SKILL_GAIN_DEFENSE] = sConfig.GetIntDefault("SkillGain.Defense", 1); + m_int_configs[CONFIG_SKILL_GAIN_DEFENSE] = sConfig->GetIntDefault("SkillGain.Defense", 1); - m_int_configs[CONFIG_SKILL_GAIN_GATHERING] = sConfig.GetIntDefault("SkillGain.Gathering", 1); + m_int_configs[CONFIG_SKILL_GAIN_GATHERING] = sConfig->GetIntDefault("SkillGain.Gathering", 1); - m_int_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfig.GetIntDefault("SkillGain.Weapon", 1); + m_int_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfig->GetIntDefault("SkillGain.Weapon", 1); - m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfig.GetIntDefault("MaxOverspeedPings",2); + m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfig->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("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; } - m_bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfig.GetBoolDefault("SaveRespawnTimeImmediately",true); - m_bool_configs[CONFIG_WEATHER] = sConfig.GetBoolDefault("ActivateWeather",true); + m_bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfig->GetBoolDefault("SaveRespawnTimeImmediately",true); + m_bool_configs[CONFIG_WEATHER] = sConfig->GetBoolDefault("ActivateWeather",true); - m_int_configs[CONFIG_DISABLE_BREATHING] = sConfig.GetIntDefault("DisableWaterBreath", SEC_CONSOLE); + m_int_configs[CONFIG_DISABLE_BREATHING] = sConfig->GetIntDefault("DisableWaterBreath", SEC_CONSOLE); - m_bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = sConfig.GetBoolDefault("AlwaysMaxSkillForLevel", false); + m_bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = sConfig->GetBoolDefault("AlwaysMaxSkillForLevel", false); if (reload) { - uint32 val = sConfig.GetIntDefault("Expansion",1); + uint32 val = sConfig->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("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] = sConfig.GetIntDefault("Expansion",1); + m_int_configs[CONFIG_EXPANSION] = sConfig->GetIntDefault("Expansion",1); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfig.GetIntDefault("ChatFlood.MessageCount",10); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfig.GetIntDefault("ChatFlood.MessageDelay",1); - m_int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfig.GetIntDefault("ChatFlood.MuteTime",10); + m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfig->GetIntDefault("ChatFlood.MessageCount",10); + m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfig->GetIntDefault("ChatFlood.MessageDelay",1); + m_int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfig->GetIntDefault("ChatFlood.MuteTime",10); - m_int_configs[CONFIG_EVENT_ANNOUNCE] = sConfig.GetIntDefault("Event.Announce",0); + m_int_configs[CONFIG_EVENT_ANNOUNCE] = sConfig->GetIntDefault("Event.Announce",0); - m_float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfig.GetFloatDefault("CreatureFamilyFleeAssistanceRadius",30.0f); - m_float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfig.GetFloatDefault("CreatureFamilyAssistanceRadius",10.0f); - m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfig.GetIntDefault("CreatureFamilyAssistanceDelay",1500); - m_int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfig.GetIntDefault("CreatureFamilyFleeDelay",7000); + m_float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfig->GetFloatDefault("CreatureFamilyFleeAssistanceRadius",30.0f); + m_float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfig->GetFloatDefault("CreatureFamilyAssistanceRadius",10.0f); + m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfig->GetIntDefault("CreatureFamilyAssistanceDelay",1500); + m_int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfig->GetIntDefault("CreatureFamilyFleeDelay",7000); - m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfig.GetIntDefault("WorldBossLevelDiff",3); + m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfig->GetIntDefault("WorldBossLevelDiff",3); // note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100) - m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfig.GetIntDefault("Quests.LowLevelHideDiff", 4); + m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfig->GetIntDefault("Quests.LowLevelHideDiff", 4); if (m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL) m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = MAX_LEVEL; - m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfig.GetIntDefault("Quests.HighLevelHideDiff", 7); + m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfig->GetIntDefault("Quests.HighLevelHideDiff", 7); if (m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL) m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = MAX_LEVEL; - m_bool_configs[CONFIG_QUEST_IGNORE_RAID] = sConfig.GetBoolDefault("Quests.IgnoreRaid", false); + m_bool_configs[CONFIG_QUEST_IGNORE_RAID] = sConfig->GetBoolDefault("Quests.IgnoreRaid", false); - m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfig.GetIntDefault("Battleground.Random.ResetHour", 6); + m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfig->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("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; } - m_bool_configs[CONFIG_DETECT_POS_COLLISION] = sConfig.GetBoolDefault("DetectPosCollision", true); + m_bool_configs[CONFIG_DETECT_POS_COLLISION] = sConfig->GetBoolDefault("DetectPosCollision", true); - m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfig.GetBoolDefault("Channel.RestrictedLfg", true); - m_bool_configs[CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL] = sConfig.GetBoolDefault("Channel.SilentlyGMJoin", false); + m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfig->GetBoolDefault("Channel.RestrictedLfg", true); + m_bool_configs[CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL] = sConfig->GetBoolDefault("Channel.SilentlyGMJoin", false); - m_bool_configs[CONFIG_TALENTS_INSPECTING] = sConfig.GetBoolDefault("TalentsInspecting", true); - m_bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfig.GetBoolDefault("ChatFakeMessagePreventing", false); - m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfig.GetIntDefault("ChatStrictLinkChecking.Severity", 0); - m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfig.GetIntDefault("ChatStrictLinkChecking.Kick", 0); + m_bool_configs[CONFIG_TALENTS_INSPECTING] = sConfig->GetBoolDefault("TalentsInspecting", true); + m_bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfig->GetBoolDefault("ChatFakeMessagePreventing", false); + m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfig->GetIntDefault("ChatStrictLinkChecking.Severity", 0); + m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfig->GetIntDefault("ChatStrictLinkChecking.Kick", 0); - m_int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfig.GetIntDefault("Corpse.Decay.NORMAL", 60); - m_int_configs[CONFIG_CORPSE_DECAY_RARE] = sConfig.GetIntDefault("Corpse.Decay.RARE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfig.GetIntDefault("Corpse.Decay.ELITE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfig.GetIntDefault("Corpse.Decay.RAREELITE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = sConfig.GetIntDefault("Corpse.Decay.WORLDBOSS", 3600); + m_int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfig->GetIntDefault("Corpse.Decay.NORMAL", 60); + m_int_configs[CONFIG_CORPSE_DECAY_RARE] = sConfig->GetIntDefault("Corpse.Decay.RARE", 300); + m_int_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfig->GetIntDefault("Corpse.Decay.ELITE", 300); + m_int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfig->GetIntDefault("Corpse.Decay.RAREELITE", 300); + m_int_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = sConfig->GetIntDefault("Corpse.Decay.WORLDBOSS", 3600); - m_int_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfig.GetIntDefault ("Death.SicknessLevel", 11); - m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvP", true); - m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfig.GetBoolDefault("Death.CorpseReclaimDelay.PvE", true); - m_bool_configs[CONFIG_DEATH_BONES_WORLD] = sConfig.GetBoolDefault("Death.Bones.World", true); - m_bool_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfig.GetBoolDefault("Death.Bones.BattlegroundOrArena", true); + m_int_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfig->GetIntDefault ("Death.SicknessLevel", 11); + m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfig->GetBoolDefault("Death.CorpseReclaimDelay.PvP", true); + m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfig->GetBoolDefault("Death.CorpseReclaimDelay.PvE", true); + m_bool_configs[CONFIG_DEATH_BONES_WORLD] = sConfig->GetBoolDefault("Death.Bones.World", true); + m_bool_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfig->GetBoolDefault("Death.Bones.BattlegroundOrArena", true); - m_bool_configs[CONFIG_DIE_COMMAND_MODE] = sConfig.GetBoolDefault("Die.Command.Mode", true); + m_bool_configs[CONFIG_DIE_COMMAND_MODE] = sConfig->GetBoolDefault("Die.Command.Mode", true); - m_float_configs[CONFIG_THREAT_RADIUS] = sConfig.GetFloatDefault("ThreatRadius", 60.0f); + m_float_configs[CONFIG_THREAT_RADIUS] = sConfig->GetFloatDefault("ThreatRadius", 60.0f); // always use declined names in the russian client m_bool_configs[CONFIG_DECLINED_NAMES_USED] = - (m_int_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfig.GetBoolDefault("DeclinedNames", false); - - m_float_configs[CONFIG_LISTEN_RANGE_SAY] = sConfig.GetFloatDefault("ListenRange.Say", 25.0f); - m_float_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfig.GetFloatDefault("ListenRange.TextEmote", 25.0f); - m_float_configs[CONFIG_LISTEN_RANGE_YELL] = sConfig.GetFloatDefault("ListenRange.Yell", 300.0f); - - m_bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig.GetBoolDefault("Battleground.CastDeserter", true); - m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.Enable", false); - m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false); - m_int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfig.GetIntDefault ("Battleground.InvitationType", 0); - m_int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig.GetIntDefault ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfig.GetIntDefault ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS); - m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfig.GetBoolDefault("Battleground.GiveXPForKills", false); - m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault ("Arena.MaxRatingDifference", 150); - m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); - m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfig.GetBoolDefault("Arena.AutoDistributePoints", false); - m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfig.GetIntDefault ("Arena.AutoDistributeInterval", 7); - m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfig.GetBoolDefault("Arena.QueueAnnouncer.Enable", false); - m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig.GetBoolDefault("Arena.QueueAnnouncer.PlayerOnly", false); - m_int_configs[CONFIG_ARENA_SEASON_ID] = sConfig.GetIntDefault ("Arena.ArenaSeason.ID", 1); - m_int_configs[CONFIG_ARENA_START_RATING] = sConfig.GetIntDefault ("Arena.ArenaStartRating", 0); - m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfig.GetIntDefault ("Arena.ArenaStartPersonalRating", 1000); - m_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfig.GetIntDefault ("Arena.ArenaStartMatchmakerRating", 1500); - m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfig.GetBoolDefault("Arena.ArenaSeason.InProgress", true); - m_bool_configs[CONFIG_ARENA_LOG_EXTENDED_INFO] = sConfig.GetBoolDefault("ArenaLog.ExtendedInfo", false); - - m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfig.GetBoolDefault("OffhandCheckAtSpellUnlearn", true); - - if (int32 clientCacheId = sConfig.GetIntDefault("ClientCacheVersion", 0)) + (m_int_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfig->GetBoolDefault("DeclinedNames", false); + + m_float_configs[CONFIG_LISTEN_RANGE_SAY] = sConfig->GetFloatDefault("ListenRange.Say", 25.0f); + m_float_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfig->GetFloatDefault("ListenRange.TextEmote", 25.0f); + m_float_configs[CONFIG_LISTEN_RANGE_YELL] = sConfig->GetFloatDefault("ListenRange.Yell", 300.0f); + + m_bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfig->GetBoolDefault("Battleground.CastDeserter", true); + m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfig->GetBoolDefault("Battleground.QueueAnnouncer.Enable", false); + m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig->GetBoolDefault("Battleground.QueueAnnouncer.PlayerOnly", false); + m_int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfig->GetIntDefault ("Battleground.InvitationType", 0); + m_int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig->GetIntDefault ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS); + m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfig->GetIntDefault ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS); + m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfig->GetBoolDefault("Battleground.GiveXPForKills", false); + m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig->GetIntDefault ("Arena.MaxRatingDifference", 150); + m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig->GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); + m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfig->GetBoolDefault("Arena.AutoDistributePoints", false); + m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfig->GetIntDefault ("Arena.AutoDistributeInterval", 7); + m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfig->GetBoolDefault("Arena.QueueAnnouncer.Enable", false); + m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfig->GetBoolDefault("Arena.QueueAnnouncer.PlayerOnly", false); + m_int_configs[CONFIG_ARENA_SEASON_ID] = sConfig->GetIntDefault ("Arena.ArenaSeason.ID", 1); + m_int_configs[CONFIG_ARENA_START_RATING] = sConfig->GetIntDefault ("Arena.ArenaStartRating", 0); + m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfig->GetIntDefault ("Arena.ArenaStartPersonalRating", 1000); + m_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfig->GetIntDefault ("Arena.ArenaStartMatchmakerRating", 1500); + m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfig->GetBoolDefault("Arena.ArenaSeason.InProgress", true); + m_bool_configs[CONFIG_ARENA_LOG_EXTENDED_INFO] = sConfig->GetBoolDefault("ArenaLog.ExtendedInfo", false); + + m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfig->GetBoolDefault("OffhandCheckAtSpellUnlearn", true); + + if (int32 clientCacheId = sConfig->GetIntDefault("ClientCacheVersion", 0)) { // overwrite DB/old value if (clientCacheId > 0) { m_int_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId; - sLog.outString("Client cache version set to: %u", clientCacheId); + sLog->outString("Client cache version set to: %u", clientCacheId); } else - sLog.outError("ClientCacheVersion can't be negative %d, ignored.", clientCacheId); + sLog->outError("ClientCacheVersion can't be negative %d, ignored.", clientCacheId); } - m_int_configs[CONFIG_INSTANT_LOGOUT] = sConfig.GetIntDefault("InstantLogout", SEC_MODERATOR); + m_int_configs[CONFIG_INSTANT_LOGOUT] = sConfig->GetIntDefault("InstantLogout", SEC_MODERATOR); - m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = sConfig.GetIntDefault("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); + m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = sConfig->GetIntDefault("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); if (m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] < GUILD_EVENTLOG_MAX_RECORDS) m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = GUILD_EVENTLOG_MAX_RECORDS; - m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = sConfig.GetIntDefault("Guild.BankEventLogRecordsCount", GUILD_BANKLOG_MAX_RECORDS); + m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = sConfig->GetIntDefault("Guild.BankEventLogRecordsCount", GUILD_BANKLOG_MAX_RECORDS); if (m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] < GUILD_BANKLOG_MAX_RECORDS) m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = GUILD_BANKLOG_MAX_RECORDS; //visibility on continents - m_MaxVisibleDistanceOnContinents = sConfig.GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE); - if (m_MaxVisibleDistanceOnContinents < 45*sWorld.getRate(RATE_CREATURE_AGGRO)) + m_MaxVisibleDistanceOnContinents = sConfig->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)); - 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)); + 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("Visibility.Distance.Continents can't be greater %f",MAX_VISIBILITY_DISTANCE); m_MaxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE; } //visibility in instances - m_MaxVisibleDistanceInInstances = sConfig.GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); - if (m_MaxVisibleDistanceInInstances < 45*sWorld.getRate(RATE_CREATURE_AGGRO)) + m_MaxVisibleDistanceInInstances = sConfig->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)); - 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)); + 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("Visibility.Distance.Instances can't be greater %f",MAX_VISIBILITY_DISTANCE); m_MaxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE; } //visibility in BG/Arenas - m_MaxVisibleDistanceInBGArenas = sConfig.GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS); - if (m_MaxVisibleDistanceInBGArenas < 45*sWorld.getRate(RATE_CREATURE_AGGRO)) + m_MaxVisibleDistanceInBGArenas = sConfig->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)); - 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)); + 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("Visibility.Distance.BGArenas can't be greater %f",MAX_VISIBILITY_DISTANCE); m_MaxVisibleDistanceInBGArenas = MAX_VISIBILITY_DISTANCE; } - m_visibility_notify_periodOnContinents = sConfig.GetIntDefault("Visibility.Notify.Period.OnContinents", DEFAULT_VISIBILITY_NOTIFY_PERIOD); - m_visibility_notify_periodInInstances = sConfig.GetIntDefault("Visibility.Notify.Period.InInstances", DEFAULT_VISIBILITY_NOTIFY_PERIOD); - m_visibility_notify_periodInBGArenas = sConfig.GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_visibility_notify_periodOnContinents = sConfig->GetIntDefault("Visibility.Notify.Period.OnContinents", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_visibility_notify_periodInInstances = sConfig->GetIntDefault("Visibility.Notify.Period.InInstances", DEFAULT_VISIBILITY_NOTIFY_PERIOD); + m_visibility_notify_periodInBGArenas = sConfig->GetIntDefault("Visibility.Notify.Period.InBGArenas", DEFAULT_VISIBILITY_NOTIFY_PERIOD); ///- Load the CharDelete related config options - m_int_configs[CONFIG_CHARDELETE_METHOD] = sConfig.GetIntDefault("CharDelete.Method", 0); - m_int_configs[CONFIG_CHARDELETE_MIN_LEVEL] = sConfig.GetIntDefault("CharDelete.MinLevel", 0); - m_int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfig.GetIntDefault("CharDelete.KeepDays", 30); + m_int_configs[CONFIG_CHARDELETE_METHOD] = sConfig->GetIntDefault("CharDelete.Method", 0); + m_int_configs[CONFIG_CHARDELETE_MIN_LEVEL] = sConfig->GetIntDefault("CharDelete.MinLevel", 0); + m_int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfig->GetIntDefault("CharDelete.KeepDays", 30); ///- Read the "Data" directory from the config file - std::string dataPath = sConfig.GetStringDefault("DataDir","./"); + std::string dataPath = sConfig->GetStringDefault("DataDir","./"); if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\') dataPath.append("/"); 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("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->outString("Using DataDir %s",m_dataPath.c_str()); } - m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfig.GetBoolDefault("vmap.enableIndoorCheck", 0); - bool enableIndoor = sConfig.GetBoolDefault("vmap.enableIndoorCheck", true); - bool enableLOS = sConfig.GetBoolDefault("vmap.enableLOS", true); - bool enableHeight = sConfig.GetBoolDefault("vmap.enableHeight", true); - bool enablePetLOS = sConfig.GetBoolDefault("vmap.petLOS", true); - std::string ignoreSpellIds = sConfig.GetStringDefault("vmap.ignoreSpellIds", ""); + m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfig->GetBoolDefault("vmap.enableIndoorCheck", 0); + bool enableIndoor = sConfig->GetBoolDefault("vmap.enableIndoorCheck", true); + bool enableLOS = sConfig->GetBoolDefault("vmap.enableLOS", true); + bool enableHeight = sConfig->GetBoolDefault("vmap.enableHeight", true); + bool enablePetLOS = sConfig->GetBoolDefault("vmap.petLOS", true); + std::string ignoreSpellIds = sConfig->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("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->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()); - m_int_configs[CONFIG_MAX_WHO] = sConfig.GetIntDefault("MaxWhoListReturns", 49); - m_bool_configs[CONFIG_PET_LOS] = sConfig.GetBoolDefault("vmap.petLOS", true); - m_bool_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false); + m_int_configs[CONFIG_MAX_WHO] = sConfig->GetIntDefault("MaxWhoListReturns", 49); + m_bool_configs[CONFIG_PET_LOS] = sConfig->GetBoolDefault("vmap.petLOS", true); + m_bool_configs[CONFIG_START_ALL_SPELLS] = sConfig->GetBoolDefault("PlayerStart.AllSpells", false); if (m_bool_configs[CONFIG_START_ALL_SPELLS]) - sLog.outString("WORLD: WARNING: PlayerStart.AllSpells enabled - may not function as intended!"); - m_int_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0); - m_bool_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false); - m_bool_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false); - m_bool_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false); - m_bool_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig.GetBoolDefault("PvPToken.Enable", false); - m_int_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4); - m_int_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434); - m_int_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1); + sLog->outString("WORLD: WARNING: PlayerStart.AllSpells enabled - may not function as intended!"); + m_int_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig->GetIntDefault("HonorPointsAfterDuel", 0); + m_bool_configs[CONFIG_START_ALL_EXPLORED] = sConfig->GetBoolDefault("PlayerStart.MapsExplored", false); + m_bool_configs[CONFIG_START_ALL_REP] = sConfig->GetBoolDefault("PlayerStart.AllReputation", false); + m_bool_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig->GetBoolDefault("AlwaysMaxWeaponSkill", false); + m_bool_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfig->GetBoolDefault("PvPToken.Enable", false); + m_int_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig->GetIntDefault("PvPToken.MapAllowType", 4); + m_int_configs[CONFIG_PVP_TOKEN_ID] = sConfig->GetIntDefault("PvPToken.ItemID", 29434); + m_int_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig->GetIntDefault("PvPToken.ItemCount", 1); if (m_int_configs[CONFIG_PVP_TOKEN_COUNT] < 1) m_int_configs[CONFIG_PVP_TOKEN_COUNT] = 1; - m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false); - m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfig.GetBoolDefault("ShowKickInWorld", false); - m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfig.GetIntDefault("RecordUpdateTimeDiffInterval", 60000); - m_int_configs[CONFIG_MIN_LOG_UPDATE] = sConfig.GetIntDefault("MinRecordUpdateTimeDiff", 100); - m_int_configs[CONFIG_NUMTHREADS] = sConfig.GetIntDefault("MapUpdate.Threads", 1); - m_int_configs[CONFIG_MAX_RESULTS_LOOKUP_COMMANDS] = sConfig.GetIntDefault("Command.LookupMaxResults", 0); + m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig->GetBoolDefault("NoResetTalentsCost", false); + m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfig->GetBoolDefault("ShowKickInWorld", false); + m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = sConfig->GetIntDefault("RecordUpdateTimeDiffInterval", 60000); + m_int_configs[CONFIG_MIN_LOG_UPDATE] = sConfig->GetIntDefault("MinRecordUpdateTimeDiff", 100); + m_int_configs[CONFIG_NUMTHREADS] = sConfig->GetIntDefault("MapUpdate.Threads", 1); + m_int_configs[CONFIG_MAX_RESULTS_LOOKUP_COMMANDS] = sConfig->GetIntDefault("Command.LookupMaxResults", 0); // chat logging - m_bool_configs[CONFIG_CHATLOG_CHANNEL] = sConfig.GetBoolDefault("ChatLogs.Channel", false); - m_bool_configs[CONFIG_CHATLOG_WHISPER] = sConfig.GetBoolDefault("ChatLogs.Whisper", false); - m_bool_configs[CONFIG_CHATLOG_SYSCHAN] = sConfig.GetBoolDefault("ChatLogs.SysChan", false); - m_bool_configs[CONFIG_CHATLOG_PARTY] = sConfig.GetBoolDefault("ChatLogs.Party", false); - m_bool_configs[CONFIG_CHATLOG_RAID] = sConfig.GetBoolDefault("ChatLogs.Raid", false); - m_bool_configs[CONFIG_CHATLOG_GUILD] = sConfig.GetBoolDefault("ChatLogs.Guild", false); - m_bool_configs[CONFIG_CHATLOG_PUBLIC] = sConfig.GetBoolDefault("ChatLogs.Public", false); - m_bool_configs[CONFIG_CHATLOG_ADDON] = sConfig.GetBoolDefault("ChatLogs.Addon", false); - m_bool_configs[CONFIG_CHATLOG_BGROUND] = sConfig.GetBoolDefault("ChatLogs.Battleground", false); + m_bool_configs[CONFIG_CHATLOG_CHANNEL] = sConfig->GetBoolDefault("ChatLogs.Channel", false); + m_bool_configs[CONFIG_CHATLOG_WHISPER] = sConfig->GetBoolDefault("ChatLogs.Whisper", false); + m_bool_configs[CONFIG_CHATLOG_SYSCHAN] = sConfig->GetBoolDefault("ChatLogs.SysChan", false); + m_bool_configs[CONFIG_CHATLOG_PARTY] = sConfig->GetBoolDefault("ChatLogs.Party", false); + m_bool_configs[CONFIG_CHATLOG_RAID] = sConfig->GetBoolDefault("ChatLogs.Raid", false); + m_bool_configs[CONFIG_CHATLOG_GUILD] = sConfig->GetBoolDefault("ChatLogs.Guild", false); + m_bool_configs[CONFIG_CHATLOG_PUBLIC] = sConfig->GetBoolDefault("ChatLogs.Public", false); + m_bool_configs[CONFIG_CHATLOG_ADDON] = sConfig->GetBoolDefault("ChatLogs.Addon", false); + m_bool_configs[CONFIG_CHATLOG_BGROUND] = sConfig->GetBoolDefault("ChatLogs.Battleground", false); // Dungeon finder - m_bool_configs[CONFIG_DUNGEON_FINDER_ENABLE] = sConfig.GetBoolDefault("DungeonFinder.Enable", false); + m_bool_configs[CONFIG_DUNGEON_FINDER_ENABLE] = sConfig->GetBoolDefault("DungeonFinder.Enable", false); // DBC_ItemAttributes - m_bool_configs[CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES] = sConfig.GetBoolDefault("DBC.EnforceItemAttributes", true); + m_bool_configs[CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES] = sConfig->GetBoolDefault("DBC.EnforceItemAttributes", true); // AutoBroadcast - m_bool_configs[CONFIG_AUTOBROADCAST] = sConfig.GetBoolDefault("AutoBroadcast.On", false); - m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = sConfig.GetIntDefault("AutoBroadcast.Center", 0); - m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = sConfig.GetIntDefault("AutoBroadcast.Timer", 60000); + m_bool_configs[CONFIG_AUTOBROADCAST] = sConfig->GetBoolDefault("AutoBroadcast.On", false); + m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = sConfig->GetIntDefault("AutoBroadcast.Center", 0); + m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = sConfig->GetIntDefault("AutoBroadcast.Timer", 60000); // MySQL ping time interval - m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfig.GetIntDefault("MaxPingTime", 30); + m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfig->GetIntDefault("MaxPingTime", 30); sScriptMgr->OnConfigLoad(reload); } @@ -1208,13 +1208,13 @@ 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("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); } ///- 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->outString(); + sLog->outString("Loading Trinity strings..."); if (!sObjectMgr->LoadTrinityStrings()) exit(1); // Error message displayed in function already @@ -1234,24 +1234,24 @@ void World::SetInitialWorldSettings() CharacterDatabase.PExecute("DELETE FROM corpse WHERE corpse_type = '0' OR time < (UNIX_TIMESTAMP()-'%u')", 3 * DAY); ///- Load the DBC files - sLog.outString("Initialize data stores..."); + sLog->outString("Initialize data stores..."); LoadDBCStores(m_dataPath); DetectDBCLang(); - sLog.outString("Loading Script Names..."); + sLog->outString("Loading Script Names..."); sObjectMgr->LoadScriptNames(); - sLog.outString("Loading Instance Template..."); + sLog->outString("Loading Instance Template..."); sObjectMgr->LoadInstanceTemplate(); - sLog.outString("Loading SkillLineAbilityMultiMap Data..."); + sLog->outString("Loading SkillLineAbilityMultiMap Data..."); sSpellMgr->LoadSkillLineAbilityMap(); ///- Clean up and pack instances - sLog.outString("Cleaning up and packing instances..."); + sLog->outString("Cleaning up and packing instances..."); sInstanceSaveMgr->CleanupAndPackInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables - sLog.outString("Loading Localization strings..."); + sLog->outString("Loading Localization strings..."); uint32 oldMSTime = getMSTime(); sObjectMgr->LoadCreatureLocales(); sObjectMgr->LoadGameObjectLocales(); @@ -1264,312 +1264,312 @@ 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->outString(">> Localization strings loaded in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); - sLog.outString("Loading Page Texts..."); + sLog->outString("Loading Page Texts..."); sObjectMgr->LoadPageTexts(); - sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts + sLog->outString("Loading Game Object Templates..."); // must be after LoadPageTexts sObjectMgr->LoadGameobjectInfo(); - sLog.outString("Loading Spell Rank Data..."); + sLog->outString("Loading Spell Rank Data..."); sSpellMgr->LoadSpellRanks(); - sLog.outString("Loading Spell Required Data..."); + sLog->outString("Loading Spell Required Data..."); sSpellMgr->LoadSpellRequired(); - sLog.outString("Loading Spell Group types..."); + sLog->outString("Loading Spell Group types..."); sSpellMgr->LoadSpellGroups(); - sLog.outString("Loading Spell Learn Skills..."); + sLog->outString("Loading Spell Learn Skills..."); sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks - sLog.outString("Loading Spell Learn Spells..."); + sLog->outString("Loading Spell Learn Spells..."); sSpellMgr->LoadSpellLearnSpells(); - sLog.outString("Loading Spell Proc Event conditions..."); + sLog->outString("Loading Spell Proc Event conditions..."); sSpellMgr->LoadSpellProcEvents(); - sLog.outString("Loading Spell Bonus Data..."); + sLog->outString("Loading Spell Bonus Data..."); sSpellMgr->LoadSpellBonusess(); - sLog.outString("Loading Aggro Spells Definitions..."); + sLog->outString("Loading Aggro Spells Definitions..."); sSpellMgr->LoadSpellThreats(); - sLog.outString("Loading Spell Group Stack Rules..."); + sLog->outString("Loading Spell Group Stack Rules..."); sSpellMgr->LoadSpellGroupStackRules(); - sLog.outString("Loading NPC Texts..."); + sLog->outString("Loading NPC Texts..."); sObjectMgr->LoadGossipText(); - sLog.outString("Loading Enchant Spells Proc datas..."); + sLog->outString("Loading Enchant Spells Proc datas..."); sSpellMgr->LoadSpellEnchantProcData(); - sLog.outString("Loading Item Random Enchantments Table..."); + sLog->outString("Loading Item Random Enchantments Table..."); LoadRandomEnchantmentsTable(); - sLog.outString("Loading Disables"); + sLog->outString("Loading Disables"); sDisableMgr->LoadDisables(); // must be before loading quests and items - sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts + sLog->outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts sObjectMgr->LoadItemPrototypes(); - sLog.outString("Loading Item set names..."); // must be after LoadItemPrototypes + sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes sObjectMgr->LoadItemSetNames(); - sLog.outString("Loading Creature Model Based Info Data..."); + sLog->outString("Loading Creature Model Based Info Data..."); sObjectMgr->LoadCreatureModelInfo(); - sLog.outString("Loading Equipment templates..."); + sLog->outString("Loading Equipment templates..."); sObjectMgr->LoadEquipmentTemplates(); - sLog.outString("Loading Creature templates..."); + sLog->outString("Loading Creature templates..."); sObjectMgr->LoadCreatureTemplates(); - sLog.outString("Loading Vehicle scaling information..."); + sLog->outString("Loading Vehicle scaling information..."); sObjectMgr->LoadVehicleScaling(); - sLog.outString("Loading Reputation Reward Rates..."); + sLog->outString("Loading Reputation Reward Rates..."); sObjectMgr->LoadReputationRewardRate(); - sLog.outString("Loading Creature Reputation OnKill Data..."); + sLog->outString("Loading Creature Reputation OnKill Data..."); sObjectMgr->LoadReputationOnKill(); - sLog.outString( "Loading Reputation Spillover Data..." ); + sLog->outString( "Loading Reputation Spillover Data..." ); sObjectMgr->LoadReputationSpilloverTemplate(); - sLog.outString("Loading Points Of Interest Data..."); + sLog->outString("Loading Points Of Interest Data..."); sObjectMgr->LoadPointsOfInterest(); - sLog.outString("Loading Creature Base Stats..."); + sLog->outString("Loading Creature Base Stats..."); sObjectMgr->LoadCreatureClassLevelStats(); - sLog.outString("Loading Creature Data..."); + sLog->outString("Loading Creature Data..."); sObjectMgr->LoadCreatures(); - sLog.outString("Loading Creature Linked Respawn..."); + sLog->outString("Loading Creature Linked Respawn..."); sObjectMgr->LoadCreatureLinkedRespawn(); // must be after LoadCreatures() - sLog.outString("Loading pet levelup spells..."); + sLog->outString("Loading pet levelup spells..."); sSpellMgr->LoadPetLevelupSpellMap(); - sLog.outString("Loading pet default spells additional to levelup spells..."); + sLog->outString("Loading pet default spells additional to levelup spells..."); sSpellMgr->LoadPetDefaultSpells(); - sLog.outString("Loading Creature Template Addon Data..."); + sLog->outString("Loading Creature Template Addon Data..."); sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() - sLog.outString("Loading Vehicle Accessories..."); + sLog->outString("Loading Vehicle Accessories..."); sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() - sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances() + sLog->outString("Loading Creature Respawn Data..."); // must be after PackInstances() sObjectMgr->LoadCreatureRespawnTimes(); - sLog.outString("Loading Gameobject Data..."); + sLog->outString("Loading Gameobject Data..."); sObjectMgr->LoadGameobjects(); - sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances() + sLog->outString("Loading Gameobject Respawn Data..."); // must be after PackInstances() sObjectMgr->LoadGameobjectRespawnTimes(); - sLog.outString("Loading Objects Pooling Data..."); // TODOLEAK: scope + sLog->outString("Loading Objects Pooling Data..."); // TODOLEAK: scope sPoolMgr->LoadFromDB(); - sLog.outString("Loading Weather Data..."); + sLog->outString("Loading Weather Data..."); sWeatherMgr->LoadWeatherData(); - sLog.outString("Loading Quests..."); + sLog->outString("Loading Quests..."); sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables - sLog.outString("Checking Quest Disables"); + sLog->outString("Checking Quest Disables"); sDisableMgr->CheckQuestDisables(); // must be after loading quests - sLog.outString("Loading Quest POI"); + sLog->outString("Loading Quest POI"); sObjectMgr->LoadQuestPOI(); - sLog.outString("Loading Quests Relations..."); + sLog->outString("Loading Quests Relations..."); sObjectMgr->LoadQuestRelations(); // must be after quest load - sLog.outString("Loading Quest Pooling Data..."); + sLog->outString("Loading Quest Pooling Data..."); sPoolMgr->LoadQuestPools(); - sLog.outString("Loading Game Event Data..."); // must be after loading pools fully + sLog->outString("Loading Game Event Data..."); // must be after loading pools fully sGameEventMgr->LoadFromDB(); // TODOLEAK: add scopes - sLog.outString("Loading Dungeon boss data..."); + sLog->outString("Loading Dungeon boss data..."); sLFGMgr->LoadDungeonEncounters(); - sLog.outString("Loading LFG rewards..."); + sLog->outString("Loading LFG rewards..."); sLFGMgr->LoadRewards(); - sLog.outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); + sLog->outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); sObjectMgr->LoadNPCSpellClickSpells(); - sLog.outString("Loading SpellArea Data..."); // must be after quest load + sLog->outString("Loading SpellArea Data..."); // must be after quest load sSpellMgr->LoadSpellAreas(); - sLog.outString("Loading AreaTrigger definitions..."); + sLog->outString("Loading AreaTrigger definitions..."); sObjectMgr->LoadAreaTriggerTeleports(); - sLog.outString("Loading Access Requirements..."); + sLog->outString("Loading Access Requirements..."); sObjectMgr->LoadAccessRequirements(); // must be after item template load - sLog.outString("Loading Quest Area Triggers..."); + sLog->outString("Loading Quest Area Triggers..."); sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests - sLog.outString("Loading Tavern Area Triggers..."); + sLog->outString("Loading Tavern Area Triggers..."); sObjectMgr->LoadTavernAreaTriggers(); - sLog.outString("Loading AreaTrigger script names..."); + sLog->outString("Loading AreaTrigger script names..."); sObjectMgr->LoadAreaTriggerScripts(); - sLog.outString("Loading Graveyard-zone links..."); + sLog->outString("Loading Graveyard-zone links..."); sObjectMgr->LoadGraveyardZones(); - sLog.outString("Loading spell pet auras..."); + sLog->outString("Loading spell pet auras..."); sSpellMgr->LoadSpellPetAuras(); - sLog.outString("Loading spell extra attributes..."); + sLog->outString("Loading spell extra attributes..."); sSpellMgr->LoadSpellCustomAttr(); - sLog.outString("Loading Spell target coordinates..."); + sLog->outString("Loading Spell target coordinates..."); sSpellMgr->LoadSpellTargetPositions(); - sLog.outString("Loading enchant custom attributes..."); + sLog->outString("Loading enchant custom attributes..."); sSpellMgr->LoadEnchantCustomAttr(); - sLog.outString("Loading linked spells..."); + sLog->outString("Loading linked spells..."); sSpellMgr->LoadSpellLinked(); - sLog.outString("Loading Player Create Data..."); + sLog->outString("Loading Player Create Data..."); sObjectMgr->LoadPlayerInfo(); - sLog.outString("Loading Exploration BaseXP Data..."); + sLog->outString("Loading Exploration BaseXP Data..."); sObjectMgr->LoadExplorationBaseXP(); - sLog.outString("Loading Pet Name Parts..."); + sLog->outString("Loading Pet Name Parts..."); sObjectMgr->LoadPetNames(); CharacterDatabaseCleaner::CleanDatabase(); - sLog.outString("Loading the max pet number..."); + sLog->outString("Loading the max pet number..."); sObjectMgr->LoadPetNumber(); - sLog.outString("Loading pet level stats..."); + sLog->outString("Loading pet level stats..."); sObjectMgr->LoadPetLevelInfo(); - sLog.outString("Loading Player Corpses..."); + sLog->outString("Loading Player Corpses..."); sObjectMgr->LoadCorpses(); - sLog.outString("Loading Player level dependent mail rewards..."); + sLog->outString("Loading Player level dependent mail rewards..."); sObjectMgr->LoadMailLevelRewards(); // Loot tables LoadLootTables(); //TODOLEAK: untangle that shit - sLog.outString("Loading Skill Discovery Table..."); + sLog->outString("Loading Skill Discovery Table..."); LoadSkillDiscoveryTable(); - sLog.outString("Loading Skill Extra Item Table..."); + sLog->outString("Loading Skill Extra Item Table..."); LoadSkillExtraItemTable(); - sLog.outString("Loading Skill Fishing base level requirements..."); + sLog->outString("Loading Skill Fishing base level requirements..."); sObjectMgr->LoadFishingBaseSkillLevel(); - sLog.outString("Loading Achievements..."); + sLog->outString("Loading Achievements..."); sAchievementMgr->LoadAchievementReferenceList(); - sLog.outString("Loading Achievement Criteria Lists..."); + sLog->outString("Loading Achievement Criteria Lists..."); sAchievementMgr->LoadAchievementCriteriaList(); - sLog.outString("Loading Achievement Criteria Data..."); + sLog->outString("Loading Achievement Criteria Data..."); sAchievementMgr->LoadAchievementCriteriaData(); - sLog.outString("Loading Achievement Rewards..."); + sLog->outString("Loading Achievement Rewards..."); sAchievementMgr->LoadRewards(); - sLog.outString("Loading Achievement Reward Locales..."); + sLog->outString("Loading Achievement Reward Locales..."); sAchievementMgr->LoadRewardLocales(); - sLog.outString("Loading Completed Achievements..."); + sLog->outString("Loading Completed Achievements..."); sAchievementMgr->LoadCompletedAchievements(); ///- Load dynamic data tables from the database - sLog.outString("Loading Item Auctions..."); + sLog->outString("Loading Item Auctions..."); sAuctionMgr->LoadAuctionItems(); - sLog.outString("Loading Auctions..."); + sLog->outString("Loading Auctions..."); sAuctionMgr->LoadAuctions(); sObjectMgr->LoadGuilds(); - sLog.outString("Loading ArenaTeams..."); + sLog->outString("Loading ArenaTeams..."); sObjectMgr->LoadArenaTeams(); - sLog.outString("Loading Groups..."); + sLog->outString("Loading Groups..."); sObjectMgr->LoadGroups(); - sLog.outString("Loading ReservedNames..."); + sLog->outString("Loading ReservedNames..."); sObjectMgr->LoadReservedPlayersNames(); - sLog.outString("Loading GameObjects for quests..."); + sLog->outString("Loading GameObjects for quests..."); sObjectMgr->LoadGameObjectForQuests(); - sLog.outString("Loading BattleMasters..."); + sLog->outString("Loading BattleMasters..."); sBattlegroundMgr->LoadBattleMastersEntry(); - sLog.outString("Loading GameTeleports..."); + sLog->outString("Loading GameTeleports..."); sObjectMgr->LoadGameTele(); - sLog.outString("Loading Npc Text Id..."); + sLog->outString("Loading Npc Text Id..."); sObjectMgr->LoadNpcTextId(); // must be after load Creature and NpcText sObjectMgr->LoadGossipScripts(); // must be before gossip menu options - sLog.outString("Loading Gossip menu..."); + sLog->outString("Loading Gossip menu..."); sObjectMgr->LoadGossipMenu(); - sLog.outString("Loading Gossip menu options..."); + sLog->outString("Loading Gossip menu options..."); sObjectMgr->LoadGossipMenuItems(); - sLog.outString("Loading Vendors..."); + sLog->outString("Loading Vendors..."); sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate - sLog.outString("Loading Trainers..."); + sLog->outString("Loading Trainers..."); sObjectMgr->LoadTrainerSpell(); // must be after load CreatureTemplate - sLog.outString("Loading Waypoints..."); + sLog->outString("Loading Waypoints..."); sWaypointMgr->Load(); - sLog.outString("Loading SmartAI Waypoints..."); + sLog->outString("Loading SmartAI Waypoints..."); sSmartWaypointMgr->LoadFromDB(); - sLog.outString("Loading Creature Formations..."); - formation_mgr.LoadCreatureFormations(); + sLog->outString("Loading Creature Formations..."); + sFormationMgr->LoadCreatureFormations(); - sLog.outString("Loading Conditions..."); + sLog->outString("Loading Conditions..."); sConditionMgr->LoadConditions(); - sLog.outString("Loading faction change achievement pairs..."); + sLog->outString("Loading faction change achievement pairs..."); sObjectMgr->LoadFactionChangeAchievements(); - sLog.outString("Loading faction change spell pairs..."); + sLog->outString("Loading faction change spell pairs..."); sObjectMgr->LoadFactionChangeSpells(); - sLog.outString("Loading faction change item pairs..."); + sLog->outString("Loading faction change item pairs..."); sObjectMgr->LoadFactionChangeItems(); - sLog.outString("Loading faction change reputation pairs..."); + sLog->outString("Loading faction change reputation pairs..."); sObjectMgr->LoadFactionChangeReputations(); - sLog.outString("Loading GM tickets..."); + sLog->outString("Loading GM tickets..."); sTicketMgr->LoadGMTickets(); - sLog.outString("Loading GM surveys..."); + sLog->outString("Loading GM surveys..."); sTicketMgr->LoadGMSurveys(); - sLog.outString("Loading client addons..."); + sLog->outString("Loading client addons..."); sAddonMgr->LoadFromDB(); ///- Handle outdated emails (delete/return) - sLog.outString("Returning old mails..."); + sLog->outString("Returning old mails..."); sObjectMgr->ReturnOrDeleteOldMails(false); - sLog.outString("Loading Autobroadcasts..."); + sLog->outString("Loading Autobroadcasts..."); LoadAutobroadcasts(); ///- Load and initialize scripts @@ -1580,35 +1580,35 @@ 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->outString("Loading Scripts text locales..."); // must be after Load*Scripts calls sObjectMgr->LoadDbScriptStrings(); - sLog.outString("Loading CreatureEventAI Texts..."); + sLog->outString("Loading CreatureEventAI Texts..."); sEventAIMgr->LoadCreatureEventAI_Texts(); - sLog.outString("Loading CreatureEventAI Summons..."); + sLog->outString("Loading CreatureEventAI Summons..."); sEventAIMgr->LoadCreatureEventAI_Summons(); - sLog.outString("Loading CreatureEventAI Scripts..."); + sLog->outString("Loading CreatureEventAI Scripts..."); sEventAIMgr->LoadCreatureEventAI_Scripts(); - sLog.outString("Loading spell script names..."); + sLog->outString("Loading spell script names..."); sObjectMgr->LoadSpellScriptNames(); - sLog.outString("Loading Creature Texts..."); + sLog->outString("Loading Creature Texts..."); sCreatureTextMgr->LoadCreatureTexts(); - sLog.outString("Initializing Scripts..."); + sLog->outString("Initializing Scripts..."); sScriptMgr->Initialize(); //LEAKTODO - sLog.outString("Validating spell scripts..."); + sLog->outString("Validating spell scripts..."); sObjectMgr->ValidateSpellScripts(); - sLog.outString("Loading SmartAI scripts..."); + sLog->outString("Loading SmartAI scripts..."); sSmartScriptMgr->LoadSmartAIFromDB(); ///- Initialize game time and timers - sLog.outDebug("DEBUG:: Initialize game time and timers"); + sLog->outDebug("DEBUG:: Initialize game time and timers"); m_gameTime = time(NULL); m_startTime=m_gameTime; @@ -1645,17 +1645,17 @@ 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.outDebug("Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires)); + sLog->outDebug("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(); Player::InitVisibleBits(); ///- Initialize MapManager - sLog.outString("Starting Map System"); + sLog->outString("Starting Map System"); sMapMgr->Initialize(); - sLog.outString("Starting Game Event system..."); + sLog->outString("Starting Game Event system..."); uint32 nextGameEvent = sGameEventMgr->Initialize(); m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event @@ -1665,67 +1665,67 @@ void World::SetInitialWorldSettings() // Delete all custom channels which haven't been used for PreserveCustomChannelDuration days. Channel::CleanOldChannelsInDB(); - sLog.outString("Starting Arena Season..."); + sLog->outString("Starting Arena Season..."); sGameEventMgr->StartArenaSeason(); sTicketMgr->Initialize(); - sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP + sLog->outString("Loading World States..."); // must be loaded before battleground and outdoor PvP LoadWorldStates(); ///- Initialize Battlegrounds - sLog.outString("Starting Battleground System"); + sLog->outString("Starting Battleground System"); sBattlegroundMgr->CreateInitialBattlegrounds(); sBattlegroundMgr->InitAutomaticArenaPointDistribution(); ///- Initialize outdoor pvp - sLog.outString("Starting Outdoor PvP System"); + sLog->outString("Starting Outdoor PvP System"); sOutdoorPvPMgr->InitOutdoorPvP(); - sLog.outString("Loading Transports..."); + sLog->outString("Loading Transports..."); sMapMgr->LoadTransports(); - sLog.outString("Loading Transport NPCs..."); + sLog->outString("Loading Transport NPCs..."); sMapMgr->LoadTransportNPCs(); - sLog.outString("Deleting expired bans..."); + sLog->outString("Deleting expired bans..."); LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); - sLog.outString("Starting objects Pooling system..."); + sLog->outString("Starting objects Pooling system..."); sPoolMgr->Initialize(); - sLog.outString("Calculate next daily quest reset time..."); + sLog->outString("Calculate next daily quest reset time..."); InitDailyQuestResetTime(); - sLog.outString("Calculate next weekly quest reset time..." ); + sLog->outString("Calculate next weekly quest reset time..." ); InitWeeklyQuestResetTime(); - sLog.outString("Calculate random battleground reset time..." ); + sLog->outString("Calculate random battleground reset time..." ); InitRandomBGResetTime(); // possibly enable db logging; avoid massive startup spam by doing it here. - if (sLog.GetLogDBLater()) + if (sLog->GetLogDBLater()) { - sLog.outString("Enabling database logging..."); - sLog.SetLogDBLater(false); - sLog.SetLogDB(true); + sLog->outString("Enabling database logging..."); + sLog->SetLogDBLater(false); + sLog->SetLogDB(true); } else - sLog.SetLogDB(false); + sLog->SetLogDB(false); uint32 startupDuration = GetMSTimeDiffToNow(startupBegin); - sLog.outString(); - sLog.outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000) ); - sLog.outString(); + sLog->outString(); + sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000) ); + sLog->outString(); } void World::DetectDBCLang() { - uint8 m_lang_confid = sConfig.GetIntDefault("DBC.Locale", 255); + uint8 m_lang_confid = sConfig->GetIntDefault("DBC.Locale", 255); if (m_lang_confid != 255 && m_lang_confid >= TOTAL_LOCALES) { - sLog.outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES); + sLog->outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES); m_lang_confid = LOCALE_enUS; } @@ -1753,14 +1753,14 @@ void World::DetectDBCLang() if (default_locale >= TOTAL_LOCALES) { - sLog.outError("Unable to determine your DBC Locale! (corrupt DBC?)"); + sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)"); exit(1); } m_defaultDbcLocale = LocaleConstant(default_locale); - sLog.outString("Using %s DBC Locale as default. All available DBC locales: %s",localeNames[m_defaultDbcLocale],availableLocalsStr.empty() ? "" : availableLocalsStr.c_str()); - sLog.outString(); + sLog->outString("Using %s DBC Locale as default. All available DBC locales: %s",localeNames[m_defaultDbcLocale],availableLocalsStr.empty() ? "" : availableLocalsStr.c_str()); + sLog->outString(); } void World::RecordTimeDiff(const char *text, ...) @@ -1783,7 +1783,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->outDetail("Difftime %s: %u.", str, diff); } m_currentTime = thisTime; @@ -1799,8 +1799,8 @@ void World::LoadAutobroadcasts() if (!result) { - sLog.outString(">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty!"); + sLog->outString(); return; } @@ -1817,8 +1817,8 @@ void World::LoadAutobroadcasts() ++count; } while (result->NextRow()); - sLog.outString(">> Loaded %u autobroadcasts definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u autobroadcasts definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } /// Update the World ! @@ -1830,7 +1830,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->outBasic("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount()); m_updateTimeSum = m_updateTime; m_updateTimeCount = 1; } @@ -1906,13 +1906,13 @@ void World::Update(uint32 diff) } ///
  • Clean logs table - if (sWorld.getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer + if (sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer { if (m_timers[WUPDATE_CLEANDB].Passed()) { m_timers[WUPDATE_CLEANDB].Reset(); LoginDatabase.PExecute("DELETE FROM logs WHERE (time + %u) < "UI64FMTD";", - sWorld.getIntConfig(CONFIG_LOGDB_CLEARTIME), uint64(time(0))); + sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME), uint64(time(0))); } } @@ -1920,7 +1920,7 @@ void World::Update(uint32 diff) ///- Update objects when the timer has passed (maps, transport, creatures,...) sMapMgr->Update(diff); // As interval = 0 - if (sWorld.getBoolConfig(CONFIG_AUTOBROADCAST)) + if (sWorld->getBoolConfig(CONFIG_AUTOBROADCAST)) { if (m_timers[WUPDATE_AUTOBROADCAST].Passed()) { @@ -1953,7 +1953,7 @@ void World::Update(uint32 diff) if (m_timers[WUPDATE_CORPSES].Passed()) { m_timers[WUPDATE_CORPSES].Reset(); - sObjectAccessor.RemoveOldCorpses(); + sObjectAccessor->RemoveOldCorpses(); } ///- Process Game events when necessary @@ -1969,7 +1969,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->outDetail("Ping MySQL to keep connection alive"); CharacterDatabase.KeepAlive(); LoginDatabase.KeepAlive(); WorldDatabase.KeepAlive(); @@ -2444,7 +2444,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->outStaticDebug("Server is %s in %s",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"),str.c_str()); } } @@ -2462,7 +2462,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->outStaticDebug("Server %s cancelled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); sScriptMgr->OnShutdownCancel(); } @@ -2518,7 +2518,7 @@ void World::ProcessCliCommands() CliCommandHolder* command; while (cliCmdQueue.next(command)) { - sLog.outDebug("CLI command under processing..."); + sLog->outDebug("CLI command under processing..."); zprint = command->m_print; callbackArg = command->m_callbackArg; CliHandler handler(callbackArg, zprint); @@ -2540,28 +2540,28 @@ void World::SendAutoBroadcast() std::advance(itr, rand() % m_Autobroadcasts.size()); msg = *itr; - uint32 abcenter = sWorld.getIntConfig(CONFIG_AUTOBROADCAST_CENTER); + uint32 abcenter = sWorld->getIntConfig(CONFIG_AUTOBROADCAST_CENTER); if (abcenter == 0) - sWorld.SendWorldText(LANG_AUTO_BROADCAST, msg.c_str()); + sWorld->SendWorldText(LANG_AUTO_BROADCAST, msg.c_str()); else if (abcenter == 1) { WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1)); data << msg; - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); } else if (abcenter == 2) { - sWorld.SendWorldText(LANG_AUTO_BROADCAST, msg.c_str()); + sWorld->SendWorldText(LANG_AUTO_BROADCAST, msg.c_str()); WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1)); data << msg; - sWorld.SendGlobalMessage(&data); + sWorld->SendGlobalMessage(&data); } - sLog.outDebug("AutoBroadcast: '%s'",msg.c_str()); + sLog->outDebug("AutoBroadcast: '%s'",msg.c_str()); } void World::UpdateRealmCharCount(uint32 accountId) @@ -2584,7 +2584,7 @@ void World::_UpdateRealmCharCount(QueryResult resultCharCount, uint32 accountId) void World::InitWeeklyQuestResetTime() { - time_t wstime = uint64(sWorld.getWorldState(WS_WEEKLY_QUEST_RESET_TIME)); + time_t wstime = uint64(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME)); time_t curtime = time(NULL); m_NextWeeklyQuestReset = wstime < curtime ? curtime : time_t(wstime); } @@ -2625,7 +2625,7 @@ void World::InitDailyQuestResetTime() void World::InitRandomBGResetTime() { - time_t bgtime = uint64(sWorld.getWorldState(WS_BG_DAILY_RESET_TIME)); + time_t bgtime = uint64(sWorld->getWorldState(WS_BG_DAILY_RESET_TIME)); if (!bgtime) m_NextRandomBGReset = time_t(time(NULL)); // game time not yet init @@ -2647,12 +2647,12 @@ void World::InitRandomBGResetTime() m_NextRandomBGReset = bgtime < curTime ? nextDayResetTime - DAY : nextDayResetTime; if (!bgtime) - sWorld.setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset)); + sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset)); } void World::ResetDailyQuests() { - sLog.outDetail("Daily quests reset for all characters."); + sLog->outDetail("Daily quests reset for all characters."); CharacterDatabase.Execute("DELETE FROM character_queststatus_daily"); for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) if (itr->second->GetPlayer()) @@ -2686,7 +2686,7 @@ void World::ResetWeeklyQuests() itr->second->GetPlayer()->ResetWeeklyQuestStatus(); m_NextWeeklyQuestReset = time_t(m_NextWeeklyQuestReset + WEEK); - sWorld.setWorldState(WS_WEEKLY_QUEST_RESET_TIME, uint64(m_NextWeeklyQuestReset)); + sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, uint64(m_NextWeeklyQuestReset)); // change available weeklies sPoolMgr->ChangeWeeklyQuests(); @@ -2694,14 +2694,14 @@ void World::ResetWeeklyQuests() void World::ResetRandomBG() { - sLog.outDetail("Random BG status reset for all characters."); + sLog->outDetail("Random BG status reset for all characters."); CharacterDatabase.Execute("DELETE FROM character_battleground_random"); for(SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) if (itr->second->GetPlayer()) itr->second->GetPlayer()->SetRandomWinner(false); m_NextRandomBGReset = time_t(m_NextRandomBGReset + DAY); - sWorld.setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset)); + sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, uint64(m_NextRandomBGReset)); } void World::UpdateMaxSessionCounters() @@ -2759,8 +2759,8 @@ void World::LoadWorldStates() if (!result) { - sLog.outString(">> Loaded 0 world states. DB table `worldstates` is empty!"); - sLog.outString(); + sLog->outString(">> Loaded 0 world states. DB table `worldstates` is empty!"); + sLog->outString(); return; } @@ -2774,8 +2774,8 @@ void World::LoadWorldStates() } while (result->NextRow()); - sLog.outString(">> Loaded %u world states in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog.outString(); + sLog->outString(">> Loaded %u world states in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } // Setting a worldstate will save it to DB diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 46aa4470159..5e2b29d6b9d 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -830,6 +830,6 @@ class World extern uint32 realmID; -#define sWorld (*ACE_Singleton::instance()) +#define sWorld ACE_Singleton::instance() #endif /// @} diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 122d034e86e..883a8b76ede 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -74,7 +74,7 @@ public: uint32 account_id = handler->GetSession()->GetAccountId(); int expansion = atoi(szExp); //get int anyway (0 if error) - if (expansion < 0 || uint8(expansion) > sWorld.getIntConfig(CONFIG_EXPANSION)) + if (expansion < 0 || uint8(expansion) > sWorld->getIntConfig(CONFIG_EXPANSION)) { handler->SendSysMessage(LANG_IMPROPER_VALUE); handler->SetSentErrorMessage(true); @@ -377,7 +377,7 @@ public: return false; int expansion = atoi(szExp); //get int anyway (0 if error) - if (expansion < 0 || uint8(expansion) > sWorld.getIntConfig(CONFIG_EXPANSION)) + if (expansion < 0 || uint8(expansion) > sWorld->getIntConfig(CONFIG_EXPANSION)) return false; // No SQL injection diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index bb3374234f3..f61e79539ab 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -239,7 +239,7 @@ public: uint32 icon = atol(icon_text); uint32 flags = atol(flags_text); - sLog.outDetail("Command : POI, NPC = %u, icon = %u flags = %u", target->GetGUIDLow(), icon,flags); + sLog->outDetail("Command : POI, NPC = %u, icon = %u flags = %u", target->GetGUIDLow(), icon,flags); pPlayer->PlayerTalkClass->SendPointOfInterest(target->GetPositionX(), target->GetPositionY(), Poi_Icon(icon), flags, 30, "Test POI"); return true; } @@ -391,12 +391,12 @@ public: } else { - sLog.outDebug("Sending opcode: unknown type '%s'", type.c_str()); + sLog->outDebug("Sending opcode: unknown type '%s'", type.c_str()); break; } } ifs.close(); - sLog.outDebug("Sending opcode %u", data.GetOpcode()); + sLog->outDebug("Sending opcode %u", data.GetOpcode()); data.hexlike(); player->GetSession()->SendPacket(&data); handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName()); @@ -1053,14 +1053,14 @@ public: if (isint32) { iValue = (uint32)atoi(py); - sLog.outDebug(handler->GetTrinityString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue); + sLog->outDebug(handler->GetTrinityString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue); target->SetUInt32Value(Opcode , iValue); handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode,iValue); } else { fValue = (float)atof(py); - sLog.outDebug(handler->GetTrinityString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue); + sLog->outDebug(handler->GetTrinityString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue); target->SetFloatValue(Opcode , fValue); handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode,fValue); } @@ -1104,13 +1104,13 @@ public: if (isint32) { iValue = target->GetUInt32Value(Opcode); - sLog.outDebug(handler->GetTrinityString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue); + sLog->outDebug(handler->GetTrinityString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue); handler->PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue); } else { fValue = target->GetFloatValue(Opcode); - sLog.outDebug(handler->GetTrinityString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue); + sLog->outDebug(handler->GetTrinityString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue); handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue); } @@ -1137,7 +1137,7 @@ public: return false; } - sLog.outDebug(handler->GetTrinityString(LANG_CHANGE_32BIT), Opcode, Value); + sLog->outDebug(handler->GetTrinityString(LANG_CHANGE_32BIT), Opcode, Value); int CurrentValue = (int)handler->GetSession()->GetPlayer()->GetUInt32Value(Opcode); @@ -1223,7 +1223,7 @@ public: if (Value > 32) //uint32 = 32 bits return false; - sLog.outDebug(handler->GetTrinityString(LANG_SET_32BIT), Opcode, Value); + sLog->outDebug(handler->GetTrinityString(LANG_SET_32BIT), Opcode, Value); uint32 iValue = Value ? 1 << (Value - 1) : 0; target->SetUInt32Value(Opcode , iValue); diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index f6b699bdb5a..8e3c8158585 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -116,11 +116,11 @@ public: bool footer = false; ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder::GetLock(), true); - HashMapHolder::MapType &m = sObjectAccessor.GetPlayers(); + HashMapHolder::MapType &m = sObjectAccessor->GetPlayers(); for (HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { AccountTypes itr_sec = itr->second->GetSession()->GetSecurity(); - if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= AccountTypes(sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) && + if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) && (!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer()))) { if (first) diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 0007ad62e40..4ef48cd1dd7 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -85,7 +85,7 @@ public: // User wants to teleport to the NPC's template entry if (strcmp(pParam1, "id") == 0) { - //sLog.outError("DEBUG: ID found"); + //sLog->outError("DEBUG: ID found"); // Get the "creature_template.entry" // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r @@ -97,7 +97,7 @@ public: return false; int32 tEntry = atoi(cId); - //sLog.outError("DEBUG: ID value: %d", tEntry); + //sLog->outError("DEBUG: ID value: %d", tEntry); if (!tEntry) return false; @@ -105,7 +105,7 @@ public: } else { - //sLog.outError("DEBUG: ID *not found*"); + //sLog->outError("DEBUG: ID *not found*"); int32 guid = atoi(pParam1); @@ -121,7 +121,7 @@ public: whereClause << "WHERE guid = '" << guid << "'"; } } - //sLog.outError("DEBUG: %s", whereClause.c_str()); + //sLog->outError("DEBUG: %s", whereClause.c_str()); QueryResult result = WorldDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map FROM creature %s", whereClause.str().c_str()); if (!result) diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index f36a876abdc..2f9e981ffbb 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -133,7 +133,7 @@ public: if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId)) { // report to DB errors log as in loading case - sLog.outErrorDb("Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.",id, gInfo->type, gInfo->displayId); + sLog->outErrorDb("Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.",id, gInfo->type, gInfo->displayId); handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA,id); handler->SetSentErrorMessage(true); return false; @@ -159,7 +159,7 @@ public: { uint32 value = atoi((char*)spawntimeSecs); pGameObj->SetRespawnTime(value); - //sLog.outDebug("*** spawntimeSecs: %d", value); + //sLog->outDebug("*** spawntimeSecs: %d", value); } // fill the gameobject data and save to the db @@ -172,7 +172,7 @@ public: return false; } - sLog.outDebug(handler->GetTrinityString(LANG_GAMEOBJECT_CURRENT), gInfo->name, db_lowGUID, x, y, z, o); + sLog->outDebug(handler->GetTrinityString(LANG_GAMEOBJECT_CURRENT), gInfo->name, db_lowGUID, x, y, z, o); map->Add(pGameObj); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 99e8d06e204..6953ed967f4 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -191,7 +191,7 @@ public: target->SetMaxPower(POWER_ENERGY,energym); target->SetPower(POWER_ENERGY, energy); - sLog.outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY),target->GetMaxPower(POWER_ENERGY)); + sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY),target->GetMaxPower(POWER_ENERGY)); return true; } @@ -998,7 +998,7 @@ public: { int32 newmoney = int32(moneyuser) + addmoney; - sLog.outDetail(handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney); + sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney); if (newmoney <= 0) { handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str()); @@ -1030,7 +1030,7 @@ public: target->ModifyMoney(addmoney); } - sLog.outDetail(handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, target->GetMoney()); + sLog->outDetail(handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, target->GetMoney()); return true; } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 3a45f774672..3eda0b508c9 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -272,14 +272,14 @@ public: static bool HandleNpcSetAllowMovementCommand(ChatHandler* handler, const char* /*args*/) { - if (sWorld.getAllowMovement()) + if (sWorld->getAllowMovement()) { - sWorld.SetAllowMovement(false); + sWorld->SetAllowMovement(false); handler->SendSysMessage(LANG_CREATURE_MOVE_DISABLED); } else { - sWorld.SetAllowMovement(true); + sWorld->SetAllowMovement(true); handler->SendSysMessage(LANG_CREATURE_MOVE_ENABLED); } return true; @@ -316,7 +316,7 @@ public: return false; uint8 lvl = (uint8) atoi((char*)args); - if (lvl < 1 || lvl > sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL) + 3) + if (lvl < 1 || lvl > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) + 3) { handler->SendSysMessage(LANG_BAD_VALUE); handler->SetSentErrorMessage(true); @@ -726,7 +726,7 @@ public: if (dontdel_str) { - //sLog.outError("DEBUG: All 3 params are set"); + //sLog->outError("DEBUG: All 3 params are set"); // All 3 params are set // GUID @@ -734,7 +734,7 @@ public: // doNotDEL if (stricmp(dontdel_str, "NODEL") == 0) { - //sLog.outError("DEBUG: doNotDelete = true;"); + //sLog->outError("DEBUG: doNotDelete = true;"); doNotDelete = true; } } @@ -743,10 +743,10 @@ public: // Only 2 params - but maybe NODEL is set if (type_str) { - sLog.outError("DEBUG: Only 2 params "); + sLog->outError("DEBUG: Only 2 params "); if (stricmp(type_str, "NODEL") == 0) { - //sLog.outError("DEBUG: type_str, NODEL "); + //sLog->outError("DEBUG: type_str, NODEL "); doNotDelete = true; type_str = NULL; } diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 676daa6a22f..d7c3a204f8a 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -214,7 +214,7 @@ public: static bool HandleReloadAllLootCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables..."); + sLog->outString("Re-Loading Loot Tables..."); LoadLootTables(); handler->SendGlobalGMSysMessage("DB tables `*_loot_template` reloaded."); sConditionMgr->LoadConditions(true); @@ -238,7 +238,7 @@ public: HandleReloadQuestPOICommand(handler,"a"); HandleReloadQuestTemplateCommand(handler,"a"); - sLog.outString("Re-Loading Quests Relations..."); + sLog->outString("Re-Loading Quests Relations..."); sObjectMgr->LoadQuestRelations(); handler->SendGlobalGMSysMessage("DB tables `*_questrelation` and `*_involvedrelation` reloaded."); return true; @@ -246,14 +246,14 @@ public: static bool HandleReloadAllScriptsCommand(ChatHandler* handler, const char* /*args*/) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->PSendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); return false; } - sLog.outString("Re-Loading Scripts..."); + sLog->outString("Re-Loading Scripts..."); HandleReloadGameObjectScriptsCommand(handler,"a"); HandleReloadGossipScriptsCommand(handler,"a"); HandleReloadEventScriptsCommand(handler,"a"); @@ -326,8 +326,8 @@ public: static bool HandleReloadConfigCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading config settings..."); - sWorld.LoadConfigSettings(true); + sLog->outString("Re-Loading config settings..."); + sWorld->LoadConfigSettings(true); sMapMgr->InitializeVisibilityDistanceInfo(); handler->SendGlobalGMSysMessage("World config settings reloaded."); return true; @@ -335,7 +335,7 @@ public: static bool HandleReloadAccessRequirementCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Access Requirement definitions..."); + sLog->outString("Re-Loading Access Requirement definitions..."); sObjectMgr->LoadAccessRequirements(); handler->SendGlobalGMSysMessage("DB table `access_requirement` reloaded."); return true; @@ -343,7 +343,7 @@ public: static bool HandleReloadAchievementCriteriaDataCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Additional Achievement Criteria Data..."); + sLog->outString("Re-Loading Additional Achievement Criteria Data..."); sAchievementMgr->LoadAchievementCriteriaData(); handler->SendGlobalGMSysMessage("DB table `achievement_criteria_data` reloaded."); return true; @@ -351,7 +351,7 @@ public: static bool HandleReloadAchievementRewardCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Achievement Reward Data..."); + sLog->outString("Re-Loading Achievement Reward Data..."); sAchievementMgr->LoadRewards(); handler->SendGlobalGMSysMessage("DB table `achievement_reward` reloaded."); return true; @@ -359,7 +359,7 @@ public: static bool HandleReloadAreaTriggerTavernCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Tavern Area Triggers..."); + sLog->outString("Re-Loading Tavern Area Triggers..."); sObjectMgr->LoadTavernAreaTriggers(); handler->SendGlobalGMSysMessage("DB table `areatrigger_tavern` reloaded."); return true; @@ -367,7 +367,7 @@ public: static bool HandleReloadAreaTriggerTeleportCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading AreaTrigger teleport definitions..."); + sLog->outString("Re-Loading AreaTrigger teleport definitions..."); sObjectMgr->LoadAreaTriggerTeleports(); handler->SendGlobalGMSysMessage("DB table `areatrigger_teleport` reloaded."); return true; @@ -375,8 +375,8 @@ public: static bool HandleReloadAutobroadcastCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Autobroadcast..."); - sWorld.LoadAutobroadcasts(); + sLog->outString("Re-Loading Autobroadcast..."); + sWorld->LoadAutobroadcasts(); handler->SendGlobalGMSysMessage("DB table `autobroadcast` reloaded."); return true; } @@ -390,7 +390,7 @@ public: static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading creature award reputation definitions..."); + sLog->outString("Re-Loading creature award reputation definitions..."); sObjectMgr->LoadReputationOnKill(); handler->SendGlobalGMSysMessage("DB table `creature_onkill_reputation` reloaded."); return true; @@ -418,7 +418,7 @@ public: return false; } - sLog.outString("Reloading creature template entry %u", entry); + sLog->outString("Reloading creature template entry %u", entry); Field *fields = result->Fetch(); @@ -539,7 +539,7 @@ public: static bool HandleReloadCreatureQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Loading Quests Relations... (`creature_questrelation`)"); + sLog->outString("Loading Quests Relations... (`creature_questrelation`)"); sObjectMgr->LoadCreatureQuestRelations(); handler->SendGlobalGMSysMessage("DB table `creature_questrelation` (creature quest givers) reloaded."); return true; @@ -547,7 +547,7 @@ public: static bool HandleReloadCreatureLinkedRespawnCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Loading Linked Respawns... (`creature_linked_respawn`)"); + sLog->outString("Loading Linked Respawns... (`creature_linked_respawn`)"); sObjectMgr->LoadCreatureLinkedRespawn(); handler->SendGlobalGMSysMessage("DB table `creature_linked_respawn` (creature linked respawns) reloaded."); return true; @@ -555,7 +555,7 @@ public: static bool HandleReloadCreatureQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Loading Quests Relations... (`creature_involvedrelation`)"); + sLog->outString("Loading Quests Relations... (`creature_involvedrelation`)"); sObjectMgr->LoadCreatureInvolvedRelations(); handler->SendGlobalGMSysMessage("DB table `creature_involvedrelation` (creature quest takers) reloaded."); return true; @@ -563,7 +563,7 @@ public: static bool HandleReloadGossipMenuCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading `gossip_menu` Table!"); + sLog->outString("Re-Loading `gossip_menu` Table!"); sObjectMgr->LoadGossipMenu(); handler->SendGlobalGMSysMessage("DB table `gossip_menu` reloaded."); sConditionMgr->LoadConditions(true); @@ -572,7 +572,7 @@ public: static bool HandleReloadGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading `gossip_menu_option` Table!"); + sLog->outString("Re-Loading `gossip_menu_option` Table!"); sObjectMgr->LoadGossipMenuItems(); handler->SendGlobalGMSysMessage("DB table `gossip_menu_option` reloaded."); sConditionMgr->LoadConditions(true); @@ -581,7 +581,7 @@ public: static bool HandleReloadGOQuestRelationsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Loading Quests Relations... (`gameobject_questrelation`)"); + sLog->outString("Loading Quests Relations... (`gameobject_questrelation`)"); sObjectMgr->LoadGameobjectQuestRelations(); handler->SendGlobalGMSysMessage("DB table `gameobject_questrelation` (gameobject quest givers) reloaded."); return true; @@ -589,7 +589,7 @@ public: static bool HandleReloadGOQuestInvRelationsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Loading Quests Relations... (`gameobject_involvedrelation`)"); + sLog->outString("Loading Quests Relations... (`gameobject_involvedrelation`)"); sObjectMgr->LoadGameobjectInvolvedRelations(); handler->SendGlobalGMSysMessage("DB table `gameobject_involvedrelation` (gameobject quest takers) reloaded."); return true; @@ -597,7 +597,7 @@ public: static bool HandleReloadQuestAreaTriggersCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Quest Area Triggers..."); + sLog->outString("Re-Loading Quest Area Triggers..."); sObjectMgr->LoadQuestAreaTriggers(); handler->SendGlobalGMSysMessage("DB table `areatrigger_involvedrelation` (quest area triggers) reloaded."); return true; @@ -605,12 +605,12 @@ public: static bool HandleReloadQuestTemplateCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Quest Templates..."); + sLog->outString("Re-Loading Quest Templates..."); sObjectMgr->LoadQuests(); handler->SendGlobalGMSysMessage("DB table `quest_template` (quest definitions) reloaded."); /// dependent also from `gameobject` but this table not reloaded anyway - sLog.outString("Re-Loading GameObjects for quests..."); + sLog->outString("Re-Loading GameObjects for quests..."); sObjectMgr->LoadGameObjectForQuests(); handler->SendGlobalGMSysMessage("Data GameObjects for quests reloaded."); return true; @@ -618,7 +618,7 @@ public: static bool HandleReloadLootTemplatesCreatureCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`creature_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`creature_loot_template`)"); LoadLootTemplates_Creature(); LootTemplates_Creature.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `creature_loot_template` reloaded."); @@ -628,7 +628,7 @@ public: static bool HandleReloadLootTemplatesDisenchantCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`disenchant_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`disenchant_loot_template`)"); LoadLootTemplates_Disenchant(); LootTemplates_Disenchant.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `disenchant_loot_template` reloaded."); @@ -638,7 +638,7 @@ public: static bool HandleReloadLootTemplatesFishingCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`fishing_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`fishing_loot_template`)"); LoadLootTemplates_Fishing(); LootTemplates_Fishing.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `fishing_loot_template` reloaded."); @@ -648,7 +648,7 @@ public: static bool HandleReloadLootTemplatesGameobjectCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`gameobject_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`gameobject_loot_template`)"); LoadLootTemplates_Gameobject(); LootTemplates_Gameobject.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `gameobject_loot_template` reloaded."); @@ -658,7 +658,7 @@ public: static bool HandleReloadLootTemplatesItemCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`item_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`item_loot_template`)"); LoadLootTemplates_Item(); LootTemplates_Item.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `item_loot_template` reloaded."); @@ -668,7 +668,7 @@ public: static bool HandleReloadLootTemplatesMillingCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`milling_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`milling_loot_template`)"); LoadLootTemplates_Milling(); LootTemplates_Milling.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `milling_loot_template` reloaded."); @@ -678,7 +678,7 @@ public: static bool HandleReloadLootTemplatesPickpocketingCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`pickpocketing_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`pickpocketing_loot_template`)"); LoadLootTemplates_Pickpocketing(); LootTemplates_Pickpocketing.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `pickpocketing_loot_template` reloaded."); @@ -688,7 +688,7 @@ public: static bool HandleReloadLootTemplatesProspectingCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`prospecting_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`prospecting_loot_template`)"); LoadLootTemplates_Prospecting(); LootTemplates_Prospecting.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `prospecting_loot_template` reloaded."); @@ -698,7 +698,7 @@ public: static bool HandleReloadLootTemplatesMailCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`mail_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`mail_loot_template`)"); LoadLootTemplates_Mail(); LootTemplates_Mail.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `mail_loot_template` reloaded."); @@ -708,7 +708,7 @@ public: static bool HandleReloadLootTemplatesReferenceCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`reference_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`reference_loot_template`)"); LoadLootTemplates_Reference(); handler->SendGlobalGMSysMessage("DB table `reference_loot_template` reloaded."); sConditionMgr->LoadConditions(true); @@ -717,7 +717,7 @@ public: static bool HandleReloadLootTemplatesSkinningCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`skinning_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`skinning_loot_template`)"); LoadLootTemplates_Skinning(); LootTemplates_Skinning.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `skinning_loot_template` reloaded."); @@ -727,7 +727,7 @@ public: static bool HandleReloadLootTemplatesSpellCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Loot Tables... (`spell_loot_template`)"); + sLog->outString("Re-Loading Loot Tables... (`spell_loot_template`)"); LoadLootTemplates_Spell(); LootTemplates_Spell.CheckLootRefs(); handler->SendGlobalGMSysMessage("DB table `spell_loot_template` reloaded."); @@ -737,7 +737,7 @@ public: static bool HandleReloadTrinityStringCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading trinity_string Table!"); + sLog->outString("Re-Loading trinity_string Table!"); sObjectMgr->LoadTrinityStrings(); handler->SendGlobalGMSysMessage("DB table `trinity_string` reloaded."); return true; @@ -745,7 +745,7 @@ public: static bool HandleReloadNpcGossipCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading `npc_gossip` Table!"); + sLog->outString("Re-Loading `npc_gossip` Table!"); sObjectMgr->LoadNpcTextId(); handler->SendGlobalGMSysMessage("DB table `npc_gossip` reloaded."); return true; @@ -753,7 +753,7 @@ public: static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading `npc_trainer` Table!"); + sLog->outString("Re-Loading `npc_trainer` Table!"); sObjectMgr->LoadTrainerSpell(); handler->SendGlobalGMSysMessage("DB table `npc_trainer` reloaded."); return true; @@ -761,7 +761,7 @@ public: static bool HandleReloadNpcVendorCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading `npc_vendor` Table!"); + sLog->outString("Re-Loading `npc_vendor` Table!"); sObjectMgr->LoadVendors(); handler->SendGlobalGMSysMessage("DB table `npc_vendor` reloaded."); return true; @@ -769,7 +769,7 @@ public: static bool HandleReloadPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading `points_of_interest` Table!"); + sLog->outString("Re-Loading `points_of_interest` Table!"); sObjectMgr->LoadPointsOfInterest(); handler->SendGlobalGMSysMessage("DB table `points_of_interest` reloaded."); return true; @@ -777,7 +777,7 @@ public: static bool HandleReloadQuestPOICommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString( "Re-Loading Quest POI ..." ); + sLog->outString( "Re-Loading Quest POI ..." ); sObjectMgr->LoadQuestPOI(); handler->SendGlobalGMSysMessage("DB Table `quest_poi` and `quest_poi_points` reloaded."); return true; @@ -785,7 +785,7 @@ public: static bool HandleReloadSpellClickSpellsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading `npc_spellclick_spells` Table!"); + sLog->outString("Re-Loading `npc_spellclick_spells` Table!"); sObjectMgr->LoadNPCSpellClickSpells(); handler->SendGlobalGMSysMessage("DB table `npc_spellclick_spells` reloaded."); return true; @@ -793,7 +793,7 @@ public: static bool HandleReloadReservedNameCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Loading ReservedNames... (`reserved_name`)"); + sLog->outString("Loading ReservedNames... (`reserved_name`)"); sObjectMgr->LoadReservedPlayersNames(); handler->SendGlobalGMSysMessage("DB table `reserved_name` (player reserved names) reloaded."); return true; @@ -801,7 +801,7 @@ public: static bool HandleReloadReputationRewardRateCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString( "Re-Loading `reputation_reward_rate` Table!" ); + sLog->outString( "Re-Loading `reputation_reward_rate` Table!" ); sObjectMgr->LoadReputationRewardRate(); handler->SendGlobalSysMessage("DB table `reputation_reward_rate` reloaded."); return true; @@ -809,7 +809,7 @@ public: static bool HandleReloadReputationSpilloverTemplateCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString( "Re-Loading `reputation_spillover_template` Table!" ); + sLog->outString( "Re-Loading `reputation_spillover_template` Table!" ); sObjectMgr->LoadReputationSpilloverTemplate(); handler->SendGlobalSysMessage("DB table `reputation_spillover_template` reloaded."); return true; @@ -817,7 +817,7 @@ public: static bool HandleReloadSkillDiscoveryTemplateCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Skill Discovery Table..."); + sLog->outString("Re-Loading Skill Discovery Table..."); LoadSkillDiscoveryTable(); handler->SendGlobalGMSysMessage("DB table `skill_discovery_template` (recipes discovered at crafting) reloaded."); return true; @@ -825,7 +825,7 @@ public: static bool HandleReloadSkillExtraItemTemplateCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Skill Extra Item Table..."); + sLog->outString("Re-Loading Skill Extra Item Table..."); LoadSkillExtraItemTable(); handler->SendGlobalGMSysMessage("DB table `skill_extra_item_template` (extra item creation when crafting) reloaded."); return true; @@ -833,7 +833,7 @@ public: static bool HandleReloadSkillFishingBaseLevelCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Skill Fishing base level requirements..."); + sLog->outString("Re-Loading Skill Fishing base level requirements..."); sObjectMgr->LoadFishingBaseSkillLevel(); handler->SendGlobalGMSysMessage("DB table `skill_fishing_base_level` (fishing base level for zone/subzone) reloaded."); return true; @@ -841,7 +841,7 @@ public: static bool HandleReloadSpellAreaCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading SpellArea Data..."); + sLog->outString("Re-Loading SpellArea Data..."); sSpellMgr->LoadSpellAreas(); handler->SendGlobalGMSysMessage("DB table `spell_area` (spell dependences from area/quest/auras state) reloaded."); return true; @@ -849,7 +849,7 @@ public: static bool HandleReloadSpellRequiredCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell Required Data... "); + sLog->outString("Re-Loading Spell Required Data... "); sSpellMgr->LoadSpellRequired(); handler->SendGlobalGMSysMessage("DB table `spell_required` reloaded."); return true; @@ -857,7 +857,7 @@ public: static bool HandleReloadSpellGroupsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell Groups..."); + sLog->outString("Re-Loading Spell Groups..."); sSpellMgr->LoadSpellGroups(); handler->SendGlobalGMSysMessage("DB table `spell_group` (spell groups) reloaded."); return true; @@ -865,7 +865,7 @@ public: static bool HandleReloadSpellLearnSpellCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell Learn Spells..."); + sLog->outString("Re-Loading Spell Learn Spells..."); sSpellMgr->LoadSpellLearnSpells(); handler->SendGlobalGMSysMessage("DB table `spell_learn_spell` reloaded."); return true; @@ -873,7 +873,7 @@ public: static bool HandleReloadSpellLinkedSpellCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell Linked Spells..."); + sLog->outString("Re-Loading Spell Linked Spells..."); sSpellMgr->LoadSpellLinked(); handler->SendGlobalGMSysMessage("DB table `spell_linked_spell` reloaded."); return true; @@ -881,7 +881,7 @@ public: static bool HandleReloadSpellProcEventCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell Proc Event conditions..."); + sLog->outString("Re-Loading Spell Proc Event conditions..."); sSpellMgr->LoadSpellProcEvents(); handler->SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded."); return true; @@ -889,7 +889,7 @@ public: static bool HandleReloadSpellBonusesCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell Bonus Data..."); + sLog->outString("Re-Loading Spell Bonus Data..."); sSpellMgr->LoadSpellBonusess(); handler->SendGlobalGMSysMessage("DB table `spell_bonus_data` (spell damage/healing coefficients) reloaded."); return true; @@ -897,7 +897,7 @@ public: static bool HandleReloadSpellTargetPositionCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell target coordinates..."); + sLog->outString("Re-Loading Spell target coordinates..."); sSpellMgr->LoadSpellTargetPositions(); handler->SendGlobalGMSysMessage("DB table `spell_target_position` (destination coordinates for spell targets) reloaded."); return true; @@ -905,7 +905,7 @@ public: static bool HandleReloadSpellThreatsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Aggro Spells Definitions..."); + sLog->outString("Re-Loading Aggro Spells Definitions..."); sSpellMgr->LoadSpellThreats(); handler->SendGlobalGMSysMessage("DB table `spell_threat` (spell aggro definitions) reloaded."); return true; @@ -913,7 +913,7 @@ public: static bool HandleReloadSpellGroupStackRulesCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell Group Stack Rules..."); + sLog->outString("Re-Loading Spell Group Stack Rules..."); sSpellMgr->LoadSpellGroupStackRules(); handler->SendGlobalGMSysMessage("DB table `spell_group_stack_rules` (spell stacking definitions) reloaded."); return true; @@ -921,7 +921,7 @@ public: static bool HandleReloadSpellPetAurasCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Spell pet auras..."); + sLog->outString("Re-Loading Spell pet auras..."); sSpellMgr->LoadSpellPetAuras(); handler->SendGlobalGMSysMessage("DB table `spell_pet_auras` reloaded."); return true; @@ -929,7 +929,7 @@ public: static bool HandleReloadPageTextsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Page Texts..."); + sLog->outString("Re-Loading Page Texts..."); sObjectMgr->LoadPageTexts(); handler->SendGlobalGMSysMessage("DB table `page_texts` reloaded."); return true; @@ -937,7 +937,7 @@ public: static bool HandleReloadItemEnchantementsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Item Random Enchantments Table..."); + sLog->outString("Re-Loading Item Random Enchantments Table..."); LoadRandomEnchantmentsTable(); handler->SendGlobalGMSysMessage("DB table `item_enchantment_template` reloaded."); return true; @@ -945,7 +945,7 @@ public: static bool HandleReloadItemSetNamesCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Item set names..."); + sLog->outString("Re-Loading Item set names..."); LoadRandomEnchantmentsTable(); handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded."); return true; @@ -953,7 +953,7 @@ public: static bool HandleReloadGossipScriptsCommand(ChatHandler* handler, const char* args) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->SendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); @@ -961,7 +961,7 @@ public: } if (*args != 'a') - sLog.outString("Re-Loading Scripts from `gossip_scripts`..."); + sLog->outString("Re-Loading Scripts from `gossip_scripts`..."); sObjectMgr->LoadGossipScripts(); @@ -973,7 +973,7 @@ public: static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->SendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); @@ -981,7 +981,7 @@ public: } if (*args != 'a') - sLog.outString("Re-Loading Scripts from `gameobject_scripts`..."); + sLog->outString("Re-Loading Scripts from `gameobject_scripts`..."); sObjectMgr->LoadGameObjectScripts(); @@ -993,7 +993,7 @@ public: static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->SendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); @@ -1001,7 +1001,7 @@ public: } if (*args != 'a') - sLog.outString("Re-Loading Scripts from `event_scripts`..."); + sLog->outString("Re-Loading Scripts from `event_scripts`..."); sObjectMgr->LoadEventScripts(); @@ -1013,7 +1013,7 @@ public: static bool HandleReloadWpScriptsCommand(ChatHandler* handler, const char* args) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->SendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); @@ -1021,7 +1021,7 @@ public: } if (*args != 'a') - sLog.outString("Re-Loading Scripts from `waypoint_scripts`..."); + sLog->outString("Re-Loading Scripts from `waypoint_scripts`..."); sObjectMgr->LoadWaypointScripts(); @@ -1034,7 +1034,7 @@ public: static bool HandleReloadEventAITextsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Texts from `creature_ai_texts`..."); + sLog->outString("Re-Loading Texts from `creature_ai_texts`..."); sEventAIMgr->LoadCreatureEventAI_Texts(); handler->SendGlobalGMSysMessage("DB table `creature_ai_texts` reloaded."); return true; @@ -1042,7 +1042,7 @@ public: static bool HandleReloadEventAISummonsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Summons from `creature_ai_summons`..."); + sLog->outString("Re-Loading Summons from `creature_ai_summons`..."); sEventAIMgr->LoadCreatureEventAI_Summons(); handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded."); return true; @@ -1050,7 +1050,7 @@ public: static bool HandleReloadEventAIScriptsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Scripts from `creature_ai_scripts`..."); + sLog->outString("Re-Loading Scripts from `creature_ai_scripts`..."); sEventAIMgr->LoadCreatureEventAI_Scripts(); handler->SendGlobalGMSysMessage("DB table `creature_ai_scripts` reloaded."); return true; @@ -1058,7 +1058,7 @@ public: static bool HandleReloadQuestEndScriptsCommand(ChatHandler* handler, const char* args) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->SendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); @@ -1066,7 +1066,7 @@ public: } if (*args != 'a') - sLog.outString("Re-Loading Scripts from `quest_end_scripts`..."); + sLog->outString("Re-Loading Scripts from `quest_end_scripts`..."); sObjectMgr->LoadQuestEndScripts(); @@ -1078,7 +1078,7 @@ public: static bool HandleReloadQuestStartScriptsCommand(ChatHandler* handler, const char* args) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->SendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); @@ -1086,7 +1086,7 @@ public: } if (*args != 'a') - sLog.outString("Re-Loading Scripts from `quest_start_scripts`..."); + sLog->outString("Re-Loading Scripts from `quest_start_scripts`..."); sObjectMgr->LoadQuestStartScripts(); @@ -1098,7 +1098,7 @@ public: static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args) { - if (sWorld.IsScriptScheduled()) + if (sWorld->IsScriptScheduled()) { handler->SendSysMessage("DB scripts used currently, please attempt reload later."); handler->SetSentErrorMessage(true); @@ -1106,7 +1106,7 @@ public: } if (*args != 'a') - sLog.outString("Re-Loading Scripts from `spell_scripts`..."); + sLog->outString("Re-Loading Scripts from `spell_scripts`..."); sObjectMgr->LoadSpellScripts(); @@ -1118,7 +1118,7 @@ public: static bool HandleReloadDbScriptStringCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Script strings from `db_script_string`..."); + sLog->outString("Re-Loading Script strings from `db_script_string`..."); sObjectMgr->LoadDbScriptStrings(); handler->SendGlobalGMSysMessage("DB table `db_script_string` reloaded."); return true; @@ -1126,7 +1126,7 @@ public: static bool HandleReloadGameGraveyardZoneCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Graveyard-zone links..."); + sLog->outString("Re-Loading Graveyard-zone links..."); sObjectMgr->LoadGraveyardZones(); @@ -1137,7 +1137,7 @@ public: static bool HandleReloadGameTeleCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Game Tele coordinates..."); + sLog->outString("Re-Loading Game Tele coordinates..."); sObjectMgr->LoadGameTele(); @@ -1148,9 +1148,9 @@ public: static bool HandleReloadDisablesCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading disables table..."); + sLog->outString("Re-Loading disables table..."); sDisableMgr->LoadDisables(); - sLog.outString("Checking quest disables..."); + sLog->outString("Checking quest disables..."); sDisableMgr->CheckQuestDisables(); handler->SendGlobalGMSysMessage("DB table `disables` reloaded."); return true; @@ -1158,7 +1158,7 @@ public: static bool HandleReloadLocalesAchievementRewardCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Achievement Reward Data..."); + sLog->outString("Re-Loading Locales Achievement Reward Data..."); sAchievementMgr->LoadRewardLocales(); handler->SendGlobalGMSysMessage("DB table `locales_achievement_reward` reloaded."); return true; @@ -1166,7 +1166,7 @@ public: static bool HandleReloadLfgEncountersCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading dungeon encounter lfg associations..."); + sLog->outString("Re-Loading dungeon encounter lfg associations..."); sLFGMgr->LoadDungeonEncounters(); handler->SendGlobalGMSysMessage("DB table `lfg_dungeon_encounters` reloaded."); return true; @@ -1174,7 +1174,7 @@ public: static bool HandleReloadLfgRewardsCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading lfg dungeon rewards..."); + sLog->outString("Re-Loading lfg dungeon rewards..."); sLFGMgr->LoadRewards(); handler->SendGlobalGMSysMessage("DB table `lfg_dungeon_rewards` reloaded."); return true; @@ -1182,7 +1182,7 @@ public: static bool HandleReloadLocalesCreatureCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Creature ..."); + sLog->outString("Re-Loading Locales Creature ..."); sObjectMgr->LoadCreatureLocales(); handler->SendGlobalGMSysMessage("DB table `locales_creature` reloaded."); return true; @@ -1190,7 +1190,7 @@ public: static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Gameobject ... "); + sLog->outString("Re-Loading Locales Gameobject ... "); sObjectMgr->LoadGameObjectLocales(); handler->SendGlobalGMSysMessage("DB table `locales_gameobject` reloaded."); return true; @@ -1198,7 +1198,7 @@ public: static bool HandleReloadLocalesGossipMenuOptionCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString( "Re-Loading Locales Gossip Menu Option ... "); + sLog->outString( "Re-Loading Locales Gossip Menu Option ... "); sObjectMgr->LoadGossipMenuItemsLocales(); handler->SendGlobalGMSysMessage("DB table `locales_gossip_menu_option` reloaded."); return true; @@ -1206,7 +1206,7 @@ public: static bool HandleReloadLocalesItemCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Item ... "); + sLog->outString("Re-Loading Locales Item ... "); sObjectMgr->LoadItemLocales(); handler->SendGlobalGMSysMessage("DB table `locales_item` reloaded."); return true; @@ -1214,7 +1214,7 @@ public: static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Item set name... "); + sLog->outString("Re-Loading Locales Item set name... "); sObjectMgr->LoadItemSetNameLocales(); handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded."); return true; @@ -1222,7 +1222,7 @@ public: static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales NPC Text ... "); + sLog->outString("Re-Loading Locales NPC Text ... "); sObjectMgr->LoadNpcTextLocales(); handler->SendGlobalGMSysMessage("DB table `locales_npc_text` reloaded."); return true; @@ -1230,7 +1230,7 @@ public: static bool HandleReloadLocalesPageTextCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Page Text ... "); + sLog->outString("Re-Loading Locales Page Text ... "); sObjectMgr->LoadPageTextLocales(); handler->SendGlobalGMSysMessage("DB table `locales_page_text` reloaded."); return true; @@ -1238,7 +1238,7 @@ public: static bool HandleReloadLocalesPointsOfInterestCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Points Of Interest ... "); + sLog->outString("Re-Loading Locales Points Of Interest ... "); sObjectMgr->LoadPointOfInterestLocales(); handler->SendGlobalGMSysMessage("DB table `locales_points_of_interest` reloaded."); return true; @@ -1246,7 +1246,7 @@ public: static bool HandleReloadLocalesQuestCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Locales Quest ... "); + sLog->outString("Re-Loading Locales Quest ... "); sObjectMgr->LoadQuestLocales(); handler->SendGlobalGMSysMessage("DB table `locales_quest` reloaded."); return true; @@ -1254,7 +1254,7 @@ public: static bool HandleReloadMailLevelRewardCommand(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Player level dependent mail rewards..."); + sLog->outString("Re-Loading Player level dependent mail rewards..."); sObjectMgr->LoadMailLevelRewards(); handler->SendGlobalGMSysMessage("DB table `mail_level_reward` reloaded."); return true; @@ -1263,7 +1263,7 @@ public: static bool HandleReloadAuctionsCommand(ChatHandler* handler, const char* /*args*/) { ///- Reload dynamic data tables from the database - sLog.outString("Re-Loading Auctions..."); + sLog->outString("Re-Loading Auctions..."); sAuctionMgr->LoadAuctionItems(); sAuctionMgr->LoadAuctions(); handler->SendGlobalGMSysMessage("Auctions reloaded."); @@ -1272,7 +1272,7 @@ public: static bool HandleReloadConditions(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Conditions..."); + sLog->outString("Re-Loading Conditions..."); sConditionMgr->LoadConditions(true); handler->SendGlobalGMSysMessage("Conditions reloaded."); return true; @@ -1280,7 +1280,7 @@ public: static bool HandleReloadCreatureText(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Creature Texts..."); + sLog->outString("Re-Loading Creature Texts..."); sCreatureTextMgr->LoadCreatureTexts(); handler->SendGlobalGMSysMessage("Creature Texts reloaded."); return true; @@ -1288,7 +1288,7 @@ public: static bool HandleReloadSmartScripts(ChatHandler* handler, const char* /*args*/) { - sLog.outString("Re-Loading Smart Scripts..."); + sLog->outString("Re-Loading Smart Scripts..."); sSmartScriptMgr->LoadSmartAIFromDB(); handler->SendGlobalGMSysMessage("Smart Scripts reloaded."); return true; diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 17e2ef27907..d235ba7a10d 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -75,7 +75,7 @@ public: */ static bool HandleWpAddCommand(ChatHandler* handler, const char* args) { - sLog.outDebug("DEBUG: HandleWpAddCommand"); + sLog->outDebug("DEBUG: HandleWpAddCommand"); // optional char* path_number = NULL; @@ -96,7 +96,7 @@ public: QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM waypoint_data"); uint32 maxpathid = result->Fetch()->GetInt32(); pathid = maxpathid+1; - sLog.outDebug("DEBUG: HandleWpAddCommand - New path started."); + sLog->outDebug("DEBUG: HandleWpAddCommand - New path started."); handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); } } @@ -108,12 +108,12 @@ public: if (!pathid) { - sLog.outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path."); + sLog->outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path."); handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path."); return true; } - sLog.outDebug("DEBUG: HandleWpAddCommand - point == 0"); + sLog->outDebug("DEBUG: HandleWpAddCommand - point == 0"); QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid); @@ -147,7 +147,7 @@ public: // Did player provide a path_id? if (!path_number) - sLog.outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided"); + sLog->outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided"); if (!target) { @@ -452,7 +452,7 @@ public: static bool HandleWpModifyCommand(ChatHandler* handler, const char* args) { - sLog.outDebug("DEBUG: HandleWpModifyCommand"); + sLog->outDebug("DEBUG: HandleWpModifyCommand"); if (!*args) return false; @@ -491,7 +491,7 @@ public: return false; } - sLog.outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC"); + sLog->outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC"); // The visual waypoint Creature* wpCreature = NULL; wpGuid = target->GetGUIDLow(); @@ -513,7 +513,7 @@ public: if (!result) { - sLog.outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'"); + sLog->outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'"); handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow()); // Select waypoint number from database @@ -531,7 +531,7 @@ public: return true; } } - sLog.outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid"); + sLog->outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid"); do { @@ -546,7 +546,7 @@ public: arg_str = strtok((char*)NULL, " "); } - sLog.outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command"); + sLog->outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command"); // Check for argument if (show != "del" && show != "move" && arg_str == NULL) @@ -644,7 +644,7 @@ public: static bool HandleWpShowCommand(ChatHandler* handler, const char* args) { - sLog.outDebug("DEBUG: HandleWpShowCommand"); + sLog->outDebug("DEBUG: HandleWpShowCommand"); if (!*args) return false; @@ -656,7 +656,7 @@ public: // second arg: GUID (optional, if a creature is selected) char* guid_str = strtok((char*)NULL, " "); - sLog.outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); + sLog->outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); uint32 pathid = 0; Creature* target = handler->getSelectedCreature(); @@ -665,7 +665,7 @@ public: if (!guid_str) { - sLog.outDebug("DEBUG: HandleWpShowCommand: !guid_str"); + sLog->outDebug("DEBUG: HandleWpShowCommand: !guid_str"); // No PathID provided // -> Player must have selected a creature @@ -680,7 +680,7 @@ public: } else { - sLog.outDebug("|cff00ff00DEBUG: HandleWpShowCommand: PathID provided|r"); + sLog->outDebug("|cff00ff00DEBUG: HandleWpShowCommand: PathID provided|r"); // PathID provided // Warn if player also selected a creature // -> Creature selection is ignored <- @@ -690,12 +690,12 @@ public: pathid = atoi((char*)guid_str); } - sLog.outDebug("DEBUG: HandleWpShowCommand: danach"); + sLog->outDebug("DEBUG: HandleWpShowCommand: danach"); std::string show = show_str; uint32 Maxpoint; - sLog.outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid); + sLog->outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid); //handler->PSendSysMessage("wpshow - show: %s", show); @@ -811,7 +811,7 @@ public: return false; } - sLog.outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); + sLog->outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); // set "wpguid" column to the visual waypoint WorldDatabase.PExecute("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 4976e2a5af6..c9ab961fcfa 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -238,7 +238,7 @@ public: if (pInstance) { pInstance->SetData(TYPE_RING_OF_LAW,DONE); - sLog.outDebug("TSCR: npc_grimstone: event reached end and set complete."); + sLog->outDebug("TSCR: npc_grimstone: event reached end and set complete."); } break; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index bbd8be5e8d2..7fe1d25a86a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -214,7 +214,7 @@ public: void SetData64(uint32 type, uint64 data) { - sLog.outDebug("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data); + sLog->outDebug("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data); switch(type) { @@ -230,7 +230,7 @@ public: void SetData(uint32 type, uint32 data) { - sLog.outDebug("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); + sLog->outDebug("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); switch(type) { diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index ea226e84682..37c0ad83c32 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -353,7 +353,7 @@ public: Nefarian->setFaction(103); NefarianGUID = Nefarian->GetGUID(); } - else sLog.outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly."); + else sLog->outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly."); } AddSpawnTimer = 4000; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index a36ebf52475..2347a1f322e 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -557,7 +557,7 @@ public: CreatureAI* GetAI(Creature* pCreature) const { - sLog.outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry()); + sLog->outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry()); SimpleAI* ai = new SimpleAI (pCreature); ai->Spell[0].Enabled = true; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index db9c87bd2f8..c95c1c9d738 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -1230,7 +1230,7 @@ public: } } - sLog.outError("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen."); + sLog->outError("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen."); } void EnterCombat(Unit* /*who*/) @@ -1476,7 +1476,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama if (Phase == PHASE_ROMULO) { - sLog.outError("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); + sLog->outError("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); damage = 0; return; } @@ -1510,7 +1510,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama return; } } - sLog.outError("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); + sLog->outError("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 4835bafba3d..49ea8f60663 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -227,7 +227,7 @@ public: void PrepareEncounter() { - sLog.outDebug("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); + sLog->outDebug("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); uint8 index = 0; uint8 count = 0; @@ -342,17 +342,17 @@ public: case GOSSIP_ACTION_INFO_DEF+3: pPlayer->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_OZ; - sLog.outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_OZ",pPlayer->GetGUID()); + sLog->outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_OZ",pPlayer->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+4: pPlayer->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_HOOD; - sLog.outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_HOOD",pPlayer->GetGUID()); + sLog->outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_HOOD",pPlayer->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+5: pPlayer->CLOSE_GOSSIP_MENU(); pBarnesAI->m_uiEventId = EVENT_RAJ; - sLog.outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_RAJ",pPlayer->GetGUID()); + sLog->outString("TSCR: player (GUID " UI64FMTD ") manually set Opera event to EVENT_RAJ",pPlayer->GetGUID()); break; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h index a24dba53e49..bbedfab8700 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h @@ -62,6 +62,6 @@ enum OperaEvents EVENT_RAJ = 3 }; -#define ERROR_INST_DATA(a) sLog.outError("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); +#define ERROR_INST_DATA(a) sLog->outError("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); #endif diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index 6519478a26d..1fdbb402879 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -75,7 +75,7 @@ public: for (uint8 i = 0; i < size; ++i) { uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL); - sLog.outDebug("TSCR: Selin: Adding Fel Crystal " UI64FMTD " to list", guid); + sLog->outDebug("TSCR: Selin: Adding Fel Crystal " UI64FMTD " to list", guid); Crystals.push_back(guid); } } @@ -120,7 +120,7 @@ public: // Small door opened after event are expected to be closed by default // Set Inst data for encounter pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); - } else sLog.outError(ERROR_INST_DATA); + } else sLog->outError(ERROR_INST_DATA); DrainLifeTimer = 3000 + rand()%4000; DrainManaTimer = DrainLifeTimer + 5000; @@ -222,7 +222,7 @@ public: else { // Make an error message in case something weird happened here - sLog.outError("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned"); + sLog->outError("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned"); DrainingCrystal = false; } } @@ -362,7 +362,7 @@ public: } } } - } else sLog.outError(ERROR_INST_DATA); + } else sLog->outError(ERROR_INST_DATA); } }; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index 710ac2b2e43..99e64734aaf 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -181,7 +181,7 @@ public: { if (FelCrystals.empty()) { - sLog.outError("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data"); + sLog->outError("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data"); return 0; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index abd9df4ef10..36482c2ca5f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -185,7 +185,7 @@ public: anchorGUID = anchor->GetGUID(); } else - sLog.outError("npc_unworthy_initiateAI: unable to find anchor!"); + sLog->outError("npc_unworthy_initiateAI: unable to find anchor!"); float dist = 99.0f; GameObject *prison = NULL; @@ -205,7 +205,7 @@ public: if (prison) prison->ResetDoorOrButton(); else - sLog.outError("npc_unworthy_initiateAI: unable to find prison!"); + sLog->outError("npc_unworthy_initiateAI: unable to find prison!"); } break; case PHASE_TO_EQUIP: @@ -216,7 +216,7 @@ public: else { me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ()); - //sLog.outDebug("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); + //sLog->outDebug("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); phase = PHASE_EQUIPING; wait_timer = 0; } @@ -1082,9 +1082,9 @@ public: { car->AI()->SetGUID(miner->GetGUID()); CAST_AI(npc_scarlet_miner::npc_scarlet_minerAI, miner->AI())->InitCartQuest(pPlayer); - } else sLog.outError("TSCR: OnGossipHello vehicle entry is not correct."); - } else sLog.outError("TSCR: OnGossipHello player is not on the vehicle."); - } else sLog.outError("TSCR: OnGossipHello Scarlet Miner cant be found by script."); + } else sLog->outError("TSCR: OnGossipHello vehicle entry is not correct."); + } else sLog->outError("TSCR: OnGossipHello player is not on the vehicle."); + } else sLog->outError("TSCR: OnGossipHello Scarlet Miner cant be found by script."); } return true; } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 396e49a925e..84d1dd55b96 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -124,7 +124,7 @@ public: return true; } - sLog.outDebug("TSCR: Instance Stratholme: Cannot open slaugther square yet."); + sLog->outDebug("TSCR: Instance Stratholme: Cannot open slaugther square yet."); return false; } @@ -220,7 +220,7 @@ public: break; Encounter[0] = data; BaronRun_Timer = 2700000; - sLog.outDebug("TSCR: Instance Stratholme: Baron run in progress."); + sLog->outDebug("TSCR: Instance Stratholme: Baron run in progress."); break; case FAIL: //may add code to remove aura from players, but in theory the time should be up already and removed. @@ -278,10 +278,10 @@ public: //UpdateGoState(ziggurat4GUID,0,true); if (Creature* pBaron = instance->GetCreature(baronGUID)) pBaron->SummonCreature(C_RAMSTEIN,4032.84f,-3390.24f,119.73f,4.71f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - sLog.outDebug("TSCR: Instance Stratholme: Ramstein spawned."); + sLog->outDebug("TSCR: Instance Stratholme: Ramstein spawned."); } else - sLog.outDebug("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); + sLog->outDebug("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); } if (data == NOT_STARTED) @@ -290,7 +290,7 @@ public: if (data == DONE) { SlaugtherSquare_Timer = 300000; - sLog.outDebug("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes."); + sLog->outDebug("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes."); } Encounter[4] = data; break; @@ -431,7 +431,7 @@ public: if (GetData(TYPE_BARON_RUN) != DONE) SetData(TYPE_BARON_RUN, FAIL); BaronRun_Timer = 0; - sLog.outDebug("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); + sLog->outDebug("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); } else BaronRun_Timer -= diff; } @@ -446,7 +446,7 @@ public: HandleGameObject(ziggurat4GUID, true); HandleGameObject(ziggurat5GUID, true); - sLog.outDebug("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); + sLog->outDebug("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); } SlaugtherSquare_Timer = 0; } else SlaugtherSquare_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 05933fae7b7..48d2a198e07 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -155,7 +155,7 @@ public: { if (!Intro || IsIntro) return; - sLog.outError("Start Intro"); + sLog->outError("Start Intro"); Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); if (Madrigosa) { @@ -170,7 +170,7 @@ public: }else { //Madrigosa not found, end intro - sLog.outError("Madrigosa was not found"); + sLog->outError("Madrigosa was not found"); EndIntro(); } } @@ -180,7 +180,7 @@ public: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Intro = false; IsIntro = false; - sLog.outError("End Intro"); + sLog->outError("End Intro"); } void AttackStart(Unit* pWho) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index c0153a88582..9b0581c2ab5 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -272,7 +272,7 @@ public: } else { - sLog.outError("TSCR: Didn't find Shathrowar. Kalecgos event reseted."); + sLog->outError("TSCR: Didn't find Shathrowar. Kalecgos event reseted."); EnterEvadeMode(); return; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 1e7cbd118ad..ee49872f6af 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -761,7 +761,7 @@ public: if (pRandomPlayer) DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false); else - sLog.outError("try to cast SPELL_LEGION_LIGHTNING on invalid target"); + sLog->outError("try to cast SPELL_LEGION_LIGHTNING on invalid target"); Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE Timer[TIMER_SOUL_FLAY] = 2500; @@ -1424,7 +1424,7 @@ public: DoMeleeAttackIfReady(); break; } - sLog.outDebug("Sinister-Timer"); + sLog->outDebug("Sinister-Timer"); for (uint8 i = 0; i < 3; ++i) uiTimer[i] -= diff; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index b1909900067..2ad15a52f9a 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -134,7 +134,7 @@ public: } } - sLog.outDebug("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 2e2db0e1fa4..33f3f931410 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -252,7 +252,7 @@ class boss_janalai : public CreatureScript cell.Visit(pair, cSearcher, *(me->GetMap())); } - //sLog.outError("Eggs %d at middle", templist.size()); + //sLog->outError("Eggs %d at middle", templist.size()); if (!templist.size()) return false; @@ -539,7 +539,7 @@ class mob_janalai_hatcher : public CreatureScript cell.Visit(pair, cSearcher, *(me->GetMap())); } - //sLog.outError("Eggs %d at %d", templist.size(), side); + //sLog->outError("Eggs %d at %d", templist.size(), side); for (std::list::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i) if ((*i)->GetDisplayId() != 11686) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 3b14f247792..f3b602cb04d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -182,7 +182,7 @@ class instance_zulaman : public InstanceMapScript ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute; char* data = new char[ss.str().length()+1]; strcpy(data, ss.str().c_str()); - //sLog.outError("TSCR: Zul'aman saved, %s.", data); + //sLog->outError("TSCR: Zul'aman saved, %s.", data); return data; } @@ -190,17 +190,17 @@ class instance_zulaman : public InstanceMapScript { if (!load) return; std::istringstream ss(load); - //sLog.outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); + //sLog->outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); char dataHead; // S uint16 data1, data2, data3; ss >> dataHead >> data1 >> data2 >> data3; - //sLog.outError("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3); + //sLog->outError("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3); if (dataHead == 'S') { BossKilled = data1; ChestLooted = data2; QuestMinute = data3; - } else sLog.outError("TSCR: Zul'aman: corrupted save data."); + } else sLog->outError("TSCR: Zul'aman: corrupted save data."); } void SetData(uint32 type, uint32 data) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 090e9193019..9b73f6232b6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -170,7 +170,7 @@ class boss_arlokk : public CreatureScript MarkedTargetGUID = pMarkedTarget->GetGUID(); } else - sLog.outError("TSCR: boss_arlokk could not accuire pMarkedTarget."); + sLog->outError("TSCR: boss_arlokk could not accuire pMarkedTarget."); m_uiMark_Timer = 15000; } diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index d27b3bdc673..e31d1a0ce66 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -322,7 +322,7 @@ public: void UpdateAI(const uint32 diff) { - //sLog.outString("DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); + //sLog->outString("DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); if (!QuestInProgress) return; diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index 695cf65c6c7..42f10329afd 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -78,7 +78,7 @@ class spell_ex_5581 : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { // we're handling SPELL_EFFECT_DUMMY in effIndex 0 here - sLog.outString("SPELL_EFFECT_DUMMY is executed on target!"); + sLog->outString("SPELL_EFFECT_DUMMY is executed on target!"); // make caster cast a spell on a unit target of effect if (Unit * target = GetHitUnit()) GetCaster()->CastSpell(target, SPELL_TRIGGERED, true); @@ -86,17 +86,17 @@ class spell_ex_5581 : public SpellScriptLoader void HandleBeforeHit() { - sLog.outString("Spell is about to hit target!"); + sLog->outString("Spell is about to hit target!"); } void HandleOnHit() { - sLog.outString("Spell just hit target!"); + sLog->outString("Spell just hit target!"); } void HandleAfterHit() { - sLog.outString("Spell just finished hitting target!"); + sLog->outString("Spell just finished hitting target!"); } // register functions used in spell script - names of these functions do not matter @@ -163,7 +163,7 @@ class spell_ex_66244 : public SpellScriptLoader void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp, AuraEffectHandleModes /*mode*/) { - sLog.outString("Aura Effect is about to be applied on target!"); + sLog->outString("Aura Effect is about to be applied on target!"); Unit * target = aurApp->GetTarget(); // cast spell on target on aura apply target->CastSpell(target, SPELL_TRIGGERED, true); @@ -171,7 +171,7 @@ class spell_ex_66244 : public SpellScriptLoader void HandleEffectRemove(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp, AuraEffectHandleModes /*mode*/) { - sLog.outString("Aura Effect is just removed on target!"); + sLog->outString("Aura Effect is just removed on target!"); Unit * target = aurApp->GetTarget(); Unit * caster = GetCaster(); // caster may be not avalible (logged out for example) @@ -183,7 +183,7 @@ class spell_ex_66244 : public SpellScriptLoader void HandleEffectPeriodic(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp) { - sLog.outString("Perioidic Aura Effect is does a tick on target!"); + sLog->outString("Perioidic Aura Effect is does a tick on target!"); Unit * target = aurApp->GetTarget(); // aura targets damage self on tick target->DealDamage(target, 100); @@ -191,14 +191,14 @@ class spell_ex_66244 : public SpellScriptLoader void HandleEffectPeriodicUpdate(AuraEffect * aurEff) { - sLog.outString("Perioidic Aura Effect is now updated!"); + sLog->outString("Perioidic Aura Effect is now updated!"); // we're doubling aura amount every tick aurEff->ChangeAmount(aurEff->GetAmount() * 2); } void HandleEffectCalcAmount(AuraEffect const * /*aurEff*/, int32 & amount, bool & canBeRecalculated) { - sLog.outString("Amount of Aura Effect is being calculated now!"); + sLog->outString("Amount of Aura Effect is being calculated now!"); // we're setting amount to 0 amount = 100; // amount will be never recalculated due to applying passive aura @@ -207,7 +207,7 @@ class spell_ex_66244 : public SpellScriptLoader void HandleEffectCalcPeriodic(AuraEffect const * /*aurEff*/, bool & isPeriodic, int32 & amplitude) { - sLog.outString("Periodic data of Aura Effect is being calculated now!"); + sLog->outString("Periodic data of Aura Effect is being calculated now!"); // we're setting aura to be periodic and tick every 10 seconds isPeriodic = true; amplitude = 2 * IN_MILLISECONDS; @@ -215,7 +215,7 @@ class spell_ex_66244 : public SpellScriptLoader void HandleEffectCalcSpellMod(AuraEffect * const /*aurEff*/, SpellModifier *& spellMod) { - sLog.outString("SpellMod data of Aura Effect is being calculated now!"); + sLog->outString("SpellMod data of Aura Effect is being calculated now!"); // we don't want spellmod for example if(spellMod) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 4dac6110ed4..7a400640610 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -69,7 +69,7 @@ public: break; case GOSSIP_ACTION_INFO_DEF: ai->Debug = !ai->Debug; - sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled"); + sLog->outDebug("TSCR: HyjalAI - Debug mode has been toggled"); break; } return true; @@ -148,7 +148,7 @@ public: break; case GOSSIP_ACTION_INFO_DEF: ai->Debug = !ai->Debug; - sLog.outDebug("TSCR: HyjalAI - Debug mode has been toggled"); + sLog->outDebug("TSCR: HyjalAI - Debug mode has been toggled"); break; } return true; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index a8e558621da..d5711f74314 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -402,7 +402,7 @@ void hyjalAI::Reset() pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); pInstance->SetData(DATA_RESET_TRASH_COUNT, 0); } - } else sLog.outError(ERROR_INST_DATA); + } else sLog->outError(ERROR_INST_DATA); //Visibility DoHide = true; @@ -533,7 +533,7 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3] if (!pInstance) { - sLog.outError(ERROR_INST_DATA); + sLog->outError(ERROR_INST_DATA); return; } InfernalCount = 0;//reset infernal count every new wave @@ -563,7 +563,7 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3] else { NextWaveTimer = 15000; - sLog.outDebug("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); + sLog->outDebug("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); } } else @@ -607,7 +607,7 @@ uint32 hyjalAI::GetInstanceData(uint32 Event) { if (pInstance) return pInstance->GetData(Event); - else sLog.outError(ERROR_INST_DATA); + else sLog->outError(ERROR_INST_DATA); return 0; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index de73311bd72..71fc108dcc5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -260,7 +260,7 @@ public: break; } - sLog.outDebug("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); + sLog->outDebug("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); if (data == DONE) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index c347b0ef9ad..ce050dc1ad0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -325,7 +325,7 @@ public: mRiftWaveCount = 0; entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; - sLog.outDebug("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); + sLog->outDebug("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); ++mRiftWaveCount; @@ -350,7 +350,7 @@ public: if (me->IsNonMeleeSpellCasted(false)) return; - sLog.outDebug("TSCR: npc_time_rift: not casting anylonger, i need to die."); + sLog->outDebug("TSCR: npc_time_rift: not casting anylonger, i need to die."); me->setDeathState(JUST_DIED); if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp index 057585707d2..01509559105 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp @@ -194,7 +194,7 @@ public: { if (data == IN_PROGRESS) { - sLog.outDebug("TSCR: Instance Dark Portal: Starting event."); + sLog->outDebug("TSCR: Instance Dark Portal: Starting event."); InitWorldState(); m_auiEncounter[1] = IN_PROGRESS; NextPortal_Timer = 15000; @@ -203,7 +203,7 @@ public: if (data == DONE) { //this may be completed further out in the post-event - sLog.outDebug("TSCR: Instance Dark Portal: Event completed."); + sLog->outDebug("TSCR: Instance Dark Portal: Event completed."); Map::PlayerList const& players = instance->GetPlayers(); if (!players.isEmpty()) @@ -268,7 +268,7 @@ public: if (entry == RIFT_BOSS) entry = RandRiftBoss(); - sLog.outDebug("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); + sLog->outDebug("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); Position pos; me->GetRandomNearPosition(pos, 10.0f); @@ -279,7 +279,7 @@ public: if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000)) return summon; - sLog.outDebug("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun..."); + sLog->outDebug("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun..."); return NULL; } @@ -292,7 +292,7 @@ public: if (tmp >= CurrentRiftId) ++tmp; - sLog.outDebug("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + sLog->outDebug("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); CurrentRiftId = tmp; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp index ac1c2508ca8..21ecd621fe3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -83,7 +83,7 @@ public: } } - sLog.outDebug("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); return NULL; } @@ -123,7 +123,7 @@ public: if (!pPlayer) { - sLog.outDebug("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); + sLog->outDebug("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); return; } @@ -139,7 +139,7 @@ public: ++mBarrelCount; DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); - sLog.outDebug("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); + sLog->outDebug("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); m_auiEncounter[0] = IN_PROGRESS; @@ -160,7 +160,7 @@ public: { ++mThrallEventCount; m_auiEncounter[1] = NOT_STARTED; - sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); m_auiEncounter[2] = NOT_STARTED; m_auiEncounter[3] = NOT_STARTED; m_auiEncounter[4] = NOT_STARTED; @@ -173,29 +173,29 @@ public: m_auiEncounter[3] = data; m_auiEncounter[4] = data; m_auiEncounter[5] = data; - sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); } } else m_auiEncounter[1] = data; - sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); + sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); break; } case TYPE_THRALL_PART1: m_auiEncounter[2] = data; - sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); + sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); break; case TYPE_THRALL_PART2: m_auiEncounter[3] = data; - sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); + sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); break; case TYPE_THRALL_PART3: m_auiEncounter[4] = data; - sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); + sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); break; case TYPE_THRALL_PART4: m_auiEncounter[5] = data; - sLog.outDebug("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); + sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); break; } } diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp index 3fe930b2cc8..f5a42bc8659 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp @@ -65,7 +65,7 @@ public: return plr; } } - sLog.outDebug("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 12368e11c7e..11770a5ac2f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -180,7 +180,7 @@ public: { pInst = c->GetInstanceScript(); if (!pInst) - sLog.outError("TSCR: No Instance eye_of_cthunAI"); + sLog->outError("TSCR: No Instance eye_of_cthunAI"); } InstanceScript* pInst; @@ -486,7 +486,7 @@ public: pInst = c->GetInstanceScript(); if (!pInst) - sLog.outError("TSCR: No Instance eye_of_cthunAI"); + sLog->outError("TSCR: No Instance eye_of_cthunAI"); } InstanceScript* pInst; diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index c45b29a8ae3..98a120f2f52 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -419,7 +419,7 @@ public: { LocaleConstant loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex(); const char* text = sObjectMgr->GetTrinityString(iTextEntry, loc_idx); - sWorld.SendServerMessage(SERVER_MSG_STRING, text, pPlayer); + sWorld->SendServerMessage(SERVER_MSG_STRING, text, pPlayer); } void AttackStart(Unit *who) diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 441d332ca00..2fbf4286668 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -559,7 +559,7 @@ public: else (*itr)->Respawn(); } - } else sLog.outError("SD2 ERROR: FlagList is empty!"); + } else sLog->outError("SD2 ERROR: FlagList is empty!"); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index eb1c1881927..3234dfd39f0 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -364,7 +364,7 @@ public: if (uiType < MAX_ENCOUNTERS) { - sLog.outBasic("[ToCr] m_auiEncounter[uiType %u] %u = uiData %u;",uiType,m_auiEncounter[uiType],uiData); + sLog->outBasic("[ToCr] m_auiEncounter[uiType %u] %u = uiData %u;",uiType,m_auiEncounter[uiType],uiData); if (uiData == FAIL) { if (IsRaidWiped()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index d062d6589fd..c6bdeeb4f06 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -193,7 +193,7 @@ public: if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD) { - sLog.outError("Script Gothik: cannot summon triggers!"); + sLog->outError("Script Gothik: cannot summon triggers!"); EnterEvadeMode(); return; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp index c8ae6ecfabd..d17d89cfd23 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp @@ -118,7 +118,7 @@ public: } } - sLog.outDebug("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp index 1975bb9233b..658f0639125 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp @@ -40,12 +40,12 @@ void OPvPCapturePointEP_EWT::ChangeState() // if changing from controlling alliance to horde or vice versa if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0; } @@ -58,14 +58,14 @@ void OPvPCapturePointEP_EWT::ChangeState() artkit = 2; SummonSupportUnitAtNorthpassTower(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; SummonSupportUnitAtNorthpassTower(HORDE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -178,12 +178,12 @@ void OPvPCapturePointEP_NPT::ChangeState() // if changing from controlling alliance to horde or vice versa if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0; } @@ -196,14 +196,14 @@ void OPvPCapturePointEP_NPT::ChangeState() artkit = 2; SummonGO(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; SummonGO(HORDE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -321,12 +321,12 @@ void OPvPCapturePointEP_CGT::ChangeState() // if changing from controlling alliance to horde or vice versa if( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0; } @@ -339,14 +339,14 @@ void OPvPCapturePointEP_CGT::ChangeState() artkit = 2; LinkGraveYard(ALLIANCE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; artkit = 1; LinkGraveYard(HORDE); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; @@ -450,12 +450,12 @@ void OPvPCapturePointEP_PWT::ChangeState() // if changing from controlling alliance to horde or vice versa if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0; } else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) { - sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H)); + sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H)); ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0; } @@ -468,14 +468,14 @@ void OPvPCapturePointEP_PWT::ChangeState() SummonFlightMaster(ALLIANCE); artkit = 2; ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = ALLIANCE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A)); break; case OBJECTIVESTATE_HORDE: m_TowerState = EP_TS_H; SummonFlightMaster(HORDE); artkit = 1; ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = HORDE; - if (m_OldState != m_State) sWorld.SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H)); + if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H)); break; case OBJECTIVESTATE_NEUTRAL: m_TowerState = EP_TS_N; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index ec38838dcf6..af0fdaa1b3d 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -175,13 +175,13 @@ void OPvPCapturePointHP::ChangeState() field = HP_MAP_A[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled) ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled--; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_A[m_TowerType])); + sWorld->SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_A[m_TowerType])); break; case OBJECTIVESTATE_HORDE: field = HP_MAP_H[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled) ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled--; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_H[m_TowerType])); + sWorld->SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_H[m_TowerType])); break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: field = HP_MAP_N[m_TowerType]; @@ -216,7 +216,7 @@ void OPvPCapturePointHP::ChangeState() artkit2 = HP_TowerArtKit_A[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled<3) ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled++; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType])); + sWorld->SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType])); break; case OBJECTIVESTATE_HORDE: field = HP_MAP_H[m_TowerType]; @@ -224,7 +224,7 @@ void OPvPCapturePointHP::ChangeState() artkit2 = HP_TowerArtKit_H[m_TowerType]; if (((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled<3) ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled++; - sWorld.SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType])); + sWorld->SendZoneText(OutdoorPvPHPBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType])); break; case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: field = HP_MAP_N[m_TowerType]; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index 1144ac970e6..b057aa32972 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -139,9 +139,9 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) if (m_ControllingFaction) sObjectMgr->RemoveGraveYardLink(NA_HALAA_GRAVEYARD,NA_HALAA_GRAVEYARD_ZONE,m_ControllingFaction,false); if (m_ControllingFaction == ALLIANCE) - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A)); + sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A)); else if (m_ControllingFaction == HORDE) - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_H)); + sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_H)); m_ControllingFaction = team; if (m_ControllingFaction) @@ -163,7 +163,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 0); m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 1); m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A)); + sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_A)); } else { @@ -175,7 +175,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team) m_PvP->SendUpdateWorldState(NA_UI_HORDE_GUARDS_SHOW, 1); m_PvP->SendUpdateWorldState(NA_UI_ALLIANCE_GUARDS_SHOW, 0); m_PvP->SendUpdateWorldState(NA_UI_GUARDS_LEFT, m_GuardsAlive); - sWorld.SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H)); + sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_CAPTURE_H)); } UpdateWyvernRoostWorldState(NA_ROOST_S); UpdateWyvernRoostWorldState(NA_ROOST_N); diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 88f992891ef..087573de7fc 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -94,7 +94,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger) if (m_Gathered_A >= SI_MAX_RESOURCES) { TeamApplyBuff(TEAM_ALLIANCE, SI_CENARION_FAVOR); - sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_A)); + sWorld->SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_A)); m_LastController = ALLIANCE; m_Gathered_A = 0; m_Gathered_H = 0; @@ -119,7 +119,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger) if (m_Gathered_H >= SI_MAX_RESOURCES) { TeamApplyBuff(TEAM_HORDE, SI_CENARION_FAVOR); - sWorld.SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_H)); + sWorld->SendZoneText(OutdoorPvPSIBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_SI_CAPTURE_H)); m_LastController = HORDE; m_Gathered_A = 0; m_Gathered_H = 0; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index 5a47cdf8ef3..2ade5dd6725 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -250,14 +250,14 @@ void OPvPCapturePointTF::ChangeState() { if (((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled) ((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled--; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_A)); + sWorld->SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_A)); } // if changing from controlling horde to alliance else if (m_OldState == OBJECTIVESTATE_HORDE) { if (((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled) ((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled--; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_H)); + sWorld->SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_H)); } uint32 artkit = 21; @@ -269,7 +269,7 @@ void OPvPCapturePointTF::ChangeState() artkit = 2; if (((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlledm_AllianceTowersControlled++; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A)); + sWorld->SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A)); for (PlayerSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr) (*itr)->AreaExploredOrEventHappens(TF_ALLY_QUEST); break; @@ -278,7 +278,7 @@ void OPvPCapturePointTF::ChangeState() artkit = 1; if (((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlledm_HordeTowersControlled++; - sWorld.SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H)); + sWorld->SendZoneText(OutdoorPvPTFBuffZones[0],sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H)); for (PlayerSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr) (*itr)->AreaExploredOrEventHappens(TF_HORDE_QUEST); break; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index cc31dfe672f..64d65b52a67 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -78,14 +78,14 @@ void OPvPCapturePointZM_Beacon::ChangeState() { if (((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled) ((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled--; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseA[m_TowerType])); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseA[m_TowerType])); } // if changing from controlling horde to alliance else if (m_OldState == OBJECTIVESTATE_HORDE) { if (((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled) ((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled--; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseH[m_TowerType])); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseH[m_TowerType])); } switch(m_State) @@ -94,13 +94,13 @@ void OPvPCapturePointZM_Beacon::ChangeState() m_TowerState = ZM_TOWERSTATE_A; if (((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlledm_AllianceTowersControlled++; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType])); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType])); break; case OBJECTIVESTATE_HORDE: m_TowerState = ZM_TOWERSTATE_H; if (((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlledm_HordeTowersControlled++; - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType])); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType])); break; case OBJECTIVESTATE_NEUTRAL: case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: @@ -216,7 +216,7 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player *plr, uint64 guid) if (plr->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A) { if (m_GraveYardState == ZM_GRAVEYARD_H) - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H)); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H)); m_GraveYardState = ZM_GRAVEYARD_A; DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant AddObject(0,ZM_Banner_A.entry,ZM_Banner_A.map,ZM_Banner_A.x,ZM_Banner_A.y,ZM_Banner_A.z,ZM_Banner_A.o,ZM_Banner_A.rot0,ZM_Banner_A.rot1,ZM_Banner_A.rot2,ZM_Banner_A.rot3); @@ -224,12 +224,12 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player *plr, uint64 guid) sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF); plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A); - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A)); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A)); } else if (plr->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H) { if (m_GraveYardState == ZM_GRAVEYARD_A) - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A)); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A)); m_GraveYardState = ZM_GRAVEYARD_H; DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant AddObject(0,ZM_Banner_H.entry,ZM_Banner_H.map,ZM_Banner_H.x,ZM_Banner_H.y,ZM_Banner_H.z,ZM_Banner_H.o,ZM_Banner_H.rot0,ZM_Banner_H.rot1,ZM_Banner_H.rot2,ZM_Banner_H.rot3); @@ -237,7 +237,7 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player *plr, uint64 guid) sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF); plr->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H); - sWorld.SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); + sWorld->SendZoneText(ZM_GRAVEYARD_ZONE,sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H)); } UpdateTowerState(); } diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp index 3c8a3c2017d..14a0e7dcc57 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -108,7 +108,7 @@ public: if (creature->isAlive()) { ++m_uiFelOverseerCount; - sLog.outDebug("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + sLog->outDebug("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); } break; } @@ -125,7 +125,7 @@ public: case TYPE_OVERSEER: if (uiData != DONE) { - sLog.outError("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + sLog->outError("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); return; } if (m_uiFelOverseerCount) @@ -133,11 +133,11 @@ public: --m_uiFelOverseerCount; if (m_uiFelOverseerCount) - sLog.outDebug("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + sLog->outDebug("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); else { m_auiEncounter[1] = DONE; - sLog.outDebug("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + sLog->outDebug("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); } } break; diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 9621d7387de..61fc9ac8f62 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -786,7 +786,7 @@ public: { EnterEvadeMode(); me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0); - sLog.outError("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); + sLog->outError("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 5a8fa42dff5..792fdd0be37 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -314,7 +314,7 @@ public: GridSearcherSucceeded = true; } } - } else sLog.outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); + } else sLog->outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); } } @@ -331,13 +331,13 @@ public: if (reseting) return; - sLog.outDebug("TSCR: Increasing Death Count for Shade of Akama encounter"); + sLog->outDebug("TSCR: Increasing Death Count for Shade of Akama encounter"); ++DeathCount; me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); if (guid) { if (Sorcerers.empty()) - sLog.outError("SD2 ERROR: Shade of Akama - attempt to remove guid " UI64FMTD " from Sorcerers list but list is already empty", guid); + sLog->outError("SD2 ERROR: Shade of Akama - attempt to remove guid " UI64FMTD " from Sorcerers list but list is already empty", guid); else Sorcerers.remove(guid); } } @@ -389,17 +389,17 @@ public: { CAST_AI(mob_ashtongue_channeler::mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID(); Channelers.push_back((*itr)->GetGUID()); - sLog.outDebug("TSCR: Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID()); + sLog->outDebug("TSCR: Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID()); } } - else sLog.outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); + else sLog->outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); } void SetSelectableChannelers() { if (Channelers.empty()) { - sLog.outError("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); + sLog->outError("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); return; } @@ -525,7 +525,7 @@ void mob_ashtongue_channeler::mob_ashtongue_channelerAI::JustDied(Unit* /*killer Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); if (Shade && Shade->isAlive()) CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); - else sLog.outError("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); + else sLog->outError("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); } void mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/) @@ -533,7 +533,7 @@ void mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/ Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); if (Shade && Shade->isAlive()) CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID()); - else sLog.outError("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); + else sLog->outError("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); } class npc_akama_shade : public CreatureScript diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 83b247857f8..efcc8285984 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -155,7 +155,7 @@ public: Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); Council[2] = pInstance->GetData64(DATA_LADYMALANDE); Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - } else sLog.outError(ERROR_INST_DATA); + } else sLog->outError(ERROR_INST_DATA); } void EnterCombat(Unit* /*who*/) {} @@ -401,7 +401,7 @@ struct boss_illidari_councilAI : public ScriptedAI } else { - sLog.outError(ERROR_INST_DATA); + sLog->outError(ERROR_INST_DATA); EnterEvadeMode(); return; } @@ -449,7 +449,7 @@ struct boss_illidari_councilAI : public ScriptedAI { if (!pInstance) { - sLog.outError(ERROR_INST_DATA); + sLog->outError(ERROR_INST_DATA); return; } diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index a7e6dee3271..a5603e86c55 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -136,7 +136,7 @@ public: } } - sLog.outDebug("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); return NULL; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp index 4a9f8ef3c6f..937df76bf48 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp @@ -138,7 +138,7 @@ public: if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) HandleGameObject(MainChambersDoor, true); - sLog.outDebug("TSCR: Instance Steamvault: Access panel used."); + sLog->outDebug("TSCR: Instance Steamvault: Access panel used."); } m_auiEncounter[0] = data; break; @@ -150,7 +150,7 @@ public: if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) HandleGameObject(MainChambersDoor, true); - sLog.outDebug("TSCR: Instance Steamvault: Access panel used."); + sLog->outDebug("TSCR: Instance Steamvault: Access panel used."); } m_auiEncounter[1] = data; break; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp index 73214aabcc9..60ac09383bb 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp @@ -66,7 +66,7 @@ class instance_ramparts : public InstanceMapScript void SetData(uint32 uiType, uint32 uiData) { - sLog.outDebug("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + sLog->outDebug("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); switch(uiType) { diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 332658d97d0..3d38eba2197 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -366,7 +366,7 @@ class boss_kaelthas : public CreatureScript if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) { - sLog.outError("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); + sLog->outError("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); DoScriptText(SAY_PHASE4_INTRO2, me); @@ -692,7 +692,7 @@ class boss_kaelthas : public CreatureScript Advisor = Unit::GetCreature((*me), m_auiAdvisorGuid[i]); if (!Advisor) - sLog.outError("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); + sLog->outError("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); else CAST_AI(advisorbase_ai, Advisor->AI())->Revive(pTarget); } @@ -785,7 +785,7 @@ class boss_kaelthas : public CreatureScript if (me->getThreatManager().getThreatList().size() >= 2) for (uint32 i = 0; i < 3; ++i) { - sLog.outDebug("SD2: Kael'Thas mind control not supported."); + sLog->outDebug("SD2: Kael'Thas mind control not supported."); //DoCast(pUnit, SPELL_MIND_CONTROL); } diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index e6752a547c3..9b59a580db0 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -160,7 +160,7 @@ public: if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER) Start(false, false, pCreature->GetOwner()->GetGUID()); else - sLog.outError("TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player."); + sLog->outError("TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player."); pCreature->SetSpeed(MOVE_WALK, 1.5f); Reset(); diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 91f2d4308c1..d1158081a3f 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -497,7 +497,7 @@ public: return true; } - sLog.outDebug("TSCR: npc_commander_dawnforge event already in progress, need to wait."); + sLog->outDebug("TSCR: npc_commander_dawnforge event already in progress, need to wait."); return false; } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 0338569b3e6..2e1ca3d4d2a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -168,7 +168,7 @@ public: case WARLOCK_IMPROVED_HEALTHSTONE_R1: rank = 1; break; case WARLOCK_IMPROVED_HEALTHSTONE_R2: rank = 2; break; default: - sLog.outError("Unknown rank of Improved Healthstone id: %d", aurEff->GetId()); + sLog->outError("Unknown rank of Improved Healthstone id: %d", aurEff->GetId()); break; } } diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp index 04202cc994d..f356ef7fd4a 100755 --- a/src/server/scripts/World/chat_log.cpp +++ b/src/server/scripts/World/chat_log.cpp @@ -30,26 +30,26 @@ public: switch (type) { case CHAT_MSG_ADDON: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_ADDON)) - sLog.outChat("[ADDON] Player %s sends: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) + sLog->outChat("[ADDON] Player %s sends: %s", player->GetName(), msg.c_str()); break; case CHAT_MSG_SAY: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_PUBLIC)) - sLog.outChat("[SAY] Player %s says (language %u): %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC)) + sLog->outChat("[SAY] Player %s says (language %u): %s", player->GetName(), lang, msg.c_str()); break; case CHAT_MSG_EMOTE: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_PUBLIC)) - sLog.outChat("[TEXTEMOTE] Player %s emotes: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC)) + sLog->outChat("[TEXTEMOTE] Player %s emotes: %s", player->GetName(), msg.c_str()); break; case CHAT_MSG_YELL: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_PUBLIC)) - sLog.outChat("[YELL] Player %s yells (language %u): %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_PUBLIC)) + sLog->outChat("[YELL] Player %s yells (language %u): %s", player->GetName(), lang, msg.c_str()); break; } @@ -57,8 +57,8 @@ public: void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Player *receiver) { - if (sWorld.getBoolConfig(CONFIG_CHATLOG_WHISPER)) - sLog.outChat("[WHISPER] Player %s tells %s: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_WHISPER)) + sLog->outChat("[WHISPER] Player %s tells %s: %s", player->GetName(), receiver ? receiver->GetName() : "", msg.c_str()); } @@ -67,44 +67,44 @@ public: switch (type) { case CHAT_MSG_PARTY: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_PARTY)) - sLog.outChat("[PARTY] Player %s tells group with leader %s: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_PARTY)) + sLog->outChat("[PARTY] Player %s tells group with leader %s: %s", player->GetName(), group ? group->GetLeaderName() : "", msg.c_str()); break; case CHAT_MSG_PARTY_LEADER: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_PARTY)) - sLog.outChat("[PARTY] Leader %s tells group: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_PARTY)) + sLog->outChat("[PARTY] Leader %s tells group: %s", player->GetName(), msg.c_str()); break; case CHAT_MSG_RAID: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_RAID)) - sLog.outChat("[RAID] Player %s tells raid with leader %s: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_RAID)) + sLog->outChat("[RAID] Player %s tells raid with leader %s: %s", player->GetName(), group ? group->GetLeaderName() : "", msg.c_str()); break; case CHAT_MSG_RAID_LEADER: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_RAID)) - sLog.outChat("[RAID] Leader player %s tells raid: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_RAID)) + sLog->outChat("[RAID] Leader player %s tells raid: %s", player->GetName(), msg.c_str()); break; case CHAT_MSG_RAID_WARNING: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_RAID)) - sLog.outChat("[RAID] Leader player %s warns raid with: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_RAID)) + sLog->outChat("[RAID] Leader player %s warns raid with: %s", player->GetName(), msg.c_str()); break; case CHAT_MSG_BATTLEGROUND: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_BGROUND)) - sLog.outChat("[BATTLEGROUND] Player %s tells battleground with leader %s: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_BGROUND)) + sLog->outChat("[BATTLEGROUND] Player %s tells battleground with leader %s: %s", player->GetName(), group ? group->GetLeaderName() : "", msg.c_str()); break; case CHAT_MSG_BATTLEGROUND_LEADER: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_BGROUND)) - sLog.outChat("[BATTLEGROUND] Leader player %s tells battleground: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_BGROUND)) + sLog->outChat("[BATTLEGROUND] Leader player %s tells battleground: %s", player->GetName(), msg.c_str()); break; } @@ -115,17 +115,17 @@ public: switch(type) { case CHAT_MSG_GUILD: - if (lang != LANG_ADDON && sWorld.getBoolConfig(CONFIG_CHATLOG_GUILD)) - sLog.outChat("[GUILD] Player %s tells guild %s: %s", + if (lang != LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_GUILD)) + sLog->outChat("[GUILD] Player %s tells guild %s: %s", player->GetName(), guild ? guild->GetName().c_str() : "", msg.c_str()); - else if (lang == LANG_ADDON && sWorld.getBoolConfig(CONFIG_CHATLOG_ADDON)) - sLog.outChat("[ADDON] Player %s sends to guild %s: %s", + else if (lang == LANG_ADDON && sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) + sLog->outChat("[ADDON] Player %s sends to guild %s: %s", player->GetName(), guild ? guild->GetName().c_str() : "", msg.c_str()); break; case CHAT_MSG_OFFICER: - if (sWorld.getBoolConfig(CONFIG_CHATLOG_GUILD)) - sLog.outChat("[OFFICER] Player %s tells guild %s officers: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_GUILD)) + sLog->outChat("[OFFICER] Player %s tells guild %s officers: %s", player->GetName(), guild ? guild->GetName().c_str() : "", msg.c_str()); break; } @@ -139,11 +139,11 @@ public: channel->HasFlag(CHANNEL_FLAG_CITY) || channel->HasFlag(CHANNEL_FLAG_LFG)); - if (sWorld.getBoolConfig(CONFIG_CHATLOG_SYSCHAN) && isSystem) - sLog.outChat("[SYSCHAN] Player %s tells channel %s: %s", + if (sWorld->getBoolConfig(CONFIG_CHATLOG_SYSCHAN) && isSystem) + sLog->outChat("[SYSCHAN] Player %s tells channel %s: %s", player->GetName(), channel->GetName().c_str(), msg.c_str()); - else if (sWorld.getBoolConfig(CONFIG_CHATLOG_CHANNEL)) - sLog.outChat("[CHANNEL] Player %s tells channel %s: %s", + else if (sWorld->getBoolConfig(CONFIG_CHATLOG_CHANNEL)) + sLog->outChat("[CHANNEL] Player %s tells channel %s: %s", player->GetName(), channel ? channel->GetName().c_str() : "", msg.c_str()); } }; diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 8c903a67df6..f66196759c9 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -330,7 +330,7 @@ public: if (Spell) pCreature->CastSpell(pPlayer, Spell, false); else - sLog.outError("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", pCreature->GetEntry(), pCreature->getFaction()); + sLog->outError("TSCR: go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", pCreature->GetEntry(), pCreature->getFaction()); } } } diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 1789e1fab33..28702296c38 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -160,7 +160,7 @@ public: if (pPlayer->GetBaseSkillValue(SKILL_RIDING) == 300) return false; - sLog.outDebug("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId); + sLog->outDebug("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId); pPlayer->SendEquipError(EQUIP_ERR_CANT_EQUIP_SKILL,pItem,NULL); return true; } diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 7b19039e743..8732879c301 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -236,7 +236,7 @@ bool EquippedOk(Player* pPlayer, uint32 spellId) if (pItem->GetProto()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - sLog.outDebug("TSCR: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId); + sLog->outDebug("TSCR: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId); return false; } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 2fe252ff098..a5d83b933d7 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -130,7 +130,7 @@ public: } if (!m_pSpawnAssoc) - sLog.outErrorDb("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", pCreature->GetEntry()); + sLog->outErrorDb("TCSR: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", pCreature->GetEntry()); else { CreatureInfo const* spawnedTemplate = GetCreatureTemplateStore(m_pSpawnAssoc->m_uiSpawnedCreatureEntry); @@ -138,7 +138,7 @@ public: if (!spawnedTemplate) { m_pSpawnAssoc = NULL; - sLog.outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); + sLog->outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); return; } } @@ -157,7 +157,7 @@ public: m_uiSpawnedGUID = pSummoned->GetGUID(); else { - sLog.outErrorDb("TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); + sLog->outErrorDb("TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); m_pSpawnAssoc = NULL; } @@ -831,7 +831,7 @@ void npc_doctor::npc_doctorAI::UpdateAI(const uint32 diff) case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[rand()%3]; break; case DOCTOR_HORDE: patientEntry = HordeSoldierId[rand()%3]; break; default: - sLog.outError("TSCR: Invalid entry for Triage doctor. Please check your database"); + sLog->outError("TSCR: Invalid entry for Triage doctor. Please check your database"); return; } @@ -1282,7 +1282,7 @@ public: if (pCreature->isCanTrainingAndResetTalentsOf(pPlayer)) pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE1, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS); - if (!(pPlayer->GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(pPlayer) && !(pPlayer->getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))) + if (!(pPlayer->GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(pPlayer) && !(pPlayer->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))) pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE3, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_LEARNDUALSPEC); if (pPlayer->getClass() == CLASS_ROGUE && pPlayer->getLevel() >= 24 && !pPlayer->HasItemCount(17126,1) && !pPlayer->GetQuestRewardStatus(6681)) @@ -1312,7 +1312,7 @@ public: pPlayer->SendTalentWipeConfirm(pCreature->GetGUID()); break; case GOSSIP_OPTION_LEARNDUALSPEC: - if (pPlayer->GetSpecsCount() == 1 && !(pPlayer->getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) + if (pPlayer->GetSpecsCount() == 1 && !(pPlayer->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) { if (!pPlayer->HasEnoughMoney(10000000)) { diff --git a/src/server/shared/Configuration/Config.cpp b/src/server/shared/Configuration/Config.cpp index 1059324b30e..7e62486d3a0 100755 --- a/src/server/shared/Configuration/Config.cpp +++ b/src/server/shared/Configuration/Config.cpp @@ -24,7 +24,7 @@ static bool GetValueHelper(ACE_Configuration_Heap *mConf, const char *name, ACE_ if (!mConf) return false; - ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, sConfig.mMtx, false); + ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, sConfig->mMtx, false); ACE_TString section_name; ACE_Configuration_Section_Key section_key; diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h index ae79f806bc7..703d88a8814 100755 --- a/src/server/shared/Configuration/Config.h +++ b/src/server/shared/Configuration/Config.h @@ -49,7 +49,7 @@ class Config ACE_Configuration_Heap *mConf; }; -#define sConfig (*ACE_Singleton::instance()) +#define sConfig ACE_Singleton::instance() #endif diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h index dcf95f5741a..ee9e2995854 100755 --- a/src/server/shared/DataStores/DBCStore.h +++ b/src/server/shared/DataStores/DBCStore.h @@ -110,7 +110,7 @@ class DBCStorage // Check if sql index pos is valid if (int32(result->GetFieldCount()-1) < sql->sqlIndexPos) { - sLog.outError("Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str()); + sLog->outError("Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str()); return false; } } @@ -138,7 +138,7 @@ class DBCStorage uint32 id = fields[sql->sqlIndexPos].GetUInt32(); if (indexTable[id]) { - sLog.outError("Index %d already exists in dbc:'%s'", id, sql->sqlTableName.c_str()); + sLog->outError("Index %d already exists in dbc:'%s'", id, sql->sqlTableName.c_str()); return false; } indexTable[id]=(T*)&sqlDataTable[offset]; @@ -193,7 +193,7 @@ class DBCStorage offset+=1; break; case FT_STRING: - sLog.outError("Unsupported data type in table '%s' at char %d", sql->sqlTableName.c_str(), columnNumber); + sLog->outError("Unsupported data type in table '%s' at char %d", sql->sqlTableName.c_str(), columnNumber); return false; case FT_SORT: break; @@ -205,13 +205,13 @@ class DBCStorage } else { - sLog.outError("Incorrect sql format string '%s' at char %d", sql->sqlTableName.c_str(), columnNumber); + sLog->outError("Incorrect sql format string '%s' at char %d", sql->sqlTableName.c_str(), columnNumber); return false; } } if (sqlColumnNumber != (result->GetFieldCount()-1)) { - sLog.outError("SQL and DBC format strings are not matching for table: '%s'", sql->sqlTableName.c_str()); + sLog->outError("SQL and DBC format strings are not matching for table: '%s'", sql->sqlTableName.c_str()); return false; } diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 0ab86708fb8..ebfc382b409 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -64,7 +64,7 @@ class DatabaseWorkerPool ~DatabaseWorkerPool() { - sLog.outSQLDriver("~DatabaseWorkerPool for '%s'.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("~DatabaseWorkerPool for '%s'.", m_connectionInfo.database.c_str()); mysql_library_end(); } @@ -72,7 +72,7 @@ class DatabaseWorkerPool { m_connectionInfo = MySQLConnectionInfo(infoString); - sLog.outSQLDriver("Opening databasepool '%s'. Async threads: %u, synch threads: %u", m_connectionInfo.database.c_str(), async_threads, synch_threads); + sLog->outSQLDriver("Opening databasepool '%s'. Async threads: %u, synch threads: %u", m_connectionInfo.database.c_str(), async_threads, synch_threads); /// Open asynchronous connections (delayed operations) m_connections[IDX_ASYNC].resize(async_threads); @@ -94,13 +94,13 @@ class DatabaseWorkerPool ++m_connectionCount[IDX_SYNCH]; } - sLog.outSQLDriver("Databasepool opened succesfuly. %u total connections running.", (m_connectionCount[IDX_SYNCH] + m_connectionCount[IDX_ASYNC])); + sLog->outSQLDriver("Databasepool opened succesfuly. %u total connections running.", (m_connectionCount[IDX_SYNCH] + m_connectionCount[IDX_ASYNC])); return true; } void Close() { - sLog.outSQLDriver("Closing down databasepool '%s'.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("Closing down databasepool '%s'.", m_connectionInfo.database.c_str()); /// Shuts down delaythreads for this connection pool. m_queue->queue()->deactivate(); @@ -118,7 +118,7 @@ class DatabaseWorkerPool --m_connectionCount[IDX_ASYNC]; } - sLog.outSQLDriver("Asynchronous connections on databasepool '%s' terminated. Proceeding with synchronous connections.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("Asynchronous connections on databasepool '%s' terminated. Proceeding with synchronous connections.", m_connectionInfo.database.c_str()); /// Shut down the synchronous connections for (uint8 i = 0; i < m_connectionCount[IDX_SYNCH]; ++i) @@ -130,7 +130,7 @@ class DatabaseWorkerPool --m_connectionCount[IDX_SYNCH]; } - sLog.outSQLDriver("All connections on databasepool %s closed.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("All connections on databasepool %s closed.", m_connectionInfo.database.c_str()); } /** @@ -335,15 +335,15 @@ class DatabaseWorkerPool //! were appended to the transaction will be respected during execution. void CommitTransaction(SQLTransaction transaction) { - if (sLog.GetSQLDriverQueryLogging()) + if (sLog->GetSQLDriverQueryLogging()) { switch (transaction->GetSize()) { case 0: - sLog.outSQLDriver("Transaction contains 0 queries. Not executing."); + sLog->outSQLDriver("Transaction contains 0 queries. Not executing."); return; case 1: - sLog.outSQLDriver("Warning: Transaction only holds 1 query, consider removing Transaction context in code."); + sLog->outSQLDriver("Warning: Transaction only holds 1 query, consider removing Transaction context in code."); break; default: break; diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h index 8b494d21679..cfe2e2149a2 100755 --- a/src/server/shared/Database/Field.h +++ b/src/server/shared/Database/Field.h @@ -43,7 +43,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetUInt8() on non-numeric field."); + sLog->outSQLDriver("Error: GetUInt8() on non-numeric field."); return 0; } #endif @@ -60,7 +60,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GeInt8() on non-numeric field."); + sLog->outSQLDriver("Error: GeInt8() on non-numeric field."); return 0; } #endif @@ -77,7 +77,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetUInt16() on non-numeric field."); + sLog->outSQLDriver("Error: GetUInt16() on non-numeric field."); return 0; } #endif @@ -94,7 +94,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetInt16() on non-numeric field."); + sLog->outSQLDriver("Error: GetInt16() on non-numeric field."); return 0; } #endif @@ -111,7 +111,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetUInt32() on non-numeric field."); + sLog->outSQLDriver("Error: GetUInt32() on non-numeric field."); return 0; } #endif @@ -128,7 +128,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetInt32() on non-numeric field."); + sLog->outSQLDriver("Error: GetInt32() on non-numeric field."); return 0; } #endif @@ -145,7 +145,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetUInt64() on non-numeric field."); + sLog->outSQLDriver("Error: GetUInt64() on non-numeric field."); return 0; } #endif @@ -162,7 +162,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetInt64() on non-numeric field."); + sLog->outSQLDriver("Error: GetInt64() on non-numeric field."); return 0; } #endif @@ -179,7 +179,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetFloat() on non-numeric field."); + sLog->outSQLDriver("Error: GetFloat() on non-numeric field."); return 0.0f; } #endif @@ -196,7 +196,7 @@ class Field #ifdef TRINITY_DEBUG if (!IsNumeric()) { - sLog.outSQLDriver("Error: GetDouble() on non-numeric field."); + sLog->outSQLDriver("Error: GetDouble() on non-numeric field."); return 0.0f; } #endif @@ -213,7 +213,7 @@ class Field #ifdef TRINITY_DEBUG if (IsNumeric()) { - sLog.outSQLDriver("Error: GetCString() on numeric field."); + sLog->outSQLDriver("Error: GetCString() on numeric field."); return NULL; } #endif @@ -311,7 +311,7 @@ class Field MYSQL_TYPE_SET: */ default: - sLog.outSQLDriver("SQL::SizeForType(): invalid field type %u", uint32(field->type)); + sLog->outSQLDriver("SQL::SizeForType(): invalid field type %u", uint32(field->type)); return 0; } } diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index 07d782c9304..bd90b528dba 100755 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -56,7 +56,7 @@ MySQLConnection::~MySQLConnection() { ASSERT (m_Mysql); /// MySQL context must be present at this point - sLog.outSQLDriver("MySQLConnection::~MySQLConnection()"); + sLog->outSQLDriver("MySQLConnection::~MySQLConnection()"); for (size_t i = 0; i < m_stmts.size(); ++i) delete m_stmts[i]; @@ -76,7 +76,7 @@ bool MySQLConnection::Open() mysqlInit = mysql_init(NULL); if (!mysqlInit) { - sLog.outError("Could not initialize Mysql connection to database `%s`", m_connectionInfo.database.c_str()); + sLog->outError("Could not initialize Mysql connection to database `%s`", m_connectionInfo.database.c_str()); return false; } @@ -120,13 +120,13 @@ bool MySQLConnection::Open() { if (!m_reconnecting) { - sLog.outSQLDriver("MySQL client library: %s", mysql_get_client_info()); - sLog.outSQLDriver("MySQL server ver: %s ", mysql_get_server_info(m_Mysql)); + sLog->outSQLDriver("MySQL client library: %s", mysql_get_client_info()); + sLog->outSQLDriver("MySQL server ver: %s ", mysql_get_server_info(m_Mysql)); if (mysql_get_server_version(m_Mysql) != mysql_get_client_version()) - sLog.outSQLDriver("[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements."); + sLog->outSQLDriver("[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements."); } - sLog.outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str()); + sLog->outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str()); mysql_autocommit(m_Mysql, 1); // set connection properties to UTF8 to properly handle locales for different @@ -136,7 +136,7 @@ bool MySQLConnection::Open() } else { - sLog.outError("Could not connect to MySQL database at %s: %s\n", m_connectionInfo.host.c_str(), mysql_error(mysqlInit)); + sLog->outError("Could not connect to MySQL database at %s: %s\n", m_connectionInfo.host.c_str(), mysql_error(mysqlInit)); mysql_close(mysqlInit); return false; } @@ -149,24 +149,24 @@ bool MySQLConnection::Execute(const char* sql) { uint32 _s = 0; - if (sLog.GetSQLDriverQueryLogging()) + if (sLog->GetSQLDriverQueryLogging()) _s = getMSTime(); if (mysql_query(m_Mysql, sql)) { uint32 lErrno = mysql_errno(m_Mysql); - sLog.outSQLDriver("SQL: %s", sql); - sLog.outSQLDriver("ERROR: [%u] %s", lErrno, mysql_error(m_Mysql)); + sLog->outSQLDriver("SQL: %s", sql); + sLog->outSQLDriver("ERROR: [%u] %s", lErrno, mysql_error(m_Mysql)); if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled succesfuly (ie reconnection) return Execute(sql); // Try again return false; } - else if (sLog.GetSQLDriverQueryLogging()) + else if (sLog->GetSQLDriverQueryLogging()) { - sLog.outSQLDriver("[%u ms] SQL: %s", getMSTimeDiff(_s, getMSTime()), sql); + sLog->outSQLDriver("[%u ms] SQL: %s", getMSTimeDiff(_s, getMSTime()), sql); } } @@ -191,13 +191,13 @@ bool MySQLConnection::Execute(PreparedStatement* stmt) MYSQL_BIND* msql_BIND = m_mStmt->GetBind(); uint32 _s = 0; - if (sLog.GetSQLDriverQueryLogging()) + if (sLog->GetSQLDriverQueryLogging()) _s = getMSTime(); if (mysql_stmt_bind_param(msql_STMT, msql_BIND)) { uint32 lErrno = mysql_errno(m_Mysql); - sLog.outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error binding params: [%u] %s", + sLog->outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error binding params: [%u] %s", index, m_connectionInfo.database.c_str(), lErrno, mysql_stmt_error(msql_STMT)); if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled succesfuly (ie reconnection) @@ -210,7 +210,7 @@ bool MySQLConnection::Execute(PreparedStatement* stmt) if (mysql_stmt_execute(msql_STMT)) { uint32 lErrno = mysql_errno(m_Mysql); - sLog.outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error executing: [%u] %s", + sLog->outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error executing: [%u] %s", index, m_connectionInfo.database.c_str(), lErrno, mysql_stmt_error(msql_STMT)); if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled succesfuly (ie reconnection) @@ -220,8 +220,8 @@ bool MySQLConnection::Execute(PreparedStatement* stmt) return false; } - if (sLog.GetSQLDriverQueryLogging()) - sLog.outSQLDriver("[%u ms] Prepared SQL: %u on database `%s`", + if (sLog->GetSQLDriverQueryLogging()) + sLog->outSQLDriver("[%u ms] Prepared SQL: %u on database `%s`", getMSTimeDiff(_s, getMSTime()), index, m_connectionInfo.database.c_str()); m_mStmt->ClearParameters(); @@ -247,13 +247,13 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint6 MYSQL_BIND* msql_BIND = m_mStmt->GetBind(); uint32 _s = 0; - if (sLog.GetSQLDriverQueryLogging()) + if (sLog->GetSQLDriverQueryLogging()) _s = getMSTime(); if (mysql_stmt_bind_param(msql_STMT, msql_BIND)) { uint32 lErrno = mysql_errno(m_Mysql); - sLog.outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error binding params: [%u] %s", + sLog->outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error binding params: [%u] %s", index, m_connectionInfo.database.c_str(), lErrno, mysql_stmt_error(msql_STMT)); if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled succesfuly (ie reconnection) @@ -266,7 +266,7 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint6 if (mysql_stmt_execute(msql_STMT)) { uint32 lErrno = mysql_errno(m_Mysql); - sLog.outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error executing: [%u] %s", + sLog->outSQLDriver("[ERROR]: PreparedStatement (id: %u, database: `%s`) error executing: [%u] %s", index, m_connectionInfo.database.c_str(), lErrno, mysql_stmt_error(msql_STMT)); if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled succesfuly (ie reconnection) @@ -276,8 +276,8 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES **pResult, uint6 return false; } - if (sLog.GetSQLDriverQueryLogging()) - sLog.outSQLDriver("[%u ms] Prepared SQL: %u on database `%s`", + if (sLog->GetSQLDriverQueryLogging()) + sLog->outSQLDriver("[%u ms] Prepared SQL: %u on database `%s`", getMSTimeDiff(_s, getMSTime()), index, m_connectionInfo.database.c_str()); m_mStmt->ClearParameters(); @@ -314,23 +314,23 @@ bool MySQLConnection::_Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD * { uint32 _s = 0; - if (sLog.GetSQLDriverQueryLogging()) + if (sLog->GetSQLDriverQueryLogging()) _s = getMSTime(); if (mysql_query(m_Mysql, sql)) { uint32 lErrno = mysql_errno(m_Mysql); - sLog.outSQLDriver("SQL: %s", sql); - sLog.outSQLDriver("ERROR: [%u] %s", lErrno, mysql_error(m_Mysql)); + sLog->outSQLDriver("SQL: %s", sql); + sLog->outSQLDriver("ERROR: [%u] %s", lErrno, mysql_error(m_Mysql)); if (_HandleMySQLErrno(lErrno)) // If it returns true, an error was handled succesfuly (ie reconnection) return _Query(sql, pResult, pFields, pRowCount, pFieldCount); // We try again return false; } - else if (sLog.GetSQLDriverQueryLogging()) + else if (sLog->GetSQLDriverQueryLogging()) { - sLog.outSQLDriver("[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql); + sLog->outSQLDriver("[%u ms] SQL: %s", getMSTimeDiff(_s,getMSTime()), sql); } *pResult = mysql_store_result(m_Mysql); @@ -372,7 +372,7 @@ MySQLPreparedStatement* MySQLConnection::GetPreparedStatement(uint32 index) ASSERT(index < m_stmts.size()); MySQLPreparedStatement* ret = m_stmts[index]; if (!ret) - sLog.outSQLDriver("ERROR: Could not fetch prepared statement %u on database `%s`, connection type: %s.", + sLog->outSQLDriver("ERROR: Could not fetch prepared statement %u on database `%s`, connection type: %s.", index, m_connectionInfo.database.c_str(), (m_connectionFlags & CONNECTION_ASYNC) ? "asynchronous" : "synchronous"); return ret; @@ -396,15 +396,15 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, bool async MYSQL_STMT * stmt = mysql_stmt_init(m_Mysql); if (!stmt) { - sLog.outSQLDriver("[ERROR]: In mysql_stmt_init() id: %u, sql: \"%s\"", index, sql); - sLog.outSQLDriver("[ERROR]: %s", mysql_error(m_Mysql)); + sLog->outSQLDriver("[ERROR]: In mysql_stmt_init() id: %u, sql: \"%s\"", index, sql); + sLog->outSQLDriver("[ERROR]: %s", mysql_error(m_Mysql)); exit(1); } if (mysql_stmt_prepare(stmt, sql, static_cast(strlen(sql)))) { - sLog.outSQLDriver("[ERROR]: In mysql_stmt_prepare() id: %u, sql: \"%s\"", index, sql); - sLog.outSQLDriver("[ERROR]: %s", mysql_stmt_error(stmt)); + sLog->outSQLDriver("[ERROR]: In mysql_stmt_prepare() id: %u, sql: \"%s\"", index, sql); + sLog->outSQLDriver("[ERROR]: %s", mysql_stmt_error(stmt)); mysql_stmt_close(stmt); exit(1); } @@ -431,7 +431,7 @@ PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt) bool MySQLConnection::_HandleMySQLErrno(uint32 errNo) { - sLog.outDebug("%s", __FUNCTION__); + sLog->outDebug("%s", __FUNCTION__); switch (errNo) { @@ -445,9 +445,9 @@ bool MySQLConnection::_HandleMySQLErrno(uint32 errNo) mysql_close(GetHandle()); if (this->Open()) // Don't remove 'this' pointer unless you want to skip loading all prepared statements.... { - sLog.outSQLDriver("Connection to the MySQL server is active."); + sLog->outSQLDriver("Connection to the MySQL server is active."); if (oldThreadId != mysql_thread_id(GetHandle())) - sLog.outSQLDriver("Succesfuly reconnected to %s @%s:%s (%s).", + sLog->outSQLDriver("Succesfuly reconnected to %s @%s:%s (%s).", m_connectionInfo.database.c_str(), m_connectionInfo.host.c_str(), m_connectionInfo.port_or_socket.c_str(), (m_connectionFlags & CONNECTION_ASYNC) ? "asynchronous" : "synchronous"); @@ -466,7 +466,7 @@ bool MySQLConnection::_HandleMySQLErrno(uint32 errNo) return false; default: - sLog.outSQLDriver("Unhandled MySQL errno %u. Unexpected behaviour possible.", errNo); + sLog->outSQLDriver("Unhandled MySQL errno %u. Unexpected behaviour possible.", errNo); return false; } } diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 95d0f89ba67..5faf8f6dbec 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -70,7 +70,7 @@ void PreparedStatement::BindParameters() } #ifdef _DEBUG if (i < m_stmt->m_paramCount) - sLog.outSQLDriver("[WARNING]: BindParameters() for statement %u did not bind all allocated parameters", m_index); + sLog->outSQLDriver("[WARNING]: BindParameters() for statement %u did not bind all allocated parameters", m_index); #endif } @@ -224,7 +224,7 @@ bool MySQLPreparedStatement::CheckValidIndex(uint8 index) return false; if (m_paramsSet[index]) - sLog.outSQLDriver("[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index); + sLog->outSQLDriver("[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index); return true; } diff --git a/src/server/shared/Database/QueryHolder.cpp b/src/server/shared/Database/QueryHolder.cpp index 6a525bccc90..3268758c2b8 100755 --- a/src/server/shared/Database/QueryHolder.cpp +++ b/src/server/shared/Database/QueryHolder.cpp @@ -24,7 +24,7 @@ bool SQLQueryHolder::SetQuery(size_t index, const char *sql) { if (m_queries.size() <= index) { - sLog.outError("Query index (%zu) out of range (size: %u) for query: %s", index, (uint32)m_queries.size(), sql); + sLog->outError("Query index (%zu) out of range (size: %u) for query: %s", index, (uint32)m_queries.size(), sql); return false; } @@ -44,7 +44,7 @@ bool SQLQueryHolder::SetPQuery(size_t index, const char *format, ...) { if (!format) { - sLog.outError("Query (index: %zu) is empty.",index); + sLog->outError("Query (index: %zu) is empty.",index); return false; } @@ -56,7 +56,7 @@ bool SQLQueryHolder::SetPQuery(size_t index, const char *format, ...) if (res == -1) { - sLog.outError("SQL Query truncated (and not execute) for format: %s",format); + sLog->outError("SQL Query truncated (and not execute) for format: %s",format); return false; } @@ -67,7 +67,7 @@ bool SQLQueryHolder::SetPreparedQuery(size_t index, PreparedStatement* stmt) { if (m_queries.size() <= index) { - sLog.outError("Query index (%zu) out of range (size: %u) for prepared statement", index, (uint32)m_queries.size()); + sLog->outError("Query index (%zu) out of range (size: %u) for prepared statement", index, (uint32)m_queries.size()); return false; } diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp index 56ac07ed8a1..8f00ce47170 100755 --- a/src/server/shared/Database/QueryResult.cpp +++ b/src/server/shared/Database/QueryResult.cpp @@ -59,7 +59,7 @@ m_length(NULL) //- This is where we store the (entire) resultset if (mysql_stmt_store_result(m_stmt)) { - sLog.outSQLDriver("%s:mysql_stmt_store_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt)); + sLog->outSQLDriver("%s:mysql_stmt_store_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt)); return; } @@ -85,7 +85,7 @@ m_length(NULL) //- This is where we bind the bind the buffer to the statement if (mysql_stmt_bind_result(m_stmt, m_rBind)) { - sLog.outSQLDriver("%s:mysql_stmt_bind_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt)); + sLog->outSQLDriver("%s:mysql_stmt_bind_result, cannot bind result from MySQL server. Error: %s", __FUNCTION__, mysql_stmt_error(m_stmt)); delete[] m_rBind; delete[] m_isNull; delete[] m_length; diff --git a/src/server/shared/Database/SQLStorageImpl.h b/src/server/shared/Database/SQLStorageImpl.h index 8f26805a051..481d87516b4 100755 --- a/src/server/shared/Database/SQLStorageImpl.h +++ b/src/server/shared/Database/SQLStorageImpl.h @@ -124,7 +124,7 @@ void SQLStorageLoaderBase::Load(SQLStorage &store) QueryResult result = WorldDatabase.PQuery("SELECT MAX(%s) FROM %s", store.entry_field, store.table); if(!result) { - sLog.outError("Error loading %s table (not exist?)\n", store.table); + sLog->outError("Error loading %s table (not exist?)\n", store.table); exit(1); // Stop server at loading non exited table or not accessable table } @@ -143,7 +143,7 @@ void SQLStorageLoaderBase::Load(SQLStorage &store) if(!result) { - sLog.outError("%s table is empty!\n", store.table); + sLog->outError("%s table is empty!\n", store.table); store.RecordCount = 0; return; } @@ -154,7 +154,7 @@ void SQLStorageLoaderBase::Load(SQLStorage &store) if(store.iNumFields != result->GetFieldCount()) { store.RecordCount = 0; - sLog.outError("Error in %s table, probably sql file format was updated (there should be %d fields in sql).\n", store.table, store.iNumFields); + sLog->outError("Error in %s table, probably sql file format was updated (there should be %d fields in sql).\n", store.table, store.iNumFields); exit(1); // Stop server at loading broken or non-compatible table. } diff --git a/src/server/shared/Database/Transaction.cpp b/src/server/shared/Database/Transaction.cpp index cfda2f1c9b0..c3b49a708bd 100755 --- a/src/server/shared/Database/Transaction.cpp +++ b/src/server/shared/Database/Transaction.cpp @@ -83,7 +83,7 @@ bool TransactionTask::Execute() ASSERT(stmt); if (!m_conn->Execute(stmt)) { - sLog.outSQLDriver("[Warning] Transaction aborted. %u queries not executed.", (uint32)queries.size()); + sLog->outSQLDriver("[Warning] Transaction aborted. %u queries not executed.", (uint32)queries.size()); m_conn->RollbackTransaction(); return false; } @@ -96,7 +96,7 @@ bool TransactionTask::Execute() ASSERT(sql); if (!m_conn->Execute(sql)) { - sLog.outSQLDriver("[Warning] Transaction aborted. %u queries not executed.", (uint32)queries.size()); + sLog->outSQLDriver("[Warning] Transaction aborted. %u queries not executed.", (uint32)queries.size()); m_conn->RollbackTransaction(); return false; } diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 271182ae220..32f4e87e1ef 100755 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -26,10 +26,10 @@ #else #define WPAssert( assertion ) { if (!(assertion)) { fprintf( stderr, "\n%s:%i in %s ASSERTION FAILED2:\n %s\n", __FILE__, __LINE__,__FUNCTION__, #assertion); assert( #assertion &&0 ); ((void(*)())NULL)();} } #endif -#define WPError( assertion, errmsg ) if( ! (assertion) ) { sLog.outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); } -#define WPWarning( assertion, errmsg ) if( ! (assertion) ) { sLog.outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); } +#define WPError( assertion, errmsg ) if( ! (assertion) ) { sLog->outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); } +#define WPWarning( assertion, errmsg ) if( ! (assertion) ) { sLog->outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); } -#define WPFatal( assertion, errmsg ) if( ! (assertion) ) { sLog.outError( "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( #assertion &&0 ); abort(); } +#define WPFatal( assertion, errmsg ) if( ! (assertion) ) { sLog->outError( "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( #assertion &&0 ); abort(); } #define ASSERT WPAssert #endif diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index e06495d0252..f186db0c7e2 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -104,16 +104,16 @@ void Log::SetDBLogLevel(char *Level) void Log::Initialize() { /// Check whether we'll log GM commands/RA events/character outputs/chat stuffs - m_dbChar = sConfig.GetBoolDefault("LogDB.Char", false); - m_dbRA = sConfig.GetBoolDefault("LogDB.RA", false); - m_dbGM = sConfig.GetBoolDefault("LogDB.GM", false); - m_dbChat = sConfig.GetBoolDefault("LogDB.Chat", false); + m_dbChar = sConfig->GetBoolDefault("LogDB.Char", false); + m_dbRA = sConfig->GetBoolDefault("LogDB.RA", false); + m_dbGM = sConfig->GetBoolDefault("LogDB.GM", false); + m_dbChat = sConfig->GetBoolDefault("LogDB.Chat", false); /// Realm must be 0 by default SetRealmID(0); /// Common log files data - m_logsDir = sConfig.GetStringDefault("LogsDir",""); + m_logsDir = sConfig->GetStringDefault("LogsDir",""); if (!m_logsDir.empty()) if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\')) m_logsDir.append("/"); @@ -122,18 +122,18 @@ void Log::Initialize() /// Open specific log files logfile = openLogFile("LogFile","LogTimestamp","w"); - InitColors(sConfig.GetStringDefault("LogColors", "")); + InitColors(sConfig->GetStringDefault("LogColors", "")); - m_gmlog_per_account = sConfig.GetBoolDefault("GmLogPerAccount",false); + m_gmlog_per_account = sConfig->GetBoolDefault("GmLogPerAccount",false); if(!m_gmlog_per_account) gmLogfile = openLogFile("GMLogFile","GmLogTimestamp","a"); else { // GM log settings for per account case - m_gmlog_filename_format = sConfig.GetStringDefault("GMLogFile", ""); + m_gmlog_filename_format = sConfig->GetStringDefault("GMLogFile", ""); if(!m_gmlog_filename_format.empty()) { - bool m_gmlog_timestamp = sConfig.GetBoolDefault("GmLogTimestamp",false); + bool m_gmlog_timestamp = sConfig->GetBoolDefault("GmLogTimestamp",false); size_t dot_pos = m_gmlog_filename_format.find_last_of("."); if(dot_pos!=m_gmlog_filename_format.npos) @@ -163,28 +163,28 @@ void Log::Initialize() sqlLogFile = openLogFile("SQLDriverLogFile", NULL, "a"); // Main log file settings - m_logLevel = sConfig.GetIntDefault("LogLevel", LOGL_NORMAL); - m_logFileLevel = sConfig.GetIntDefault("LogFileLevel", LOGL_NORMAL); - m_dbLogLevel = sConfig.GetIntDefault("DBLogLevel", LOGL_NORMAL); - m_sqlDriverQueryLogging = sConfig.GetBoolDefault("SQLDriverQueryLogging", false); + m_logLevel = sConfig->GetIntDefault("LogLevel", LOGL_NORMAL); + m_logFileLevel = sConfig->GetIntDefault("LogFileLevel", LOGL_NORMAL); + m_dbLogLevel = sConfig->GetIntDefault("DBLogLevel", LOGL_NORMAL); + m_sqlDriverQueryLogging = sConfig->GetBoolDefault("SQLDriverQueryLogging", false); m_logFilter = 0; - if(sConfig.GetBoolDefault("LogFilter_TransportMoves", true)) + if(sConfig->GetBoolDefault("LogFilter_TransportMoves", true)) m_logFilter |= LOG_FILTER_TRANSPORT_MOVES; - if(sConfig.GetBoolDefault("LogFilter_CreatureMoves", true)) + if(sConfig->GetBoolDefault("LogFilter_CreatureMoves", true)) m_logFilter |= LOG_FILTER_CREATURE_MOVES; - if(sConfig.GetBoolDefault("LogFilter_VisibilityChanges", true)) + if(sConfig->GetBoolDefault("LogFilter_VisibilityChanges", true)) m_logFilter |= LOG_FILTER_VISIBILITY_CHANGES; - if(sConfig.GetBoolDefault("LogFilter_AchievementUpdates", true)) + if(sConfig->GetBoolDefault("LogFilter_AchievementUpdates", true)) m_logFilter |= LOG_FILTER_ACHIEVEMENT_UPDATES; // Char log settings - m_charLog_Dump = sConfig.GetBoolDefault("CharLogDump", false); - m_charLog_Dump_Separate = sConfig.GetBoolDefault("CharLogDump.Separate", false); + m_charLog_Dump = sConfig->GetBoolDefault("CharLogDump", false); + m_charLog_Dump_Separate = sConfig->GetBoolDefault("CharLogDump.Separate", false); if (m_charLog_Dump_Separate) { - m_dumpsDir = sConfig.GetStringDefault("CharLogDump.SeparateDir", ""); + m_dumpsDir = sConfig->GetStringDefault("CharLogDump.SeparateDir", ""); if (!m_dumpsDir.empty()) if ((m_dumpsDir.at(m_dumpsDir.length() - 1) != '/') && (m_dumpsDir.at(m_dumpsDir.length() - 1) != '\\')) m_dumpsDir.append("/"); @@ -193,11 +193,11 @@ void Log::Initialize() FILE* Log::openLogFile(char const* configFileName,char const* configTimeStampFlag, char const* mode) { - std::string logfn=sConfig.GetStringDefault(configFileName, ""); + std::string logfn=sConfig->GetStringDefault(configFileName, ""); if(logfn.empty()) return NULL; - if(configTimeStampFlag && sConfig.GetBoolDefault(configTimeStampFlag,false)) + if(configTimeStampFlag && sConfig->GetBoolDefault(configTimeStampFlag,false)) { size_t dot_pos = logfn.find_last_of("."); if(dot_pos!=logfn.npos) diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 2d3d5faccff..39857493b48 100755 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -178,7 +178,7 @@ class Log std::string m_dumpsDir; }; -#define sLog (*ACE_Singleton::instance()) +#define sLog ACE_Singleton::instance() #endif diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 6fb28aa576b..5307c1051fd 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -35,7 +35,7 @@ class ByteBufferException void PrintPosError() const { - sLog.outError("Attempted to %s in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") value with size: " SIZEFMTD, + sLog->outError("Attempted to %s in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") value with size: " SIZEFMTD, (add ? "put" : "get"), pos, size, esize); } private: @@ -413,33 +413,33 @@ class ByteBuffer void print_storage() const { - if(!sLog.IsOutDebug()) // optimize disabled debug output + if(!sLog->IsOutDebug()) // optimize disabled debug output return; - sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); + sLog->outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); for (uint32 i = 0; i < size(); ++i) - sLog.outDebugInLine("%u - ", read(i) ); - sLog.outDebug(" "); + sLog->outDebugInLine("%u - ", read(i) ); + sLog->outDebug(" "); } void textlike() const { - if(!sLog.IsOutDebug()) // optimize disabled debug output + if(!sLog->IsOutDebug()) // optimize disabled debug output return; - sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); + sLog->outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); for (uint32 i = 0; i < size(); ++i) - sLog.outDebugInLine("%c", read(i) ); - sLog.outDebug(" "); + sLog->outDebugInLine("%c", read(i) ); + sLog->outDebug(" "); } void hexlike() const { - if(!sLog.IsOutDebug()) // optimize disabled debug output + if(!sLog->IsOutDebug()) // optimize disabled debug output return; uint32 j = 1, k = 1; - sLog.outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); + sLog->outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); for (uint32 i = 0; i < size(); ++i) { @@ -447,11 +447,11 @@ class ByteBuffer { if (read(i) < 0x10) { - sLog.outDebugInLine("| 0%X ", read(i) ); + sLog->outDebugInLine("| 0%X ", read(i) ); } else { - sLog.outDebugInLine("| %X ", read(i) ); + sLog->outDebugInLine("| %X ", read(i) ); } ++j; } @@ -459,15 +459,15 @@ class ByteBuffer { if (read(i) < 0x10) { - sLog.outDebugInLine("\n"); + sLog->outDebugInLine("\n"); - sLog.outDebugInLine("0%X ", read(i) ); + sLog->outDebugInLine("0%X ", read(i) ); } else { - sLog.outDebugInLine("\n"); + sLog->outDebugInLine("\n"); - sLog.outDebugInLine("%X ", read(i) ); + sLog->outDebugInLine("%X ", read(i) ); } ++k; @@ -477,15 +477,15 @@ class ByteBuffer { if (read(i) < 0x10) { - sLog.outDebugInLine("0%X ", read(i) ); + sLog->outDebugInLine("0%X ", read(i) ); } else { - sLog.outDebugInLine("%X ", read(i) ); + sLog->outDebugInLine("%X ", read(i) ); } } } - sLog.outDebugInLine("\n"); + sLog->outDebugInLine("\n"); } protected: diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp index 4efa2af922b..08f58850bb3 100755 --- a/src/server/shared/Utilities/ServiceWin32.cpp +++ b/src/server/shared/Utilities/ServiceWin32.cpp @@ -257,7 +257,7 @@ bool WinServiceRun() if (!StartServiceCtrlDispatcher(serviceTable)) { - sLog.outError("StartService Failed. Error [%u]", ::GetLastError()); + sLog->outError("StartService Failed. Error [%u]", ::GetLastError()); return false; } return true; diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 8b2fe8bd422..350d02bfde6 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -412,7 +412,7 @@ bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args) */ bool ChatHandler::HandleCharacterDeletedOldCommand(const char* args) { - int32 keepDays = sWorld.getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); + int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS); char* px = strtok((char*)args, " "); if (px) @@ -493,7 +493,7 @@ bool ChatHandler::HandleServerSetLogFileLevelCommand(const char *args) if (!NewLevel) return false; - sLog.SetLogFileLevel(NewLevel); + sLog->SetLogFileLevel(NewLevel); return true; } @@ -507,7 +507,7 @@ bool ChatHandler::HandleServerSetLogLevelCommand(const char *args) if (!NewLevel) return false; - sLog.SetLogLevel(NewLevel); + sLog->SetLogLevel(NewLevel); return true; } @@ -525,7 +525,7 @@ bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args) if (NewTime < 0) return false; - sWorld.SetRecordDiffInterval(NewTime); + sWorld->SetRecordDiffInterval(NewTime); printf( "Record diff every %u ms\n", NewTime); return true; } @@ -533,8 +533,8 @@ bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args) /// toggle sql driver query logging bool ChatHandler::HandleServerToggleQueryLogging(const char* /* args */) { - sLog.SetSQLDriverQueryLogging(!sLog.GetSQLDriverQueryLogging()); - if(sLog.GetSQLDriverQueryLogging()) + sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging()); + if(sLog->GetSQLDriverQueryLogging()) PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED); else PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED); @@ -563,12 +563,12 @@ int kb_hit_return() void CliRunnable::run() { ///- Display the list of available CLI functions then beep - //sLog.outString(""); + //sLog->outString(""); #if PLATFORM != WINDOWS rl_attempted_completion_function = cli_completion; rl_event_hook = cli_hook_func; #endif - if (sConfig.GetBoolDefault("BeepAtStart", true)) + if (sConfig->GetBoolDefault("BeepAtStart", true)) printf("\a"); // \a = Alert // print this here the first time @@ -615,7 +615,7 @@ void CliRunnable::run() continue; } fflush(stdout); - sWorld.QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished)); + sWorld->QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished)); #if PLATFORM != WINDOWS add_history(command.c_str()); #endif diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 4a09fb718b7..334b3e27bf0 100755 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -58,7 +58,7 @@ uint32 realmID; ///< Id of the realm /// Print out the usage string for this program on the console. void usage(const char *prog) { - sLog.outString("Usage: \n %s []\n" + sLog->outString("Usage: \n %s []\n" " -c config_file use config_file as configuration file\n\r" #ifdef _WIN32 " Running as service functions:\n\r" @@ -83,7 +83,7 @@ extern int main(int argc, char **argv) { if( ++c >= argc ) { - sLog.outError("Runtime-Error: -c option requires an input argument"); + sLog->outError("Runtime-Error: -c option requires an input argument"); usage(argv[0]); return 1; } @@ -99,25 +99,25 @@ extern int main(int argc, char **argv) { if( ++c >= argc ) { - sLog.outError("Runtime-Error: -s option requires an input argument"); + sLog->outError("Runtime-Error: -s option requires an input argument"); usage(argv[0]); return 1; } if( strcmp(argv[c],"install") == 0) { if (WinServiceInstall()) - sLog.outString("Installing service"); + sLog->outString("Installing service"); return 1; } else if( strcmp(argv[c],"uninstall") == 0) { if(WinServiceUninstall()) - sLog.outString("Uninstalling service"); + sLog->outString("Uninstalling service"); return 1; } else { - sLog.outError("Runtime-Error: unsupported option %s",argv[c]); + sLog->outError("Runtime-Error: unsupported option %s",argv[c]); usage(argv[0]); return 1; } @@ -131,20 +131,20 @@ extern int main(int argc, char **argv) ++c; } - if (!sConfig.SetSource(cfg_file)) + if (!sConfig->SetSource(cfg_file)) { - sLog.outError("Invalid or missing configuration file : %s", cfg_file); - sLog.outError("Verify that the file exists and has \'[worldserver]' written in the top of the file!"); + sLog->outError("Invalid or missing configuration file : %s", cfg_file); + sLog->outError("Verify that the file exists and has \'[worldserver]' written in the top of the file!"); return 1; } - sLog.outString("Using configuration file %s.", cfg_file); + sLog->outString("Using configuration file %s.", cfg_file); - sLog.outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); - sLog.outDetail("Using ACE: %s", ACE_VERSION); + sLog->outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + sLog->outDetail("Using ACE: %s", ACE_VERSION); ///- and run the 'Master' /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? - int ret = sMaster.Run(); + int ret = sMaster->Run(); // at sMaster return function exist with codes // 0 - normal shutdown diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 81f13d5144a..ce4b322cb4a 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -82,7 +82,7 @@ public: { if (!_delaytime) return; - sLog.outString("Starting up anti-freeze thread (%u seconds max stuck time)...",_delaytime/1000); + sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...",_delaytime/1000); m_loops = 0; w_loops = 0; m_lastchange = 0; @@ -100,11 +100,11 @@ public: // possible freeze else if (getMSTimeDiff(w_lastchange,curtime) > _delaytime) { - sLog.outError("World Thread hangs, kicking out server!"); + sLog->outError("World Thread hangs, kicking out server!"); *((uint32 volatile*)NULL) = 0; // bang crash } } - sLog.outString("Anti-freeze thread exiting without problems."); + sLog->outString("Anti-freeze thread exiting without problems."); } }; @@ -122,38 +122,38 @@ int Master::Run() BigNumber seed1; seed1.SetRand(16 * 8); - sLog.outString( "%s (core-daemon)", _FULLVERSION ); - sLog.outString( " to stop.\n" ); + sLog->outString( "%s (core-daemon)", _FULLVERSION ); + sLog->outString( " to stop.\n" ); - sLog.outString( " ______ __"); - sLog.outString( "/\\__ _\\ __ __/\\ \\__"); - sLog.outString( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __"); - sLog.outString( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\"); - sLog.outString( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\"); - sLog.outString( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\"); - sLog.outString( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\"); - sLog.outString( " C O R E /\\___/"); - sLog.outString( "http://TrinityCore.org \\/__/\n"); + sLog->outString( " ______ __"); + sLog->outString( "/\\__ _\\ __ __/\\ \\__"); + sLog->outString( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __"); + sLog->outString( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\"); + sLog->outString( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\"); + sLog->outString( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\"); + sLog->outString( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\"); + sLog->outString( " C O R E /\\___/"); + sLog->outString( "http://TrinityCore.org \\/__/\n"); #ifdef USE_SFMT_FOR_RNG - sLog.outString( "\n"); - sLog.outString( "SFMT has been enabled as the random number generator, if worldserver"); - sLog.outString( "freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration"); - sLog.outString( "\n"); + sLog->outString( "\n"); + sLog->outString( "SFMT has been enabled as the random number generator, if worldserver"); + sLog->outString( "freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration"); + sLog->outString( "\n"); #endif //USE_SFMT_FOR_RNG /// worldd PID file creation - std::string pidfile = sConfig.GetStringDefault("PidFile", ""); + std::string pidfile = sConfig->GetStringDefault("PidFile", ""); if(!pidfile.empty()) { uint32 pid = CreatePIDFile(pidfile); if( !pid ) { - sLog.outError( "Cannot create PID file %s.\n", pidfile.c_str() ); + sLog->outError( "Cannot create PID file %s.\n", pidfile.c_str() ); return 1; } - sLog.outString( "Daemon PID: %u\n", pid ); + sLog->outString( "Daemon PID: %u\n", pid ); } ///- Start the databases @@ -161,7 +161,7 @@ int Master::Run() return 1; ///- Initialize the World - sWorld.SetInitialWorldSettings(); + sWorld->SetInitialWorldSettings(); // Initialise the signal handlers @@ -189,9 +189,9 @@ int Master::Run() ACE_Based::Thread* cliThread = NULL; #ifdef _WIN32 - if (sConfig.GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) + if (sConfig->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) #else - if (sConfig.GetBoolDefault("Console.Enable", true)) + if (sConfig->GetBoolDefault("Console.Enable", true)) #endif { ///- Launch CliRunnable thread @@ -205,7 +205,7 @@ int Master::Run() { HANDLE hProcess = GetCurrentProcess(); - uint32 Aff = sConfig.GetIntDefault("UseProcessors", 0); + uint32 Aff = sConfig->GetIntDefault("UseProcessors", 0); if(Aff > 0) { ULONG_PTR appAff; @@ -217,39 +217,39 @@ int Master::Run() if(!curAff ) { - sLog.outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x",Aff,appAff); + sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x",Aff,appAff); } else { if(SetProcessAffinityMask(hProcess,curAff)) - sLog.outString("Using processors (bitmask, hex): %x", curAff); + sLog->outString("Using processors (bitmask, hex): %x", curAff); else - sLog.outError("Can't set used processors (hex): %x",curAff); + sLog->outError("Can't set used processors (hex): %x",curAff); } } - sLog.outString(""); + sLog->outString(""); } - bool Prio = sConfig.GetBoolDefault("ProcessPriority", false); + bool Prio = sConfig->GetBoolDefault("ProcessPriority", false); // if(Prio && (m_ServiceStatus == -1)/* need set to default process priority class in service mode*/) if(Prio) { if(SetPriorityClass(hProcess,HIGH_PRIORITY_CLASS)) - sLog.outString("TrinityCore process priority class set to HIGH"); + sLog->outString("TrinityCore process priority class set to HIGH"); else - sLog.outError("Can't set Trinityd process priority class."); - sLog.outString(""); + sLog->outError("Can't set Trinityd process priority class."); + sLog->outString(""); } } #endif //Start soap serving thread ACE_Based::Thread* soap_thread = NULL; - if(sConfig.GetBoolDefault("SOAP.Enabled", false)) + if(sConfig->GetBoolDefault("SOAP.Enabled", false)) { TCSoapRunnable *runnable = new TCSoapRunnable(); - runnable->setListenArguments(sConfig.GetStringDefault("SOAP.IP", "127.0.0.1"), sConfig.GetIntDefault("SOAP.Port", 7878)); + runnable->setListenArguments(sConfig->GetStringDefault("SOAP.IP", "127.0.0.1"), sConfig->GetIntDefault("SOAP.Port", 7878)); soap_thread = new ACE_Based::Thread(runnable); } @@ -257,7 +257,7 @@ int Master::Run() realCurrTime = realPrevTime = getMSTime(); ///- Start up freeze catcher thread - if(uint32 freeze_delay = sConfig.GetIntDefault("MaxCoreStuckTime", 0)) + if(uint32 freeze_delay = sConfig->GetIntDefault("MaxCoreStuckTime", 0)) { FreezeDetectorRunnable *fdr = new FreezeDetectorRunnable(); fdr->SetDelayTime(freeze_delay*1000); @@ -266,12 +266,12 @@ int Master::Run() } ///- Launch the world listener socket - uint16 wsport = sWorld.getIntConfig(CONFIG_PORT_WORLD); - std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0"); + uint16 wsport = sWorld->getIntConfig(CONFIG_PORT_WORLD); + std::string bind_ip = sConfig->GetStringDefault ("BindIP", "0.0.0.0"); if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1) { - sLog.outError ("Failed to start network"); + sLog->outError ("Failed to start network"); World::StopNow(ERROR_EXIT_CODE); // go down and shutdown the server } @@ -301,7 +301,7 @@ int Master::Run() WorldDatabase.Close(); LoginDatabase.Close(); - sLog.outString( "Halting process..." ); + sLog->outString( "Halting process..." ); if (cliThread) { @@ -364,95 +364,95 @@ int Master::Run() /// Initialize connection to the databases bool Master::_StartDB() { - sLog.SetLogDB(false); + sLog->SetLogDB(false); std::string dbstring; uint8 async_threads, synch_threads; - dbstring = sConfig.GetStringDefault("WorldDatabaseInfo", ""); + dbstring = sConfig->GetStringDefault("WorldDatabaseInfo", ""); if (dbstring.empty()) { - sLog.outError("World database not specified in configuration file"); + sLog->outError("World database not specified in configuration file"); return false; } - async_threads = sConfig.GetIntDefault("WorldDatabase.WorkerThreads", 1); + async_threads = sConfig->GetIntDefault("WorldDatabase.WorkerThreads", 1); if (async_threads < 1 || async_threads > 32) { - sLog.outError("World database: invalid number of worker threads specified. " + sLog->outError("World database: invalid number of worker threads specified. " "Please pick a value between 1 and 32."); return false; } - synch_threads = sConfig.GetIntDefault("WorldDatabase.SynchThreads", 1); + synch_threads = sConfig->GetIntDefault("WorldDatabase.SynchThreads", 1); ///- Initialise the world database if (!WorldDatabase.Open(dbstring, async_threads, synch_threads)) { - sLog.outError("Cannot connect to world database %s", dbstring.c_str()); + sLog->outError("Cannot connect to world database %s", dbstring.c_str()); return false; } ///- Get character database info from configuration file - dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", ""); + dbstring = sConfig->GetStringDefault("CharacterDatabaseInfo", ""); if (dbstring.empty()) { - sLog.outError("Character database not specified in configuration file"); + sLog->outError("Character database not specified in configuration file"); return false; } - async_threads = sConfig.GetIntDefault("CharacterDatabase.WorkerThreads", 1); + async_threads = sConfig->GetIntDefault("CharacterDatabase.WorkerThreads", 1); if (async_threads < 1 || async_threads > 32) { - sLog.outError("Character database: invalid number of worker threads specified. " + sLog->outError("Character database: invalid number of worker threads specified. " "Please pick a value between 1 and 32."); return false; } - synch_threads = sConfig.GetIntDefault("CharacterDatabase.SynchThreads", 2); + synch_threads = sConfig->GetIntDefault("CharacterDatabase.SynchThreads", 2); ///- Initialise the Character database if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads)) { - sLog.outError("Cannot connect to Character database %s", dbstring.c_str()); + sLog->outError("Cannot connect to Character database %s", dbstring.c_str()); return false; } ///- Get login database info from configuration file - dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", ""); + dbstring = sConfig->GetStringDefault("LoginDatabaseInfo", ""); if (dbstring.empty()) { - sLog.outError("Login database not specified in configuration file"); + sLog->outError("Login database not specified in configuration file"); return false; } - async_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1); + async_threads = sConfig->GetIntDefault("LoginDatabase.WorkerThreads", 1); if (async_threads < 1 || async_threads > 32) { - sLog.outError("Login database: invalid number of worker threads specified. " + sLog->outError("Login database: invalid number of worker threads specified. " "Please pick a value between 1 and 32."); return false; } - synch_threads = sConfig.GetIntDefault("LoginDatabase.SynchThreads", 1); + synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1); ///- Initialise the login database if (!LoginDatabase.Open(dbstring, async_threads, synch_threads)) { - sLog.outError("Cannot connect to login database %s", dbstring.c_str()); + sLog->outError("Cannot connect to login database %s", dbstring.c_str()); return false; } ///- Get the realm Id from the configuration file - realmID = sConfig.GetIntDefault("RealmID", 0); + realmID = sConfig->GetIntDefault("RealmID", 0); if (!realmID) { - sLog.outError("Realm ID not defined in configuration file"); + sLog->outError("Realm ID not defined in configuration file"); return false; } - sLog.outString("Realm running as realm ID %d", realmID); + sLog->outString("Realm running as realm ID %d", realmID); ///- Initialize the DB logging system - sLog.SetLogDBLater(sConfig.GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished. - sLog.SetLogDB(false); - sLog.SetRealmID(realmID); + sLog->SetLogDBLater(sConfig->GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished. + sLog->SetLogDB(false); + sLog->SetRealmID(realmID); ///- Clean the database before starting clearOnlineAccounts(); @@ -460,10 +460,10 @@ bool Master::_StartDB() ///- Insert version info into DB WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _REVISION); - sWorld.LoadDBVersion(); + sWorld->LoadDBVersion(); - sLog.outString("Using World DB: %s", sWorld.GetDBVersion()); - sLog.outString("Using creature EventAI: %s", sWorld.GetCreatureEventAIVersion()); + sLog->outString("Using World DB: %s", sWorld->GetDBVersion()); + sLog->outString("Using creature EventAI: %s", sWorld->GetCreatureEventAIVersion()); return true; } diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h index a6ddae1b375..58ef3f762f4 100755 --- a/src/server/worldserver/Master.h +++ b/src/server/worldserver/Master.h @@ -39,6 +39,6 @@ class Master void clearOnlineAccounts(); }; -#define sMaster (*ACE_Singleton::instance()) +#define sMaster ACE_Singleton::instance() #endif /// @} diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp index 87ddd4cb43a..2e7c25440ba 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.cpp +++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp @@ -61,23 +61,23 @@ RARunnable::~RARunnable() void RARunnable::run() { - if (!sConfig.GetBoolDefault("Ra.Enable", false)) + if (!sConfig->GetBoolDefault("Ra.Enable", false)) return; ACE_Acceptor acceptor; - uint16 raport = sConfig.GetIntDefault("Ra.Port", 3443); - std::string stringip = sConfig.GetStringDefault("Ra.IP", "0.0.0.0"); + uint16 raport = sConfig->GetIntDefault("Ra.Port", 3443); + std::string stringip = sConfig->GetStringDefault("Ra.IP", "0.0.0.0"); ACE_INET_Addr listen_addr(raport, stringip.c_str()); if (acceptor.open(listen_addr, m_Reactor) == -1) { - sLog.outError("Trinity RA can not bind to port %d on %s", raport, stringip.c_str()); + sLog->outError("Trinity RA can not bind to port %d on %s", raport, stringip.c_str()); return; } - sLog.outString("Starting Trinity RA on port %d on %s", raport, stringip.c_str()); + sLog->outString("Starting Trinity RA on port %d on %s", raport, stringip.c_str()); while (!World::IsStopped()) { @@ -89,5 +89,5 @@ void RARunnable::run() break; } - sLog.outStaticDebug("Trinity RA thread exiting"); + sLog->outStaticDebug("Trinity RA thread exiting"); } diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index ba49c9dcf57..4f32d8c0ef2 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -32,7 +32,7 @@ RASocket::RASocket() { - iMinLevel = sConfig.GetIntDefault("RA.MinLevel", 3); + iMinLevel = sConfig->GetIntDefault("RA.MinLevel", 3); } RASocket::~RASocket() @@ -45,18 +45,18 @@ int RASocket::open(void *) if (peer().get_remote_addr(remote_addr) == -1) { - sLog.outError("RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno)); + sLog->outError("RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno)); return -1; } - sLog.outRemote("Incoming connection from %s", remote_addr.get_host_addr()); + sLog->outRemote("Incoming connection from %s", remote_addr.get_host_addr()); return activate(); } int RASocket::handle_close(ACE_HANDLE, ACE_Reactor_Mask) { - sLog.outRemote("Closing connection"); + sLog->outRemote("Closing connection"); peer().close_reader(); wait(); destroy(); @@ -122,7 +122,7 @@ int RASocket::recv_line(std::string& out_line) if (recv_line(message_block) == -1) { - sLog.outRemote("Recv error %s", ACE_OS::strerror(errno)); + sLog->outRemote("Recv error %s", ACE_OS::strerror(errno)); return -1; } @@ -136,7 +136,7 @@ int RASocket::process_command(const std::string& command) if (command.length() == 0) return 0; - sLog.outRemote("Got command: %s", command.c_str()); + sLog->outRemote("Got command: %s", command.c_str()); // handle quit, exit and logout commands to terminate connection if (command == "quit" || command == "exit" || command == "logout") { @@ -145,7 +145,7 @@ int RASocket::process_command(const std::string& command) } CliCommandHolder* cmd = new CliCommandHolder(this, command.c_str(), &RASocket::zprint, &RASocket::commandFinished); - sWorld.QueueCliCommand(cmd); + sWorld->QueueCliCommand(cmd); // wait for result ACE_Message_Block* mb; @@ -183,7 +183,7 @@ int RASocket::check_access_level(const std::string& user) if (!result) { - sLog.outRemote("User %s does not exist in database", user.c_str()); + sLog->outRemote("User %s does not exist in database", user.c_str()); return -1; } @@ -191,12 +191,12 @@ int RASocket::check_access_level(const std::string& user) if (fields[1].GetUInt32() < iMinLevel) { - sLog.outRemote("User %s has no privilege to login", user.c_str()); + sLog->outRemote("User %s has no privilege to login", user.c_str()); return -1; } else if (fields[2].GetInt32() != -1) { - sLog.outRemote("User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str()); + sLog->outRemote("User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str()); return -1; } @@ -221,7 +221,7 @@ int RASocket::check_password(const std::string& user, const std::string& pass) if (!check) { - sLog.outRemote("Wrong password for user: %s", user.c_str()); + sLog->outRemote("Wrong password for user: %s", user.c_str()); return -1; } @@ -244,7 +244,7 @@ int RASocket::authenticate() if (recv_line(pass) == -1) return -1; - sLog.outRemote("Login attempt for user: %s", user.c_str()); + sLog->outRemote("Login attempt for user: %s", user.c_str()); if (check_access_level(user) == -1) return -1; @@ -252,7 +252,7 @@ int RASocket::authenticate() if (check_password(user, pass) == -1) return -1; - sLog.outRemote("User login: %s", user.c_str()); + sLog->outRemote("User login: %s", user.c_str()); return 0; } @@ -269,7 +269,7 @@ int RASocket::svc(void) } // send motd - if (send(std::string(sWorld.GetMotd()) + "\r\n") == -1) + if (send(std::string(sWorld->GetMotd()) + "\r\n") == -1) return -1; for(;;) @@ -304,7 +304,7 @@ void RASocket::zprint(void* callbackArg, const char * szText) if (socket->putq(mb, const_cast(&ACE_Time_Value::zero)) == -1) { - sLog.outRemote("Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno)); + sLog->outRemote("Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno)); mb->release(); } } @@ -325,7 +325,7 @@ void RASocket::commandFinished(void* callbackArg, bool /*success*/) if (socket->putq(mb) == -1) { // getting here is bad, command can't be marked as complete - sLog.outRemote("Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno)); + sLog->outRemote("Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno)); mb->release(); } } diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp index 2bdc4b49678..5bba822013f 100755 --- a/src/server/worldserver/TCSoap/TCSoap.cpp +++ b/src/server/worldserver/TCSoap/TCSoap.cpp @@ -38,18 +38,18 @@ void TCSoapRunnable::run() soap.send_timeout = 5; if (soap_bind(&soap, m_host.c_str(), m_port, 100) < 0) { - sLog.outError("TCSoap: couldn't bind to %s:%d", m_host.c_str(), m_port); + sLog->outError("TCSoap: couldn't bind to %s:%d", m_host.c_str(), m_port); exit(-1); } - sLog.outString("TCSoap: bound to http://%s:%d", m_host.c_str(), m_port); + sLog->outString("TCSoap: bound to http://%s:%d", m_host.c_str(), m_port); while(!World::IsStopped()) { if (soap_accept(&soap) < 0) continue; // ran into an accept timeout - sLog.outDebug("TCSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); + sLog->outDebug("TCSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); struct soap* thread_soap = soap_copy(&soap);// make a safe copy ACE_Message_Block *mb = new ACE_Message_Block(sizeof(struct soap*)); @@ -87,40 +87,40 @@ int ns1__executeCommand(soap* soap, char* command, char** result) // security check if (!soap->userid || !soap->passwd) { - sLog.outDebug("TCSoap: Client didn't provide login information"); + sLog->outDebug("TCSoap: Client didn't provide login information"); return 401; } uint32 accountId = sAccountMgr->GetId(soap->userid); if(!accountId) { - sLog.outDebug("TCSoap: Client used invalid username '%s'", soap->userid); + sLog->outDebug("TCSoap: Client used invalid username '%s'", soap->userid); return 401; } if(!sAccountMgr->CheckPassword(accountId, soap->passwd)) { - sLog.outDebug("TCSoap: invalid password for account '%s'", soap->userid); + sLog->outDebug("TCSoap: invalid password for account '%s'", soap->userid); return 401; } if(sAccountMgr->GetSecurity(accountId) < SEC_ADMINISTRATOR) { - sLog.outDebug("TCSoap: %s's gmlevel is too low", soap->userid); + sLog->outDebug("TCSoap: %s's gmlevel is too low", soap->userid); return 403; } if(!command || !*command) return soap_sender_fault(soap, "Command mustn't be empty", "The supplied command was an empty string"); - sLog.outDebug("TCSoap: got command '%s'", command); + sLog->outDebug("TCSoap: got command '%s'", command); SOAPCommand connection; // commands are executed in the world thread. We have to wait for them to be completed { // CliCommandHolder will be deleted from world, accessing after queueing is NOT save CliCommandHolder* cmd = new CliCommandHolder(&connection, command, &SOAPCommand::print, &SOAPCommand::commandFinished); - sWorld.QueueCliCommand(cmd); + sWorld->QueueCliCommand(cmd); } // wait for callback to complete command @@ -128,7 +128,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) int acc = connection.pendingCommands.acquire(); if(acc) { - sLog.outError("TCSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno); + sLog->outError("TCSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno); } // alright, command finished diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index bcb2cb6190b..48dd67a18e7 100755 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -56,7 +56,7 @@ void WorldRunnable::run() uint32 diff = getMSTimeDiff(realPrevTime,realCurrTime); - sWorld.Update( diff ); + sWorld->Update( diff ); realPrevTime = realCurrTime; // diff (D0) include time of previous sleep (d0) + tick time (t0) @@ -82,8 +82,8 @@ void WorldRunnable::run() sScriptMgr->OnShutdown(); - sWorld.KickAll(); // save and kick all players - sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call + sWorld->KickAll(); // save and kick all players + sWorld->UpdateSessions( 1 ); // real players unload required UpdateSessions call // unload battleground templates before different singletons destroyed sBattlegroundMgr->DeleteAllBattlegrounds(); -- cgit v1.2.3