2017-02-28 22:20:37 +01:00
|
|
|
/* Create programs */
|
2017-04-11 22:42:06 +02:00
|
|
|
Programs = {
|
|
|
|
NukeProgram: "NUKE.exe",
|
|
|
|
BruteSSHProgram: "BruteSSH.exe",
|
|
|
|
FTPCrackProgram: "FTPCrack.exe",
|
|
|
|
RelaySMTPProgram: "relaySMTP.exe",
|
|
|
|
HTTPWormProgram: "HTTPWorm.exe",
|
|
|
|
SQLInjectProgram: "SQLInject.exe",
|
|
|
|
}
|
|
|
|
|
2017-04-19 23:39:25 +02:00
|
|
|
//TODO Right now the times needed to complete work are hard-coded...
|
|
|
|
//maybe later make this dependent on hacking level or something
|
2017-02-28 22:20:37 +01:00
|
|
|
function displayCreateProgramContent() {
|
2017-03-31 14:32:04 +02:00
|
|
|
var portHackALink = document.getElementById("create-program-porthack");
|
|
|
|
var bruteSshALink = document.getElementById("create-program-brutessh");
|
|
|
|
var ftpCrackALink = document.getElementById("create-program-ftpcrack");
|
|
|
|
var relaySmtpALink = document.getElementById("create-program-relaysmtp");
|
|
|
|
var httpWormALink = document.getElementById("create-program-httpworm");
|
|
|
|
var sqlInjectALink = document.getElementById("create-program-sqlinject");
|
|
|
|
|
|
|
|
portHackALink.style.display = "none";
|
|
|
|
bruteSshALink.style.display = "none";
|
|
|
|
ftpCrackALink.style.display = "none";
|
|
|
|
relaySmtpALink.style.display = "none";
|
|
|
|
httpWormALink.style.display = "none";
|
|
|
|
sqlInjectALink.style.display = "none";
|
|
|
|
|
2017-03-31 23:47:06 +02:00
|
|
|
//TODO These addEventListeners should only happen once so I guess just put them in Engine.init()
|
|
|
|
|
2017-02-28 23:06:12 +01:00
|
|
|
//PortHack.exe (in case you delete it lol)
|
2017-04-11 22:42:06 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.NukeProgram) == -1) {
|
2017-03-31 14:32:04 +02:00
|
|
|
portHackALink.style.display = "block";
|
|
|
|
portHackALink.addEventListener("click", function() {
|
2017-05-05 17:50:55 +02:00
|
|
|
createProgram(Programs.PortHackProgram, CONSTANTS.MillisecondsPerQuarterHour);
|
2017-04-13 19:33:34 +02:00
|
|
|
});
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 22:20:37 +01:00
|
|
|
|
2017-02-28 23:06:12 +01:00
|
|
|
//BruteSSH
|
2017-04-11 22:42:06 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.BruteSSHProgram) == -1 &&
|
2017-03-31 14:32:04 +02:00
|
|
|
Player.hacking_skill >= 50) {
|
|
|
|
bruteSshALink.style.display = "block";
|
|
|
|
bruteSshALink.addEventListener("click", function() {
|
2017-05-04 07:27:22 +02:00
|
|
|
Player.startCreateProgramWork(Programs.BruteSSHProgram, CONSTANTS.MillisecondsPerQuarterHour);
|
2017-04-13 19:33:34 +02:00
|
|
|
});
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
|
|
|
|
//FTPCrack
|
2017-04-11 22:42:06 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.FTPCrackProgram) == -1 &&
|
2017-05-02 19:06:46 +02:00
|
|
|
Player.hacking_skill >= 100) {
|
2017-03-31 14:32:04 +02:00
|
|
|
ftpCrackALink.style.display = "block";
|
|
|
|
ftpCrackALink.addEventListener("click", function() {
|
2017-05-05 06:54:40 +02:00
|
|
|
Player.startCreateProgramWork(Programs.FTPCrackProgram, CONSTANTS.MillisecondsPerHalfHour);
|
2017-04-13 19:33:34 +02:00
|
|
|
});
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
|
|
|
|
//relaySMTP
|
2017-04-13 19:33:34 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.RelaySMTPProgram) == -1 &&
|
2017-05-02 19:06:46 +02:00
|
|
|
Player.hacking_skill >= 250) {
|
2017-03-31 14:32:04 +02:00
|
|
|
relaySmtpALink.style.display = "block";
|
|
|
|
relaySmtpAlink.addEventListener("click", function() {
|
2017-05-04 07:27:22 +02:00
|
|
|
Player.startCreateProgramWork(Programs.RelaySMTPProgram. CONSTANTS.MillisecondsPer2Hours);
|
2017-04-13 19:33:34 +02:00
|
|
|
});
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
|
|
|
|
//HTTPWorm
|
2017-04-13 19:33:34 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.HTTPWormProgram) == -1 &&
|
2017-03-31 14:32:04 +02:00
|
|
|
Player.hacking_skill >= 500) {
|
|
|
|
httpWormALink.style.display = "block";
|
|
|
|
httpWormALink.addEventListener("click", function() {
|
2017-05-04 07:27:22 +02:00
|
|
|
Player.startCreateProgramWork(Programs.HTTPWormProgram, CONSTANTS.MillisecondsPer4Hours);
|
2017-04-13 19:33:34 +02:00
|
|
|
});
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 23:06:12 +01:00
|
|
|
|
|
|
|
//SQLInject
|
2017-04-13 19:33:34 +02:00
|
|
|
if (Player.getHomeComputer().programs.indexOf(Programs.SQLInjectProgram) == -1 &&
|
2017-03-31 14:32:04 +02:00
|
|
|
Player.hacking_skill >= 750) {
|
|
|
|
sqlInjectALink.style.display = "block";
|
|
|
|
sqlInjectALink.addEventListener("click", function() {
|
2017-05-04 07:27:22 +02:00
|
|
|
Player.startCreateProgramWork(Programs.SQLInjectProgram, CONSTANTS.MillisecondsPer8Hours);
|
2017-04-13 19:33:34 +02:00
|
|
|
});
|
2017-03-31 14:32:04 +02:00
|
|
|
}
|
2017-02-28 22:20:37 +01:00
|
|
|
}
|