diff options
Diffstat (limited to 'src/Root.cpp')
-rw-r--r-- | src/Root.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/Root.cpp b/src/Root.cpp index 8d344ee65..349e85315 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -21,6 +21,7 @@ #include "IniFile.h" #include "SettingsRepositoryInterface.h" #include "OverridesSettingsRepository.h" +#include "SelfTests.h" #ifdef _WIN32 #include <conio.h> @@ -111,11 +112,16 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> overridesRepo) cLogger::GetInstance().AttachListener(consoleLogListener); cLogger::GetInstance().AttachListener(fileLogListener); - LOG("--- Started Log ---\n"); + LOG("--- Started Log ---"); #ifdef BUILD_ID - LOG("MCServer " BUILD_SERIES_NAME " build id: " BUILD_ID); - LOG("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME); + LOG("MCServer " BUILD_SERIES_NAME " build id: " BUILD_ID); + LOG("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME); + #endif + + // Run the self-tests registered previously via cSelfTests::Register(): + #ifdef SELF_TEST + cSelfTests::ExecuteAll(); #endif cDeadlockDetect dd; @@ -255,7 +261,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> overridesRepo) delete m_FurnaceRecipe; m_FurnaceRecipe = nullptr; delete m_CraftingRecipes; m_CraftingRecipes = nullptr; - LOGD("Unloading worlds..."); + LOG("Unloading worlds..."); UnloadWorlds(); LOGD("Stopping plugin manager..."); @@ -336,7 +342,7 @@ void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings) -cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension, const AString & a_OverworldName) +cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension a_Dimension, const AString & a_OverworldName, bool a_InitSpawn) { cWorld * World = m_WorldsByName[a_WorldName]; if (World != nullptr) @@ -347,7 +353,10 @@ cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName, eDimension cWorld * NewWorld = new cWorld(a_WorldName.c_str(), a_Dimension, a_OverworldName); m_WorldsByName[a_WorldName] = NewWorld; NewWorld->Start(); - NewWorld->InitializeSpawn(); + if (a_InitSpawn) + { + NewWorld->InitializeSpawn(); + } m_PluginManager->CallHookWorldStarted(*NewWorld); return NewWorld; } @@ -869,3 +878,8 @@ int cRoot::GetFurnaceFuelBurnTime(const cItem & a_Fuel) cFurnaceRecipe * FR = Get()->GetFurnaceRecipe(); return FR->GetBurnTime(a_Fuel); } + + + + + |