From a9e325f6b7be8e884402ad87a5f97ec265dc4e82 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Sun, 5 Apr 2020 14:28:24 +0200 Subject: Core/Logs: Log full guid instead of just low guid, part 2 (cherry picked from commit 3def52c1c459f566ab2b2d8cf017c70df4d7cf22) --- src/server/game/Maps/MapScripts.cpp | 66 ++++++++++++++----------------------- 1 file changed, 25 insertions(+), 41 deletions(-) (limited to 'src/server/game/Maps/MapScripts.cpp') diff --git a/src/server/game/Maps/MapScripts.cpp b/src/server/game/Maps/MapScripts.cpp index 0e0a0993a0b..8c5b7a91efe 100644 --- a/src/server/game/Maps/MapScripts.cpp +++ b/src/server/game/Maps/MapScripts.cpp @@ -194,10 +194,8 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, ScriptInfo const* s if (!obj) TC_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); else if (!obj->isType(TYPEMASK_UNIT)) - { - TC_LOG_ERROR("scripts", "%s %s object is not unit (TypeId: %u, Entry: %u, %s), skipping.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s %s object is not unit %s, skipping.", + scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); else { unit = obj->ToUnit(); @@ -217,10 +215,8 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, ScriptInfo cons { player = obj->ToPlayer(); if (!player) - { - TC_LOG_ERROR("scripts", "%s %s object is not a player (TypeId: %u, Entry: %u, %s).", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s %s object is not a player %s.", + scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); } return player; } @@ -234,10 +230,8 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, ScriptInfo { creature = obj->ToCreature(); if (!creature) - { - TC_LOG_ERROR("scripts", "%s %s object is not a creature (TypeId: %u, Entry: %u, %s).", scriptInfo->GetDebugInfo().c_str(), - isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s %s object is not a creature %s.", scriptInfo->GetDebugInfo().c_str(), + isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); } return creature; } @@ -252,10 +246,8 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, Scrip { pWorldObject = dynamic_cast(obj); if (!pWorldObject) - { - TC_LOG_ERROR("scripts", "%s %s object is not a world object (TypeId: %u, Entry: %u, %s).", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s %s object is not a world object %s.", + scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); } return pWorldObject; } @@ -278,28 +270,22 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, ScriptInfo c else if (!source) TC_LOG_ERROR("scripts", "%s source object is NULL.", scriptInfo->GetDebugInfo().c_str()); else if (!source->isType(TYPEMASK_UNIT)) - { - TC_LOG_ERROR("scripts", "%s source object is not unit (TypeId: %u, Entry: %u, %s), skipping.", scriptInfo->GetDebugInfo().c_str(), - source->GetTypeId(), source->GetEntry(), source->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s source object is not unit %s, skipping.", scriptInfo->GetDebugInfo().c_str(), + source->GetGUID().ToString().c_str()); else { WorldObject* wSource = dynamic_cast (source); if (!wSource) - { - TC_LOG_ERROR("scripts", "%s source object could not be cast to world object (TypeId: %u, Entry: %u, %s), skipping.", - scriptInfo->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s source object could not be cast to world object %s, skipping.", + scriptInfo->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); else { GameObject* pDoor = _FindGameObject(wSource, guid); if (!pDoor) TC_LOG_ERROR("scripts", "%s gameobject was not found (guid: " UI64FMTD ").", scriptInfo->GetDebugInfo().c_str(), guid); else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR) - { - TC_LOG_ERROR("scripts", "%s gameobject is not a door (GoType: %u, Entry: %u, %s).", - scriptInfo->GetDebugInfo().c_str(), pDoor->GetGoType(), pDoor->GetEntry(), pDoor->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s gameobject is not a door (GoType: %u, %s).", + scriptInfo->GetDebugInfo().c_str(), pDoor->GetGoType(), pDoor->GetGUID().ToString().c_str()); else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY)) { pDoor->UseDoorOrButton(nTimeToToggle); @@ -513,8 +499,8 @@ void Map::ScriptsProcess() { if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER) { - TC_LOG_ERROR("scripts", "%s source is not unit, gameobject or player (TypeId: %u, Entry: %u, %s), skipping.", - step.script->GetDebugInfo().c_str(), source->GetTypeId(), source->GetEntry(), source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "%s source is not unit, gameobject or player %s, skipping.", + step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); break; } worldObject = dynamic_cast(source); @@ -526,17 +512,17 @@ void Map::ScriptsProcess() { if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER) { - TC_LOG_ERROR("scripts", "%s target is not unit, gameobject or player (TypeId: %u, Entry: %u, %s), skipping.", - step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "%s target is not unit, gameobject or player %s, skipping.", + step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str()); break; } worldObject = dynamic_cast(target); } else { - TC_LOG_ERROR("scripts", "%s neither source nor target is player (Entry: %u, GUID: %s; target: Entry: %u, GUID: %s), skipping.", - step.script->GetDebugInfo().c_str(), source->GetEntry(), source->GetGUID().ToString().c_str(), - target->GetEntry(), target->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "%s neither source nor target is player (source: %s; target: %s), skipping.", + step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str(), + target->GetGUID().ToString().c_str()); break; } } @@ -642,8 +628,8 @@ void Map::ScriptsProcess() if (target->GetTypeId() != TYPEID_GAMEOBJECT) { - TC_LOG_ERROR("scripts", "%s target object is not gameobject (TypeId: %u, Entry: %u, %s), skipping.", - step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "%s target object is not gameobject %s, skipping.", + step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str()); break; } @@ -823,10 +809,8 @@ void Map::ScriptsProcess() if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script)) { if (cSource->isDead()) - { - TC_LOG_ERROR("scripts", "%s creature is already dead (Entry: %u, %s)", - step.script->GetDebugInfo().c_str(), cSource->GetEntry(), cSource->GetGUID().ToString().c_str()); - } + TC_LOG_ERROR("scripts", "%s creature is already dead %s", + step.script->GetDebugInfo().c_str(), cSource->GetGUID().ToString().c_str()); else { cSource->setDeathState(JUST_DIED); -- cgit v1.2.3