diff options
| author | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
| commit | aaa6e73c8ca6d60e943cb964605536eb78219db2 (patch) | |
| tree | f5a0187925e646ef071d647efa7a5dac20501813 /src/server/game/Entities/GameObject | |
| parent | 825c697a764017349ca94ecfca8f30a8365666c0 (diff) | |
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
(cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3)
Diffstat (limited to 'src/server/game/Entities/GameObject')
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 7ea636fe75b..d893a357b85 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -197,8 +197,8 @@ void GameObject::RemoveFromOwner() } // This happens when a mage portal is despawned after the caster changes map (for example using the portal) - TC_LOG_DEBUG("misc", "Removed GameObject (%s Entry: %u SpellId: %u LinkedGO: %u) that just lost any reference to the owner (%s) GO list", - GetGUID().ToString().c_str(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), ownerGUID.ToString().c_str()); + TC_LOG_DEBUG("misc", "Removed GameObject ({} Entry: {} SpellId: {} LinkedGO: {}) that just lost any reference to the owner ({}) GO list", + GetGUID().ToString(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), ownerGUID.ToString()); SetOwnerGUID(ObjectGuid::Empty); } @@ -263,7 +263,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u m_stationaryPosition.Relocate(pos); if (!IsPositionValid()) { - TC_LOG_ERROR("misc", "Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, pos.GetPositionX(), pos.GetPositionY()); + TC_LOG_ERROR("misc", "Gameobject (GUID: {} Entry: {}) not created. Suggested coordinates isn't valid (X: {} Y: {})", guidlow, name_id, pos.GetPositionX(), pos.GetPositionY()); return false; } @@ -285,13 +285,13 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id); if (!goinfo) { - TC_LOG_ERROR("sql.sql", "Gameobject (GUID: %u Entry: %u) not created: non-existing entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f)", guidlow, name_id, map->GetId(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); + TC_LOG_ERROR("sql.sql", "Gameobject (GUID: {} Entry: {}) not created: non-existing entry in `gameobject_template`. Map: {} (X: {} Y: {} Z: {})", guidlow, name_id, map->GetId(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); return false; } if (goinfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT) { - TC_LOG_ERROR("sql.sql", "Gameobject (GUID: %u Entry: %u) not created: gameobject type GAMEOBJECT_TYPE_MO_TRANSPORT cannot be manually created.", guidlow, name_id); + TC_LOG_ERROR("sql.sql", "Gameobject (GUID: {} Entry: {}) not created: gameobject type GAMEOBJECT_TYPE_MO_TRANSPORT cannot be manually created.", guidlow, name_id); return false; } @@ -305,7 +305,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u if (goinfo->type >= MAX_GAMEOBJECT_TYPE) { - TC_LOG_ERROR("sql.sql", "Gameobject (GUID: %u Entry: %u) not created: non-existing GO type '%u' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type); + TC_LOG_ERROR("sql.sql", "Gameobject (GUID: {} Entry: {}) not created: non-existing GO type '{}' in `gameobject_template`. It will crash client if created.", guidlow, name_id, goinfo->type); return false; } @@ -517,7 +517,7 @@ void GameObject::Update(uint32 diff) G3D::Vector3 src(GetPositionX(), GetPositionY(), GetPositionZ()); - TC_LOG_DEBUG("misc", "Src: %s Dest: %s", src.toString().c_str(), pos.toString().c_str()); + TC_LOG_DEBUG("misc", "Src: {} Dest: {}", src.toString(), pos.toString()); GetMap()->GameObjectRelocation(this, pos.x, pos.y, pos.z, GetOrientation()); } @@ -1087,7 +1087,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap if (!data) { - TC_LOG_ERROR("sql.sql", "Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", spawnId); + TC_LOG_ERROR("sql.sql", "Gameobject (GUID: {}) not found in table `gameobject`, can't load. ", spawnId); return false; } @@ -1131,7 +1131,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap { if (!m_respawnCompatibilityMode) { - TC_LOG_WARN("sql.sql", "GameObject %u (SpawnID %u) is not spawned by default, but tries to use a non-hack spawn system. This will not work. Defaulting to compatibility mode.", entry, spawnId); + TC_LOG_WARN("sql.sql", "GameObject {} (SpawnID {}) is not spawned by default, but tries to use a non-hack spawn system. This will not work. Defaulting to compatibility mode.", entry, spawnId); m_respawnCompatibilityMode = true; } @@ -1480,7 +1480,7 @@ void GameObject::ActivateObject(GameObjectActions action, WorldObject* spellCast switch (action) { case GameObjectActions::None: - TC_LOG_FATAL("spell", "Spell %d has action type NONE in effect %d", spellId, effectIndex); + TC_LOG_FATAL("spell", "Spell {} has action type NONE in effect {}", spellId, effectIndex); break; case GameObjectActions::AnimateCustom0: case GameObjectActions::AnimateCustom1: @@ -1552,7 +1552,7 @@ void GameObject::ActivateObject(GameObjectActions action, WorldObject* spellCast artKitValue = templateAddon->artKits[artKitIndex]; if (artKitValue == 0) - TC_LOG_ERROR("sql.sql", "GameObject %d hit by spell %d needs `artkit%d` in `gameobject_template_addon`", GetEntry(), spellId, artKitIndex); + TC_LOG_ERROR("sql.sql", "GameObject {} hit by spell {} needs `artkit{}` in `gameobject_template_addon`", GetEntry(), spellId, artKitIndex); else SetGoArtKit(artKitValue); @@ -1562,7 +1562,7 @@ void GameObject::ActivateObject(GameObjectActions action, WorldObject* spellCast // No use cases, implementation unknown break; default: - TC_LOG_ERROR("spell", "Spell %d has unhandled action %d in effect %d", spellId, int32(action), effectIndex); + TC_LOG_ERROR("spell", "Spell {} has unhandled action {} in effect {}", spellId, int32(action), effectIndex); break; } } @@ -1767,7 +1767,7 @@ void GameObject::Use(Unit* user) if (info->goober.eventId) { - TC_LOG_DEBUG("maps.script", "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetSpawnId()); + TC_LOG_DEBUG("maps.script", "Goober ScriptStart id {} for GO entry {} (GUID {}).", info->goober.eventId, GetEntry(), GetSpawnId()); GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this); EventInform(info->goober.eventId, user); } @@ -1856,7 +1856,7 @@ void GameObject::Use(Unit* user) //provide error, no fishable zone or area should be 0 if (!zone_skill) - TC_LOG_ERROR("sql.sql", "Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone); + TC_LOG_ERROR("sql.sql", "Fishable areaId {} are not properly defined in `skill_fishing_base_level`.", subzone); int32 skill = player->GetSkillValue(SKILL_FISHING); @@ -1872,7 +1872,7 @@ void GameObject::Use(Unit* user) int32 roll = irand(1, 100); - TC_LOG_DEBUG("misc", "Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll); + TC_LOG_DEBUG("misc", "Fishing check (skill: {} zone min skill: {} chance {} roll: {}", skill, zone_skill, chance, roll); player->UpdateFishingSkill(); @@ -2185,8 +2185,8 @@ void GameObject::Use(Unit* user) } default: if (GetGoType() >= MAX_GAMEOBJECT_TYPE) - TC_LOG_ERROR("misc", "GameObject::Use(): unit (%s, name: %s) tries to use object (%s, name: %s) of unknown type (%u)", - user->GetGUID().ToString().c_str(), user->GetName().c_str(), GetGUID().ToString().c_str(), GetGOInfo()->name.c_str(), GetGoType()); + TC_LOG_ERROR("misc", "GameObject::Use(): unit ({}, name: {}) tries to use object ({}, name: {}) of unknown type ({})", + user->GetGUID().ToString(), user->GetName(), GetGUID().ToString(), GetGOInfo()->name, GetGoType()); break; } @@ -2196,9 +2196,9 @@ void GameObject::Use(Unit* user) if (!sSpellMgr->GetSpellInfo(spellId)) { if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this)) - TC_LOG_ERROR("misc", "WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType()); + TC_LOG_ERROR("misc", "WORLD: unknown spell id {} at use action for gameobject (Entry: {} GoType: {})", spellId, GetEntry(), GetGoType()); else - TC_LOG_DEBUG("outdoorpvp", "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); + TC_LOG_DEBUG("outdoorpvp", "WORLD: {} non-dbc spell was handled by OutdoorPvP", spellId); return; } |
