From a84c4c7ecc745d83ea337c14790d4b4fb6b7d40f Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 10 Dec 2017 15:57:19 +0200 Subject: [PATCH] [Server] Print module order on startup --- apps/openmw-mp/Script/LuaState.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/openmw-mp/Script/LuaState.cpp b/apps/openmw-mp/Script/LuaState.cpp index 33a7c168e..7790bb8ab 100644 --- a/apps/openmw-mp/Script/LuaState.cpp +++ b/apps/openmw-mp/Script/LuaState.cpp @@ -434,12 +434,20 @@ vector::iterator> loadOrderSolver(vector::iterator> notResolved; vector::iterator> result; + int currentIndex = 1; + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Using automated order for server modules:"); + for (auto it = modules.begin(); it != modules.end(); ++it) { checkDependencies(modules, *it); if (it->dependencies.empty()) // if the server module doesn't have any dependencies, we can safely add it to the result + { + LOG_APPEND(Log::LOG_INFO, "- %i) %s", currentIndex, it->name.c_str()); + currentIndex++; + result.push_back(it); + } else notResolved.push_back(it); } @@ -483,6 +491,9 @@ vector::iterator> loadOrderSolver(vectorname.c_str()); + currentIndex++; + result.push_back(*it); it = notResolved.erase(it); } @@ -549,6 +560,10 @@ void LuaState::loadModules(const std::string &moduleDir, std::vector::iterator> sortedModuleList; if (list != nullptr && !list->empty()) // manual sorted list { + int currentIndex = 1; + + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Using manual order for server modules:"); + for (const auto &mssp : *list) { bool found = false; @@ -557,7 +572,12 @@ void LuaState::loadModules(const std::string &moduleDir, std::vectorname == mssp) { checkDependencies(modules, *it, false); // check dependencies, but do not throw exceptions + + LOG_APPEND(Log::LOG_INFO, "- %i) %s", currentIndex, mssp.c_str()); + currentIndex++; + sortedModuleList.push_back(it); + found = true; break; }