Add no-update flag

This commit is contained in:
Tixx 2024-09-23 00:00:27 +02:00
parent 2ddb576e72
commit 467c8dc584
3 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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.");