/
GameDownloadLinks.cs
31 lines (23 loc) · 1016 Bytes
/
GameDownloadLinks.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
namespace Arise.Server.Web.Net;
[RegisterSingleton<GameDownloadLinks>]
internal sealed class GameDownloadLinks
{
public Uri TeraManifestUri { get; }
public Uri TeraDownloadUri { get; }
public Uri AriseManifestUri { get; }
public Uri AriseDownloadUri { get; }
public GameDownloadLinks(IOptions<WebOptions> options)
{
static (Uri, Uri) GetUris(string repository, string version, string format)
{
var uri = $"https://github.com/tera-arise/arise-{repository}/releases/{version}/download/";
return (new($"{uri}manifest.json"), new($"{uri}{format}"));
}
var teraRevision = options.Value.TeraRevision;
var ariseRevision = ThisAssembly.GameRevision;
(TeraManifestUri, TeraDownloadUri) = GetUris(
"client", $"r{teraRevision}", $"TERA.EU.{teraRevision}.{{0}}.zip");
(AriseManifestUri, AriseDownloadUri) = GetUris(
"release", $"v{ariseRevision}", $"TERA.Arise.{ariseRevision}.zip");
}
}