File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . Collections . Generic ;
23using System . IO ;
34using System . Linq ;
45using System . Runtime . InteropServices ;
@@ -15,7 +16,7 @@ internal static class AntiPiracy
1516 "ReShadePreset.ini"
1617 } ;
1718
18- public static bool IsInvalid ( string path )
19+ public static IEnumerable < string > IsInvalid ( string path )
1920 {
2021 var dataPlugins = Path . Combine ( GameVersionEarly . ResolveDataPath ( path ) , "Plugins" ) ;
2122
@@ -37,8 +38,10 @@ public static bool IsInvalid(string path)
3738
3839 // To the guys that maintain a fork that removes this code: I would greatly appreciate if we could talk
3940 // about this for a little bit. Please message me on Discord at DaNike#6223
40- return Directory . EnumerateFiles ( path , "*" ) . Any ( IsInvalidFile ) ||
41- Directory . EnumerateFiles ( dataPlugins , "*" , SearchOption . AllDirectories ) . Any ( IsInvalidFile ) ;
41+ return Directory . EnumerateFiles ( path , "*" )
42+ . Concat ( Directory . EnumerateFiles ( dataPlugins , "*" , SearchOption . AllDirectories ) )
43+ . Where ( IsInvalidFile )
44+ . Select ( file => file . Substring ( path . Length + 1 ) ) ;
4245 }
4346
4447 private static bool IsInvalidFile ( string filePath )
Original file line number Diff line number Diff line change 1010using System ;
1111using System . Diagnostics ;
1212using System . IO ;
13+ using System . Linq ;
1314using System . Reflection ;
1415using System . Threading . Tasks ;
1516using UnityEngine ;
@@ -55,11 +56,10 @@ internal static void Main(string[] args)
5556
5657 Default . Debug ( "Initializing logger" ) ;
5758
58- if ( AntiPiracy . IsInvalid ( Environment . CurrentDirectory ) )
59+ var invalidFiles = AntiPiracy . IsInvalid ( Environment . CurrentDirectory ) . ToList ( ) ;
60+ if ( invalidFiles . Any ( ) )
5961 {
60- Default . Error ( "Invalid installation; please buy the game to run BSIPA." ) ;
61-
62- return ;
62+ Default . Warn ( $ "Invalid installation; Unknown files: { string . Join ( ", " , invalidFiles ) } ") ;
6363 }
6464
6565 EnsureDirectories ( ) ;
You can’t perform that action at this time.
0 commit comments