@@ -362,6 +362,11 @@ private async Task LoadAssetRegistries(CancellationToken cancellationToken = def
362
362
/* File IO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
363
363
public async Task Save ( )
364
364
{
365
+ if ( Globals . HideAllProfileCardInformation )
366
+ {
367
+ return ;
368
+ }
369
+
365
370
Directory . CreateDirectory ( Globals . ProfilesFolder . ToString ( ) ) ;
366
371
367
372
if ( IsAutoDetected )
@@ -568,20 +573,9 @@ public async Task TryAutoFetchAesKeysUndetected()
568
573
569
574
/* Only for Fortnite */
570
575
if ( ! ArchiveDirectory . Contains ( "Fortnite" ) ) return ;
571
-
572
- var normalized = Name ;
573
- if ( Name . Count ( c => c == '.' ) == 2 )
574
- {
575
- var parts = Name . Split ( '.' ) ;
576
- if ( parts . Length == 3 )
577
- {
578
- normalized = parts [ 0 ] + "." + parts [ 1 ] + parts [ 2 ] ;
579
- }
580
- }
581
576
582
- if ( ! double . TryParse ( normalized , NumberStyles . Float , CultureInfo . InvariantCulture , out var value ) )
577
+ if ( ! TryParseProfileName ( Name , out var value ) )
583
578
{
584
- Log . Information ( $ "Could not parse Profile Name { Name } ") ;
585
579
return ;
586
580
}
587
581
@@ -613,6 +607,80 @@ public async Task TryAutoFetchAesKeysUndetected()
613
607
DisposeProvider ( false ) ;
614
608
}
615
609
610
+ public bool TryParseProfileName ( string name , out double value )
611
+ {
612
+ var normalized = name ;
613
+
614
+ if ( name . Count ( c => c == '.' ) == 2 )
615
+ {
616
+ var parts = name . Split ( '.' ) ;
617
+ if ( parts . Length == 3 )
618
+ {
619
+ normalized = parts [ 0 ] + "." + parts [ 1 ] + parts [ 2 ] ;
620
+ }
621
+ }
622
+
623
+ if ( ! double . TryParse ( normalized , NumberStyles . Float , CultureInfo . InvariantCulture , out value ) )
624
+ {
625
+ Log . Information ( $ "Could not parse Profile Name { name } ") ;
626
+ return false ;
627
+ }
628
+
629
+ return true ;
630
+ }
631
+
632
+ public EGame PredictBaseUEVersion ( string name )
633
+ {
634
+ if ( ! TryParseProfileName ( name , out var version ) )
635
+ {
636
+ return EGame . GAME_UE5_7 ;
637
+ }
638
+
639
+ var major = Math . Floor ( version ) ;
640
+
641
+ switch ( major )
642
+ {
643
+ case < 1.10 :
644
+ {
645
+ return EGame . GAME_UE4_16 ;
646
+ }
647
+ case < 2.5 :
648
+ {
649
+ return EGame . GAME_UE4_19 ;
650
+ }
651
+ case < 7.0 :
652
+ {
653
+ return EGame . GAME_UE4_21 ;
654
+ }
655
+ case < 8.1 :
656
+ {
657
+ return EGame . GAME_UE4_22 ;
658
+ }
659
+ case < 13.0 :
660
+ {
661
+ return EGame . GAME_UE4_23 ;
662
+ }
663
+ }
664
+
665
+ const double minVersion = 1.0 ;
666
+ const double maxVersion = 36.30 ;
667
+ var t = Math . Clamp ( ( version - minVersion ) / ( maxVersion - minVersion ) , 0.0 , 1.0 ) ;
668
+
669
+ var baseGames = Enum . GetValues ( typeof ( EGame ) )
670
+ . Cast < EGame > ( )
671
+ . Where ( g => ( ( uint ) g & 0xFFFF ) == 0 )
672
+ . Select ( g => ( uint ) g )
673
+ . OrderBy ( v => v )
674
+ . ToArray ( ) ;
675
+
676
+ var startGame = baseGames . First ( ) ;
677
+ var endGame = baseGames . Last ( ) ;
678
+ var lerped = startGame + ( endGame - startGame ) * t ;
679
+ var snapped = baseGames . OrderBy ( v => Math . Abs ( v - lerped ) ) . First ( ) ;
680
+
681
+ return ( EGame ) snapped ;
682
+ }
683
+
616
684
public async Task FetchEncryptionKeysAsync ( string url = null ! , bool isUnknown = false )
617
685
{
618
686
var aes = await RestAPI . Central . GetAesAsync ( url , useBaseUrl : false ) ;
0 commit comments