Added hacknet node api functions for spending hashes. Fixed several bugs with v0.46.0. Rebalanced hash upgrades. continued working on terminal directory implementation

This commit is contained in:
danielyxie
2019-04-05 02:08:41 -07:00
parent fb857642e8
commit 3241945452
30 changed files with 576 additions and 314 deletions
+2 -12
View File
@@ -17,6 +17,7 @@ import { AllServers } from "../Server/AllServers";
import { processSingleServerGrowth } from "../Server/ServerHelpers";
import { Settings } from "../Settings/Settings";
import { EditorSetting } from "../Settings/SettingEnums";
import { isValidFilename } from "../Terminal/DirectoryHelpers";
import {TextFile} from "../TextFile";
import {Page, routing} from "../ui/navigationTracking";
@@ -247,7 +248,7 @@ function saveAndCloseScriptEditor() {
return;
}
if (checkValidFilename(filename) == false) {
if (filename !== ".fconf" && !isValidFilename(filename)) {
dialogBoxCreate("Script filename can contain only alphanumerics, hyphens, and underscores");
return;
}
@@ -292,17 +293,6 @@ function saveAndCloseScriptEditor() {
Engine.loadTerminalContent();
}
//Checks that the string contains only valid characters for a filename, which are alphanumeric,
// underscores, hyphens, and dots
function checkValidFilename(filename) {
var regex = /^[.a-zA-Z0-9\/_-]+$/;
if (filename.match(regex)) {
return true;
}
return false;
}
//Called when the game is loaded. Loads all running scripts (from all servers)
//into worker scripts so that they will start running
export function loadAllRunningScripts() {