update Cpu Affinity

This commit is contained in:
2023-11-21 01:05:20 +08:00
parent 5ecfc82506
commit faec463478
8 changed files with 99 additions and 13 deletions

View File

@@ -134,8 +134,7 @@ class HomeUIModel extends BaseUIModel {
return;
}
scInstallPaths = await SCLoggerHelper.getGameInstallPath(listData,
withVersion: ["LIVE", "PTU", "EPTU", "TECH-PREVIEW"],
checkExists: true);
withVersion: ["LIVE", "PTU", "EPTU"], checkExists: true);
if (scInstallPaths.isNotEmpty) {
scInstalledPath = scInstallPaths.first;
}

View File

@@ -49,7 +49,7 @@ class LoginDialog extends BaseUI<LoginDialogModel> {
color: Colors.white.withOpacity(.6),
),
)
] else if (model.loginStatus == 2) ...[
] else if (model.loginStatus == 2 || model.loginStatus == 3) ...[
Center(
child: Column(
children: [
@@ -76,7 +76,9 @@ class LoginDialog extends BaseUI<LoginDialogModel> {
fontSize: 24, fontWeight: FontWeight.bold),
),
const SizedBox(height: 32),
const Text("正在为您启动游戏..."),
Text(model.loginStatus == 2
? "正在为您启动游戏..."
: "正在等待优化CPU参数..."),
const SizedBox(height: 12),
const ProgressRing(),
],

View File

@@ -7,6 +7,7 @@ import 'package:hive/hive.dart';
import 'package:jwt_decode/jwt_decode.dart';
import 'package:local_auth/local_auth.dart';
import 'package:starcitizen_doctor/base/ui_model.dart';
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
import 'package:starcitizen_doctor/common/win32/credentials.dart';
import 'package:starcitizen_doctor/ui/home/home_ui_model.dart';
import 'package:starcitizen_doctor/ui/home/webview/webview.dart';
@@ -217,12 +218,21 @@ class LoginDialogModel extends BaseUIModel {
await launchFile.writeAsString(json.encode(launchData));
notifyListeners();
await Future.delayed(const Duration(seconds: 1));
await Future.delayed(const Duration(seconds: 3));
final confBox = await Hive.openBox("app_conf");
final inputGameLaunchECore = int.tryParse(
confBox.get("gameLaunch_eCore_count", defaultValue: "0")) ??
0;
final processorAffinity =
await SystemHelper.getCpuAffinity(inputGameLaunchECore);
// TODO 更新启动方式
homeUIModel.doLaunchGame(
'$installPath\\$executable',
["-no_login_dialog", ...launchOptions.toString().split(" ")],
installPath);
await Future.delayed(const Duration(seconds: 3));
Navigator.pop(context!);
}
String getChannelID() {
@@ -232,8 +242,6 @@ class LoginDialogModel extends BaseUIModel {
return "PTU";
} else if (installPath.endsWith("\\EPTU")) {
return "EPTU";
} else if (installPath.endsWith("\\TECH-PREVIEW")) {
return "TECH-PREVIEW";
}
return "LIVE";
}