Skip to content

Commit

Permalink
Change ApiUrls and fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
CorruptComputer committed Nov 26, 2023
1 parent 51e5aa5 commit d2bd0ca
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using UnitystationLauncher.Models;
using UnitystationLauncher.Models.Api;
using UnitystationLauncher.Services.Interface;
Expand All @@ -22,7 +23,7 @@ public List<Installation> GetInstallations()
return null;
}

public (Download?, string) DownloadInstallation(Server server)
public Task<(Download?, string)> DownloadInstallationAsync(Server server)
{
throw new NotImplementedException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace UnitystationLauncher.Tests.MocksRepository.PingService;

public class MockPingReturnsNull : IPingService
{
public Task<string> GetPing(Server server)
public Task<string> GetPingAsync(Server server)
{
return Task.FromResult(null as string)!;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public MockPingStaticPingTime(int pingInMilliseconds)
{
_pingTime = $"{pingInMilliseconds}ms";
}
public Task<string> GetPing(Server server)
public Task<string> GetPingAsync(Server server)
{
return Task.FromResult(_pingTime);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace UnitystationLauncher.Tests.MocksRepository.PingService;

public class MockPingThrowsException : IPingService
{
public Task<string> GetPing(Server server)
public Task<string> GetPingAsync(Server server)
{
throw new();
}
Expand Down
26 changes: 13 additions & 13 deletions UnitystationLauncher/Constants/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ namespace UnitystationLauncher.Constants;

public static class ApiUrls
{
private const string ApiBaseUrl = "https://api.unitystation.org";
public const string ServerListUrl = $"{ApiBaseUrl}/serverlist";
public const string ValidateUrl = $"{ApiBaseUrl}/validatehubclient";
public const string ValidateTokenUrl = $"{ApiBaseUrl}/validatetoken?data=";
public const string SignOutUrl = $"{ApiBaseUrl}/signout?data=";
private static string ApiBaseUrl => "https://api.unitystation.org";
public static string ServerListUrl => $"{ApiBaseUrl}/serverlist";
public static string ValidateUrl => $"{ApiBaseUrl}/validatehubclient";
public static string ValidateTokenUrl => $"{ApiBaseUrl}/validatetoken?data=";
public static string SignOutUrl => $"{ApiBaseUrl}/signout?data=";

private const string ChangelogBaseUrl = "https://changelog.unitystation.org";
public const string Latest10VersionsUrl = $"{ChangelogBaseUrl}/all-changes?format=json&limit=10";
public const string LatestBlogPosts = $"{ChangelogBaseUrl}/posts/?format=json";
private static string ChangelogBaseUrl => "https://changelog.unitystation.org";
public static string Latest10VersionsUrl => $"{ChangelogBaseUrl}/all-changes?format=json&limit=10";
public static string LatestBlogPosts => $"{ChangelogBaseUrl}/posts/?format=json";

private const string CdnBaseUrl = "https://unitystationfile.b-cdn.net";
public const string GoodFilesBaseUrl = $"{CdnBaseUrl}/GoodFiles";
public const string AllowedGoodFilesUrl = $"{GoodFilesBaseUrl}/AllowGoodFiles.json";
private static string CdnBaseUrl => "https://unitystationfile.b-cdn.net";
public static string GoodFilesBaseUrl => $"{CdnBaseUrl}/GoodFiles";
public static string AllowedGoodFilesUrl => $"{GoodFilesBaseUrl}/AllowGoodFiles.json";

private const string RawGitHubFileBaseUrl = "https://raw.githubusercontent.com/unitystation/unitystation/develop";
public const string CodeScanListUrl = $"{RawGitHubFileBaseUrl}/CodeScanList.json";
private static string RawGitHubFileBaseUrl => "https://raw.githubusercontent.com/unitystation/unitystation/develop";
public static string CodeScanListUrl => $"{RawGitHubFileBaseUrl}/CodeScanList.json";
}

0 comments on commit d2bd0ca

Please sign in to comment.