|
@@ -296,8 +296,8 @@ namespace VeloeMinecraftLauncher.MinecraftLauncher
|
|
|
{
|
|
|
if (!((
|
|
|
library.downloads.classifiers.NativesWindows is not null ||
|
|
|
- library.downloads.classifiers.NativesWindows64 is not null ||
|
|
|
- library.downloads.classifiers.NativesWindows32 is not null) && OperatingSystem.IsWindows() ||
|
|
|
+ library.downloads.classifiers.NativesWindows64 is not null ||
|
|
|
+ library.downloads.classifiers.NativesWindows32 is not null) && OperatingSystem.IsWindows() ||
|
|
|
library.downloads.classifiers.NativesLinux is not null && OperatingSystem.IsLinux()))
|
|
|
continue;
|
|
|
|
|
@@ -570,25 +570,25 @@ namespace VeloeMinecraftLauncher.MinecraftLauncher
|
|
|
jsonData = webClient.GetStringAsync(url).Result;
|
|
|
|
|
|
|
|
|
- if (string.IsNullOrEmpty(jsonData))
|
|
|
- {
|
|
|
- Settings.logger.Warning("Empty string!");
|
|
|
- return new T();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (filename != "")
|
|
|
+ if (string.IsNullOrEmpty(jsonData))
|
|
|
+ {
|
|
|
+ Settings.logger.Warning("Empty string!");
|
|
|
+ return new T();
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- if (!Directory.Exists(path))
|
|
|
+ if (!string.IsNullOrEmpty(filename) && !string.IsNullOrEmpty(path))
|
|
|
{
|
|
|
- Settings.logger.Debug("Creating path: {0}", path);
|
|
|
- Directory.CreateDirectory(path);
|
|
|
+ if (!Directory.Exists(path))
|
|
|
+ {
|
|
|
+ Settings.logger.Debug("Creating path: {0}", path);
|
|
|
+ Directory.CreateDirectory(path);
|
|
|
+ }
|
|
|
+ File.WriteAllText(path + filename, jsonData);
|
|
|
}
|
|
|
- File.WriteAllText(path + filename, jsonData);
|
|
|
+ //Settings.logger.Debug("Return serialized string.");
|
|
|
+ return JsonSerializer.Deserialize<T>(jsonData);
|
|
|
}
|
|
|
- //Settings.logger.Debug("Return serialized string.");
|
|
|
- return JsonSerializer.Deserialize<T>(jsonData);
|
|
|
- }
|
|
|
/*
|
|
|
return string.IsNullOrEmpty(jsonData)
|
|
|
? new T()
|
|
@@ -631,10 +631,10 @@ namespace VeloeMinecraftLauncher.MinecraftLauncher
|
|
|
}
|
|
|
|
|
|
private static void waitWhileBisy(ref WebClient webClient)
|
|
|
- {
|
|
|
+ {
|
|
|
while (webClient.IsBusy)
|
|
|
{
|
|
|
- Task.Delay(100).Wait();
|
|
|
+ Task.Delay(10).Wait();
|
|
|
}
|
|
|
}
|
|
|
}
|