diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java b/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java index 7b65f5b4..9a5fad87 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java @@ -71,7 +71,12 @@ public static Path getLauncherDir(String projectname) throws IOException { @LauncherAPI public static Path getStoreDir(String projectname) throws IOException { - return getAppDataDir().resolve("store"); + if(JVMHelper.OS_TYPE == JVMHelper.OS.LINUX) + return getAppDataDir().resolve("store"); + else if(JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE) + return getAppDataDir().resolve("GravitLauncherStore"); + else + return getAppDataDir().resolve("minecraftStore"); } @LauncherAPI public static Path getProjectStoreDir(String projectname) throws IOException diff --git a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java index dc0ea894..6e04378b 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java +++ b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java @@ -24,8 +24,10 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { try(HInput input = new HInput(IOHelper.newInput(file))) { + String dirName = input.readString(128); + String fullPath = input.readString(1024); HashedDir dir = new HashedDir(input); - settings.lastHDirs.put(file.getFileName().toString(), dir); + settings.lastHDirs.put(dirName, dir); } return super.visitFile(file, attrs); } @@ -68,9 +70,11 @@ public void saveHDirStore(Path storeProjectPath) throws IOException Files.createDirectories(storeProjectPath); for(Map.Entry e : settings.lastHDirs.entrySet()) { - Path file = Files.createFile(storeProjectPath.resolve(e.getKey())); + Path file = Files.createFile(storeProjectPath.resolve(e.getKey().concat(".bin"))); try(HOutput output = new HOutput(IOHelper.newOutput(file))) { + output.writeString(e.getKey(), 128); + output.writeString("", 1024); e.getValue().write(output); } }