mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-25 15:42:28 +01:00
Merge branch 'dev' of https://github.com/danielyxie/bitburner into nsjs-memoryleak
This commit is contained in:
commit
abb5b9895f
15
dist/engine.bundle.js
vendored
15
dist/engine.bundle.js
vendored
@ -14817,7 +14817,7 @@ let Terminal = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var scriptname = args[0];
|
var scriptname = args[0];
|
||||||
if (!scriptname.endsWith(".lit") && !Object(_Script_js__WEBPACK_IMPORTED_MODULE_14__["isScriptFilename"])(scriptName) &&
|
if (!scriptname.endsWith(".lit") && !Object(_Script_js__WEBPACK_IMPORTED_MODULE_14__["isScriptFilename"])(scriptname) &&
|
||||||
!scriptname.endsWith(".txt")){
|
!scriptname.endsWith(".txt")){
|
||||||
post("Error: scp only works for .script, .txt, and .lit files");
|
post("Error: scp only works for .script, .txt, and .lit files");
|
||||||
return;
|
return;
|
||||||
@ -18521,7 +18521,7 @@ function prestigeWorkerScripts() {
|
|||||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["deleteActiveScriptsItem"])(workerScripts[i]);
|
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["deleteActiveScriptsItem"])(workerScripts[i]);
|
||||||
workerScripts[i].env.stopFlag = true;
|
workerScripts[i].env.stopFlag = true;
|
||||||
}
|
}
|
||||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(); //Force UI to update
|
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(5000); //Force UI to update
|
||||||
workerScripts.length = 0;
|
workerScripts.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54961,7 +54961,6 @@ let ActiveScriptsUI = {};
|
|||||||
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
|
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
|
||||||
|
|
||||||
function createActiveScriptsServerPanel(server) {
|
function createActiveScriptsServerPanel(server) {
|
||||||
ActiveScriptsTasks.push(function(server) {
|
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
|
|
||||||
var activeScriptsList = document.getElementById("active-scripts-list");
|
var activeScriptsList = document.getElementById("active-scripts-list");
|
||||||
@ -54990,13 +54989,11 @@ function createActiveScriptsServerPanel(server) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return li;
|
return li;
|
||||||
}.bind(null, server));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deletes the info for a particular server (Dropdown header + Panel with all info)
|
//Deletes the info for a particular server (Dropdown header + Panel with all info)
|
||||||
//in the Active Scripts page if it exists
|
//in the Active Scripts page if it exists
|
||||||
function deleteActiveScriptsServerPanel(server) {
|
function deleteActiveScriptsServerPanel(server) {
|
||||||
ActiveScriptsTasks.push(function(server) {
|
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
if (ActiveScriptsUI[hostname] == null) {
|
if (ActiveScriptsUI[hostname] == null) {
|
||||||
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
|
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
|
||||||
@ -55012,7 +55009,6 @@ function deleteActiveScriptsServerPanel(server) {
|
|||||||
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].panel);
|
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].panel);
|
||||||
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].header);
|
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].header);
|
||||||
delete ActiveScriptsUI[hostname];
|
delete ActiveScriptsUI[hostname];
|
||||||
}.bind(null, server));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addActiveScriptsItem(workerscript) {
|
function addActiveScriptsItem(workerscript) {
|
||||||
@ -55022,11 +55018,12 @@ function addActiveScriptsItem(workerscript) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
|
|
||||||
|
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
||||||
if (ActiveScriptsUI[hostname] == null) {
|
if (ActiveScriptsUI[hostname] == null) {
|
||||||
createActiveScriptsServerPanel(server);
|
createActiveScriptsServerPanel(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
|
||||||
//Create the unique identifier (key) for this script
|
//Create the unique identifier (key) for this script
|
||||||
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
|
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
|
||||||
for (var i = 0; i < workerscript.args.length; ++i) {
|
for (var i = 0; i < workerscript.args.length; ++i) {
|
||||||
@ -55117,10 +55114,10 @@ function deleteActiveScriptsItem(workerscript) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Update the ActiveScriptsItems array
|
//Update the ActiveScriptsItems array
|
||||||
function updateActiveScriptsItems() {
|
function updateActiveScriptsItems(maxTasks=100) {
|
||||||
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
||||||
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
||||||
let numTasks = Math.min(100, ActiveScriptsTasks.length);
|
let numTasks = Math.min(maxTasks, ActiveScriptsTasks.length);
|
||||||
for (let i = 0; i < numTasks; ++i) {
|
for (let i = 0; i < numTasks; ++i) {
|
||||||
let task = ActiveScriptsTasks.shift();
|
let task = ActiveScriptsTasks.shift();
|
||||||
try {
|
try {
|
||||||
|
15
dist/tests.bundle.js
vendored
15
dist/tests.bundle.js
vendored
@ -14817,7 +14817,7 @@ let Terminal = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var scriptname = args[0];
|
var scriptname = args[0];
|
||||||
if (!scriptname.endsWith(".lit") && !Object(_Script_js__WEBPACK_IMPORTED_MODULE_14__["isScriptFilename"])(scriptName) &&
|
if (!scriptname.endsWith(".lit") && !Object(_Script_js__WEBPACK_IMPORTED_MODULE_14__["isScriptFilename"])(scriptname) &&
|
||||||
!scriptname.endsWith(".txt")){
|
!scriptname.endsWith(".txt")){
|
||||||
post("Error: scp only works for .script, .txt, and .lit files");
|
post("Error: scp only works for .script, .txt, and .lit files");
|
||||||
return;
|
return;
|
||||||
@ -18521,7 +18521,7 @@ function prestigeWorkerScripts() {
|
|||||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["deleteActiveScriptsItem"])(workerScripts[i]);
|
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["deleteActiveScriptsItem"])(workerScripts[i]);
|
||||||
workerScripts[i].env.stopFlag = true;
|
workerScripts[i].env.stopFlag = true;
|
||||||
}
|
}
|
||||||
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(); //Force UI to update
|
Object(_ActiveScriptsUI_js__WEBPACK_IMPORTED_MODULE_0__["updateActiveScriptsItems"])(5000); //Force UI to update
|
||||||
workerScripts.length = 0;
|
workerScripts.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54961,7 +54961,6 @@ let ActiveScriptsUI = {};
|
|||||||
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
|
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
|
||||||
|
|
||||||
function createActiveScriptsServerPanel(server) {
|
function createActiveScriptsServerPanel(server) {
|
||||||
ActiveScriptsTasks.push(function(server) {
|
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
|
|
||||||
var activeScriptsList = document.getElementById("active-scripts-list");
|
var activeScriptsList = document.getElementById("active-scripts-list");
|
||||||
@ -54990,13 +54989,11 @@ function createActiveScriptsServerPanel(server) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return li;
|
return li;
|
||||||
}.bind(null, server));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deletes the info for a particular server (Dropdown header + Panel with all info)
|
//Deletes the info for a particular server (Dropdown header + Panel with all info)
|
||||||
//in the Active Scripts page if it exists
|
//in the Active Scripts page if it exists
|
||||||
function deleteActiveScriptsServerPanel(server) {
|
function deleteActiveScriptsServerPanel(server) {
|
||||||
ActiveScriptsTasks.push(function(server) {
|
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
if (ActiveScriptsUI[hostname] == null) {
|
if (ActiveScriptsUI[hostname] == null) {
|
||||||
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
|
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
|
||||||
@ -55012,7 +55009,6 @@ function deleteActiveScriptsServerPanel(server) {
|
|||||||
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].panel);
|
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].panel);
|
||||||
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].header);
|
Object(_utils_HelperFunctions_js__WEBPACK_IMPORTED_MODULE_5__["removeElement"])(ActiveScriptsUI[hostname].header);
|
||||||
delete ActiveScriptsUI[hostname];
|
delete ActiveScriptsUI[hostname];
|
||||||
}.bind(null, server));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addActiveScriptsItem(workerscript) {
|
function addActiveScriptsItem(workerscript) {
|
||||||
@ -55022,11 +55018,12 @@ function addActiveScriptsItem(workerscript) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
|
|
||||||
|
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
||||||
if (ActiveScriptsUI[hostname] == null) {
|
if (ActiveScriptsUI[hostname] == null) {
|
||||||
createActiveScriptsServerPanel(server);
|
createActiveScriptsServerPanel(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
|
||||||
//Create the unique identifier (key) for this script
|
//Create the unique identifier (key) for this script
|
||||||
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
|
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
|
||||||
for (var i = 0; i < workerscript.args.length; ++i) {
|
for (var i = 0; i < workerscript.args.length; ++i) {
|
||||||
@ -55117,10 +55114,10 @@ function deleteActiveScriptsItem(workerscript) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Update the ActiveScriptsItems array
|
//Update the ActiveScriptsItems array
|
||||||
function updateActiveScriptsItems() {
|
function updateActiveScriptsItems(maxTasks=100) {
|
||||||
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
||||||
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
||||||
let numTasks = Math.min(100, ActiveScriptsTasks.length);
|
let numTasks = Math.min(maxTasks, ActiveScriptsTasks.length);
|
||||||
for (let i = 0; i < numTasks; ++i) {
|
for (let i = 0; i < numTasks; ++i) {
|
||||||
let task = ActiveScriptsTasks.shift();
|
let task = ActiveScriptsTasks.shift();
|
||||||
try {
|
try {
|
||||||
|
@ -26,7 +26,6 @@ let ActiveScriptsUI = {};
|
|||||||
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
|
let ActiveScriptsTasks = []; //Sequentially schedule the creation/deletion of UI elements
|
||||||
|
|
||||||
function createActiveScriptsServerPanel(server) {
|
function createActiveScriptsServerPanel(server) {
|
||||||
ActiveScriptsTasks.push(function(server) {
|
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
|
|
||||||
var activeScriptsList = document.getElementById("active-scripts-list");
|
var activeScriptsList = document.getElementById("active-scripts-list");
|
||||||
@ -55,13 +54,11 @@ function createActiveScriptsServerPanel(server) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return li;
|
return li;
|
||||||
}.bind(null, server));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deletes the info for a particular server (Dropdown header + Panel with all info)
|
//Deletes the info for a particular server (Dropdown header + Panel with all info)
|
||||||
//in the Active Scripts page if it exists
|
//in the Active Scripts page if it exists
|
||||||
function deleteActiveScriptsServerPanel(server) {
|
function deleteActiveScriptsServerPanel(server) {
|
||||||
ActiveScriptsTasks.push(function(server) {
|
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
if (ActiveScriptsUI[hostname] == null) {
|
if (ActiveScriptsUI[hostname] == null) {
|
||||||
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
|
console.log("WARNING: Tried to delete non-existent Active Scripts Server panel. Aborting");
|
||||||
@ -77,7 +74,6 @@ function deleteActiveScriptsServerPanel(server) {
|
|||||||
removeElement(ActiveScriptsUI[hostname].panel);
|
removeElement(ActiveScriptsUI[hostname].panel);
|
||||||
removeElement(ActiveScriptsUI[hostname].header);
|
removeElement(ActiveScriptsUI[hostname].header);
|
||||||
delete ActiveScriptsUI[hostname];
|
delete ActiveScriptsUI[hostname];
|
||||||
}.bind(null, server));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addActiveScriptsItem(workerscript) {
|
function addActiveScriptsItem(workerscript) {
|
||||||
@ -87,11 +83,12 @@ function addActiveScriptsItem(workerscript) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let hostname = server.hostname;
|
let hostname = server.hostname;
|
||||||
|
|
||||||
|
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
||||||
if (ActiveScriptsUI[hostname] == null) {
|
if (ActiveScriptsUI[hostname] == null) {
|
||||||
createActiveScriptsServerPanel(server);
|
createActiveScriptsServerPanel(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveScriptsTasks.push(function(workerscript, hostname) {
|
|
||||||
//Create the unique identifier (key) for this script
|
//Create the unique identifier (key) for this script
|
||||||
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
|
var itemNameArray = ["active", "scripts", hostname, workerscript.name];
|
||||||
for (var i = 0; i < workerscript.args.length; ++i) {
|
for (var i = 0; i < workerscript.args.length; ++i) {
|
||||||
@ -182,10 +179,10 @@ function deleteActiveScriptsItem(workerscript) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Update the ActiveScriptsItems array
|
//Update the ActiveScriptsItems array
|
||||||
function updateActiveScriptsItems() {
|
function updateActiveScriptsItems(maxTasks=100) {
|
||||||
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
//Run tasks that need to be done sequentially (adding items, creating/deleting server panels)
|
||||||
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
//We'll limit this to 50 at a time in case someone decides to start a bunch of scripts all at once...
|
||||||
let numTasks = Math.min(100, ActiveScriptsTasks.length);
|
let numTasks = Math.min(maxTasks, ActiveScriptsTasks.length);
|
||||||
for (let i = 0; i < numTasks; ++i) {
|
for (let i = 0; i < numTasks; ++i) {
|
||||||
let task = ActiveScriptsTasks.shift();
|
let task = ActiveScriptsTasks.shift();
|
||||||
try {
|
try {
|
||||||
|
@ -1432,7 +1432,7 @@ function NetscriptFunctions(workerScript) {
|
|||||||
}
|
}
|
||||||
var stock = SymbolToStockMap[symbol];
|
var stock = SymbolToStockMap[symbol];
|
||||||
if (stock == null) {
|
if (stock == null) {
|
||||||
throw makeRuntimeRejectMsg(workerScript, "Invalid stock symbol passed into getStockPrice()");
|
throw makeRuntimeRejectMsg(workerScript, "Invalid stock symbol passed into getStockPosition()");
|
||||||
}
|
}
|
||||||
return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];
|
return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];
|
||||||
},
|
},
|
||||||
|
@ -53,7 +53,7 @@ function prestigeWorkerScripts() {
|
|||||||
deleteActiveScriptsItem(workerScripts[i]);
|
deleteActiveScriptsItem(workerScripts[i]);
|
||||||
workerScripts[i].env.stopFlag = true;
|
workerScripts[i].env.stopFlag = true;
|
||||||
}
|
}
|
||||||
updateActiveScriptsItems(); //Force UI to update
|
updateActiveScriptsItems(5000); //Force UI to update
|
||||||
workerScripts.length = 0;
|
workerScripts.length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1379,7 +1379,7 @@ let Terminal = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var scriptname = args[0];
|
var scriptname = args[0];
|
||||||
if (!scriptname.endsWith(".lit") && !isScriptFilename(scriptName) &&
|
if (!scriptname.endsWith(".lit") && !isScriptFilename(scriptname) &&
|
||||||
!scriptname.endsWith(".txt")){
|
!scriptname.endsWith(".txt")){
|
||||||
post("Error: scp only works for .script, .txt, and .lit files");
|
post("Error: scp only works for .script, .txt, and .lit files");
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user