From b270c2bd68a03498dd1835b6eacac3ce0b2adf8f Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 8 Oct 2023 23:00:49 +0200 Subject: [PATCH] Don't print ASCII art when using ncurses --- src/server.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index f74c960a0..a9c4c10b3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -540,13 +540,22 @@ void Server::start() m_thread->start(); // ASCII art for the win! - std::cerr - << " __. __. __. " << std::endl - << " _____ |__| ____ _____ / |_ _____ _____ / |_ " << std::endl - << " / \\| |/ \\ / __ \\ _\\/ __ \\/ __> _\\" << std::endl - << "| Y Y \\ | | \\ ___/| | | ___/\\___ \\| | " << std::endl - << "|__|_| / |___| /\\______> | \\______>_____/| | " << std::endl - << " \\/ \\/ \\/ \\/ \\/ " << std::endl; + const char *art[] = { + " __. __. __. ", + " _____ |__| ____ _____ / |_ _____ _____ / |_ ", + " / \\| |/ \\ / __ \\ _\\/ __ \\/ __> _\\", + "| Y Y \\ | | \\ ___/| | | ___/\\___ \\| | ", + "|__|_| / |___| /\\______> | \\______>_____/| | ", + " \\/ \\/ \\/ \\/ \\/ " + }; + + if (!m_admin_chat) { + // we're not printing to rawstream to avoid it showing up in the logs. + // however it would then mess up the ncurses terminal (m_admin_chat), + // so we skip it in that case. + for (auto line : art) + std::cerr << line << std::endl; + } actionstream << "World at [" << m_path_world << "]" << std::endl; actionstream << "Server for gameid=\"" << m_gamespec.id << "\" listening on ";