Apply automatic dart fixes
This commit is contained in:
parent
fc9dc6f4d3
commit
e0561ea13f
6 changed files with 41 additions and 49 deletions
|
@ -1,10 +1,7 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:servermanager/credentials.dart';
|
||||
import 'package:servermanager/mod.dart';
|
||||
import 'package:servermanager/settingsEntry.dart';
|
||||
import 'package:servermanager/steamcmd.dart';
|
||||
|
||||
class Settings {
|
||||
Settings._();
|
||||
|
@ -35,8 +32,9 @@ class Settings {
|
|||
bool isValid() {
|
||||
if (!Hive.isBoxOpen("settings")) {
|
||||
return false;
|
||||
} else
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Future<Box<E>> Open<E>() {
|
||||
|
@ -51,44 +49,40 @@ class Settings {
|
|||
}
|
||||
|
||||
String getServerPath() {
|
||||
return game_path + Platform.pathSeparator + "server";
|
||||
return "$game_path${Platform.pathSeparator}server";
|
||||
}
|
||||
|
||||
bool checkInitDone() {
|
||||
if (File(steamcmd_path + Platform.pathSeparator + "cxinit").existsSync()) {
|
||||
if (File("$steamcmd_path${Platform.pathSeparator}cxinit").existsSync()) {
|
||||
return true;
|
||||
} else
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
String getSteamCmd() {
|
||||
return steamcmd_path +
|
||||
Platform.pathSeparator +
|
||||
"steamcmd" +
|
||||
(Platform.isWindows ? ".exe" : ".sh");
|
||||
return "$steamcmd_path${Platform.pathSeparator}steamcmd${Platform.isWindows ? ".exe" : ".sh"}";
|
||||
}
|
||||
|
||||
String getSteamCmd2FA() {
|
||||
return steamcmd_path +
|
||||
Platform.pathSeparator +
|
||||
"steamcmd-2fa" +
|
||||
(Platform.isWindows ? ".exe" : "");
|
||||
return "$steamcmd_path${Platform.pathSeparator}steamcmd-2fa${Platform.isWindows ? ".exe" : ""}";
|
||||
}
|
||||
|
||||
String getModPath() {
|
||||
return game_path + Platform.pathSeparator + "mods";
|
||||
return "$game_path${Platform.pathSeparator}mods";
|
||||
}
|
||||
|
||||
Future<void> createModFolderIfNotExists() async {
|
||||
if (Directory(getModPath()).existsSync())
|
||||
if (Directory(getModPath()).existsSync()) {
|
||||
return;
|
||||
else
|
||||
} else {
|
||||
await Directory(getModPath()).create(recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
bool serverInstalled() {
|
||||
return File(
|
||||
getServerPath() + Platform.pathSeparator + "ConanSandboxServer.exe")
|
||||
"${getServerPath()}${Platform.pathSeparator}ConanSandboxServer.exe")
|
||||
.existsSync();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue