diff --git a/MASTER_FILE b/MASTER_FILE index 18e9e5f..8dd6358 100644 --- a/MASTER_FILE +++ b/MASTER_FILE @@ -1 +1 @@ -1.1.010425.1748 \ No newline at end of file +1.1.010425.1753 \ No newline at end of file diff --git a/bin/server.dart b/bin/server.dart index 1bb5724..58eebc9 100644 --- a/bin/server.dart +++ b/bin/server.dart @@ -17,6 +17,7 @@ void main() async { ClientPackets.register(); // Set up paths Settings settings = Settings(); + Settings.makeAbsoluteSettingsPath(); await settings.Read(); print( diff --git a/lib/consts.dart b/lib/consts.dart index 5feff6b..ada30fb 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -1,5 +1,5 @@ class Consts { - static const VERSION = "1.1.010425.1748"; + static const VERSION = "1.1.010425.1753"; static const MF_VER_URL = "https://git.zontreck.com/AriasCreations/ConanServerManager/raw/branch/master/MASTER_FILE"; } diff --git a/lib/structs/settings.dart b/lib/structs/settings.dart index e4f21a3..0b49573 100644 --- a/lib/structs/settings.dart +++ b/lib/structs/settings.dart @@ -25,6 +25,13 @@ class Settings { final String Base2FAPath = "https://github.com/zontreck/steamcmd-2fa/releases/download/0.2.0/steamcmd-2fa"; + static String ABSOLUTE_PATH = ""; + + static void makeAbsoluteSettingsPath() { + File fi = File("settings.dat"); + ABSOLUTE_PATH = fi.absolute.path; + } + Settings._(); static final Settings Instance = Settings._(); @@ -105,7 +112,7 @@ class Settings { Future Read() async { if (!server) return; try { - var tag = await NbtIo.read("settings.dat"); + var tag = await NbtIo.read(ABSOLUTE_PATH); inst = SettingsEntry.deserialize(tag.get("entry") as CompoundTag); @@ -138,7 +145,7 @@ class Settings { NbtUtils.writeBoolean(tag, "fts", FTS); NbtUtils.writeBoolean(tag, "wine_init", wineInitialized); - NbtIo.write("settings.dat", tag); + NbtIo.write(ABSOLUTE_PATH, tag); } Future Open() async { diff --git a/pubspec.yaml b/pubspec.yaml index cfd4db1..b14ea8e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.1.010425+1748 +version: 1.1.010425+1753 environment: sdk: ">=3.1.4 <4.0.0"