mirror of
https://github.com/OpenFusionProject/Client.git
synced 2024-11-22 13:40:06 +00:00
Check config before running cache swap logic
This commit is contained in:
parent
c997ab96ec
commit
9c5338da2d
@ -4,6 +4,7 @@ var remotefs = remote.require('fs-extra');
|
|||||||
var userdir = remote.require('app').getPath('userData');
|
var userdir = remote.require('app').getPath('userData');
|
||||||
var versionarray
|
var versionarray
|
||||||
var serverarray
|
var serverarray
|
||||||
|
var config
|
||||||
|
|
||||||
function enableServerListButtons() {
|
function enableServerListButtons() {
|
||||||
$('#of-connect-button').removeClass('disabled');
|
$('#of-connect-button').removeClass('disabled');
|
||||||
@ -56,8 +57,8 @@ function loadGameVersions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadConfig() {
|
function loadConfig() {
|
||||||
// TODO: actually use these values
|
// load config object globally
|
||||||
var configjson = JSON.parse(remotefs.readFileSync(userdir+"\\config.json"));
|
config = JSON.parse(remotefs.readFileSync(userdir+"\\config.json"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadServerList() {
|
function loadServerList() {
|
||||||
@ -96,6 +97,7 @@ function setGameInfo(serverUUID) {
|
|||||||
var result = serverarray.filter(function(obj) {return (obj.uuid === serverUUID);})[0];
|
var result = serverarray.filter(function(obj) {return (obj.uuid === serverUUID);})[0];
|
||||||
var gameversion = versionarray.filter(function(obj) {return (obj.name === result.version);})[0];
|
var gameversion = versionarray.filter(function(obj) {return (obj.name === result.version);})[0];
|
||||||
|
|
||||||
|
if(config['cache-swapping']) { // if cache swapping property exists AND is `true`, run cache swapping logic
|
||||||
// Cache folder renaming
|
// Cache folder renaming
|
||||||
var cachedir = userdir + '\\..\\..\\LocalLow\\Unity\\Web Player\\Cache';
|
var cachedir = userdir + '\\..\\..\\LocalLow\\Unity\\Web Player\\Cache';
|
||||||
var curversion = cachedir + '\\Fusionfall';
|
var curversion = cachedir + '\\Fusionfall';
|
||||||
@ -124,6 +126,7 @@ function setGameInfo(serverUUID) {
|
|||||||
|
|
||||||
// make note of what version we are launching for next launch
|
// make note of what version we are launching for next launch
|
||||||
remotefs.writeFileSync(record, gameversion.name);
|
remotefs.writeFileSync(record, gameversion.name);
|
||||||
|
}
|
||||||
|
|
||||||
window.asseturl = gameversion.url; // gameclient.js needs to access this
|
window.asseturl = gameversion.url; // gameclient.js needs to access this
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user