diff options
| author | Shauren <shauren.trinity@gmail.com> | 2023-01-08 21:16:53 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2023-01-08 21:16:53 +0100 |
| commit | d791afae1dfcfaf592326f787755ca32d629e4d3 (patch) | |
| tree | 54dc9916ede5800e110a2f0edff91530811fbdb8 /src/server/game/Maps | |
| parent | b6820a706f46f18b9652fcd9806e4bec8805d29d (diff) | |
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
Diffstat (limited to 'src/server/game/Maps')
| -rw-r--r-- | src/server/game/Maps/GridMap.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Maps/Map.cpp | 110 | ||||
| -rw-r--r-- | src/server/game/Maps/MapManager.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/Maps/MapScripts.cpp | 130 | ||||
| -rw-r--r-- | src/server/game/Maps/TerrainMgr.cpp | 40 | ||||
| -rw-r--r-- | src/server/game/Maps/TransportMgr.cpp | 26 |
6 files changed, 158 insertions, 158 deletions
diff --git a/src/server/game/Maps/GridMap.cpp b/src/server/game/Maps/GridMap.cpp index 5ffca166bba..247a22b5d89 100644 --- a/src/server/game/Maps/GridMap.cpp +++ b/src/server/game/Maps/GridMap.cpp @@ -108,7 +108,7 @@ GridMap::LoadResult GridMap::loadData(char const* filename) return LoadResult::Ok; } - TC_LOG_ERROR("maps", "Map file '%s' is from an incompatible map version (%.*s v%u), %.*s v%u is expected. Please pull your source, recompile tools and recreate maps using the updated mapextractor, then replace your old map files with new files. If you still have problems search on forum for error TCE00018.", + TC_LOG_ERROR("maps", "Map file '{}' is from an incompatible map version (%.*s v{}), %.*s v{} is expected. Please pull your source, recompile tools and recreate maps using the updated mapextractor, then replace your old map files with new files. If you still have problems search on forum for error TCE00018.", filename, 4, header.mapMagic.data(), header.versionMagic, 4, MapMagic.data(), MapVersionMagic); fclose(in); return LoadResult::InvalidFile; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 9b863c17cac..f4b6e27db81 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -269,7 +269,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on) CellCoord p = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); if (!p.IsCoordValid()) { - TC_LOG_ERROR("maps", "Map::SwitchGridContainers: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID().ToString().c_str(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord); + TC_LOG_ERROR("maps", "Map::SwitchGridContainers: Object {} has invalid coordinates X:{} Y:{} grid cell [{}:{}]", obj->GetGUID().ToString(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord); return; } @@ -283,7 +283,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on) uint32 const grid_x = cell.data.Part.grid_x; uint32 const grid_y = cell.data.Part.grid_y; - TC_LOG_DEBUG("maps", "Switch object %s from grid[%u, %u] %u", obj->GetGUID().ToString().c_str(), grid_x, grid_y, on); + TC_LOG_DEBUG("maps", "Switch object {} from grid[{}, {}] {}", obj->GetGUID().ToString(), grid_x, grid_y, on); } NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); @@ -328,7 +328,7 @@ void Map::EnsureGridCreated(GridCoord const& p) { if (!getNGrid(p.x_coord, p.y_coord)) { - TC_LOG_DEBUG("maps", "Creating grid[%u, %u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); + TC_LOG_DEBUG("maps", "Creating grid[{}, {}] for map {} instance {}", p.x_coord, p.y_coord, GetId(), i_InstanceId); NGridType* ngrid = 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(ngrid, p.x_coord, p.y_coord); @@ -359,7 +359,7 @@ void Map::EnsureGridLoadedForActiveObject(Cell const& cell, WorldObject const* o // refresh grid state & timer if (grid->GetGridState() != GRID_STATE_ACTIVE) { - TC_LOG_DEBUG("maps", "Active object %s triggers loading of grid [%u, %u] on map %u", object->GetGUID().ToString().c_str(), cell.GridX(), cell.GridY(), GetId()); + TC_LOG_DEBUG("maps", "Active object {} triggers loading of grid [{}, {}] on map {}", object->GetGUID().ToString(), cell.GridX(), cell.GridY(), GetId()); ResetGridExpiry(*grid, 0.1f); grid->SetGridState(GRID_STATE_ACTIVE); } @@ -374,7 +374,7 @@ bool Map::EnsureGridLoaded(Cell const& cell) ASSERT(grid != nullptr); if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) { - TC_LOG_DEBUG("maps", "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); + TC_LOG_DEBUG("maps", "Loading grid[{}, {}] for map {} instance {}", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); setGridObjectDataLoaded(true, cell.GridX(), cell.GridY()); @@ -431,7 +431,7 @@ bool Map::AddPlayerToMap(Player* player, bool initPlayer /*= true*/) CellCoord cellCoord = Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()); if (!cellCoord.IsCoordValid()) { - TC_LOG_ERROR("maps", "Map::Add: Player %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUID().ToString().c_str(), player->GetPositionX(), player->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); + TC_LOG_ERROR("maps", "Map::Add: Player {} has invalid coordinates X:{} Y:{} grid cell [{}:{}]", player->GetGUID().ToString(), player->GetPositionX(), player->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); return false; } @@ -543,7 +543,7 @@ bool Map::AddToMap(T* obj) ASSERT(cellCoord.IsCoordValid()); if (!cellCoord.IsCoordValid()) { - TC_LOG_ERROR("maps", "Map::Add: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID().ToString().c_str(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); + TC_LOG_ERROR("maps", "Map::Add: Object {} has invalid coordinates X:{} Y:{} grid cell [{}:{}]", obj->GetGUID().ToString(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); return false; //Should delete object } @@ -553,7 +553,7 @@ bool Map::AddToMap(T* obj) else EnsureGridCreated(GridCoord(cell.GridX(), cell.GridY())); AddToGrid(obj, cell); - TC_LOG_DEBUG("maps", "Object %s enters grid[%u, %u]", obj->GetGUID().ToString().c_str(), cell.GridX(), cell.GridY()); + TC_LOG_DEBUG("maps", "Object {} enters grid[{}, {}]", obj->GetGUID().ToString(), cell.GridX(), cell.GridY()); //Must already be set before AddToMap. Usually during obj->Create. //obj->SetMap(this); @@ -582,7 +582,7 @@ bool Map::AddToMap(Transport* obj) CellCoord cellCoord = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); if (!cellCoord.IsCoordValid()) { - TC_LOG_ERROR("maps", "Map::Add: Object %s has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUID().ToString().c_str(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); + TC_LOG_ERROR("maps", "Map::Add: Object {} has invalid coordinates X:{} Y:{} grid cell [{}:{}]", obj->GetGUID().ToString(), obj->GetPositionX(), obj->GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); return false; //Should delete object } @@ -997,8 +997,8 @@ template <typename T> Cell xy_cell(object->GetPositionX(), object->GetPositionY()); if (xy_cell != cur_cell) { - TC_LOG_DEBUG("maps", "%s %s X: %f Y: %f (%s) is in grid[%u, %u]cell[%u, %u] instead of grid[%u, %u]cell[%u, %u]", - objType, object->GetGUID().ToString().c_str(), + TC_LOG_DEBUG("maps", "{} {} X: {} Y: {} ({}) is in grid[{}, {}]cell[{}, {}] instead of grid[{}, {}]cell[{}, {}]", + objType, object->GetGUID().ToString(), object->GetPositionX(), object->GetPositionY(), (moved ? "final" : "original"), cur_cell.GridX(), cur_cell.GridY(), cur_cell.CellX(), cur_cell.CellY(), xy_cell.GridX(), xy_cell.GridY(), xy_cell.CellX(), xy_cell.CellY()); @@ -1021,7 +1021,7 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell)) { - TC_LOG_DEBUG("maps", "Player %s relocation grid[%u, %u]cell[%u, %u]->grid[%u, %u]cell[%u, %u]", player->GetName().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "Player {} relocation grid[{}, {}]cell[{}, {}]->grid[{}, {}]cell[{}, {}]", 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()); player->RemoveFromGrid(); @@ -1049,7 +1049,7 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "Creature %s added to moving list from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", creature->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "Creature {} added to moving list from grid[{}, {}]cell[{}, {}] to grid[{}, {}]cell[{}, {}].", creature->GetGUID().ToString(), 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 @@ -1081,7 +1081,7 @@ void Map::GameObjectRelocation(GameObject* go, float x, float y, float z, float if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "GameObject %s added to moving list from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", go->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "GameObject {} added to moving list from grid[{}, {}]cell[{}, {}] to grid[{}, {}]cell[{}, {}].", go->GetGUID().ToString(), 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 AddGameObjectToMoveList(go, x, y, z, orientation); // in diffcell/diffgrid case notifiers called at finishing move go in Map::MoveAllGameObjectsInMoveList @@ -1110,7 +1110,7 @@ void Map::DynamicObjectRelocation(DynamicObject* dynObj, float x, float y, float if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "GameObject %s added to moving list from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", dynObj->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "GameObject {} added to moving list from grid[{}, {}]cell[{}, {}] to grid[{}, {}]cell[{}, {}].", dynObj->GetGUID().ToString(), 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 AddDynamicObjectToMoveList(dynObj, x, y, z, orientation); // in diffcell/diffgrid case notifiers called at finishing move dynObj in Map::MoveAllGameObjectsInMoveList @@ -1140,7 +1140,7 @@ void Map::AreaTriggerRelocation(AreaTrigger* at, float x, float y, float z, floa if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "AreaTrigger (%s) added to moving list from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", at->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "AreaTrigger ({}) added to moving list from grid[{}, {}]cell[{}, {}] to grid[{}, {}]cell[{}, {}].", at->GetGUID().ToString(), 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 AddAreaTriggerToMoveList(at, x, y, z, orientation); // in diffcell/diffgrid case notifiers called at finishing move at in Map::MoveAllAreaTriggersInMoveList @@ -1270,7 +1270,7 @@ void Map::MoveAllCreaturesInMoveList() { // ... or unload (if respawn grid also not loaded) #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "Creature %s cannot be move to unloaded respawn grid.", c->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("maps", "Creature {} cannot be move to unloaded respawn grid.", c->GetGUID().ToString()); #endif //AddObjectToRemoveList(Pet*) should only be called in Pet::Remove //This may happen when a player just logs in and a pet moves to a nearby unloaded cell @@ -1323,7 +1323,7 @@ void Map::MoveAllGameObjectsInMoveList() { // ... or unload (if respawn grid also not loaded) #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "GameObject %s cannot be move to unloaded respawn grid.", go->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("maps", "GameObject {} cannot be move to unloaded respawn grid.", go->GetGUID().ToString()); #endif AddObjectToRemoveList(go); } @@ -1363,7 +1363,7 @@ void Map::MoveAllDynamicObjectsInMoveList() else { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "DynamicObject %s cannot be moved to unloaded grid.", dynObj->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("maps", "DynamicObject {} cannot be moved to unloaded grid.", dynObj->GetGUID().ToString()); #endif } } @@ -1402,7 +1402,7 @@ void Map::MoveAllAreaTriggersInMoveList() else { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "AreaTrigger %s cannot be moved to unloaded grid.", at->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("maps", "AreaTrigger {} cannot be moved to unloaded grid.", at->GetGUID().ToString()); #endif } } @@ -1421,7 +1421,7 @@ bool Map::MapObjectCellRelocation(T* object, Cell new_cell, [[maybe_unused]] cha if (old_cell.DiffCell(new_cell)) { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "%s %s moved in grid[%u, %u] from cell[%u, %u] to cell[%u, %u].", objType, object->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "{} {} moved in grid[{}, {}] from cell[{}, {}] to cell[{}, {}].", objType, object->GetGUID().ToString(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); #endif object->RemoveFromGrid(); @@ -1430,7 +1430,7 @@ bool Map::MapObjectCellRelocation(T* object, Cell new_cell, [[maybe_unused]] cha else { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "%s %s moved in same grid[%u, %u]cell[%u, %u].", objType, object->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); + TC_LOG_DEBUG("maps", "{} {} moved in same grid[{}, {}]cell[{}, {}].", objType, object->GetGUID().ToString(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); #endif } @@ -1443,7 +1443,7 @@ bool Map::MapObjectCellRelocation(T* object, Cell new_cell, [[maybe_unused]] cha EnsureGridLoadedForActiveObject(new_cell, object); #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "Active %s %s moved from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", objType, object->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "Active {} {} moved from grid[{}, {}]cell[{}, {}] to grid[{}, {}]cell[{}, {}].", objType, object->GetGUID().ToString(), 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 object->RemoveFromGrid(); @@ -1460,7 +1460,7 @@ bool Map::MapObjectCellRelocation(T* object, Cell new_cell, [[maybe_unused]] cha if (IsGridLoaded(GridCoord(new_cell.GridX(), new_cell.GridY()))) { #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "%s %s moved from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", objType, object->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "{} {} moved from grid[{}, {}]cell[{}, {}] to grid[{}, {}]cell[{}, {}].", objType, object->GetGUID().ToString(), 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 object->RemoveFromGrid(); @@ -1472,7 +1472,7 @@ bool Map::MapObjectCellRelocation(T* object, Cell new_cell, [[maybe_unused]] cha // fail to move: normal object attempt move to unloaded grid #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "%s %s attempted to move from grid[%u, %u]cell[%u, %u] to unloaded grid[%u, %u]cell[%u, %u].", objType, object->GetGUID().ToString().c_str(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + TC_LOG_DEBUG("maps", "{} {} attempted to move from grid[{}, {}]cell[{}, {}] to unloaded grid[{}, {}]cell[{}, {}].", objType, object->GetGUID().ToString(), 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; } @@ -1511,7 +1511,7 @@ bool Map::CreatureRespawnRelocation(Creature* c, bool diffGridOnly) c->GetMotionMaster()->Clear(); #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "Creature %s moved from grid[%u, %u]cell[%u, %u] to respawn grid[%u, %u]cell[%u, %u].", c->GetGUID().ToString().c_str(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); + TC_LOG_DEBUG("maps", "Creature {} moved from grid[{}, {}]cell[{}, {}] to respawn grid[{}, {}]cell[{}, {}].", c->GetGUID().ToString(), 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) @@ -1539,7 +1539,7 @@ bool Map::GameObjectRespawnRelocation(GameObject* go, bool diffGridOnly) return true; #ifdef TRINITY_DEBUG - TC_LOG_DEBUG("maps", "GameObject %s moved from grid[%u, %u]cell[%u, %u] to respawn grid[%u, %u]cell[%u, %u].", go->GetGUID().ToString().c_str(), go->GetCurrentCell().GridX(), go->GetCurrentCell().GridY(), go->GetCurrentCell().CellX(), go->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); + TC_LOG_DEBUG("maps", "GameObject {} moved from grid[{}, {}]cell[{}, {}] to respawn grid[{}, {}]cell[{}, {}].", go->GetGUID().ToString(), go->GetCurrentCell().GridX(), go->GetCurrentCell().GridY(), go->GetCurrentCell().CellX(), go->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) @@ -1570,7 +1570,7 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll) return false; } - TC_LOG_DEBUG("maps", "Unloading grid[%u, %u] for map %u", x, y, GetId()); + TC_LOG_DEBUG("maps", "Unloading grid[{}, {}] for map {}", x, y, GetId()); if (!unloadAll) { @@ -1618,7 +1618,7 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll) m_terrain->UnloadMap(gx, gy); - TC_LOG_DEBUG("maps", "Unloading grid[%u, %u] for map %u finished", x, y, GetId()); + TC_LOG_DEBUG("maps", "Unloading grid[{}, {}] for map {} finished", x, y, GetId()); return true; } @@ -1632,7 +1632,7 @@ void Map::RemoveAllPlayers() if (!player->IsBeingTeleportedFar()) { // this is happening for bg - TC_LOG_ERROR("maps", "Map::UnloadAll: player %s is still in map %u during unload, this should not happen!", player->GetName().c_str(), GetId()); + TC_LOG_ERROR("maps", "Map::UnloadAll: player {} is still in map {} during unload, this should not happen!", player->GetName(), GetId()); player->TeleportTo(player->m_homebind); } } @@ -1821,7 +1821,7 @@ char const* Map::GetMapName() const void Map::SendInitSelf(Player* player) { - TC_LOG_DEBUG("maps", "Creating player data for himself %s", player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("maps", "Creating player data for himself {}", player->GetGUID().ToString()); UpdateData data(player->GetMapId()); @@ -1916,7 +1916,7 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y) { if (x >= MAX_NUMBER_OF_GRIDS || y >= MAX_NUMBER_OF_GRIDS) { - TC_LOG_ERROR("maps", "map::setNGrid() Invalid grid coordinates found: %d, %d!", x, y); + TC_LOG_ERROR("maps", "map::setNGrid() Invalid grid coordinates found: {}, {}!", x, y); ABORT(); } i_grids[x][y] = grid; @@ -2054,7 +2054,7 @@ bool Map::AddRespawnInfo(RespawnInfo const& info) { if (!info.spawnId) { - TC_LOG_ERROR("maps", "Attempt to insert respawn info for zero spawn id (type %u)", uint32(info.type)); + TC_LOG_ERROR("maps", "Attempt to insert respawn info for zero spawn id (type {})", uint32(info.type)); return false; } @@ -2313,7 +2313,7 @@ bool Map::SpawnGroupSpawn(uint32 groupId, bool ignoreRespawn, bool force, std::v SpawnGroupTemplateData const* groupData = GetSpawnGroupData(groupId); if (!groupData || groupData->flags & SPAWNGROUP_FLAG_SYSTEM) { - TC_LOG_ERROR("maps", "Tried to spawn non-existing (or system) spawn group %u on map %u. Blocked.", groupId, GetId()); + TC_LOG_ERROR("maps", "Tried to spawn non-existing (or system) spawn group {} on map {}. Blocked.", groupId, GetId()); return false; } @@ -2402,7 +2402,7 @@ bool Map::SpawnGroupDespawn(uint32 groupId, bool deleteRespawnTimes, size_t* cou SpawnGroupTemplateData const* groupData = GetSpawnGroupData(groupId); if (!groupData || groupData->flags & SPAWNGROUP_FLAG_SYSTEM) { - TC_LOG_ERROR("maps", "Tried to despawn non-existing (or system) spawn group %u on map %u. Blocked.", groupId, GetId()); + TC_LOG_ERROR("maps", "Tried to despawn non-existing (or system) spawn group {} on map {}. Blocked.", groupId, GetId()); return false; } @@ -2425,7 +2425,7 @@ void Map::SetSpawnGroupActive(uint32 groupId, bool state) SpawnGroupTemplateData const* const data = GetSpawnGroupData(groupId); if (!data || data->flags & SPAWNGROUP_FLAG_SYSTEM) { - TC_LOG_ERROR("maps", "Tried to set non-existing (or system) spawn group %u to %s on map %u. Blocked.", groupId, state ? "active" : "inactive", GetId()); + TC_LOG_ERROR("maps", "Tried to set non-existing (or system) spawn group {} to {} on map {}. Blocked.", groupId, state ? "active" : "inactive", GetId()); return; } if (state != !(data->flags & SPAWNGROUP_FLAG_MANUAL_SPAWN)) // toggled @@ -2439,7 +2439,7 @@ bool Map::IsSpawnGroupActive(uint32 groupId) const SpawnGroupTemplateData const* const data = GetSpawnGroupData(groupId); if (!data) { - TC_LOG_ERROR("maps", "Tried to query state of non-existing spawn group %u on map %u.", groupId, GetId()); + TC_LOG_ERROR("maps", "Tried to query state of non-existing spawn group {} on map {}.", groupId, GetId()); return false; } if (data->flags & SPAWNGROUP_FLAG_SYSTEM) @@ -2577,7 +2577,7 @@ void Map::RemoveAllObjectsInRemoveList() { Corpse* corpse = ObjectAccessor::GetCorpse(*obj, obj->GetGUID()); if (!corpse) - TC_LOG_ERROR("maps", "Tried to delete corpse/bones %s that is not in map.", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("maps", "Tried to delete corpse/bones {} that is not in map.", obj->GetGUID().ToString()); else RemoveFromMap(corpse, true); break; @@ -2607,7 +2607,7 @@ void Map::RemoveAllObjectsInRemoveList() RemoveFromMap(obj->ToCreature(), true); break; default: - TC_LOG_ERROR("maps", "Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId()); + TC_LOG_ERROR("maps", "Non-grid object (TypeId: {}) is in grid object remove list, ignored.", obj->GetTypeId()); break; } @@ -2702,8 +2702,8 @@ void Map::AddToActive(WorldObject* obj) else { GridCoord p2 = Trinity::ComputeGridCoord(obj->GetPositionX(), obj->GetPositionY()); - TC_LOG_ERROR("maps", "Active object %s added to grid[%u, %u] but spawn grid[%u, %u] was not loaded.", - obj->GetGUID().ToString().c_str(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + TC_LOG_ERROR("maps", "Active object {} added to grid[{}, {}] but spawn grid[{}, {}] was not loaded.", + obj->GetGUID().ToString(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); } } } @@ -2741,8 +2741,8 @@ void Map::RemoveFromActive(WorldObject* obj) else { GridCoord p2 = Trinity::ComputeGridCoord(obj->GetPositionX(), obj->GetPositionY()); - TC_LOG_ERROR("maps", "Active object %s removed from to grid[%u, %u] but spawn grid[%u, %u] was not loaded.", - obj->GetGUID().ToString().c_str(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + TC_LOG_ERROR("maps", "Active object {} removed from to grid[{}, {}] but spawn grid[{}, {}] was not loaded.", + obj->GetGUID().ToString(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); } } } @@ -2809,7 +2809,7 @@ TransferAbortParams InstanceMap::CannotEnter(Player* player) { if (player->GetMapRef().getTarget() == this) { - TC_LOG_ERROR("maps", "InstanceMap::CannotEnter - player %s %s already in map %d, %d, %d!", player->GetName().c_str(), player->GetGUID().ToString().c_str(), GetId(), GetInstanceId(), GetDifficultyID()); + TC_LOG_ERROR("maps", "InstanceMap::CannotEnter - player {} {} already in map {}, {}, {}!", player->GetName(), player->GetGUID().ToString(), GetId(), GetInstanceId(), GetDifficultyID()); ABORT(); return TRANSFER_ABORT_ERROR; } @@ -2822,7 +2822,7 @@ TransferAbortParams InstanceMap::CannotEnter(Player* player) uint32 maxPlayers = GetMaxPlayers(); if (GetPlayersCountExceptGMs() >= maxPlayers) { - TC_LOG_WARN("maps", "MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName().c_str()); + TC_LOG_WARN("maps", "MAP: Instance '{}' of map '{}' cannot have more than '{}' players. Player '{}' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName()); return TRANSFER_ABORT_MAX_PLAYERS; } @@ -2870,7 +2870,7 @@ bool InstanceMap::AddPlayerToMap(Player* player, bool initPlayer /*= true*/) } } - TC_LOG_DEBUG("maps", "MAP: Player '%s' entered instance '%u' of map '%s'", player->GetName().c_str(), GetInstanceId(), GetMapName()); + TC_LOG_DEBUG("maps", "MAP: Player '{}' entered instance '{}' of map '{}'", player->GetName(), GetInstanceId(), GetMapName()); // initialize unload state m_unloadTimer = 0; @@ -2908,7 +2908,7 @@ void InstanceMap::Update(uint32 t_diff) void InstanceMap::RemovePlayerFromMap(Player* player, bool remove) { - TC_LOG_DEBUG("maps", "MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to another map", player->GetName().c_str(), GetInstanceId(), GetMapName()); + TC_LOG_DEBUG("maps", "MAP: Removing player '{}' from instance '{}' of map '{}' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName()); if (i_data) i_data->OnPlayerLeave(player); @@ -2956,7 +2956,7 @@ void InstanceMap::CreateInstanceData() i_data->SetEntranceLocation(lockData->EntranceWorldSafeLocId); if (!lockData->Data.empty()) { - TC_LOG_DEBUG("maps", "Loading instance data for `%s` with id %u", sObjectMgr->GetScriptName(i_script_id).c_str(), i_InstanceId); + TC_LOG_DEBUG("maps", "Loading instance data for `{}` with id {}", sObjectMgr->GetScriptName(i_script_id), i_InstanceId); i_data->Load(lockData->Data.c_str()); } else @@ -3289,7 +3289,7 @@ TransferAbortParams BattlegroundMap::CannotEnter(Player* player) { if (player->GetMapRef().getTarget() == this) { - TC_LOG_ERROR("maps", "BGMap::CannotEnter - player %s is already in map!", player->GetGUID().ToString().c_str()); + TC_LOG_ERROR("maps", "BGMap::CannotEnter - player {} is already in map!", player->GetGUID().ToString()); ABORT(); return TRANSFER_ABORT_ERROR; } @@ -3310,7 +3310,7 @@ bool BattlegroundMap::AddPlayerToMap(Player* player, bool initPlayer /*= true*/) void BattlegroundMap::RemovePlayerFromMap(Player* player, bool remove) { - TC_LOG_DEBUG("maps", "MAP: Removing player '%s' from bg '%u' of map '%s' before relocating to another map", player->GetName().c_str(), GetInstanceId(), GetMapName()); + TC_LOG_DEBUG("maps", "MAP: Removing player '{}' from bg '{}' of map '{}' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName()); Map::RemovePlayerFromMap(player, remove); } @@ -3430,7 +3430,7 @@ void Map::SaveRespawnTime(SpawnObjectType type, ObjectGuid::LowType spawnId, uin SpawnMetadata const* data = sObjectMgr->GetSpawnMetadata(type, spawnId); if (!data) { - TC_LOG_ERROR("maps", "Map %u attempt to save respawn time for nonexistant spawnid (%u," UI64FMTD ").", GetId(), type, spawnId); + TC_LOG_ERROR("maps", "Map {} attempt to save respawn time for nonexistant spawnid ({},{}).", GetId(), type, spawnId); return; } @@ -3452,7 +3452,7 @@ void Map::SaveRespawnTime(SpawnObjectType type, ObjectGuid::LowType spawnId, uin if (startup) { if (!success) - TC_LOG_ERROR("maps", "Attempt to load saved respawn %" PRIu64 " for (%u," UI64FMTD ") failed - duplicate respawn? Skipped.", respawnTime, uint32(type), spawnId); + TC_LOG_ERROR("maps", "Attempt to load saved respawn %" PRIu64 " for ({},{}) failed - duplicate respawn? Skipped.", respawnTime, uint32(type), spawnId); } else if (success) SaveRespawnInfoDB(ri, dbTrans); @@ -3494,11 +3494,11 @@ void Map::LoadRespawnTimes() if (SpawnData const* data = sObjectMgr->GetSpawnData(type, spawnId)) SaveRespawnTime(type, spawnId, data->id, time_t(respawnTime), Trinity::ComputeGridCoord(data->spawnPoint.GetPositionX(), data->spawnPoint.GetPositionY()).GetId(), nullptr, true); else - TC_LOG_ERROR("maps", "Loading saved respawn time of %" PRIu64 " for spawnid (%u," UI64FMTD ") - spawn does not exist, ignoring", respawnTime, uint32(type), spawnId); + TC_LOG_ERROR("maps", "Loading saved respawn time of %" PRIu64 " for spawnid ({},{}) - spawn does not exist, ignoring", respawnTime, uint32(type), spawnId); } else { - TC_LOG_ERROR("maps", "Loading saved respawn time of %" PRIu64 " for spawnid (%u," UI64FMTD ") - invalid spawn type, ignoring", respawnTime, uint32(type), spawnId); + TC_LOG_ERROR("maps", "Loading saved respawn time of %" PRIu64 " for spawnid ({},{}) - invalid spawn type, ignoring", respawnTime, uint32(type), spawnId); } } while (result->NextRow()); @@ -3595,7 +3595,7 @@ void Map::LoadCorpseData() ObjectGuid::LowType guid = fields[15].GetUInt64(); if (type >= MAX_CORPSE_TYPE || type == CORPSE_BONES) { - TC_LOG_ERROR("misc", "Corpse (guid: " UI64FMTD ") have wrong corpse type (%u), not loading.", guid, type); + TC_LOG_ERROR("misc", "Corpse (guid: {}) have wrong corpse type ({}), not loading.", guid, type); continue; } diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 5254559785e..fe9c950cc49 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -87,14 +87,14 @@ InstanceMap* MapManager::CreateInstance(uint32 mapId, uint32 instanceId, Instanc MapEntry const* entry = sMapStore.LookupEntry(mapId); if (!entry) { - TC_LOG_ERROR("maps", "CreateInstance: no entry for map %d", mapId); + TC_LOG_ERROR("maps", "CreateInstance: no entry for map {}", mapId); ABORT(); } // some instances only have one difficulty sDB2Manager.GetDownscaledMapDifficultyData(mapId, difficulty); - TC_LOG_DEBUG("maps", "MapInstanced::CreateInstance: %smap instance %d for %d created with difficulty %s", + TC_LOG_DEBUG("maps", "MapInstanced::CreateInstance: {}map instance {} for {} created with difficulty {}", instanceLock && instanceLock->GetInstanceId() ? "" : "new ", instanceId, mapId, sDifficultyStore.AssertEntry(difficulty)->Name[sWorld->GetDefaultDbcLocale()]); InstanceMap* map = new InstanceMap(mapId, i_gridCleanUpDelay, instanceId, difficulty, team, instanceLock); @@ -116,7 +116,7 @@ InstanceMap* MapManager::CreateInstance(uint32 mapId, uint32 instanceId, Instanc BattlegroundMap* MapManager::CreateBattleground(uint32 mapId, uint32 instanceId, Battleground* bg) { - TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", instanceId, mapId); + TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg {} for {} created.", instanceId, mapId); BattlegroundMap* map = new BattlegroundMap(mapId, i_gridCleanUpDelay, instanceId, DIFFICULTY_NONE); ASSERT(map->IsBattlegroundOrArena()); @@ -459,5 +459,5 @@ void MapManager::AddSC_BuiltInScripts() { for (MapEntry const* mapEntry : sMapStore) if (mapEntry->IsWorldMap() && mapEntry->IsSplitByFaction()) - new SplitByFactionMapScript(Trinity::StringFormat("world_map_set_faction_worldstates_%u", mapEntry->ID).c_str(), mapEntry->ID); + new SplitByFactionMapScript(Trinity::StringFormat("world_map_set_faction_worldstates_{}", mapEntry->ID).c_str(), mapEntry->ID); } diff --git a/src/server/game/Maps/MapScripts.cpp b/src/server/game/Maps/MapScripts.cpp index 0462967e1e6..8c88d07b81c 100644 --- a/src/server/game/Maps/MapScripts.cpp +++ b/src/server/game/Maps/MapScripts.cpp @@ -102,7 +102,7 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe { Player* player = nullptr; if (!source && !target) - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", 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) - TC_LOG_ERROR("scripts", "%s neither source nor target object is player (source: TypeId: %u, Entry: %u, %s; target: TypeId: %u, Entry: %u, %s), skipping.", + TC_LOG_ERROR("scripts", "{} neither source nor target object is player (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.", scriptInfo->GetDebugInfo().c_str(), source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(), target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str()); @@ -124,7 +124,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t { Creature* creature = nullptr; if (!source && !target) - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo()); else { if (bReverse) @@ -145,7 +145,7 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t } if (!creature) - TC_LOG_ERROR("scripts", "%s neither source nor target are creatures (source: TypeId: %u, Entry: %u, %s; target: TypeId: %u, Entry: %u, %s), skipping.", + TC_LOG_ERROR("scripts", "{} neither source nor target are creatures (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.", scriptInfo->GetDebugInfo().c_str(), source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(), target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str()); @@ -157,7 +157,7 @@ inline GameObject* Map::_GetScriptGameObjectSourceOrTarget(Object* source, Objec { GameObject* gameobject = nullptr; if (!source && !target) - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", scriptInfo->GetDebugInfo()); else { if (bReverse) @@ -178,7 +178,7 @@ inline GameObject* Map::_GetScriptGameObjectSourceOrTarget(Object* source, Objec } if (!gameobject) - TC_LOG_ERROR("scripts", "%s neither source nor target are gameobjects (source: TypeId: %u, Entry: %u, %s; target: TypeId: %u, Entry: %u, %s), skipping.", + TC_LOG_ERROR("scripts", "{} neither source nor target are gameobjects (source: TypeId: {}, Entry: {}, {}; target: TypeId: {}, Entry: {}, {}), skipping.", scriptInfo->GetDebugInfo().c_str(), source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, (source ? source->GetGUID() : ObjectGuid::Empty).ToString().c_str(), target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, (target ? target->GetGUID() : ObjectGuid::Empty).ToString().c_str()); @@ -190,16 +190,16 @@ inline Unit* Map::_GetScriptUnit(Object* obj, bool isSource, ScriptInfo const* s { Unit* unit = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else if (!obj->isType(TYPEMASK_UNIT)) - TC_LOG_ERROR("scripts", "%s %s object is not unit %s, skipping.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} {} object is not unit {}, skipping.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString()); else { unit = obj->ToUnit(); if (!unit) - TC_LOG_ERROR("scripts", "%s %s object could not be cast to unit.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object could not be cast to unit.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); } return unit; } @@ -208,13 +208,13 @@ inline Player* Map::_GetScriptPlayer(Object* obj, bool isSource, ScriptInfo cons { Player* player = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else { player = obj->ToPlayer(); if (!player) - TC_LOG_ERROR("scripts", "%s %s object is not a player %s.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} {} object is not a player {}.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString()); } return player; } @@ -223,13 +223,13 @@ inline Creature* Map::_GetScriptCreature(Object* obj, bool isSource, ScriptInfo { Creature* creature = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else { creature = obj->ToCreature(); if (!creature) - TC_LOG_ERROR("scripts", "%s %s object is not a creature %s.", scriptInfo->GetDebugInfo().c_str(), - isSource ? "source" : "target", obj->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} {} object is not a creature {}.", scriptInfo->GetDebugInfo(), + isSource ? "source" : "target", obj->GetGUID().ToString()); } return creature; } @@ -238,14 +238,14 @@ inline WorldObject* Map::_GetScriptWorldObject(Object* obj, bool isSource, Scrip { WorldObject* pWorldObject = nullptr; if (!obj) - TC_LOG_ERROR("scripts", "%s %s object is NULL.", - scriptInfo->GetDebugInfo().c_str(), isSource ? "source" : "target"); + TC_LOG_ERROR("scripts", "{} {} object is NULL.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target"); else { pWorldObject = dynamic_cast<WorldObject*>(obj); if (!pWorldObject) - 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()); + TC_LOG_ERROR("scripts", "{} {} object is not a world object {}.", + scriptInfo->GetDebugInfo(), isSource ? "source" : "target", obj->GetGUID().ToString()); } return pWorldObject; } @@ -260,30 +260,30 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, ScriptInfo c case SCRIPT_COMMAND_OPEN_DOOR: bOpen = true; break; case SCRIPT_COMMAND_CLOSE_DOOR: break; default: - TC_LOG_ERROR("scripts", "%s unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} unknown command for _ScriptProcessDoor.", scriptInfo->GetDebugInfo()); return; } if (!guid) - TC_LOG_ERROR("scripts", "%s door guid is not specified.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} door guid is not specified.", scriptInfo->GetDebugInfo()); else if (!source) - TC_LOG_ERROR("scripts", "%s source object is NULL.", scriptInfo->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source object is NULL.", scriptInfo->GetDebugInfo()); else if (!source->isType(TYPEMASK_UNIT)) - TC_LOG_ERROR("scripts", "%s source object is not unit %s, skipping.", scriptInfo->GetDebugInfo().c_str(), - source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source object is not unit {}, skipping.", scriptInfo->GetDebugInfo(), + source->GetGUID().ToString()); else { WorldObject* wSource = dynamic_cast <WorldObject*> (source); if (!wSource) - 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()); + TC_LOG_ERROR("scripts", "{} source object could not be cast to world object {}, skipping.", + scriptInfo->GetDebugInfo(), source->GetGUID().ToString()); else { GameObject* pDoor = _FindGameObject(wSource, guid); if (!pDoor) - TC_LOG_ERROR("scripts", "%s gameobject was not found (guid: " UI64FMTD ").", scriptInfo->GetDebugInfo().c_str(), guid); + TC_LOG_ERROR("scripts", "{} gameobject was not found (guid: {}).", scriptInfo->GetDebugInfo(), guid); else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR) - TC_LOG_ERROR("scripts", "%s gameobject is not a door (GoType: %u, %s).", - scriptInfo->GetDebugInfo().c_str(), pDoor->GetGoType(), pDoor->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} gameobject is not a door (GoType: {}, {}).", + scriptInfo->GetDebugInfo(), pDoor->GetGoType(), pDoor->GetGUID().ToString()); else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY)) { pDoor->UseDoorOrButton(nTimeToToggle); @@ -348,8 +348,8 @@ void Map::ScriptsProcess() source = GetCorpse(step.sourceGUID); break; default: - TC_LOG_ERROR("scripts", "%s source with unsupported high guid %s.", - step.script->GetDebugInfo().c_str(), step.sourceGUID.ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source with unsupported high guid {}.", + step.script->GetDebugInfo(), step.sourceGUID.ToString()); break; } } @@ -377,8 +377,8 @@ void Map::ScriptsProcess() target = GetCorpse(step.targetGUID); break; default: - TC_LOG_ERROR("scripts", "%s target with unsupported high guid %s.", - step.script->GetDebugInfo().c_str(), step.targetGUID.ToString().c_str()); + TC_LOG_ERROR("scripts", "{} target with unsupported high guid {}.", + step.script->GetDebugInfo(), step.targetGUID.ToString()); break; } } @@ -389,7 +389,7 @@ void Map::ScriptsProcess() { if (step.script->Talk.ChatType > CHAT_TYPE_BOSS_WHISPER) { - TC_LOG_ERROR("scripts", "%s invalid chat type (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->Talk.ChatType); + TC_LOG_ERROR("scripts", "{} invalid chat type ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->Talk.ChatType); break; } @@ -403,7 +403,7 @@ void Map::ScriptsProcess() Unit* sourceUnit = source->ToUnit(); if (!sourceUnit) { - TC_LOG_ERROR("scripts", "%s source object (%s) is not an unit, skipping.", step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source object ({}) is not an unit, skipping.", step.script->GetDebugInfo(), source->GetGUID().ToString()); break; } @@ -424,7 +424,7 @@ void Map::ScriptsProcess() { Player* receiver = target ? target->ToPlayer() : nullptr; if (!receiver) - TC_LOG_ERROR("scripts", "%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); + TC_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_TYPE_BOSS_WHISPER); break; @@ -481,12 +481,12 @@ void Map::ScriptsProcess() { if (!source) { - TC_LOG_ERROR("scripts", "%s source object is NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source object is NULL.", step.script->GetDebugInfo()); break; } if (!target) { - TC_LOG_ERROR("scripts", "%s target object is NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} target object is NULL.", step.script->GetDebugInfo()); break; } @@ -497,8 +497,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 %s, skipping.", - step.script->GetDebugInfo().c_str(), source->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} source is not unit, gameobject or player {}, skipping.", + step.script->GetDebugInfo(), source->GetGUID().ToString()); break; } worldObject = dynamic_cast<WorldObject*>(source); @@ -510,15 +510,15 @@ 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 %s, skipping.", - step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} target is not unit, gameobject or player {}, skipping.", + step.script->GetDebugInfo(), target->GetGUID().ToString()); break; } worldObject = dynamic_cast<WorldObject*>(target); } else { - TC_LOG_ERROR("scripts", "%s neither source nor target is player (source: %s; target: %s), skipping.", + TC_LOG_ERROR("scripts", "{} 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; @@ -551,7 +551,7 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_RESPAWN_GAMEOBJECT: if (!step.script->RespawnGameobject.GOGuid) { - TC_LOG_ERROR("scripts", "%s gameobject guid (datalong) is not specified.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} gameobject guid (datalong) is not specified.", step.script->GetDebugInfo()); break; } @@ -561,7 +561,7 @@ void Map::ScriptsProcess() GameObject* pGO = _FindGameObject(pSummoner, step.script->RespawnGameobject.GOGuid); if (!pGO) { - TC_LOG_ERROR("scripts", "%s gameobject was not found (guid: %u).", step.script->GetDebugInfo().c_str(), step.script->RespawnGameobject.GOGuid); + TC_LOG_ERROR("scripts", "{} gameobject was not found (guid: {}).", step.script->GetDebugInfo(), step.script->RespawnGameobject.GOGuid); break; } @@ -570,8 +570,8 @@ void Map::ScriptsProcess() pGO->GetGoType() == GAMEOBJECT_TYPE_BUTTON || pGO->GetGoType() == GAMEOBJECT_TYPE_TRAP) { - TC_LOG_ERROR("scripts", "%s can not be used with gameobject of type %u (guid: %u).", - step.script->GetDebugInfo().c_str(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid); + TC_LOG_ERROR("scripts", "{} can not be used with gameobject of type {} (guid: {}).", + step.script->GetDebugInfo(), uint32(pGO->GetGoType()), step.script->RespawnGameobject.GOGuid); break; } @@ -593,7 +593,7 @@ void Map::ScriptsProcess() if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script)) { if (!step.script->TempSummonCreature.CreatureEntry) - TC_LOG_ERROR("scripts", "%s creature entry (datalong) is not specified.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} creature entry (datalong) is not specified.", step.script->GetDebugInfo()); else { float x = step.script->TempSummonCreature.PosX; @@ -602,7 +602,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, Milliseconds(step.script->TempSummonCreature.DespawnDelay))) - TC_LOG_ERROR("scripts", "%s creature was not spawned (entry: %u).", step.script->GetDebugInfo().c_str(), step.script->TempSummonCreature.CreatureEntry); + TC_LOG_ERROR("scripts", "{} creature was not spawned (entry: {}).", step.script->GetDebugInfo(), step.script->TempSummonCreature.CreatureEntry); } } break; @@ -620,14 +620,14 @@ void Map::ScriptsProcess() // Target must be GameObject. if (!target) { - TC_LOG_ERROR("scripts", "%s target object is NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} target object is NULL.", step.script->GetDebugInfo()); break; } if (target->GetTypeId() != TYPEID_GAMEOBJECT) { - TC_LOG_ERROR("scripts", "%s target object is not gameobject %s, skipping.", - step.script->GetDebugInfo().c_str(), target->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} target object is not gameobject {}, skipping.", + step.script->GetDebugInfo(), target->GetGUID().ToString()); break; } @@ -649,7 +649,7 @@ void Map::ScriptsProcess() { if (!source && !target) { - TC_LOG_ERROR("scripts", "%s source and target objects are NULL.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} source and target objects are NULL.", step.script->GetDebugInfo()); break; } @@ -682,13 +682,13 @@ void Map::ScriptsProcess() if (!uSource) { - TC_LOG_ERROR("scripts", "%s no source worldobject found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID); + TC_LOG_ERROR("scripts", "{} no source worldobject found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID); break; } if (!uTarget) { - TC_LOG_ERROR("scripts", "%s no target worldobject found for spell %u", step.script->GetDebugInfo().c_str(), step.script->CastSpell.SpellID); + TC_LOG_ERROR("scripts", "{} no target worldobject found for spell {}", step.script->GetDebugInfo(), step.script->CastSpell.SpellID); break; } @@ -750,7 +750,7 @@ void Map::ScriptsProcess() if (Unit* unit = _GetScriptUnit(source, true, step.script)) { if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID)) - TC_LOG_ERROR("scripts", "%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID); + TC_LOG_ERROR("scripts", "{} 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 != 0); } @@ -760,12 +760,12 @@ void Map::ScriptsProcess() { if (!step.script->CallScript.CreatureEntry) { - TC_LOG_ERROR("scripts", "%s creature entry is not specified, skipping.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} creature entry is not specified, skipping.", step.script->GetDebugInfo()); break; } if (!step.script->CallScript.ScriptID) { - TC_LOG_ERROR("scripts", "%s script id is not specified, skipping.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "{} script id is not specified, skipping.", step.script->GetDebugInfo()); break; } @@ -784,7 +784,7 @@ void Map::ScriptsProcess() if (!cTarget) { - TC_LOG_ERROR("scripts", "%s target was not found (entry: %u)", step.script->GetDebugInfo().c_str(), step.script->CallScript.CreatureEntry); + TC_LOG_ERROR("scripts", "{} target was not found (entry: {})", step.script->GetDebugInfo(), step.script->CallScript.CreatureEntry); break; } @@ -793,7 +793,7 @@ void Map::ScriptsProcess() //if no scriptmap present... if (!datamap) { - TC_LOG_ERROR("scripts", "%s unknown scriptmap (%u) specified, skipping.", step.script->GetDebugInfo().c_str(), step.script->CallScript.ScriptType); + TC_LOG_ERROR("scripts", "{} unknown scriptmap ({}) specified, skipping.", step.script->GetDebugInfo(), step.script->CallScript.ScriptType); break; } @@ -807,8 +807,8 @@ void Map::ScriptsProcess() if (Creature* cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script)) { if (cSource->isDead()) - TC_LOG_ERROR("scripts", "%s creature is already dead %s", - step.script->GetDebugInfo().c_str(), cSource->GetGUID().ToString().c_str()); + TC_LOG_ERROR("scripts", "{} creature is already dead {}", + step.script->GetDebugInfo(), cSource->GetGUID().ToString()); else { cSource->setDeathState(JUST_DIED); @@ -888,7 +888,7 @@ void Map::ScriptsProcess() break; default: - TC_LOG_ERROR("scripts", "Unknown script command %s.", step.script->GetDebugInfo().c_str()); + TC_LOG_ERROR("scripts", "Unknown script command {}.", step.script->GetDebugInfo()); break; } diff --git a/src/server/game/Maps/TerrainMgr.cpp b/src/server/game/Maps/TerrainMgr.cpp index cbab36ca703..b811f24a821 100644 --- a/src/server/game/Maps/TerrainMgr.cpp +++ b/src/server/game/Maps/TerrainMgr.cpp @@ -49,7 +49,7 @@ char const* TerrainInfo::GetMapName() const void TerrainInfo::DiscoverGridMapFiles() { - std::string tileListName = Trinity::StringFormat("%smaps/%04u.tilelist", sWorld->GetDataPath().c_str(), GetId()); + std::string tileListName = Trinity::StringFormat("{}maps/{:04}.tilelist", sWorld->GetDataPath(), GetId()); // tile list is optional if (auto tileList = Trinity::make_unique_ptr_with_deleter(fopen(tileListName.c_str(), "rb"), &::fclose)) { @@ -76,7 +76,7 @@ void TerrainInfo::DiscoverGridMapFiles() bool TerrainInfo::ExistMap(uint32 mapid, int32 gx, int32 gy, bool log /*= true*/) { - std::string fileName = Trinity::StringFormat("%smaps/%04u_%02u_%02u.map", sWorld->GetDataPath().c_str(), mapid, gx, gy); + std::string fileName = Trinity::StringFormat("{}maps/{:04}_{:02}_{:02}.map", sWorld->GetDataPath(), mapid, gx, gy); bool ret = false; auto file = Trinity::make_unique_ptr_with_deleter(fopen(fileName.c_str(), "rb"), &::fclose); @@ -84,8 +84,8 @@ bool TerrainInfo::ExistMap(uint32 mapid, int32 gx, int32 gy, bool log /*= true*/ { if (log) { - TC_LOG_ERROR("maps", "Map file '%s' does not exist!", fileName.c_str()); - TC_LOG_ERROR("maps", "Please place MAP-files (*.map) in the appropriate directory (%s), or correct the DataDir setting in your worldserver.conf file.", (sWorld->GetDataPath() + "maps/").c_str()); + TC_LOG_ERROR("maps", "Map file '{}' does not exist!", fileName); + TC_LOG_ERROR("maps", "Please place MAP-files (*.map) in the appropriate directory ({}), or correct the DataDir setting in your worldserver.conf file.", (sWorld->GetDataPath() + "maps/")); } } else @@ -96,8 +96,8 @@ bool TerrainInfo::ExistMap(uint32 mapid, int32 gx, int32 gy, bool log /*= true*/ if (header.mapMagic != MapMagic || header.versionMagic != MapVersionMagic) { if (log) - TC_LOG_ERROR("maps", "Map file '%s' is from an incompatible map version (%.*s v%u), %.*s v%u is expected. Please pull your source, recompile tools and recreate maps using the updated mapextractor, then replace your old map files with new files. If you still have problems search on forum for error TCE00018.", - fileName.c_str(), 4, header.mapMagic.data(), header.versionMagic, 4, MapMagic.data(), MapVersionMagic); + TC_LOG_ERROR("maps", "Map file '{}' is from an incompatible map version (%.*s v{}), %.*s v{} is expected. Please pull your source, recompile tools and recreate maps using the updated mapextractor, then replace your old map files with new files. If you still have problems search on forum for error TCE00018.", + fileName, 4, header.mapMagic.data(), header.versionMagic, 4, MapMagic.data(), MapVersionMagic); } else ret = true; @@ -120,19 +120,19 @@ bool TerrainInfo::ExistVMap(uint32 mapid, int32 gx, int32 gy) case VMAP::LoadResult::Success: break; case VMAP::LoadResult::FileNotFound: - TC_LOG_ERROR("maps", "VMap file '%s' does not exist", (sWorld->GetDataPath() + "vmaps/" + name).c_str()); - TC_LOG_ERROR("maps", "Please place VMAP files (*.vmtree and *.vmtile) in the vmap directory (%s), or correct the DataDir setting in your worldserver.conf file.", (sWorld->GetDataPath() + "vmaps/").c_str()); + TC_LOG_ERROR("maps", "VMap file '{}' does not exist", (sWorld->GetDataPath() + "vmaps/" + name)); + TC_LOG_ERROR("maps", "Please place VMAP files (*.vmtree and *.vmtile) in the vmap directory ({}), or correct the DataDir setting in your worldserver.conf file.", (sWorld->GetDataPath() + "vmaps/")); return false; case VMAP::LoadResult::VersionMismatch: - TC_LOG_ERROR("maps", "VMap file '%s' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name).c_str()); + TC_LOG_ERROR("maps", "VMap file '{}' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name)); TC_LOG_ERROR("maps", "This is because the version of the VMap file and the version of this module are different, please re-extract the maps with the tools compiled with this module."); return false; case VMAP::LoadResult::ReadFromFileFailed: - TC_LOG_ERROR("maps", "VMap file '%s' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name).c_str()); + TC_LOG_ERROR("maps", "VMap file '{}' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name)); TC_LOG_ERROR("maps", "This is because VMAP files are corrupted, please re-extract the maps with the tools compiled with this module."); return false; case VMAP::LoadResult::DisabledInConfig: - TC_LOG_ERROR("maps", "VMap file '%s' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name).c_str()); + TC_LOG_ERROR("maps", "VMap file '{}' couldn't be loaded", (sWorld->GetDataPath() + "vmaps/" + name)); TC_LOG_ERROR("maps", "This is because VMAP is disabled in config file."); return false; } @@ -184,8 +184,8 @@ void TerrainInfo::LoadMap(int32 gx, int32 gy) return; // map file name - std::string fileName = Trinity::StringFormat("%smaps/%04u_%02u_%02u.map", sWorld->GetDataPath().c_str(), GetId(), gx, gy); - TC_LOG_DEBUG("maps", "Loading map %s", fileName.c_str()); + std::string fileName = Trinity::StringFormat("{}maps/{:04}_{:02}_{:02}.map", sWorld->GetDataPath(), GetId(), gx, gy); + TC_LOG_DEBUG("maps", "Loading map {}", fileName); // loading data std::unique_ptr<GridMap> gridMap = std::make_unique<GridMap>(); GridMap::LoadResult gridMapLoadResult = gridMap->loadData(fileName.c_str()); @@ -195,7 +195,7 @@ void TerrainInfo::LoadMap(int32 gx, int32 gy) _gridFileExists[GetBitsetIndex(gx, gy)] = false; if (gridMapLoadResult == GridMap::LoadResult::InvalidFile) - TC_LOG_ERROR("maps", "Error loading map file: %s", fileName.c_str()); + TC_LOG_ERROR("maps", "Error loading map file: {}", fileName); } void TerrainInfo::LoadVMap(int32 gx, int32 gy) @@ -207,14 +207,14 @@ void TerrainInfo::LoadVMap(int32 gx, int32 gy) switch (vmapLoadResult) { case VMAP::LoadResult::Success: - TC_LOG_DEBUG("maps", "VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); + TC_LOG_DEBUG("maps", "VMAP loaded name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); break; case VMAP::LoadResult::VersionMismatch: case VMAP::LoadResult::ReadFromFileFailed: - TC_LOG_ERROR("maps", "Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); + TC_LOG_ERROR("maps", "Could not load VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); break; case VMAP::LoadResult::DisabledInConfig: - TC_LOG_DEBUG("maps", "Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); + TC_LOG_DEBUG("maps", "Ignored VMAP name:{}, id:{}, x:{}, y:{} (vmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); break; default: break; @@ -229,9 +229,9 @@ void TerrainInfo::LoadMMap(int32 gx, int32 gy) bool mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap(sWorld->GetDataPath(), GetId(), gx, gy); if (mmapLoadResult) - TC_LOG_DEBUG("mmaps.tiles", "MMAP loaded name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); + TC_LOG_DEBUG("mmaps.tiles", "MMAP loaded name:{}, id:{}, x:{}, y:{} (mmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); else - TC_LOG_WARN("mmaps.tiles", "Could not load MMAP name:%s, id:%d, x:%d, y:%d (mmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); + TC_LOG_WARN("mmaps.tiles", "Could not load MMAP name:{}, id:{}, x:{}, y:{} (mmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); } void TerrainInfo::UnloadMap(int32 gx, int32 gy) @@ -453,7 +453,7 @@ ZLiquidStatus TerrainInfo::GetLiquidStatus(PhaseShift const& phaseShift, uint32 if (vmgr->GetLiquidLevel(terrainMapId, x, y, z, AsUnderlyingType(ReqLiquidType), liquid_level, ground_level, liquid_type, mogpFlags)) { useGridLiquid = !IsInWMOInterior(mogpFlags); - TC_LOG_DEBUG("maps", "GetLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); + TC_LOG_DEBUG("maps", "GetLiquidStatus(): vmap liquid level: {} ground: {} type: {}", liquid_level, ground_level, liquid_type); // Check water level and ground level if (liquid_level > ground_level && G3D::fuzzyGe(z, ground_level - GROUND_HEIGHT_TOLERANCE)) { diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp index 5c597960fc6..58b8b7f6342 100644 --- a/src/server/game/Maps/TransportMgr.cpp +++ b/src/server/game/Maps/TransportMgr.cpp @@ -210,13 +210,13 @@ void TransportMgr::LoadTransportTemplates() GameObjectTemplate const* goInfo = sObjectMgr->GetGameObjectTemplate(entry); if (goInfo == nullptr) { - TC_LOG_ERROR("sql.sql", "Transport %u has no associated GameObjectTemplate from `gameobject_template` , skipped.", entry); + TC_LOG_ERROR("sql.sql", "Transport {} has no associated GameObjectTemplate from `gameobject_template` , skipped.", entry); continue; } if (goInfo->moTransport.taxiPathID >= sTaxiPathNodesByPath.size()) { - TC_LOG_ERROR("sql.sql", "Transport %u (name: %s) has an invalid path specified in `gameobject_template`.`Data0` (%u) field, skipped.", entry, goInfo->name.c_str(), goInfo->moTransport.taxiPathID); + TC_LOG_ERROR("sql.sql", "Transport {} (name: {}) has an invalid path specified in `gameobject_template`.`Data0` ({}) field, skipped.", entry, goInfo->name, goInfo->moTransport.taxiPathID); continue; } @@ -231,7 +231,7 @@ void TransportMgr::LoadTransportTemplates() ++count; } while (result->NextRow()); - TC_LOG_INFO("server.loading", ">> Loaded %u transport templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO("server.loading", ">> Loaded {} transport templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); } void TransportMgr::LoadTransportAnimationAndRotation() @@ -267,26 +267,26 @@ void TransportMgr::LoadTransportSpawns() TransportTemplate const* transportTemplate = GetTransportTemplate(entry); if (!transportTemplate) { - TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: " UI64FMTD " Entry: %u) with unknown gameobject `entry` set, skipped.", guid, entry); + TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: {} Entry: {}) with unknown gameobject `entry` set, skipped.", guid, entry); continue; } if (phaseUseFlags & ~PHASE_USE_FLAGS_ALL) { - TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: " UI64FMTD " Entry: %u) with unknown `phaseUseFlags` set, removed unknown value.", guid, entry); + TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: {} Entry: {}) with unknown `phaseUseFlags` set, removed unknown value.", guid, entry); phaseUseFlags &= PHASE_USE_FLAGS_ALL; } if (phaseUseFlags & PHASE_USE_FLAGS_ALWAYS_VISIBLE && phaseUseFlags & PHASE_USE_FLAGS_INVERSE) { - TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: " UI64FMTD " Entry: %u) has both `phaseUseFlags` PHASE_USE_FLAGS_ALWAYS_VISIBLE and PHASE_USE_FLAGS_INVERSE," + TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: {} Entry: {}) has both `phaseUseFlags` PHASE_USE_FLAGS_ALWAYS_VISIBLE and PHASE_USE_FLAGS_INVERSE," " removing PHASE_USE_FLAGS_INVERSE.", guid, entry); phaseUseFlags &= ~PHASE_USE_FLAGS_INVERSE; } if (phaseGroupId && phaseId) { - TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: " UI64FMTD " Entry: %u) with both `phaseid` and `phasegroup` set, `phasegroup` set to 0", guid, entry); + TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: {} Entry: {}) with both `phaseid` and `phasegroup` set, `phasegroup` set to 0", guid, entry); phaseGroupId = 0; } @@ -294,7 +294,7 @@ void TransportMgr::LoadTransportSpawns() { if (!sPhaseStore.LookupEntry(phaseId)) { - TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: " UI64FMTD " Entry: %u) with `phaseid` %u does not exist, set to 0", guid, entry, phaseId); + TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: {} Entry: {}) with `phaseid` {} does not exist, set to 0", guid, entry, phaseId); phaseId = 0; } } @@ -303,7 +303,7 @@ void TransportMgr::LoadTransportSpawns() { if (!sDB2Manager.GetPhasesForGroup(phaseGroupId)) { - TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: " UI64FMTD " Entry: %u) with `phaseGroup` %u does not exist, set to 0", guid, entry, phaseGroupId); + TC_LOG_ERROR("sql.sql", "Table `transports` have transport (GUID: {} Entry: {}) with `phaseGroup` {} does not exist, set to 0", guid, entry, phaseGroupId); phaseGroupId = 0; } } @@ -321,7 +321,7 @@ void TransportMgr::LoadTransportSpawns() } while (result->NextRow()); } - TC_LOG_INFO("server.loading", ">> Spawned %u continent transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO("server.loading", ">> Spawned {} continent transports in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); } class SplineRawInitializer @@ -568,20 +568,20 @@ Transport* TransportMgr::CreateTransport(uint32 entry, Map* map, ObjectGuid::Low TransportTemplate const* tInfo = GetTransportTemplate(entry); if (!tInfo) { - TC_LOG_ERROR("sql.sql", "Transport %u will not be loaded, `transport_template` missing", entry); + TC_LOG_ERROR("sql.sql", "Transport {} will not be loaded, `transport_template` missing", entry); return nullptr; } if (tInfo->MapIds.find(map->GetId()) == tInfo->MapIds.end()) { - TC_LOG_ERROR("entities.transport", "Transport %u attempted creation on map it has no path for %u!", entry, map->GetId()); + TC_LOG_ERROR("entities.transport", "Transport {} attempted creation on map it has no path for {}!", entry, map->GetId()); return nullptr; } Optional<Position> startingPosition = tInfo->ComputePosition(0, nullptr, nullptr); if (!startingPosition) { - TC_LOG_ERROR("sql.sql", "Transport %u will not be loaded, failed to compute starting position", entry); + TC_LOG_ERROR("sql.sql", "Transport {} will not be loaded, failed to compute starting position", entry); return nullptr; } |
