refactor(Core/Logging): switch to fmt style for LOG_ (#10366)

* feat(Core/Common): add support fmt style for ASSERT and ABORT

* correct CheckCompactArrayMaskOverflow

* 1

* Update src/server/game/Spells/Spell.cpp

* rework logging

* add fmt replace logs

* logging

* FMT_LOG_

* settings

* fix startup

* 1

* 2

* 3

* 4

* 5

* fmt::print

* to fmt
This commit is contained in:
Kargatum
2022-01-27 22:44:41 +07:00
committed by GitHub
parent 5228d29379
commit 5969df4e30
211 changed files with 3689 additions and 3842 deletions

View File

@@ -102,7 +102,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
{
Player* player = nullptr;
if (!source && !target)
LOG_ERROR("maps.script", "%s source and target objects are nullptr.", scriptInfo->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} source and target objects are nullptr.", scriptInfo->GetDebugInfo());
else
{
// Check target first, then source.
@@ -112,7 +112,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
player = source->ToPlayer();
if (!player)
LOG_ERROR("maps.script", "%s neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %s; target: TypeId: %u, Entry: %u, GUID: %s), skipping.",
LOG_ERROR("maps.script", "{} neither source nor target object is player (source: TypeId: {}, Entry: {}, GUID: {}; target: TypeId: {}, Entry: {}, GUID: {}), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUID().ToString().c_str() : "",
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUID().ToString().c_str() : "");
@@ -124,7 +124,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
{
Creature* creature = nullptr;
if (!source && !target)
LOG_ERROR("maps.script", "%s source and target objects are nullptr.", scriptInfo->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} source and target objects are nullptr.", scriptInfo->GetDebugInfo());
else
{
if (bReverse)
@@ -145,7 +145,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
}
if (!creature)
LOG_ERROR("maps.script", "%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %s; target: TypeId: %u, Entry: %u, GUID: %s), skipping.",
LOG_ERROR("maps.script", "{} neither source nor target are creatures (source: TypeId: {}, Entry: {}, GUID: {}; target: TypeId: {}, Entry: {}, GUID: {}), skipping.",
scriptInfo->GetDebugInfo().c_str(),
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUID().ToString().c_str() : "",
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUID().ToString().c_str() : "");
@@ -157,16 +157,16 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, const ScriptInfo* s
{
Unit* unit = nullptr;
if (!obj)
LOG_ERROR("maps.script", "%s %s object is nullptr.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
LOG_ERROR("maps.script", "{} {} object is nullptr.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
else if (!obj->isType(TYPEMASK_UNIT))
LOG_ERROR("maps.script", "%s %s object is not unit (TypeId: %u, Entry: %u, GUID: %s), skipping.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} {} object is not unit (TypeId: {}, Entry: {}, GUID: {}), skipping.",
scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetTypeId(), obj->GetEntry(), obj->GetGUID().ToString());
else
{
unit = obj->ToUnit();
if (!unit)
LOG_ERROR("maps.script", "%s %s object could not be casted to unit.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
LOG_ERROR("maps.script", "{} {} object could not be casted to unit.",
scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
}
return unit;
}
@@ -175,13 +175,13 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, const ScriptInf
{
Player* player = nullptr;
if (!obj)
LOG_ERROR("maps.script", "%s %s object is nullptr.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
LOG_ERROR("maps.script", "{} {} object is nullptr.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
else
{
player = obj->ToPlayer();
if (!player)
LOG_ERROR("maps.script", "%s %s object is not a player (%s).",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} {} object is not a player ({}).",
scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString());
}
return player;
}
@@ -190,13 +190,13 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, const Scrip
{
Creature* creature = nullptr;
if (!obj)
LOG_ERROR("maps.script", "%s %s object is nullptr.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
LOG_ERROR("maps.script", "{} {} object is nullptr.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
else
{
creature = obj->ToCreature();
if (!creature)
LOG_ERROR("maps.script", "%s %s object is not a creature (%s).", scriptInfo->GetDebugInfo().c_str(),
isSource ? "source" : "target", obj->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} {} object is not a creature ({}).", scriptInfo->GetDebugInfo(),
isSource ? "source" : "target", obj->GetGUID().ToString());
}
return creature;
}
@@ -205,14 +205,14 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, const
{
WorldObject* pWorldObject = nullptr;
if (!obj)
LOG_ERROR("maps.script", "%s %s object is nullptr.",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target");
LOG_ERROR("maps.script", "{} {} object is nullptr.",
scriptInfo->GetDebugInfo(), isSource ? "source" : "target");
else
{
pWorldObject = dynamic_cast<WorldObject*>(obj);
if (!pWorldObject)
LOG_ERROR("maps.script", "%s %s object is not a world object (%s).",
scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} {} object is not a world object ({}).",
scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString());
}
return pWorldObject;
}
@@ -230,28 +230,28 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, const Script
case SCRIPT_COMMAND_CLOSE_DOOR:
break;
default:
LOG_ERROR("maps.script", "%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo());
return;
}
if (!guid)
LOG_ERROR("maps.script", "%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} door guid is not specified.", scriptInfo->GetDebugInfo());
else if (!source)
LOG_ERROR("maps.script", "%s source object is nullptr.", scriptInfo->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} source object is nullptr.", scriptInfo->GetDebugInfo());
else if (!source->isType(TYPEMASK_UNIT))
LOG_ERROR("maps.script", "%s source object is not unit (%s), skipping.", scriptInfo->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} source object is not unit ({}), skipping.", scriptInfo->GetDebugInfo(), source->GetGUID().ToString());
else
{
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
if (!wSource)
LOG_ERROR("maps.script", "%s source object could not be casted to world object (%s), skipping.", scriptInfo->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} source object could not be casted to world object ({}), skipping.", scriptInfo->GetDebugInfo(), source->GetGUID().ToString());
else
{
GameObject* pDoor = _FindGameObject(wSource, guid);
if (!pDoor)
LOG_ERROR("maps.script", "%s gameobject was not found (guid: %u).", scriptInfo->GetDebugInfo().c_str(), guid);
LOG_ERROR("maps.script", "{} gameobject was not found (guid: {}).", scriptInfo->GetDebugInfo(), guid);
else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR)
LOG_ERROR("maps.script", "%s gameobject is not a door (%s).",
scriptInfo->GetDebugInfo().c_str(), pDoor->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} gameobject is not a door ({}).",
scriptInfo->GetDebugInfo(), pDoor->GetGUID().ToString());
else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY))
{
pDoor->UseDoorOrButton(nTimeToToggle);
@@ -319,8 +319,8 @@ void Map::ScriptsProcess()
source = GetTransport(step.sourceGUID);
break;
default:
LOG_ERROR("maps.script", "%s source with unsupported high guid (%s).",
step.script->GetDebugInfo().c_str(), step.sourceGUID.ToString().c_str());
LOG_ERROR("maps.script", "{} source with unsupported high guid ({}).",
step.script->GetDebugInfo(), step.sourceGUID.ToString());
break;
}
}
@@ -351,8 +351,8 @@ void Map::ScriptsProcess()
target = GetTransport(step.targetGUID);
break;
default:
LOG_ERROR("maps.script", "%s target with unsupported high guid (%s).",
step.script->GetDebugInfo().c_str(), step.targetGUID.ToString().c_str());
LOG_ERROR("maps.script", "{} target with unsupported high guid ({}).",
step.script->GetDebugInfo(), step.targetGUID.ToString());
break;
}
}
@@ -363,7 +363,7 @@ void Map::ScriptsProcess()
{
if (step.script->Talk.ChatType > CHAT_TYPE_WHISPER && step.script->Talk.ChatType != CHAT_MSG_RAID_BOSS_WHISPER)
{
LOG_ERROR("maps.script", "%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType);
LOG_ERROR("maps.script", "{} invalid chat type ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->Talk.ChatType);
break;
}
@@ -381,7 +381,7 @@ void Map::ScriptsProcess()
Unit* sourceUnit = source->ToUnit();
if (!sourceUnit)
{
LOG_ERROR("scripts", "%s source object (%s) is not an unit, skipping.", step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str());
LOG_ERROR("scripts", "{} source object ({}) is not an unit, skipping.", step.script->GetDebugInfo(), source->GetGUID().ToString());
break;
}
@@ -402,7 +402,7 @@ void Map::ScriptsProcess()
{
Player* receiver = target ? target->ToPlayer() : nullptr;
if (!receiver)
LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str());
LOG_ERROR("scripts", "{} attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo());
else
sourceUnit->Whisper(step.script->Talk.TextID, receiver, step.script->Talk.ChatType == CHAT_MSG_RAID_BOSS_WHISPER);
break;
@@ -430,8 +430,8 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FieldSet.FieldID <= OBJECT_FIELD_ENTRY || step.script->FieldSet.FieldID >= cSource->GetValuesCount())
LOG_ERROR("maps.script", "%s wrong field %u (max count: %u) in object (%s) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FieldSet.FieldID, cSource->GetValuesCount(), cSource->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} wrong field {} (max count: {}) in object ({}) specified, skipping.",
step.script->GetDebugInfo(), step.script->FieldSet.FieldID, cSource->GetValuesCount(), cSource->GetGUID().ToString());
else
cSource->SetUInt32Value(step.script->FieldSet.FieldID, step.script->FieldSet.FieldValue);
}
@@ -458,8 +458,8 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
LOG_ERROR("maps.script", "%s wrong field %u (max count: %u) in object (%s) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID, cSource->GetValuesCount(), cSource->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} wrong field {} (max count: {}) in object ({}) specified, skipping.",
step.script->GetDebugInfo(), step.script->FlagToggle.FieldID, cSource->GetValuesCount(), cSource->GetGUID().ToString());
else
cSource->SetFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
}
@@ -471,8 +471,8 @@ void Map::ScriptsProcess()
{
// Validate field number.
if (step.script->FlagToggle.FieldID <= OBJECT_FIELD_ENTRY || step.script->FlagToggle.FieldID >= cSource->GetValuesCount())
LOG_ERROR("maps.script", "%s wrong field %u (max count: %u) in object (%s) specified, skipping.",
step.script->GetDebugInfo().c_str(), step.script->FlagToggle.FieldID, cSource->GetValuesCount(), cSource->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} wrong field {} (max count: {}) in object ({}) specified, skipping.",
step.script->GetDebugInfo(), step.script->FlagToggle.FieldID, cSource->GetValuesCount(), cSource->GetGUID().ToString());
else
cSource->RemoveFlag(step.script->FlagToggle.FieldID, step.script->FlagToggle.FieldValue);
}
@@ -497,12 +497,12 @@ void Map::ScriptsProcess()
{
if (!source)
{
LOG_ERROR("maps.script", "%s source object is nullptr.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} source object is nullptr.", step.script->GetDebugInfo());
break;
}
if (!target)
{
LOG_ERROR("maps.script", "%s target object is nullptr.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} target object is nullptr.", step.script->GetDebugInfo());
break;
}
@@ -513,7 +513,7 @@ void Map::ScriptsProcess()
{
if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
{
LOG_ERROR("maps.script", "%s source is not unit, gameobject or player (%s), skipping.", step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} source is not unit, gameobject or player ({}), skipping.", step.script->GetDebugInfo(), source->GetGUID().ToString());
break;
}
worldObject = dynamic_cast<WorldObject*>(source);
@@ -525,14 +525,14 @@ void Map::ScriptsProcess()
{
if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
{
LOG_ERROR("maps.script", "%s target is not unit, gameobject or player (%s), skipping.", step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} target is not unit, gameobject or player ({}), skipping.", step.script->GetDebugInfo(), target->GetGUID().ToString());
break;
}
worldObject = dynamic_cast<WorldObject*>(target);
}
else
{
LOG_ERROR("maps.script", "%s neither source nor target is player (source: %s; target: %s), skipping.",
LOG_ERROR("maps.script", "{} neither source nor target is player (source: {}; target: {}), skipping.",
step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str(), target->GetGUID().ToString().c_str());
break;
}
@@ -562,7 +562,7 @@ void Map::ScriptsProcess()
case SCRIPT_COMMAND_RESPAWN_GAMEOBJECT:
if (!step.script->RespawnGameobject.GOGuid)
{
LOG_ERROR("maps.script", "%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} gameobject guid (datalong) is not specified.", step.script->GetDebugInfo());
break;
}
@@ -572,7 +572,7 @@ void Map::ScriptsProcess()
GameObject* pGO = _FindGameObject(pSummoner, step.script->RespawnGameobject.GOGuid);
if (!pGO)
{
LOG_ERROR("maps.script", "%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid);
LOG_ERROR("maps.script", "{} gameobject was not found (guid: {}).", step.script->GetDebugInfo(), step.script->RespawnGameobject.GOGuid);
break;
}
@@ -581,8 +581,8 @@ void Map::ScriptsProcess()
pGO->GetGoType() == GAMEOBJECT_TYPE_BUTTON ||
pGO->GetGoType() == GAMEOBJECT_TYPE_TRAP)
{
LOG_ERROR("maps.script", "%s can not be used with gameobject of type %u (guid: %u).",
step.script->GetDebugInfo().c_str(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid);
LOG_ERROR("maps.script", "{} can not be used with gameobject of type {} (guid: {}).",
step.script->GetDebugInfo(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid);
break;
}
@@ -604,7 +604,7 @@ void Map::ScriptsProcess()
if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script))
{
if (!step.script->TempSummonCreature.CreatureEntry)
LOG_ERROR("maps.script", "%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} creature entry (datalong) is not specified.", step.script->GetDebugInfo());
else
{
uint32 entry = step.script->TempSummonCreature.CreatureEntry;
@@ -620,7 +620,7 @@ void Map::ScriptsProcess()
break;
if (!pSummoner->SummonCreature(entry, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, step.script->TempSummonCreature.DespawnDelay))
LOG_ERROR("maps.script", "%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry);
LOG_ERROR("maps.script", "{} creature was not spawned (entry: {}).", step.script->GetDebugInfo(), step.script->TempSummonCreature.CreatureEntry);
}
}
break;
@@ -638,13 +638,13 @@ void Map::ScriptsProcess()
// Target must be GameObject.
if (!target)
{
LOG_ERROR("maps.script", "%s target object is nullptr.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} target object is nullptr.", step.script->GetDebugInfo());
break;
}
if (target->GetTypeId() != TYPEID_GAMEOBJECT)
{
LOG_ERROR("maps.script", "%s target object is not gameobject (%s), skipping.", step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} target object is not gameobject ({}), skipping.", step.script->GetDebugInfo(), target->GetGUID().ToString());
break;
}
@@ -667,7 +667,7 @@ void Map::ScriptsProcess()
// TODO: Allow gameobjects to be targets and casters
if (!source && !target)
{
LOG_ERROR("maps.script", "%s source and target objects are nullptr.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} source and target objects are nullptr.", step.script->GetDebugInfo());
break;
}
@@ -700,13 +700,13 @@ void Map::ScriptsProcess()
if (!uSource || !uSource->isType(TYPEMASK_UNIT))
{
LOG_ERROR("maps.script", "%s no source unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
LOG_ERROR("maps.script", "{} no source unit found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID);
break;
}
if (!uTarget || !uTarget->isType(TYPEMASK_UNIT))
{
LOG_ERROR("maps.script", "%s no target unit found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID);
LOG_ERROR("maps.script", "{} no target unit found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID);
break;
}
@@ -766,7 +766,7 @@ void Map::ScriptsProcess()
if (Unit* unit = _GetScriptUnit(source, true, step.script))
{
if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID))
LOG_ERROR("maps.script", "%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID);
LOG_ERROR("maps.script", "{} source object has an invalid path ({}), skipping.", step.script->GetDebugInfo(), step.script->LoadPath.PathID);
else
unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable);
}
@@ -776,12 +776,12 @@ void Map::ScriptsProcess()
{
if (!step.script->CallScript.CreatureEntry)
{
LOG_ERROR("maps.script", "%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} creature entry is not specified, skipping.", step.script->GetDebugInfo());
break;
}
if (!step.script->CallScript.ScriptID)
{
LOG_ERROR("maps.script", "%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "{} script id is not specified, skipping.", step.script->GetDebugInfo());
break;
}
@@ -799,7 +799,7 @@ void Map::ScriptsProcess()
if (!cTarget)
{
LOG_ERROR("maps.script", "%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry);
LOG_ERROR("maps.script", "{} target was not found (entry: {})", step.script->GetDebugInfo(), step.script->CallScript.CreatureEntry);
break;
}
@@ -808,7 +808,7 @@ void Map::ScriptsProcess()
//if no scriptmap present...
if (!datamap)
{
LOG_ERROR("maps.script", "%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType);
LOG_ERROR("maps.script", "{} unknown scriptmap ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->CallScript.ScriptType);
break;
}
@@ -822,7 +822,7 @@ void Map::ScriptsProcess()
if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script))
{
if (cSource->isDead())
LOG_ERROR("maps.script", "%s creature is already dead (%s)", step.script->GetDebugInfo().c_str(), cSource->GetGUID().ToString().c_str());
LOG_ERROR("maps.script", "{} creature is already dead ({})", step.script->GetDebugInfo(), cSource->GetGUID().ToString());
else
{
cSource->setDeathState(JUST_DIED);
@@ -897,7 +897,7 @@ void Map::ScriptsProcess()
break;
default:
LOG_ERROR("maps.script", "Unknown script command %s.", step.script->GetDebugInfo().c_str());
LOG_ERROR("maps.script", "Unknown script command {}.", step.script->GetDebugInfo());
break;
}

View File

@@ -151,7 +151,7 @@ void ScriptMgr::LoadDatabase()
CheckIfScriptsInDatabaseExist();
LOG_INFO("server.loading", ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", ">> Loaded {} C++ scripts in {} ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", " ");
}
@@ -195,7 +195,7 @@ void ScriptMgr::CheckIfScriptsInDatabaseExist()
!ScriptRegistry<GroupScript>::GetScriptById(sid) &&
!ScriptRegistry<DatabaseScript>::GetScriptById(sid))
{
LOG_ERROR("sql.sql", "Script named '%s' is assigned in the database, but has no code!", scriptName.c_str());
LOG_ERROR("sql.sql", "Script named '{}' is assigned in the database, but has no code!", scriptName);
}
}
}

View File

@@ -294,7 +294,7 @@ public:
_mapEntry = sMapStore.LookupEntry(_mapId);
if (!_mapEntry)
LOG_ERROR("maps.script", "Invalid MapScript for %u; no such map ID.", _mapId);
LOG_ERROR("maps.script", "Invalid MapScript for {}; no such map ID.", _mapId);
}
// Gets the MapEntry structure associated with this script. Can return nullptr.
@@ -335,7 +335,7 @@ public:
checkMap();
if (GetEntry() && !GetEntry()->IsWorldMap())
LOG_ERROR("maps.script", "WorldMapScript for map %u is invalid.", GetEntry()->MapID);
LOG_ERROR("maps.script", "WorldMapScript for map {} is invalid.", GetEntry()->MapID);
}
};
@@ -352,7 +352,7 @@ public:
checkMap();
if (GetEntry() && !GetEntry()->IsDungeon())
LOG_ERROR("maps.script", "InstanceMapScript for map %u is invalid.", GetEntry()->MapID);
LOG_ERROR("maps.script", "InstanceMapScript for map {} is invalid.", GetEntry()->MapID);
}
// Gets an InstanceScript object for this instance.
@@ -372,7 +372,7 @@ public:
checkMap();
if (GetEntry() && !GetEntry()->IsBattleground())
LOG_ERROR("maps.script", "BattlegroundMapScript for map %u is invalid.", GetEntry()->MapID);
LOG_ERROR("maps.script", "BattlegroundMapScript for map {} is invalid.", GetEntry()->MapID);
}
};
@@ -2695,8 +2695,8 @@ public:
{
// The script uses a script name from database, but isn't assigned to anything.
if (script->GetName().find("Smart") == std::string::npos)
LOG_ERROR("sql.sql", "Script named '%s' is not assigned in the database.",
script->GetName().c_str());
LOG_ERROR("sql.sql", "Script named '{}' is not assigned in the database.",
script->GetName());
}
}
else
@@ -2729,8 +2729,8 @@ private:
{
if (it->second == script)
{
LOG_ERROR("scripts", "Script '%s' has same memory pointer as '%s'.",
script->GetName().c_str(), it->second->GetName().c_str());
LOG_ERROR("scripts", "Script '{}' has same memory pointer as '{}'.",
script->GetName(), it->second->GetName());
return false;
}

View File

@@ -41,7 +41,7 @@ void SystemMgr::LoadScriptWaypoints()
if (result)
uiCreatureCount = result->GetRowCount();
LOG_INFO("server.loading", "Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount);
LOG_INFO("server.loading", "Loading Script Waypoints for {} creature(s)...", uiCreatureCount);
// 0 1 2 3 4 5
result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid");
@@ -72,16 +72,16 @@ void SystemMgr::LoadScriptWaypoints()
if (!pCInfo)
{
LOG_ERROR("sql.sql", "DB table script_waypoint has waypoint for non-existant creature entry %u", temp.uiCreatureEntry);
LOG_ERROR("sql.sql", "DB table script_waypoint has waypoint for non-existant creature entry {}", temp.uiCreatureEntry);
continue;
}
if (!pCInfo->ScriptID)
LOG_ERROR("sql.sql", "DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
LOG_ERROR("sql.sql", "DB table script_waypoint has waypoint for creature entry {}, but creature does not have ScriptName defined and then useless.", temp.uiCreatureEntry);
m_mPointMoveMap[uiEntry].push_back(temp);
++count;
} while (result->NextRow());
LOG_INFO("server.loading", ">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", ">> Loaded {} Script Waypoint nodes in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
}