Skip to content

Commit d332df2

Browse files
committed
Version Checking
1 parent 71cbf9a commit d332df2

File tree

7 files changed

+84
-0
lines changed

7 files changed

+84
-0
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

Scripts/Networking/Git.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Net.Http;
4+
using System.Text;
5+
using ABH.Net.Payloads;
6+
7+
namespace ABH.Net
8+
{
9+
class GitClient
10+
{
11+
public struct Repository
12+
{
13+
public string owner;
14+
public string repo;
15+
}
16+
17+
class Releases
18+
{
19+
static HttpClient _client = new HttpClient();
20+
21+
public List<string> ListReleases (Repository _repository)
22+
{
23+
Release _release = new Release(_repository, 30, 1);
24+
25+
HttpResponseMessage _response = await _client.PostAsJsonAsync
26+
}
27+
}
28+
}
29+
}

Scripts/Networking/RESTPayloads.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using static ABH.Net.GitClient;
5+
6+
namespace ABH.Net.Payloads
7+
{
8+
// See https://docs.github.com/en/rest/reference/repos#releases
9+
class Release
10+
{
11+
public string accept = "application/vnd.github.v3+json";
12+
public Repository repo;
13+
public int per_page;
14+
public int page;
15+
16+
public Release(Repository _repo, int _per_page, int _page)
17+
{
18+
repo = _repo;
19+
per_page = _per_page;
20+
page = _page;
21+
}
22+
23+
public Release(string _accept, Repository _repo, int _per_page, int _page)
24+
{
25+
accept = _accept;
26+
repo = _repo;
27+
per_page = _per_page;
28+
page = _page;
29+
}
30+
}
31+
}

Scripts/Networking/VersionHandler.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace ABH.Net
6+
{
7+
class VersionHandler
8+
{
9+
public void GetLatestVersion()
10+
{
11+
12+
}
13+
14+
public void ReadCurrentVersion()
15+
{
16+
17+
}
18+
19+
public bool CheckCurrentVersion()
20+
{
21+
return false;
22+
}
23+
}
24+
}
File renamed without changes.

0 commit comments

Comments
 (0)