feat: translate-manager Beta

This commit is contained in:
xkeyC
2025-12-27 11:47:25 +08:00
parent a673f70862
commit 2be5441cf4
9 changed files with 141 additions and 72 deletions

View File

@@ -1,9 +1,9 @@
import 'dart:io';
class ConstConf {
static const String appVersion = "3.0.0 Beta9";
static const String appVersion = "3.0.0 Beta10";
static const int appVersionCode = 79;
static const String appVersionDate = "2025-12-22";
static const String appVersionDate = "2025-12-27";
static const _gameChannels = ["LIVE", "4.0_PREVIEW", "PTU", "EPTU", "TECH-PREVIEW", "HOTFIX"];
static const isMSE = String.fromEnvironment("MSE", defaultValue: "false") == "true";
static const win32AppId = isMSE

View File

@@ -10,10 +10,10 @@ class URLConf {
static const String analyticsApiHome = "https://scbox.org";
/// PartyRoom Server
static const String partyRoomServerAddress = "localhost";
static const int partyRoomServerPort = 50051;
// static const String partyRoomServerAddress = "ecdn.partyroom.grpc.scbox.xkeyc.cn";
// static const int partyRoomServerPort = 443;
// static const String partyRoomServerAddress = "localhost";
// static const int partyRoomServerPort = 50051;
static const String partyRoomServerAddress = "ecdn.partyroom.grpc.scbox.xkeyc.cn";
static const int partyRoomServerPort = 443;
static bool isUrlCheckPass = false;

View File

@@ -16,7 +16,8 @@ class SCLoggerHelper {
dPrint("rsiLauncherPath Wine:$rsiLauncherPath");
final jsonLogPath = "$rsiLauncherPath/logs/log.log";
return jsonLogPath;
};
}
;
Map<String, String> envVars = Platform.environment;
final appDataPath = envVars["appdata"];
if (appDataPath == null) {
@@ -85,6 +86,8 @@ class SCLoggerHelper {
List<String> scInstallPaths = [];
checkAndAddPath(String path, bool checkExists) async {
// Handle JSON-escaped backslashes (\\\\) -> single backslash (\\)
path = path.replaceAll(r'\\', r'\');
// Normalize path separators to current platform format
path = path.platformPath;
@@ -110,8 +113,19 @@ class SCLoggerHelper {
try {
for (var v in withVersion) {
// Match both Windows (\\) and Unix (/) path separators in log entries, case-insensitive
String pattern = r'([a-zA-Z]:[\\/][^\\/]*[\\/][^\\/]*[\\/]StarCitizen[\\/]' + v + r')';
// Platform-specific regex patterns for game install path detection
// Uses restrictive character class to avoid matching across JSON delimiters
String pattern;
if (Platform.isWindows) {
// Windows: Match paths like C:\...\StarCitizen\LIVE
// Path segments can only contain: letters, numbers, space, dot, underscore, hyphen, parentheses
// Handles both single backslash, forward slash, and JSON-escaped double backslash
pattern =
r'([a-zA-Z]:(?:[/\\]|\\\\)(?:[a-zA-Z0-9 ._()-]+(?:[/\\]|\\\\))*StarCitizen(?:[/\\]|\\\\)' + v + r')';
} else {
// Unix (Wine): Match paths like /home/user/.../StarCitizen/LIVE
pattern = r'(/(?:[a-zA-Z0-9 ._()-]+/)*StarCitizen/' + v + r')';
}
RegExp regExp = RegExp(pattern, caseSensitive: false);
for (var i = listData.length - 1; i > 0; i--) {
final line = listData[i];