Removed time for Program netscript ocmmands (nuke, brutessh, etc)

This commit is contained in:
Daniel Xie 2017-06-05 01:24:30 -05:00
parent bb24c017f1
commit 71999ea2eb
2 changed files with 52 additions and 61 deletions

@ -488,6 +488,11 @@ CONSTANTS = {
"RAM Upgrades on your home computer",
Changelog:
"v0.20.0<br>" +
"Refactor Netscript Interpreter code. Operations in Netscript should now run significantly faster (Every operation " +
"such as a variable assignment, a function call, a binary operator, getting a variable's value, etc. used to take up to several seconds, " +
"now each one should only take 750 milliseconds). <br> " +
""
"v0.19.7<br>" +
"-Added changelog to Options menu<br>" +
"-Bug fix with autocompletion (wasn't working properly for capitalized filenames/programs<br><br>" +

@ -252,9 +252,6 @@ function netscriptRunNukeProgram(exp, workerScript, server) {
if (server.openPortCount < server.numOpenPortsRequired) {
return Promise.reject(makeRuntimeRejectMsg(workerScript, "Not enough ports opened to use NUKE.exe virus"));
}
workerScript.scriptRef.log("Running NUKE.exe on server " + server.hostname + " in 5 seconds");
setTimeout(function() {
if (server.hasAdminRights) {
workerScript.scriptRef.log("Already have root access to " + server.hostname);
} else {
@ -262,13 +259,11 @@ function netscriptRunNukeProgram(exp, workerScript, server) {
workerScript.scriptRef.log("Executed NUKE.exe virus on " + server.hostname + " to gain root access");
}
return Promise.resolve(true);
}, 5 * 1000);
}
function netscriptRunBrutesshProgram(exp, workerScript, server) {
var env = workerScript.env;
if (env.stopFlag) {return Promise.reject(workerScript);}
setTimeout(function() {
if (!server.sshPortOpen) {
workerScript.scriptRef.log("Executed BruteSSH.exe virus on " + server.hostname + " to open SSH port (22)");
server.sshPortOpen = true;
@ -277,13 +272,11 @@ function netscriptRunBrutesshProgram(exp, workerScript, server) {
workerScript.scriptRef.log("SSH Port (22) already opened on " + server.hostname);
}
return Promise.resolve(true);
}, 10 * 1000);
}
function netscriptRunFtpcrackProgram(exp, workerScript, server) {
var env = workerScript.env;
if (env.stopFlag) {return Promise.reject(workerScript);}
setTimeout(function() {
if (!server.ftpPortOpen) {
workerScript.scriptRef.log("Executed FTPCrack.exe virus on " + server.hostname + " to open FTP port (21)");
server.ftpPortOpen = true;
@ -292,13 +285,11 @@ function netscriptRunFtpcrackProgram(exp, workerScript, server) {
workerScript.scriptRef.log("FTP Port (21) already opened on " + server.hostname);
}
return Promise.resolve(true);
}, 15 * 1000);
}
function netscriptRunRelaysmtpProgram(exp, workerScript, server) {
var env = workerScript.env;
if (env.stopFlag) {return Promise.reject(workerScript);}
setTimeout(function() {
if (!server.smtpPortOpen) {
workerScript.scriptRef.log("Executed relaySMTP.exe virus on " + server.hostname + " to open SMTP port (25)");
server.smtpPortOpen = true;
@ -307,13 +298,11 @@ function netscriptRunRelaysmtpProgram(exp, workerScript, server) {
workerScript.scriptRef.log("SMTP Port (25) already opened on " + server.hostname);
}
return Promise.resolve(true);
}, 20 * 1000);
}
function netscriptRunHttpwormProgram(exp, workerScript, server) {
var env = workerScript.env;
if (env.stopFlag) {return Promise.reject(workerScript);}
setTimeout(function() {
if (!server.httpPortOpen) {
workerScript.scriptRef.log("Executed HTTPWorm.exe virus on " + server.hostname + " to open HTTP port (25)");
server.httpPortOpen = true;
@ -322,13 +311,11 @@ function netscriptRunHttpwormProgram(exp, workerScript, server) {
workerScript.scriptRef.log("HTTP Port (80) already opened on " + server.hostname);
}
return Promise.resolve(true);
}, 25 * 1000);
}
function netscriptRunSqlinjectProgram(exp, workerScript, server) {
var env = workerScript.env;
if (env.stopFlag) {return Promise.reject(workerScript);}
setTimeout(function() {
if (!server.sqlPortOpen) {
workerScript.scriptRef.log("Executed SQLInject.exe virus on " + server.hostname + " to open SQL port (1433)");
server.sqlPortOpen = true;
@ -337,5 +324,4 @@ function netscriptRunSqlinjectProgram(exp, workerScript, server) {
workerScript.scriptRef.log("SQL Port (1433) already opened on " + server.hostname);
}
return Promise.resolve(true);
}, 30 * 1000);
}