mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user