From 3fc397814ce9f1f7d0db8c1ac755fadd4acc5cd2 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Fri, 10 Sep 2021 16:37:46 +0300 Subject: [PATCH] Move update check to after initialization (since its blocking) --- src/Common.cpp | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common.cpp b/src/Common.cpp index e4689bc..0313190 100644 --- a/src/Common.cpp +++ b/src/Common.cpp @@ -81,7 +81,7 @@ void Application::CheckForUpdates() { std::string RealVersionString = std::to_string(RemoteVersion[0]) + "."; RealVersionString += std::to_string(RemoteVersion[1]) + "."; RealVersionString += std::to_string(RemoteVersion[2]); - warn(std::string(ANSI_YELLOW_BOLD) + "NEW VERSION OUT! There's a new version (v" + RealVersionString + ") of the BeamMP-Server available! For info on how to update your server, visit https://wiki.beammp.com/en/home/server-maintenance#updating-the-server." + std::string(ANSI_RESET)); + warn(std::string(ANSI_YELLOW_BOLD) + "NEW VERSION OUT! There's a new version (v" + RealVersionString + ") of the BeamMP-Server available! For more info visit https://wiki.beammp.com/en/home/server-maintenance#updating-the-server." + std::string(ANSI_RESET)); } else { info("Server up-to-date!"); } diff --git a/src/main.cpp b/src/main.cpp index 01a77ae..27cafee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,7 +45,6 @@ int main(int argc, char** argv) try { Sentry.SetupUser(); Sentry.PrintWelcome(); - Application::CheckForUpdates(); TResourceManager ResourceManager; TPPSMonitor PPSMonitor(Server); THeartbeatThread Heartbeat(ResourceManager, Server); @@ -53,6 +52,7 @@ int main(int argc, char** argv) try { TLuaEngine LuaEngine(Server, Network); PPSMonitor.SetNetwork(Network); Application::Console().InitializeLuaConsole(LuaEngine); + Application::CheckForUpdates(); // TODO: replace while (!Shutdown) {