File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ internal static async Task<BrowserEndpoint> GetBrowserEndpointAsync()
4040 }
4141 else
4242 {
43- Log . Logger . Error ( "Could not fetch browser, SFP possibly tried to inject too early" ) ;
43+ Log . Logger . Error ( "Could not fetch browser, SFP either tried to inject too early or another service is running on port 8080 " ) ;
4444 }
4545 Log . Logger . Debug ( e ) ;
4646 throw ;
Original file line number Diff line number Diff line change @@ -198,15 +198,15 @@ public static Task StartSteam(string? args = null)
198198 const string DebuggingString = @"-cef-enable-debugging" ;
199199 if ( ! args . Contains ( DebuggingString ) )
200200 {
201- args += $ " { DebuggingString } ";
202201 args = args . Trim ( ) ;
202+ args += $ " { DebuggingString } ";
203203 }
204204
205205 const string BootstrapString = @"-skipinitialbootstrap" ;
206206 if ( OperatingSystem . IsMacOS ( ) && ! args . Contains ( BootstrapString ) )
207207 {
208- args += $ " { BootstrapString } ";
209208 args = args . Trim ( ) ;
209+ args += $ " { BootstrapString } ";
210210 }
211211
212212 if ( OperatingSystem . IsWindows ( ) && File . Exists ( MillenniumPath ) )
@@ -381,7 +381,7 @@ private static async Task<bool> CheckForMissingArgumentsAsync()
381381 return false ;
382382 }
383383
384- var argumentMissing = Settings . Default . SteamLaunchArgs . Split ( ' ' )
384+ var argumentMissing = Settings . Default . SteamLaunchArgs . Trim ( ) . ToLower ( ) . Split ( ' ' , StringSplitOptions . TrimEntries | StringSplitOptions . RemoveEmptyEntries )
385385 . Any ( arg => ! cmdLine . Contains ( arg ) ) ;
386386
387387 if ( ! argumentMissing )
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ public static List<string> GetCommandLine(Process process)
1717 var processName = process . ProcessName ;
1818 var command = $ "pgrep -x { processName } | xargs sh -c 'if [ -n \" $1\" ]; then ps -o command= -p \" $1\" ; fi' _";
1919 var output = RunCommand ( command ) ;
20- var lines = output . Split ( ' ' , StringSplitOptions . RemoveEmptyEntries ) ;
21- return lines . Select ( line => line . Trim ( ) ) . Where ( arg => ! string . IsNullOrWhiteSpace ( arg ) ) . ToList ( ) ;
20+ var lines = output . ToLower ( ) . Split ( ' ' , StringSplitOptions . TrimEntries | StringSplitOptions . RemoveEmptyEntries ) ;
21+ return lines . ToList ( ) ;
2222 }
2323
2424 [ SuppressMessage ( "CodeSmell" , "ERP022:Unobserved exception in a generic exception handler" ) ]
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public static List<string> GetCommandLine(Process process)
4646 var query = con . CreateQuery ( "SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + process . Id ) ;
4747 var commandLine = query . SingleOrDefault ( ) ? [ "CommandLine" ] ? . ToString ( ) ;
4848 return commandLine != null
49- ? commandLine . Split ( ' ' , StringSplitOptions . RemoveEmptyEntries ) . ToList ( )
49+ ? commandLine . ToLower ( ) . Split ( ' ' , StringSplitOptions . TrimEntries | StringSplitOptions . RemoveEmptyEntries ) . ToList ( )
5050 : new List < string > ( ) ;
5151 }
5252
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ private static void SetupNLog()
4949 LogManager . Setup ( ) . LoadConfiguration ( c =>
5050 {
5151 c . ForLogger ( ) . FilterMinLevel ( LogLevel . Info ) . WriteToConsole ( ) . WithAsync ( ) ;
52- var fileTarget = new FileTarget
52+ using var fileTarget = new FileTarget
5353 {
5454 FileName = "SFP.log" ,
5555 ArchiveOldFileOnStartup = true ,
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public class MainPageViewModel : ViewModelBase
2525
2626 [ Reactive ] public bool ButtonsEnabled { get ; set ; } = true ;
2727
28- [ Reactive ] public bool IsInjected { get ; set ; }
28+ [ Reactive ] public bool IsInjected { get ; set ; } = Injector . IsInjected ;
2929
3030 [ Reactive ] public string StartSteamText { get ; set ; } = Steam . IsSteamRunning ? "Restart Steam" : "Start Steam" ;
3131
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ public SettingsPageViewModel()
143143 . Throttle ( TimeSpan . FromSeconds ( 1 ) )
144144 . Subscribe ( value =>
145145 {
146- Settings . Default . SteamLaunchArgs = value ;
146+ Settings . Default . SteamLaunchArgs = value . Trim ( ) ;
147147 Settings . Default . Save ( ) ;
148148 } ) ;
149149
You can’t perform that action at this time.
0 commit comments