Added stuff for compatibility with new version

This commit is contained in:
Daniel Xie
2017-06-17 02:21:42 -05:00
parent 9581798bcf
commit 316aa8ad2d
3 changed files with 35 additions and 2 deletions
+27
View File
@@ -69,6 +69,19 @@ loadGame = function(saveObj) {
try {
var ver = JSON.parse(saveObj.VersionSave, Reviver);
if (ver != CONSTANTS.Version) {
if (CONSTANTS.Version == "0.21.0") {
dialogBoxCreate("All scripts automatically killed for the sake of compatibility " +
"with new version. If the game is still broken, try the following: " +
"Options -> Soft Reset -> Save Game -> Reload page. If that STILL " +
"doesn't work contact the dev");
//This is the big update that might break games. Kill all running scripts
for (var ip in AllServers) {
if (AllServers.hasOwnProperty(ip)) {
AllServers[ip].runningScripts = [];
AllServers[ip].runningScripts.length = 0;
}
}
}
createNewUpdateText();
}
} catch(e) {
@@ -126,6 +139,20 @@ loadImportedGame = function(saveObj, saveString) {
if (ver != CONSTANTS.Version) {
createNewUpdateText();
}
if (ver != CONSTANTS.Version) {
if (CONSTANTS.Version == "0.21.0") {
console.log("here");
//This is the big update that might break games. Kill all running scripts
for (var ip in tempAllServers) {
if (tempAllServers.hasOwnProperty(ip)) {
tempAllServers[ip].runningScripts = [];
tempAllServers[ip].runningScripts.length = 0;
}
}
}
createNewUpdateText();
}
} catch(e) {
createNewUpdateText();
}