Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion FModel/Creator/Bases/FN/BaseQuest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ private void DrawTexts(SKCanvas c, int x, int y, int padding)
{
_informationPaint.TextSize = 25;
_informationPaint.Typeface = Utils.Typefaces.Bundle;
Utils.DrawMultilineText(c, DisplayName, Width - padding, 0, SKTextAlign.Left,

Utils.DrawMultilineText(c, Utils.RemoveHtmlTags(DisplayName).Replace(" ", " "), Width - padding, 0, SKTextAlign.Left,
new SKRect(x, y + padding, maxX, Height - padding * 1.5f), _informationPaint, out _);
}

Expand Down
4 changes: 2 additions & 2 deletions FModel/ViewModels/ApiEndpointViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ApiEndpointViewModel

public FortniteApiEndpoint FortniteApi { get; }
public ValorantApiEndpoint ValorantApi { get; }
public FortniteCentralApiEndpoint CentralApi { get; }
public DillyApiEndpoint DillyApi { get; }
public EpicApiEndpoint EpicApi { get; }
public FModelApiEndpoint FModelApi { get; }
public GitHubApiEndpoint GitHubApi { get; }
Expand All @@ -27,7 +27,7 @@ public ApiEndpointViewModel()
{
FortniteApi = new FortniteApiEndpoint(_client);
ValorantApi = new ValorantApiEndpoint(_client);
CentralApi = new FortniteCentralApiEndpoint(_client);
DillyApi = new DillyApiEndpoint(_client);
EpicApi = new EpicApiEndpoint(_client);
FModelApi = new FModelApiEndpoint(_client);
GitHubApi = new GitHubApiEndpoint(_client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
using System.Threading;
using System.Threading.Tasks;
using FModel.Framework;
using FModel.ViewModels.ApiEndpoints.Models;
using RestSharp;
using Serilog;

namespace FModel.ViewModels.ApiEndpoints;

public class FortniteCentralApiEndpoint : AbstractApiProvider
public class DillyApiEndpoint : AbstractApiProvider
{
public FortniteCentralApiEndpoint(RestClient client) : base(client) { }
private Backup[] _backups;

public DillyApiEndpoint(RestClient client) : base(client) { }

public async Task<IDictionary<string, IDictionary<string, string>>> GetHotfixesAsync(CancellationToken token, string language = "en")
{
var request = new FRestRequest("https://fortnitecentral.genxgames.gg/api/v1/hotfixes")
var request = new FRestRequest("https://api.fortniteapi.com/v1/cloudstorage/hotfixes")
{
Interceptors = [_interceptor]
};
Expand All @@ -27,4 +30,17 @@ public IDictionary<string, IDictionary<string, string>> GetHotfixes(Cancellation
{
return GetHotfixesAsync(token, language).GetAwaiter().GetResult();
}

public async Task<Backup[]> GetBackupsAsync(CancellationToken token)
{
var request = new FRestRequest($"https://api.fortniteapi.com/v1/backups");
var response = await _client.ExecuteAsync<Backup[]>(request, token).ConfigureAwait(false);
Log.Information("[{Method}] [{Status}({StatusCode})] '{Resource}'", request.Method, response.StatusDescription, (int) response.StatusCode, response.ResponseUri?.OriginalString);
return response.Data;
}

public Backup[] GetBackups(CancellationToken token)
{
return _backups ??= GetBackupsAsync(token).GetAwaiter().GetResult();
}
}
2 changes: 1 addition & 1 deletion FModel/ViewModels/BackupManagerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task Initialize()
{
await _threadWorkerView.Begin(cancellationToken =>
{
var backups = _apiEndpointView.FModelApi.GetBackups(cancellationToken, _gameName);
var backups = _apiEndpointView.DillyApi.GetBackups(cancellationToken); // gamename is useless here
if (backups == null) return;

Application.Current.Dispatcher.Invoke(() =>
Expand Down
2 changes: 1 addition & 1 deletion FModel/ViewModels/CUE4ParseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ private Task LoadHotfixedLocalizedResources()
if (!Provider.ProjectName.Equals("fortnitegame", StringComparison.OrdinalIgnoreCase) || HotfixedResourcesDone) return Task.CompletedTask;
return Task.Run(() =>
{
var hotfixes = ApplicationService.ApiEndpointView.CentralApi.GetHotfixes(CancellationToken.None, Provider.GetLanguageCode(UserSettings.Default.AssetLanguage));
var hotfixes = ApplicationService.ApiEndpointView.DillyApi.GetHotfixes(CancellationToken.None, Provider.GetLanguageCode(UserSettings.Default.AssetLanguage));
if (hotfixes == null) return;

Provider.Internationalization.Override(hotfixes);
Expand Down