Released 9.2.5

This commit is contained in:
Alessandro Autiero
2024-08-18 20:29:09 +02:00
parent 582270849e
commit 4c3fe9bc65
21 changed files with 503 additions and 383 deletions

View File

@@ -11,7 +11,7 @@ const List<String> kCorruptedBuildErrors = [
"Critical error",
"when 0 bytes remain",
"Pak chunk signature verification failed!",
"Couldn't find pak signature file"
"LogWindows:Error: Fatal error!"
];
const List<String> kCannotConnectErrors = [
"port 3551 failed: Connection refused",

View File

@@ -9,9 +9,22 @@ extension FortniteVersionExtension on FortniteVersion {
static File? findFile(Directory directory, String name) {
try{
final result = directory.listSync(recursive: true)
.firstWhere((element) => path.basename(element.path) == name);
return File(result.path);
for(final child in directory.listSync()) {
if(child is Directory) {
if(!path.basename(child.path).startsWith("\.")) {
final result = findFile(child, name);
if(result != null) {
return result;
}
}
}else if(child is File) {
if(path.basename(child.path) == name) {
return child;
}
}
}
return null;
}catch(_){
return null;
}

View File

@@ -15,13 +15,16 @@ final Semaphore _semaphore = Semaphore();
String? _lastIp;
String? _lastPort;
Future<Process> startEmbeddedBackend(bool detached) async {
Future<Process> startEmbeddedBackend(bool detached, {void Function(String)? onError}) async {
final process = await startProcess(
executable: backendStartExecutable,
window: detached,
);
process.stdOutput.listen((message) => log("[BACKEND] Message: $message"));
process.stdError.listen((error) => log("[BACKEND] Error: $error"));
process.stdError.listen((error) {
log("[BACKEND] Error: $error");
onError?.call(error);
});
process.exitCode.then((exitCode) => log("[BACKEND] Exit code: $exitCode"));
return process;
}

View File

@@ -102,8 +102,7 @@ Future<bool> startElevatedProcess({required String executable, required String a
shellInput.ref.fMask = ES_AWAYMODE_REQUIRED;
shellInput.ref.lpVerb = "runas".toNativeUtf16();
shellInput.ref.cbSize = sizeOf<SHELLEXECUTEINFO>();
var shellResult = ShellExecuteEx(shellInput);
return shellResult == 1;
return ShellExecuteEx(shellInput) == 1;
}
Future<Process> startProcess({required File executable, List<String>? args, bool useTempBatch = true, bool window = false, String? name, Map<String, String>? environment}) async {
@@ -313,7 +312,14 @@ final class _ExtendedProcess implements Process {
@override
Future<int> get exitCode => _delegate.exitCode;
Future<int> get exitCode {
try {
return _delegate.exitCode;
}catch(_) {
return watchProcess(_delegate.pid)
.then((_) => -1);
}
}
@override
bool kill([ProcessSignal signal = ProcessSignal.sigterm]) => _delegate.kill(signal);