Skip to content

Commit a4e92b6

Browse files
committed
migrated api endpoints over to UEDB
1 parent 407be3d commit a4e92b6

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

FModel/Settings/EndpointSettings.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public static EndpointSettings[] Default(string gameName)
1616
case "Fortnite [LIVE]":
1717
return new EndpointSettings[]
1818
{
19-
new("https://fortnitecentral.genxgames.gg/api/v1/aes", "$.['mainKey','dynamicKeys']"),
20-
new("https://fortnitecentral.genxgames.gg/api/v1/mappings", "$.[0].['url','fileName']") // just get the first available, not just oodle! (Unfortunately not default except when resetting settings)
19+
new("https://uedb.dev/svc/api/v1/fortnite/aes", "$.['mainKey','dynamicKeys']"),
20+
new("https://uedb.dev/svc/api/v1/fortnite/mappings", "$.mappings.Brotli")
2121
};
2222
default:
2323
return new EndpointSettings[] { new(), new() };
@@ -106,4 +106,4 @@ public void TryValidate(DynamicApiEndpoint endpoint, EEndpointType type, out JTo
106106
}
107107
}
108108
}
109-
}
109+
}

FModel/ViewModels/CUE4ParseViewModel.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ public async Task RefreshAes()
321321

322322
await _threadWorkerView.Begin(cancellationToken =>
323323
{
324+
// deprecated values
325+
if (endpoint.Url == "https://fortnitecentral.genxgames.gg/api/v1/aes") endpoint.Url = "https://uedb.dev/svc/api/v1/fortnite/aes";
326+
324327
var aes = _apiEndpointView.DynamicApi.GetAesKeys(cancellationToken, endpoint.Url, endpoint.Path);
325328
if (aes is not { IsValid: true }) return;
326329

@@ -362,8 +365,15 @@ public Task InitMappings(bool force = false)
362365
}
363366
else if (endpoint.IsValid)
364367
{
365-
var mappingsFolder = Path.Combine(UserSettings.Default.OutputDirectory, ".data");
368+
// deprecated values
366369
if (endpoint.Path == "$.[?(@.meta.compressionMethod=='Oodle')].['url','fileName']") endpoint.Path = "$.[0].['url','fileName']";
370+
if (endpoint.Url == "https://fortnitecentral.genxgames.gg/api/v1/mappings")
371+
{
372+
endpoint.Url = "https://uedb.dev/svc/api/v1/fortnite/mappings";
373+
endpoint.Path = "$.mappings.Brotli";
374+
}
375+
376+
var mappingsFolder = Path.Combine(UserSettings.Default.OutputDirectory, ".data");
367377
var mappings = _apiEndpointView.DynamicApi.GetMappings(CancellationToken.None, endpoint.Url, endpoint.Path);
368378
if (mappings is { Length: > 0 })
369379
{
@@ -372,7 +382,7 @@ public Task InitMappings(bool force = false)
372382
if (!mapping.IsValid) continue;
373383

374384
var mappingPath = Path.Combine(mappingsFolder, mapping.FileName);
375-
if (force || !File.Exists(mappingPath))
385+
if (force || !File.Exists(mappingPath) || new FileInfo(mappingPath).Length == 0)
376386
{
377387
_apiEndpointView.DownloadFile(mapping.Url, mappingPath);
378388
}

0 commit comments

Comments
 (0)