Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix launcher updater change #10

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions SharkyPatcher/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,18 @@ static async Task<string> GetLauncherVersionAsync()
{
Log.Information("【鯊鯊補丁】獲取啟動器版本中……");

HttpClient client = new HttpClient { Timeout = TimeSpan.FromMinutes(1) };
client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue { NoCache = true };
string versionJson = await client.GetStringAsync("https://aonyx.ffxiv.wang/Launcher/GetLease").ConfigureAwait(false);
JObject launcherVersion = JObject.Parse(versionJson);
string releasesList = launcherVersion.GetValue("releasesList").Value<string>();
string latestRelease = releasesList.Split('\n').Last();
string nupkgVersion = latestRelease.Split().ElementAt(1);
string appVersion = nupkgVersion.Replace("XIVLauncherCN", "app")
.Replace("-full.nupkg", "")
.Replace("-delta.nupkg", "");
LogF.Information($"【鯊鯊補丁】啟動器版本:{releasesList}");
// HttpClient client = new HttpClient { Timeout = TimeSpan.FromMinutes(1) };
// client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue { NoCache = true };
// string versionJson = await client.GetStringAsync("https://aonyx.ffxiv.wang/Launcher/GetLease").ConfigureAwait(false);
// JObject launcherVersion = JObject.Parse(versionJson);
// string releasesList = launcherVersion.GetValue("releasesList").Value<string>();
// string latestRelease = releasesList.Split('\n').Last();
// string nupkgVersion = latestRelease.Split().ElementAt(1);
// string appVersion = nupkgVersion.Replace("XIVLauncherCN", "app")
// .Replace("-full.nupkg", "")
// .Replace("-delta.nupkg", "");
// LogF.Information($"【鯊鯊補丁】啟動器版本:{releasesList}");
string appVersion = "current";
Log.Information($"【鯊鯊補丁】當前啟動器版本:<{appVersion}>");

return appVersion;
Expand Down