aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Scripting/ScriptMgr.cpp
diff options
context:
space:
mode:
authorXanadu <none@none>2010-06-22 02:53:04 +0200
committerXanadu <none@none>2010-06-22 02:53:04 +0200
commitc9b20170a34feeaae4d57c6feba374b653223824 (patch)
tree452f4dddd8c702e4e737891b5b93a630776b4903 /src/server/game/Scripting/ScriptMgr.cpp
parent06ef6e2553a76bd9be2562d89a1128e840a290c8 (diff)
Cleanup of logging - removed a few duplicit functions from olden times, fixed a typo.
--HG-- branch : trunk
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.cpp')
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index b41f6a215f8..88e5b7284c0 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -45,22 +45,22 @@ ScriptMgr::~ScriptMgr()
void ScriptMgr::ScriptsInit()
{
//Trinity Script startup
- /*outstring_log(" _____ _ _ _ ____ _ _");
- outstring_log("|_ _| __(_)_ __ (_) |_ _ _/ ___| ___ _ __(_)_ __ | |_ ");
- outstring_log(" | || '__| | '_ \\| | __| | | \\___ \\ / __| \'__| | \'_ \\| __|");
- outstring_log(" | || | | | | | | | |_| |_| |___) | (__| | | | |_) | |_ ");
- outstring_log(" |_||_| |_|_| |_|_|\\__|\\__, |____/ \\___|_| |_| .__/ \\__|");
- outstring_log(" |___/ |_| ");
- outstring_log("");
- outstring_log("");*/
+ /*sLog.outString(" _____ _ _ _ ____ _ _");
+ sLog.outString("|_ _| __(_)_ __ (_) |_ _ _/ ___| ___ _ __(_)_ __ | |_ ");
+ sLog.outString(" | || '__| | '_ \\| | __| | | \\___ \\ / __| \'__| | \'_ \\| __|");
+ sLog.outString(" | || | | | | | | | |_| |_| |___) | (__| | | | |_) | |_ ");
+ sLog.outString(" |_||_| |_|_| |_|_|\\__|\\__, |____/ \\___|_| |_| .__/ \\__|");
+ sLog.outString(" |___/ |_| ");
+ sLog.outString("");
+ sLog.outString("");*/
//Load database (must be called after SD2Config.SetSource).
LoadDatabase();
- outstring_log("Loading C++ scripts");
+ sLog.outString("Loading C++ scripts");
barGoLink bar(1);
bar.step();
- outstring_log("");
+ sLog.outString("");
for (uint16 i =0; i<MAX_SCRIPTS; ++i)
m_scripts[i]=NULL;
@@ -69,9 +69,9 @@ void ScriptMgr::ScriptsInit()
AddScripts();
- outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);
+ sLog.outString(">> Loaded %i C++ Scripts.", num_sc_scripts);
- outstring_log(">> Load Overriden SQL Data.");
+ sLog.outString(">> Load Overriden SQL Data.");
LoadOverridenSQLData();
}
@@ -82,13 +82,13 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
{
if (!pSource)
{
- error_log("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry);
+ sLog.outError("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry);
return;
}
if (iTextEntry >= 0)
{
- error_log("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;
}
@@ -96,11 +96,11 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
if (!pData)
{
- error_log("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;
}
- debug_log("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)
{
@@ -109,7 +109,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
pSource->SendPlaySound(pData->uiSoundId, false);
}
else
- error_log("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)
@@ -117,7 +117,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER)
((Unit*)pSource)->HandleEmoteCommand(pData->uiEmote);
else
- error_log("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)
@@ -139,7 +139,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID());
else
- error_log("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;
case CHAT_TYPE_BOSS_WHISPER:
@@ -147,7 +147,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget)
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true);
else
- error_log("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;
case CHAT_TYPE_ZONE_YELL:
@@ -165,7 +165,7 @@ void Script::RegisterSelf()
// somebody forgot to allocate memory for a script by a method like this: newscript = new Script
if (m_scripts[i] == this)
{
- error_log("ScriptName: '%s' - Forgot to allocate memory, so this script and/or the script before that can't work.", Name.c_str());
+ sLog.outError("ScriptName: '%s' - Forgot to allocate memory, so this script and/or the script before that can't work.", Name.c_str());
// don't register it
// and don't delete it because its memory is used for another script
return;
@@ -200,14 +200,14 @@ void Script::RegisterSelf()
else
{
// TODO: write a better error message than this one :)
- error_log("ScriptName: '%s' already assigned with the same ScriptName, so the script can't work.", Name.c_str());
+ sLog.outError("ScriptName: '%s' already assigned with the same ScriptName, so the script can't work.", Name.c_str());
delete this;
}
}
else
{
if (Name.find("example") == std::string::npos)
- error_db_log("TrinityScript: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str());
+ sLog.outErrorDb("TrinityScript: RegisterSelf, but script named %s does not have ScriptName assigned in database.",(this)->Name.c_str());
delete this;
}
}
@@ -326,7 +326,7 @@ bool ScriptMgr::GossipHello (Player * pPlayer, Creature* pCreature)
bool ScriptMgr::GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
- debug_log("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction);
+ sLog.outDebug("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction);
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pGossipSelect) return false;
@@ -337,7 +337,7 @@ bool ScriptMgr::GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSend
bool ScriptMgr::GossipSelectWithCode(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* sCode)
{
- debug_log("TSCR: Gossip selection with code, sender: %d, action: %d", uiSender, uiAction);
+ sLog.outDebug("TSCR: Gossip selection with code, sender: %d, action: %d", uiSender, uiAction);
Script *tmpscript = m_scripts[pCreature->GetScriptId()];
if (!tmpscript || !tmpscript->pGossipSelectWithCode) return false;
@@ -350,7 +350,7 @@ bool ScriptMgr::GOSelect(Player* pPlayer, GameObject* pGO, uint32 uiSender, uint
{
if (!pGO)
return false;
- debug_log("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction);
+ sLog.outDebug("TSCR: Gossip selection, sender: %d, action: %d", uiSender, uiAction);
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if (!tmpscript || !tmpscript->pGOSelect) return false;
@@ -363,7 +363,7 @@ bool ScriptMgr::GOSelectWithCode(Player* pPlayer, GameObject* pGO, uint32 uiSend
{
if (!pGO)
return false;
- debug_log("TSCR: Gossip selection, sender: %d, action: %d",uiSender, uiAction);
+ sLog.outDebug("TSCR: Gossip selection, sender: %d, action: %d",uiSender, uiAction);
Script *tmpscript = m_scripts[pGO->GetGOInfo()->ScriptId];
if (!tmpscript || !tmpscript->pGOSelectWithCode) return false;