From 72d286473bdd5f6ceb2f0a178ff531c31b166dcd Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 16 Jul 2018 03:21:14 +0300 Subject: [PATCH] [General] Move credits integrity error message to new ErrorMessages file Additionally, use correct log level for credit integrity message on server. --- apps/openmw-mp/main.cpp | 7 +++---- components/CMakeLists.txt | 2 +- components/openmw-mp/ErrorMessages.hpp | 9 +++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 components/openmw-mp/ErrorMessages.hpp diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index be7ba6e16..de9f12046 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -216,10 +217,8 @@ int main(int argc, char *argv[]) if (!hasValidCredits) { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "To respect the hard work that has gone into\n" - "creating TES3MP, you are required to keep an unmodified tes3mp-credits file\n" - "corresponding to this version of the code in the same folder as this\n" - "executable. It can have either an .md or a .txt extension."); + LOG_MESSAGE_SIMPLE(Log::LOG_FATAL, "The server is shutting down"); + LOG_APPEND(Log::LOG_FATAL, "- %s", TES3MP_CREDITS_ERROR); return 1; } diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index c117563f6..05a2d73cb 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -146,7 +146,7 @@ add_component_dir (version ) add_component_dir (openmw-mp - Log Utils NetworkMessages Version + Log Utils ErrorMessages NetworkMessages Version ) add_component_dir (openmw-mp/Base diff --git a/components/openmw-mp/ErrorMessages.hpp b/components/openmw-mp/ErrorMessages.hpp new file mode 100644 index 000000000..efbb50f09 --- /dev/null +++ b/components/openmw-mp/ErrorMessages.hpp @@ -0,0 +1,9 @@ +#ifndef OPENMW_ERRORMESSAGES_HPP +#define OPENMW_ERRORMESSAGES_HPP + +#define TES3MP_CREDITS_ERROR ("To respect the hard work that has gone into creating TES3MP, you are\n"\ + "required to keep an unmodified tes3mp-credits file corresponding to this\n"\ + "version of the code in the same folder as this executable. It can have either\n"\ + "an .md or a .txt extension.") + +#endif //OPENMW_ERRORMESSAGES_HPP