Overhauling file system structure.

Common files such as assets, libraries, and mods have been externalized into a 'common' folder. Each server now has its own instance folder to allow saving per version files. This resolves issues with resourcepacks and mod configurations being overriden, and still preserves our optimizations in storing libraries and mods maven style.
This commit is contained in:
Daniel Scalzi
2018-06-04 00:17:20 -04:00
parent 97e9c15baf
commit 0cc861f614
5 changed files with 61 additions and 38 deletions

View File

@@ -34,7 +34,6 @@ const DEFAULT_CONFIG = {
],
},
game: {
directory: path.join(dataPath, 'game'),
resWidth: 1280,
resHeight: 720,
fullscreen: false,
@@ -43,6 +42,8 @@ const DEFAULT_CONFIG = {
},
launcher: {}
},
commonDirectory: path.join(dataPath, 'common'),
instanceDirectory: path.join(dataPath, 'instances'),
clientToken: uuidV4().replace(/-/g, ''),
selectedServer: null, // Resolved
selectedAccount: null,
@@ -139,6 +140,22 @@ exports.getTempNativeFolder = function(){
// System Settings (Unconfigurable on UI)
/**
* Retrieve the common directory for shared
* game files (assets, libraries, etc).
*/
exports.getCommonDirectory = function(){
return config.commonDirectory
}
/**
* Retrieve the instance directory for the per
* server game directories.
*/
exports.getInstanceDirectory = function(){
return config.instanceDirectory
}
/**
* Retrieve the launcher's Client Token.
* There is no default client token.