This commit is contained in:
Alessandro Autiero
2025-02-04 13:50:01 +01:00
parent d5e41ed646
commit b319479def
14 changed files with 112 additions and 235 deletions

View File

@@ -357,7 +357,6 @@ class BackendController extends GetxController {
severity: InfoBarSeverity.success
);
case ServerResultType.startError:
print(event.stackTrace);
return _showRebootInfoBar(
type.value == ServerType.local ? translations.localServerError(event.error ?? translations.unknownError) : translations.startServerError(event.error ?? translations.unknownError),
severity: InfoBarSeverity.error,

View File

@@ -16,8 +16,7 @@ class DllController extends GetxController {
static const String storageName = "v2_dll_storage";
late final GetStorage? _storage;
late final String originalDll;
late final TextEditingController gameServerDll;
late final TextEditingController customGameServerDll;
late final TextEditingController unrealEngineConsoleDll;
late final TextEditingController backendDll;
late final TextEditingController memoryLeakDll;
@@ -32,7 +31,7 @@ class DllController extends GetxController {
DllController() {
_storage = appWithNoStorage ? null : GetStorage(storageName);
gameServerDll = _createController("game_server", InjectableDll.gameServer);
customGameServerDll = _createController("game_server", InjectableDll.gameServer);
unrealEngineConsoleDll = _createController("unreal_engine_console", InjectableDll.console);
backendDll = _createController("backend", InjectableDll.auth);
memoryLeakDll = _createController("memory_leak", InjectableDll.memoryLeak);
@@ -59,7 +58,7 @@ class DllController extends GetxController {
}
void resetGame() {
gameServerDll.text = getDefaultDllPath(InjectableDll.gameServer);
customGameServerDll.text = getDefaultDllPath(InjectableDll.gameServer);
unrealEngineConsoleDll.text = getDefaultDllPath(InjectableDll.console);
backendDll.text = getDefaultDllPath(InjectableDll.auth);
}
@@ -148,7 +147,7 @@ class DllController extends GetxController {
switch(dll){
case InjectableDll.gameServer:
if(customGameServer.value) {
return (File(gameServerDll.text), true);
return (File(customGameServerDll.text), true);
}
return (version.major >= 20 ? rebootAboveS20DllFile : rebootBeforeS20DllFile, false);
@@ -171,7 +170,7 @@ class DllController extends GetxController {
case InjectableDll.auth:
return backendDll;
case InjectableDll.gameServer:
return gameServerDll;
return customGameServerDll;
case InjectableDll.memoryLeak:
return memoryLeakDll;
}
@@ -182,7 +181,7 @@ class DllController extends GetxController {
case InjectableDll.console:
return "${dllsDirectory.path}\\console.dll";
case InjectableDll.auth:
return "${dllsDirectory.path}\\starfall.dll";
return "${dllsDirectory.path}\\cobalt.dll";
case InjectableDll.gameServer:
return "${dllsDirectory.path}\\reboot.dll";
case InjectableDll.memoryLeak:

View File

@@ -250,7 +250,7 @@ class _LaunchButtonState extends State<LaunchButton> {
log("[${host ? 'HOST' : 'GAME'}] Generating instance args...");
final gameArgs = createRebootArgs(
host ? _hostingController.accountUsername.text : _gameController.username.text,
host ? _hostingController.accountPassword.text :_gameController.password.text,
host ? _hostingController.accountPassword.text : _gameController.password.text,
host,
hostType,
false,
@@ -495,6 +495,7 @@ class _LaunchButtonState extends State<LaunchButton> {
const Duration(days: 1)
);
this._pingOperation = pingOperation;
_gameServerInfoBar?.close();
_gameServerInfoBar = showRebootInfoBar(
translations.checkGameServerFixMessage(gameServerPort),
action: Button(
@@ -508,8 +509,9 @@ class _LaunchButtonState extends State<LaunchButton> {
final result = await pingOperation.future;
_gameServerInfoBar?.close();
return result;
}finally {
}catch(_) {
_gameServerInfoBar?.close();
return false;
}
}

View File

@@ -35,18 +35,12 @@ class _AddVersionDialogState extends State<AddVersionDialog> {
final Rxn<double> _progress = Rxn();
final RxInt _speed = RxInt(0);
late Future<List<FortniteBuild>> _fetchFuture;
SendPort? _downloadPort;
Object? _error;
StackTrace? _stackTrace;
@override
void initState() {
_fetchFuture = compute(fetchBuilds, null).then((value) {
_updateFormDefaults();
return value;
});
super.initState();
}
@@ -60,6 +54,7 @@ class _AddVersionDialogState extends State<AddVersionDialog> {
void _cancelDownload() {
_downloadPort?.send(kStopBuildDownloadSignal);
WindowsTaskbar.setProgressMode(TaskbarProgressMode.noProgress);
stopDownloadServer();
}
@override
@@ -68,28 +63,10 @@ class _AddVersionDialogState extends State<AddVersionDialog> {
child: Obx(() {
switch(_status.value){
case _DownloadStatus.form:
return FutureBuilder(
future: _fetchFuture,
builder: (context, snapshot) {
if (snapshot.hasError) {
WidgetsBinding.instance.addPostFrameCallback((_) => _onDownloadError(snapshot.error, snapshot.stackTrace));
}
final data = snapshot.data;
if (data == null) {
return ProgressDialog(
text: translations.fetchingBuilds,
showButton: widget.closable,
onStop: () => Navigator.of(context).pop()
);
}
return Obx(() => FormDialog(
content: _buildFormBody(data),
buttons: _formButtons
));
}
);
return Obx(() => FormDialog(
content: _buildFormBody(downloadableBuilds),
buttons: _formButtons
));
case _DownloadStatus.downloading:
case _DownloadStatus.extracting:
return GenericDialog(
@@ -256,7 +233,7 @@ class _AddVersionDialogState extends State<AddVersionDialog> {
style: FluentTheme.maybeOf(context)?.typography.body,
),
if(timeLeft != null)
if(timeLeft != null && timeLeft != -1)
Text(
translations.timeLeft(timeLeft),
style: FluentTheme.maybeOf(context)?.typography.body,
@@ -450,7 +427,6 @@ class _AddVersionDialogState extends State<AddVersionDialog> {
return;
}
print("${bestDisk.path}\\FortniteBuilds\\${build.version}");
final pathText = "${bestDisk.path}FortniteBuilds\\${build.version}";
_pathController.text = pathText;
_pathController.selection = TextSelection.collapsed(offset: pathText.length);

View File

@@ -184,10 +184,10 @@ class _SettingsPageState extends RebootPageState<SettingsPage> {
return createFileSetting(
title: translations.settingsOldServerFileName,
description: translations.settingsServerFileDescription,
controller: _dllController.gameServerDll,
controller: _dllController.customGameServerDll,
onReset: () {
final path = _dllController.getDefaultDllPath(InjectableDll.gameServer);
_dllController.gameServerDll.text = path;
_dllController.customGameServerDll.text = path;
_dllController.download(InjectableDll.gameServer, path);
}
);