mirror of
https://github.com/4sval/FModel.git
synced 2026-05-15 00:49:53 -05:00
UEFN Live
it's in the same game as Fortnite [Live]
This commit is contained in:
parent
75e0f9589b
commit
3163711925
|
|
@ -11,6 +11,7 @@ namespace FModel.ViewModels.ApiEndpoints;
|
|||
public class DillyApiEndpoint : AbstractApiProvider
|
||||
{
|
||||
private Backup[] _backups;
|
||||
private ManifestInfoDilly[] _manifests;
|
||||
|
||||
public DillyApiEndpoint(RestClient client) : base(client) { }
|
||||
|
||||
|
|
@ -27,6 +28,19 @@ public class DillyApiEndpoint : AbstractApiProvider
|
|||
return _backups ??= GetBackupsAsync(token).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public async Task<ManifestInfoDilly[]> GetManifestsAsync(CancellationToken token)
|
||||
{
|
||||
var request = new FRestRequest($"https://export-service-new.dillyapis.com/v1/manifests");
|
||||
var response = await _client.ExecuteAsync<ManifestInfoDilly[]>(request, token).ConfigureAwait(false);
|
||||
Log.Information("[{Method}] [{Status}({StatusCode})] '{Resource}'", request.Method, response.StatusDescription, (int) response.StatusCode, response.ResponseUri?.OriginalString);
|
||||
return response.Data;
|
||||
}
|
||||
|
||||
public ManifestInfoDilly[] GetManifests(CancellationToken token)
|
||||
{
|
||||
return _manifests ??= GetManifestsAsync(token).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public async Task<IDictionary<string, IDictionary<string, string>>> GetHotfixesAsync(CancellationToken token, string language = "en")
|
||||
{
|
||||
var request = new FRestRequest("https://api.fortniteapi.com/v1/cloudstorage/hotfixes")
|
||||
|
|
|
|||
|
|
@ -23,6 +23,13 @@ public class Backup
|
|||
[J] public string Url { get; private set; }
|
||||
}
|
||||
|
||||
[DebuggerDisplay("{" + nameof(AppName) + "}")]
|
||||
public class ManifestInfoDilly
|
||||
{
|
||||
[J] public string AppName { get; private set; }
|
||||
[J] public string DownloadUrl { get; private set; }
|
||||
}
|
||||
|
||||
public class Donator
|
||||
{
|
||||
[J] public string Username { get; private set; }
|
||||
|
|
|
|||
|
|
@ -284,6 +284,20 @@ public class CUE4ParseViewModel : ViewModel
|
|||
it => new FRandomAccessStreamArchive(it, manifest.FindFile(it)!.GetStream(), p.Versions));
|
||||
});
|
||||
|
||||
var manifests = _apiEndpointView.DillyApi.GetManifests(cancellationToken);
|
||||
var downloadUrl = manifests.First(x => x.AppName == "Fortnite_Studio").DownloadUrl;
|
||||
|
||||
using var client = new HttpClient();
|
||||
var manifestBytes = client.GetByteArrayAsync(downloadUrl).GetAwaiter().GetResult();
|
||||
|
||||
var uefnManifest = FBuildPatchAppManifest.Deserialize(manifestBytes, manifestOptions);
|
||||
|
||||
Parallel.ForEach(uefnManifest.Files.Where(x => _fnLiveRegex.IsMatch(x.FileName)), fileManifest =>
|
||||
{
|
||||
p.RegisterVfs(fileManifest.FileName, [fileManifest.GetStream()],
|
||||
it => new FRandomAccessStreamArchive(it, uefnManifest.FindFile(it)!.GetStream(), p.Versions));
|
||||
});
|
||||
|
||||
var elapsedTime = Stopwatch.GetElapsedTime(startTs);
|
||||
FLogger.Append(ELog.Information, () =>
|
||||
FLogger.Text($"Fortnite [LIVE] has been loaded successfully in {elapsedTime.TotalMilliseconds:F1}ms", Constants.WHITE, true));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user