diff --git a/src/Constants.js b/src/Constants.js index b260431d0..e1946f9ce 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -643,6 +643,9 @@ CONSTANTS = { "RAM Upgrades on your home computer", Changelog: + "v0.21.1
" + + "-IF YOUR GAME BREAKS, DO THE FOLLOWING: Options -> Soft Reset -> Save Game -> Reload Page. Sorry about that!
" + + "-Autocompletion for aliases - courtesy of Github user LTCNugget" + "v0.21.0
" + "-Added dynamic arrays. See Netscript documentation
" + "-Added ability to pass arguments into scripts. See documentation
" + @@ -793,6 +796,9 @@ CONSTANTS = { LatestUpdate: "v0.21.0
" + + "-All scripts automatically killed for the sake of update compatibility
" + + "-IF YOUR GAME BREAKS, DO THE FOLLOWING: Options -> Soft Reset -> Save Game -> Reload Page. Sorry about that!
" + + "-Autocompletion for aliases - courtesy of Github user LTCNugget

" + "-Added dynamic arrays. See Netscript documentation
" + "-Added ability to pass arguments into scripts. See documentation
" + "-The implementation/function signature of functions that deal with scripts have changed. Therefore, some old scripts might not " + diff --git a/src/SaveObject.js b/src/SaveObject.js index 1cdf2b6f1..ef666c865 100644 --- a/src/SaveObject.js +++ b/src/SaveObject.js @@ -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(); } diff --git a/src/Terminal.js b/src/Terminal.js index d6d8969ed..bcaea1a78 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -238,7 +238,7 @@ function determineAllPossibilitiesForTabCompletion(input, index=0) { return ["alias", "analyze", "cat", "check", "clear", "cls", "connect", "free", "hack", "help", "home", "hostname", "ifconfig", "kill", "killall", "ls", "mem", "nano", "ps", "rm", "run", "scan", "scan-analyze", - "scp", "sudov", "tail", "theme", "top"]; + "scp", "sudov", "tail", "theme", "top"].concat(Object.keys(Aliases)); } if (input.startsWith ("buy ")) { @@ -1003,7 +1003,7 @@ var Terminal = { var args = commandArray[1] ? commandArray[1].split(" ") : []; if(args.length != 1 && args.length != 3) { post("Incorrect number of arguments."); - post("Usage: theme [default|muted|solarized] | [background color hex] [text color hex] [highlight color hex]"); + post("Usage: theme [default|muted|solarized] | #[background color hex] #[text color hex] #[highlight color hex]"); }else if(args.length == 1){ var themeName = args[0]; if(themeName == "default"){