mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-29 06:55:37 +08:00
cpu Affinity
This commit is contained in:
@ -526,11 +526,32 @@ class HomeUIModel extends BaseUIModel {
|
||||
return (map["status"] == "ok" || map["status"] == "operational");
|
||||
}
|
||||
|
||||
doLaunchGame(String launchExe, List<String> args, String installPath) async {
|
||||
doLaunchGame(String launchExe, List<String> args, String installPath,
|
||||
int? processorAffinity) async {
|
||||
_isGameRunning[installPath] = true;
|
||||
notifyListeners();
|
||||
try {
|
||||
await Process.run(launchExe, args);
|
||||
if (processorAffinity == null) {
|
||||
ProcessResult result = await Process.run(launchExe, args);
|
||||
dPrint('Exit code: ${result.exitCode}');
|
||||
dPrint('stdout: ${result.stdout}');
|
||||
dPrint('stderr: ${result.stderr}');
|
||||
} else {
|
||||
ProcessResult result = await Process.run("cmd.exe", [
|
||||
'/C',
|
||||
'Start',
|
||||
'"StarCitizen"',
|
||||
'/High',
|
||||
'/Affinity',
|
||||
'$processorAffinity',
|
||||
launchExe,
|
||||
...args
|
||||
]);
|
||||
dPrint('Exit code: ${result.exitCode}');
|
||||
dPrint('stdout: ${result.stdout}');
|
||||
dPrint('stderr: ${result.stderr}');
|
||||
}
|
||||
|
||||
final launchFile = File("$installPath\\loginData.json");
|
||||
if (await launchFile.exists()) {
|
||||
await launchFile.delete();
|
||||
|
Reference in New Issue
Block a user