diff --git a/include/Options.h b/include/Options.h index dd161a9..73a5c68 100644 --- a/include/Options.h +++ b/include/Options.h @@ -7,6 +7,7 @@ struct Options { unsigned int port = 4444; bool verbose = false; bool no_download = false; + bool no_update = false; bool no_launch = false; char **game_arguments = nullptr; int game_arguments_length = 0; diff --git a/src/Options.cpp b/src/Options.cpp index 9cd9b7c..37acf48 100644 --- a/src/Options.cpp +++ b/src/Options.cpp @@ -46,12 +46,15 @@ void InitOptions(int argc, char *argv[], Options &options) { options.verbose = true; } else if (argument == "--no-download") { options.no_download = true; + } else if (argument == "--no-update") { + options.no_update = true; } else if (argument == "--no-launch") { options.no_launch = true; } else if (argument == "--dev") { options.verbose = true; options.no_download = true; options.no_launch = true; + options.no_update = true; } else if (argument == "--") { options.game_arguments = &argv[i + 1]; options.game_arguments_length = argc - i - 1; diff --git a/src/Startup.cpp b/src/Startup.cpp index bdce188..67c9419 100644 --- a/src/Startup.cpp +++ b/src/Startup.cpp @@ -170,7 +170,7 @@ void CheckForUpdates(const std::string& CV) { std::string FileHash = hashpp::get::getFileHash(hashpp::ALGORITHMS::SHA2_256, EP); - if (FileHash != LatestHash && IsOutdated(Version(VersionStrToInts(GetVer() + GetPatch())), Version(VersionStrToInts(LatestVersion))) && !options.no_download) { + if (FileHash != LatestHash && IsOutdated(Version(VersionStrToInts(GetVer() + GetPatch())), Version(VersionStrToInts(LatestVersion))) && !options.no_update) { info("Launcher update found!"); #if defined(__linux__) error("Auto update is NOT implemented for the Linux version. Please update manually ASAP as updates contain security patches.");