diff options
author | Mattes D <github@xoft.cz> | 2023-05-11 22:05:17 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2023-05-16 23:50:37 +0200 |
commit | c9522fb740200ccef6230cec452c48efb31e5394 (patch) | |
tree | 7e74d70699e13dd0a92444a1a0add7a3059ac7ca /src/World.cpp | |
parent | Try a timeout for jobs. (diff) | |
download | cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.gz cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.bz2 cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.lz cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.xz cuberite-c9522fb740200ccef6230cec452c48efb31e5394.tar.zst cuberite-c9522fb740200ccef6230cec452c48efb31e5394.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/World.cpp b/src/World.cpp index 67ae6623b..2f92020bf 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -95,8 +95,8 @@ cWorld::cLock::cLock(const cWorld & a_World) : //////////////////////////////////////////////////////////////////////////////// // cWorld::cTickThread: -cWorld::cTickThread::cTickThread(cWorld & a_World) : - Super(Printf("World Ticker (%s)", a_World.GetName().c_str())), +cWorld::cTickThread::cTickThread(cWorld & a_World): + Super(fmt::format(FMT_STRING("World Ticker ({})"), a_World.GetName())), m_World(a_World) { } @@ -105,7 +105,7 @@ cWorld::cTickThread::cTickThread(cWorld & a_World) : -void cWorld::cTickThread::Execute(void) +void cWorld::cTickThread::Execute() { auto LastTime = std::chrono::steady_clock::now(); auto TickTime = std::chrono::duration_cast<std::chrono::milliseconds>(1_tick); @@ -216,7 +216,7 @@ cWorld::cWorld( m_Lighting(*this), m_TickThread(*this) { - LOGD("cWorld::cWorld(\"%s\")", a_WorldName.c_str()); + LOGD("cWorld::cWorld(\"%s\")", a_WorldName); cFile::CreateFolderRecursive(m_DataPath); @@ -227,13 +227,13 @@ cWorld::cWorld( Serializer.Load(); // Track the CSs used by this world in the deadlock detector: - a_DeadlockDetect.TrackCriticalSection(m_CSTasks, Printf("World %s tasks", m_WorldName.c_str())); + a_DeadlockDetect.TrackCriticalSection(m_CSTasks, fmt::format(FMT_STRING("World {} tasks"), m_WorldName)); // Load world settings from the ini file cIniFile IniFile; if (!IniFile.ReadFile(m_IniFileName)) { - LOGWARNING("Cannot read world settings from \"%s\", defaults will be used.", m_IniFileName.c_str()); + LOGWARNING("Cannot read world settings from \"%s\", defaults will be used.", m_IniFileName); // TODO: More descriptions for each key IniFile.AddHeaderComment(" This is the per-world configuration file, managing settings such as generators, simulators, and spawn points"); @@ -3080,17 +3080,15 @@ cRedstoneSimulator * cWorld::InitializeRedstoneSimulator(cIniFile & a_IniFile) cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const char * a_FluidName, BLOCKTYPE a_SimulateBlock, BLOCKTYPE a_StationaryBlock) { - AString SimulatorNameKey; - Printf(SimulatorNameKey, "%sSimulator", a_FluidName); - AString SimulatorSectionName; - Printf(SimulatorSectionName, "%sSimulator", a_FluidName); + auto SimulatorNameKey = fmt::format(FMT_STRING("{}Simulator"), a_FluidName); + auto SimulatorSectionName = fmt::format(FMT_STRING("{}Simulator"), a_FluidName); bool IsWater = (strcmp(a_FluidName, "Water") == 0); // Used for defaults AString DefaultSimulatorName = ((GetDimension() == dimNether) && IsWater) ? "Vaporise" : "Vanilla"; AString SimulatorName = a_IniFile.GetValueSet("Physics", SimulatorNameKey, DefaultSimulatorName); if (SimulatorName.empty()) { - LOGWARNING("[Physics] %s not present or empty in %s, using the default of \"%s\".", SimulatorNameKey.c_str(), GetIniFileName().c_str(), DefaultSimulatorName.c_str()); + LOGWARNING("[Physics] %s not present or empty in %s, using the default of \"%s\".", SimulatorNameKey, GetIniFileName(), DefaultSimulatorName); SimulatorName = DefaultSimulatorName; } cFluidSimulator * res = nullptr; |