Skip to content

Commit fa0f644

Browse files
authored
Merge pull request #526 from GhostScissors/dev
Make downloading of chunks parallel + fix for icon generation and static meshes
2 parents 062d54e + f341bb5 commit fa0f644

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

FModel/Creator/Bases/FN/BaseCommunity.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public override void ParseForInfo()
5858

5959
if (Object.TryGetValue(out FGameplayTagContainer gameplayTags, "GameplayTags"))
6060
CheckGameplayTags(gameplayTags);
61+
else if (Object.TryGetValue(out FInstancedStruct[] dataList, "DataList"))
62+
CheckGameplayTags(dataList);
63+
6164
if (Object.TryGetValue(out FPackageIndex cosmeticItem, "cosmetic_item"))
6265
CosmeticSource = cosmeticItem.Name.ToUpper();
6366

@@ -91,7 +94,7 @@ public override SKBitmap[] Draw()
9194
return new[] { ret };
9295
}
9396

94-
private void CheckGameplayTags(FGameplayTagContainer gameplayTags)
97+
protected override void CheckGameplayTags(FGameplayTagContainer gameplayTags)
9598
{
9699
if (_design == null) return;
97100
if (_design.DrawSource)

FModel/Creator/Bases/FN/BaseIcon.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ protected string GetCosmeticSet(string setName)
229229
2 => 8,
230230
3 => 4,
231231
4 => 5,
232+
5 => 5,
232233
_ => 10
233234
};
234235

@@ -264,14 +265,15 @@ protected string GetCosmeticSeason(string seasonNumber)
264265
return Utils.RemoveHtmlTags(string.Format(introduced, d));
265266
}
266267

267-
private void CheckGameplayTags(FInstancedStruct[] dataList)
268+
protected void CheckGameplayTags(FInstancedStruct[] dataList)
268269
{
269270
if (dataList.FirstOrDefault(d => d.NonConstStruct?.TryGetValue(out FGameplayTagContainer _, "Tags") ?? false) is { NonConstStruct: not null } tags)
270271
{
271272
CheckGameplayTags(tags.NonConstStruct.Get<FGameplayTagContainer>("Tags"));
272273
}
273274
}
274-
private void CheckGameplayTags(FGameplayTagContainer gameplayTags)
275+
276+
protected virtual void CheckGameplayTags(FGameplayTagContainer gameplayTags)
275277
{
276278
if (gameplayTags.TryGetGameplayTag("Cosmetics.Source.", out var source))
277279
CosmeticSource = source.Text["Cosmetics.Source.".Length..];

FModel/ViewModels/CUE4ParseViewModel.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,22 +253,22 @@ await _threadWorkerView.Begin(cancellationToken =>
253253
).GetAwaiter().GetResult();
254254
var parseTime = Stopwatch.GetElapsedTime(startTs);
255255

256-
foreach (var fileManifest in manifest.Files)
256+
Parallel.ForEach(manifest.Files, fileManifest =>
257257
{
258258
if (fileManifest.FileName.Equals("Cloud/IoStoreOnDemand.ini", StringComparison.OrdinalIgnoreCase))
259259
{
260260
IoStoreOnDemand.Read(new StreamReader(fileManifest.GetStream()));
261-
continue;
261+
return;
262262
}
263263

264264
if (!_fnLive.IsMatch(fileManifest.FileName))
265265
{
266-
continue;
266+
return;
267267
}
268268

269269
p.RegisterVfs(fileManifest.FileName, [fileManifest.GetStream()]
270270
, it => new FRandomAccessStreamArchive(it, manifest.Files.First(x => x.FileName.Equals(it)).GetStream(), p.Versions));
271-
}
271+
});
272272

273273
FLogger.Append(ELog.Information, () =>
274274
FLogger.Text($"Fortnite [LIVE] has been loaded successfully in {parseTime.TotalMilliseconds}ms", Constants.WHITE, true));
@@ -282,10 +282,10 @@ await _threadWorkerView.Begin(cancellationToken =>
282282
throw new Exception("Could not load latest Valorant manifest, you may have to switch to your local installation.");
283283
}
284284

285-
for (var i = 0; i < manifestInfo.Paks.Length; i++)
285+
Parallel.For(0, manifestInfo.Paks.Length, i =>
286286
{
287287
p.RegisterVfs(manifestInfo.Paks[i].GetFullName(), [manifestInfo.GetPakStream(i)]);
288-
}
288+
});
289289

290290
FLogger.Append(ELog.Information, () =>
291291
FLogger.Text($"Valorant '{manifestInfo.Header.GameVersion}' has been loaded successfully", Constants.WHITE, true));

FModel/ViewModels/GameSelectorViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ private IEnumerable<EGame> EnumerateUeGames()
8787
.OrderBy(value => (int)value == ((int)value & ~0xF));
8888
private IEnumerable<DirectorySettings> EnumerateDetectedGames()
8989
{
90-
yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_5);
91-
yield return DirectorySettings.Default("Fortnite [LIVE]", Constants._FN_LIVE_TRIGGER, ue: EGame.GAME_UE5_5);
90+
yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_6);
91+
yield return DirectorySettings.Default("Fortnite [LIVE]", Constants._FN_LIVE_TRIGGER, ue: EGame.GAME_UE5_6);
9292
yield return GetUnrealEngineGame("Pewee", "\\RogueCompany\\Content\\Paks", EGame.GAME_RogueCompany);
9393
yield return GetUnrealEngineGame("Rosemallow", "\\Indiana\\Content\\Paks", EGame.GAME_UE4_21);
9494
yield return GetUnrealEngineGame("Catnip", "\\OakGame\\Content\\Paks", EGame.GAME_Borderlands3);

0 commit comments

Comments
 (0)