fix: better handling when no config files are available

This commit is contained in:
fenopy
2026-03-18 12:55:26 -05:00
parent db93c7b610
commit 28fe132012

View File

@@ -92,6 +92,7 @@ namespace AndroidSideloader
public static bool noRcloneUpdating; public static bool noRcloneUpdating;
public static bool noAppCheck = false; public static bool noAppCheck = false;
public static bool hasPublicConfig = false; public static bool hasPublicConfig = false;
public static bool hasUploadConfig = false;
public static bool UsingPublicConfig = false; public static bool UsingPublicConfig = false;
public static bool enviromentCreated = false; public static bool enviromentCreated = false;
public static PublicConfig PublicConfigFile; public static PublicConfig PublicConfigFile;
@@ -529,13 +530,15 @@ namespace AndroidSideloader
// Upload in background // Upload in background
_ = Task.Run(() => _ = Task.Run(() =>
{ {
_ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{settings.CurrentCrashPath}\" RSL-gameuploads:CrashLogs"); if (hasUploadConfig) {
this.Invoke(() => _ = RCLONE.runRcloneCommand_UploadConfig($"copy \"{settings.CurrentCrashPath}\" RSL-gameuploads:CrashLogs");
{ this.Invoke(() =>
_ = FlexibleMessageBox.Show(Program.form, {
$"Your CrashLog has been copied to the server.\nPlease mention your CrashLogID ({settings.CurrentCrashName}) to the Mods.\nIt has been automatically copied to your clipboard."); _ = FlexibleMessageBox.Show(Program.form,
Clipboard.SetText(settings.CurrentCrashName); $"Your CrashLog has been copied to the server.\nPlease mention your CrashLogID ({settings.CurrentCrashName}) to the Mods.\nIt has been automatically copied to your clipboard.");
}); Clipboard.SetText(settings.CurrentCrashName);
});
}
}); });
} }
} }
@@ -574,7 +577,7 @@ namespace AndroidSideloader
string configFilePath = Path.Combine(Environment.CurrentDirectory, "vrp-public.json"); string configFilePath = Path.Combine(Environment.CurrentDirectory, "vrp-public.json");
// Public config check // Public config check
if (File.Exists(configFilePath)) if (File.Exists(configFilePath) && settings.AutoUpdateConfig)
{ {
await GetPublicConfigAsync(); await GetPublicConfigAsync();
if (!hasPublicConfig) if (!hasPublicConfig)
@@ -639,6 +642,12 @@ namespace AndroidSideloader
changeTitle("Getting Upload Config..."); changeTitle("Getting Upload Config...");
await Task.Run(() => SideloaderRCLONE.updateUploadConfig()); await Task.Run(() => SideloaderRCLONE.updateUploadConfig());
string uploadConfigPath = Path.Combine(Environment.CurrentDirectory, "rclone", "vrp.upload.config");
if (File.Exists(uploadConfigPath))
{
hasUploadConfig = true;
}
_ = Logger.Log("Initializing Servers"); _ = Logger.Log("Initializing Servers");
changeTitle("Initializing Servers..."); changeTitle("Initializing Servers...");
@@ -2771,7 +2780,7 @@ namespace AndroidSideloader
progressBar.IsIndeterminate = false; progressBar.IsIndeterminate = false;
if (either && !updatesNotified && !noAppCheck) if (either && !updatesNotified && !noAppCheck && hasUploadConfig)
{ {
changeTitle(""); changeTitle("");
DonorsListViewForm donorForm = new DonorsListViewForm(); DonorsListViewForm donorForm = new DonorsListViewForm();
@@ -2891,7 +2900,7 @@ namespace AndroidSideloader
string RlsName = Sideloader.PackageNametoGameName(newGamesToUpload); string RlsName = Sideloader.PackageNametoGameName(newGamesToUpload);
Logger.Log($"Release name obtained: {RlsName}", LogLevel.INFO); Logger.Log($"Release name obtained: {RlsName}", LogLevel.INFO);
if (!updatesNotified && !onapplist && newint < 6) if (!updatesNotified && !onapplist && newint < 6 && hasUploadConfig)
{ {
changeTitle("Unrecognized App found. Downloading APK to take a closer look. (This may take a minute)"); changeTitle("Unrecognized App found. Downloading APK to take a closer look. (This may take a minute)");
@@ -3530,13 +3539,9 @@ Additional Thanks & Resources
if (quotaTries > remotesList.Items.Count) if (quotaTries > remotesList.Items.Count)
{ {
ShowError_QuotaExceeded(); ShowError_QuotaExceeded();
isOffline = true;
if (Application.MessageLoop) success = false;
{ return success;
isOffline = true;
success = false;
return success;
}
} }
return success; return success;
@@ -3554,7 +3559,7 @@ If the problem persists, visit our Telegram (https://t.me/VRPirates) or Discord
FlexibleMessageBox.Show(Program.form, errorMessage, "Unable to connect to remote server"); FlexibleMessageBox.Show(Program.form, errorMessage, "Unable to connect to remote server");
// Close application after showing the message // Close application after showing the message
Application.Exit(); // Application.Exit();
} }
public async void cleanupActiveDownloadStatus() public async void cleanupActiveDownloadStatus()