forked from HeyM1ke/ValorantStreamOverlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Updator.cs
36 lines (32 loc) · 1.07 KB
/
Updator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Text;
using AutoUpdaterDotNET;
using Newtonsoft.Json;
namespace ValorantStreamOverlay
{
class Updator
{
public Updator()
{
AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent;
AutoUpdater.Start("https://dl.dropboxusercontent.com/s/2h50ctzn973cx6r/updator.json?dl=0");
}
void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs args)
{
dynamic json = JsonConvert.DeserializeObject(args.RemoteData);
args.UpdateInfo = new UpdateInfoEventArgs
{
CurrentVersion = json["version"],
ChangelogURL = json["changelog"],
DownloadURL = json["url"],
Mandatory = new Mandatory
{
Value = json["mandatory"]["value"],
UpdateMode = json["mandatory"]["UpdateMode"],
MinimumVersion = json["mandatory"]["MinimumVersion"]
}
};
}
}
}