24 lines
669 B
C#
24 lines
669 B
C#
using Newtonsoft.Json;
|
|
|
|
namespace ModpackUpdater;
|
|
|
|
public class ModpackConfig
|
|
{
|
|
public bool Maintenance { get; set; }
|
|
public string Name { get; set; }
|
|
public string UpdateUrl { get; set; }
|
|
public string InstallUrl { get; set; }
|
|
public string UnleashApiUrl { get; set; }
|
|
public string UnleashInstanceId { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public string ConfigUrl { get; set; }
|
|
|
|
public static ModpackConfig LoadFromUrl(string url)
|
|
{
|
|
var result = new HttpClient().GetStringAsync(url).Result;
|
|
var config = JsonConvert.DeserializeObject<ModpackConfig>(result);
|
|
config.ConfigUrl = url;
|
|
return config;
|
|
}
|
|
} |