2018-06-26 18:34:11 +02:00
|
|
|
import {BitNodeMultipliers} from "./BitNode";
|
|
|
|
import {CONSTANTS} from "./Constants";
|
|
|
|
import {Programs} from "./CreateProgram";
|
|
|
|
import {Player} from "./Player";
|
|
|
|
import {RunningScript, Script} from "./Script";
|
|
|
|
import {SpecialServerNames, SpecialServerIps} from "./SpecialServerIps";
|
2018-07-05 02:35:33 +02:00
|
|
|
import {getRandomInt} from "../utils/helpers/getRandomInt";
|
2018-06-26 18:34:11 +02:00
|
|
|
import {createRandomIp, isValidIPAddress, ipExists} from "../utils/IPAddress";
|
2017-08-30 19:44:29 +02:00
|
|
|
import {Reviver, Generic_toJSON,
|
2018-06-26 18:34:11 +02:00
|
|
|
Generic_fromJSON} from "../utils/JSONReviver";
|
2017-08-30 19:44:29 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
function Server(params={ip:createRandomIp(), hostname:""}) {
|
|
|
|
/* Properties */
|
|
|
|
//Connection information
|
|
|
|
this.ip = params.ip ? params.ip : createRandomIp();
|
|
|
|
|
|
|
|
var hostname = params.hostname;
|
2017-08-03 06:21:15 +02:00
|
|
|
var i = 0;
|
2017-10-07 07:51:49 +02:00
|
|
|
var suffix = "";
|
|
|
|
while (GetServerByHostname(hostname+suffix) != null) {
|
2017-08-03 06:21:15 +02:00
|
|
|
//Server already exists
|
2017-10-07 07:51:49 +02:00
|
|
|
suffix = "-" + i;
|
2017-08-03 06:21:15 +02:00
|
|
|
++i;
|
|
|
|
}
|
2018-05-05 22:23:57 +02:00
|
|
|
this.hostname = hostname + suffix;
|
2018-05-06 22:27:47 +02:00
|
|
|
this.organizationName = params.organizationName != null ? params.organizationName : "";
|
|
|
|
this.isConnectedTo = params.isConnectedTo != null ? params.isConnectedTo : false;
|
2018-05-05 22:23:57 +02:00
|
|
|
|
|
|
|
//Access information
|
2018-05-06 22:27:47 +02:00
|
|
|
this.hasAdminRights = params.adminRights != null ? params.adminRights : false;
|
|
|
|
this.purchasedByPlayer = params.purchasedByPlayer != null ? params.purchasedByPlayer : false;
|
2018-05-05 22:23:57 +02:00
|
|
|
this.manuallyHacked = false; //Flag that tracks whether or not the server has been hacked at least once
|
|
|
|
|
|
|
|
//RAM, CPU speed and Scripts
|
2018-05-06 22:27:47 +02:00
|
|
|
this.maxRam = params.maxRam != null ? params.maxRam : 0; //GB
|
2018-05-05 22:23:57 +02:00
|
|
|
this.ramUsed = 0;
|
|
|
|
this.cpuCores = 1; //Max of 8, affects hacking times and Hacking Mission starting Cores
|
|
|
|
|
|
|
|
this.scripts = [];
|
|
|
|
this.runningScripts = []; //Stores RunningScript objects
|
|
|
|
this.programs = [];
|
|
|
|
this.messages = [];
|
|
|
|
this.textFiles = [];
|
|
|
|
this.dir = 0; //new Directory(this, null, ""); TODO
|
|
|
|
|
|
|
|
/* Hacking information (only valid for "foreign" aka non-purchased servers) */
|
2018-05-06 22:27:47 +02:00
|
|
|
this.requiredHackingSkill = params.requiredHackingSkill != null ? params.requiredHackingSkill : 1;
|
2018-05-06 23:20:00 +02:00
|
|
|
this.moneyAvailable = params.moneyAvailable != null ? params.moneyAvailable * BitNodeMultipliers.ServerStartingMoney : 0;
|
2018-05-05 22:23:57 +02:00
|
|
|
this.moneyMax = 25 * this.moneyAvailable * BitNodeMultipliers.ServerMaxMoney;
|
|
|
|
|
|
|
|
//Hack Difficulty is synonymous with server security. Base Difficulty = Starting difficulty
|
2018-05-06 22:27:47 +02:00
|
|
|
this.hackDifficulty = params.hackDifficulty != null ? params.hackDifficulty * BitNodeMultipliers.ServerStartingSecurity : 1;
|
2018-05-05 22:23:57 +02:00
|
|
|
this.baseDifficulty = this.hackDifficulty;
|
|
|
|
this.minDifficulty = Math.max(1, Math.round(this.hackDifficulty / 3));
|
2018-05-06 22:27:47 +02:00
|
|
|
this.serverGrowth = params.serverGrowth != null ? params.serverGrowth : 1; //Integer from 0 to 100. Affects money increase from grow()
|
2018-05-05 22:23:57 +02:00
|
|
|
|
|
|
|
//The IP's of all servers reachable from this one (what shows up if you run scan/netstat)
|
2016-12-01 23:18:18 +01:00
|
|
|
// NOTE: Only contains IP and not the Server objects themselves
|
2018-05-05 22:23:57 +02:00
|
|
|
this.serversOnNetwork = [];
|
|
|
|
|
|
|
|
//Port information, required for porthacking servers to get admin rights
|
2018-05-06 22:27:47 +02:00
|
|
|
this.numOpenPortsRequired = params.numOpenPortsRequired != null ? params.numOpenPortsRequired : 5;
|
2018-05-05 22:23:57 +02:00
|
|
|
this.sshPortOpen = false; //Port 22
|
|
|
|
this.ftpPortOpen = false; //Port 21
|
|
|
|
this.smtpPortOpen = false; //Port 25
|
|
|
|
this.httpPortOpen = false; //Port 80
|
|
|
|
this.sqlPortOpen = false; //Port 1433
|
|
|
|
this.openPortCount = 0;
|
2016-10-17 23:23:23 +02:00
|
|
|
};
|
|
|
|
|
2017-08-30 19:44:29 +02:00
|
|
|
Server.prototype.setMaxRam = function(ram) {
|
|
|
|
this.maxRam = ram;
|
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//The serverOnNetwork array holds the IP of all the servers. This function
|
|
|
|
//returns the actual Server objects
|
|
|
|
Server.prototype.getServerOnNetwork = function(i) {
|
|
|
|
if (i > this.serversOnNetwork.length) {
|
|
|
|
console.log("Tried to get server on network that was out of range");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return AllServers[this.serversOnNetwork[i]];
|
2016-10-19 23:43:49 +02:00
|
|
|
}
|
|
|
|
|
2016-12-15 18:51:23 +01:00
|
|
|
//Given the name of the script, returns the corresponding
|
|
|
|
//script object on the server (if it exists)
|
|
|
|
Server.prototype.getScript = function(scriptName) {
|
2018-05-05 22:23:57 +02:00
|
|
|
for (var i = 0; i < this.scripts.length; i++) {
|
|
|
|
if (this.scripts[i].filename == scriptName) {
|
|
|
|
return this.scripts[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
2016-12-15 18:51:23 +01:00
|
|
|
}
|
|
|
|
|
2018-06-22 21:41:55 +02:00
|
|
|
Server.prototype.capDifficulty = function() {
|
|
|
|
if (this.hackDifficulty < this.minDifficulty) {this.hackDifficulty = this.minDifficulty;}
|
|
|
|
if (this.hackDifficulty < 1) {this.hackDifficulty = 1;}
|
2017-09-19 20:38:03 +02:00
|
|
|
//Place some arbitrarily limit that realistically should never happen unless someone is
|
|
|
|
//screwing around with the game
|
|
|
|
if (this.hackDifficulty > 1000000) {this.hackDifficulty = 1000000;}
|
2017-05-31 18:45:30 +02:00
|
|
|
}
|
|
|
|
|
2018-06-22 21:41:55 +02:00
|
|
|
//Strengthens a server's security level (difficulty) by the specified amount
|
|
|
|
Server.prototype.fortify = function(amt) {
|
|
|
|
this.hackDifficulty += amt;
|
|
|
|
this.capDifficulty();
|
|
|
|
}
|
|
|
|
|
2017-05-31 18:45:30 +02:00
|
|
|
Server.prototype.weaken = function(amt) {
|
2017-08-30 19:44:29 +02:00
|
|
|
this.hackDifficulty -= (amt * BitNodeMultipliers.ServerWeakenRate);
|
2018-06-22 21:41:55 +02:00
|
|
|
this.capDifficulty();
|
2017-05-31 18:45:30 +02:00
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Functions for loading and saving a Server
|
|
|
|
Server.prototype.toJSON = function() {
|
2018-05-05 22:23:57 +02:00
|
|
|
return Generic_toJSON("Server", this);
|
2016-10-18 23:37:53 +02:00
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
Server.fromJSON = function(value) {
|
2018-05-05 22:23:57 +02:00
|
|
|
return Generic_fromJSON(Server, value.data);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Reviver.constructors.Server = Server;
|
|
|
|
|
2017-08-30 19:44:29 +02:00
|
|
|
function initForeignServers() {
|
2016-12-01 23:18:18 +01:00
|
|
|
//MegaCorporations
|
2018-05-05 22:23:57 +02:00
|
|
|
var ECorpServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"ecorp", organizationName:"ECorp",
|
|
|
|
requiredHackingSkill:getRandomInt(1150, 1300), moneyAvailable:getRandomInt(30e9, 70e9),
|
|
|
|
hackDifficulty:99,serverGrowth:99, numOpenPortsRequired: 5,
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(ECorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var MegaCorpServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"megacorp", organizationName:"MegaCorp",
|
|
|
|
requiredHackingSkill:getRandomInt(1150, 1300), moneyAvailable:getRandomInt(40e9, 60e9),
|
|
|
|
hackDifficulty:99, serverGrowth:99, numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(MegaCorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var BachmanAndAssociatesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"b-and-a", organizationName:"Bachman & Associates",
|
|
|
|
requiredHackingSkill:getRandomInt(1000, 1050), moneyAvailable:getRandomInt(20e9, 25e9),
|
|
|
|
hackDifficulty:getRandomInt(75, 85), serverGrowth:getRandomInt(65, 75), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(BachmanAndAssociatesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var BladeIndustriesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"blade", organizationName:"Blade Industries", maxRam:128,
|
|
|
|
requiredHackingSkill:getRandomInt(1000, 1100), moneyAvailable:getRandomInt(12e9, 20e9),
|
|
|
|
hackDifficulty:getRandomInt(90, 95), serverGrowth:getRandomInt(60, 75), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
BladeIndustriesServer.messages.push("beyond-man.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(BladeIndustriesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var NWOServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"nwo", organizationName:"New World Order",
|
|
|
|
requiredHackingSkill:getRandomInt(1000, 1200), moneyAvailable:getRandomInt(25e9, 35e9),
|
|
|
|
hackDifficulty:99, serverGrowth:getRandomInt(75, 85), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
NWOServer.messages.push("the-hidden-world.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(NWOServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var ClarkeIncorporatedServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"clarkeinc", organizationName:"Clarke Incorporated",
|
|
|
|
requiredHackingSkill:getRandomInt(1000, 1200), moneyAvailable:getRandomInt(15e9, 25e9),
|
|
|
|
hackDifficulty:getRandomInt(50, 60), serverGrowth:getRandomInt(50, 70), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
ClarkeIncorporatedServer.messages.push("beyond-man.lit");
|
|
|
|
ClarkeIncorporatedServer.messages.push("cost-of-immortality.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(ClarkeIncorporatedServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var OmniTekIncorporatedServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"omnitek", organizationName:"OmniTek Incorporated", maxRam:256,
|
|
|
|
requiredHackingSkill:getRandomInt(900, 1100), moneyAvailable:getRandomInt(15e9, 20e9),
|
|
|
|
hackDifficulty:getRandomInt(90, 99), serverGrowth:getRandomInt(95, 99), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
OmniTekIncorporatedServer.messages.push("coded-intelligence.lit");
|
2018-05-05 22:23:57 +02:00
|
|
|
OmniTekIncorporatedServer.messages.push("history-of-synthoids.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(OmniTekIncorporatedServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var FourSigmaServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"4sigma", organizationName:"FourSigma",
|
|
|
|
requiredHackingSkill:getRandomInt(950, 1200), moneyAvailable:getRandomInt(15e9, 25e9),
|
|
|
|
hackDifficulty:getRandomInt(60, 70), serverGrowth:getRandomInt(75, 99), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(FourSigmaServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var KuaiGongInternationalServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"kuai-gong", organizationName:"KuaiGong International",
|
|
|
|
requiredHackingSkill:getRandomInt(1000, 1250), moneyAvailable:getRandomInt(20e9, 30e9),
|
|
|
|
hackDifficulty:getRandomInt(95, 99), serverGrowth:getRandomInt(90, 99), numOpenPortsRequired:5,
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(KuaiGongInternationalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Technology and communications companies (large targets)
|
2018-05-05 22:23:57 +02:00
|
|
|
var FulcrumTechnologiesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"fulcrumtech", organizationName:"Fulcrum Technologies", maxRam:512,
|
|
|
|
requiredHackingSkill:getRandomInt(1000, 1200), moneyAvailable:getRandomInt(1.4e9, 1.8e9),
|
|
|
|
hackDifficulty:getRandomInt(85, 95), serverGrowth:getRandomInt(80, 99), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
FulcrumTechnologiesServer.messages.push("simulated-reality.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(FulcrumTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var FulcrumSecretTechnologiesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"fulcrumassets", organizationName:"Fulcrum Technologies Assets",
|
|
|
|
requiredHackingSkill:getRandomInt(1200, 1500), moneyAvailable:1e6,
|
|
|
|
hackDifficulty:99, serverGrowth:1, numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(FulcrumSecretTechnologiesServer);
|
2018-05-05 22:23:57 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.FulcrumSecretTechnologies, FulcrumSecretTechnologiesServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var StormTechnologiesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"stormtech", organizationName:"Storm Technologies",
|
|
|
|
requiredHackingSkill:getRandomInt(900, 1050), moneyAvailable:getRandomInt(1e9, 1.2e9),
|
|
|
|
hackDifficulty:getRandomInt(80, 90), serverGrowth:getRandomInt(70, 90), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(StormTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var DefCommServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"defcomm", organizationName:"DefComm",
|
|
|
|
requiredHackingSkill:getRandomInt(900, 1000), moneyAvailable:getRandomInt(800e6, 950e6),
|
|
|
|
hackDifficulty:getRandomInt(85, 95), serverGrowth:getRandomInt(50, 70), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(DefCommServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var InfoCommServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"infocomm", organizationName:"InfoComm",
|
|
|
|
requiredHackingSkill:getRandomInt(875, 950), moneyAvailable:getRandomInt(600e6, 900e6),
|
|
|
|
hackDifficulty:getRandomInt(70, 90), serverGrowth:getRandomInt(35, 75), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(InfoCommServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var HeliosLabsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"helios", organizationName:"Helios Labs", maxRam:128,
|
|
|
|
requiredHackingSkill:getRandomInt(800, 900), moneyAvailable:getRandomInt(550e6, 750e6),
|
|
|
|
hackDifficulty:getRandomInt(85, 95), serverGrowth:getRandomInt(70, 80), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
HeliosLabsServer.messages.push("beyond-man.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(HeliosLabsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var VitaLifeServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"vitalife", organizationName:"VitaLife", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(775, 900), moneyAvailable:getRandomInt(700e6, 800e6),
|
|
|
|
hackDifficulty:getRandomInt(80, 90), serverGrowth:getRandomInt(60, 80), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
VitaLifeServer.messages.push("A-Green-Tomorrow.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(VitaLifeServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var IcarusMicrosystemsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"icarus", organizationName:"Icarus Microsystems",
|
|
|
|
requiredHackingSkill:getRandomInt(850, 925), moneyAvailable:getRandomInt(900e6, 1000e6),
|
|
|
|
hackDifficulty:getRandomInt(85, 95), serverGrowth:getRandomInt(85, 95), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(IcarusMicrosystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var UniversalEnergyServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"univ-energy", organizationName:"Universal Energy", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(800, 900), moneyAvailable:getRandomInt(1.1e9, 1.2e9),
|
|
|
|
hackDifficulty:getRandomInt(80, 90), serverGrowth:getRandomInt(80, 90), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(UniversalEnergyServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var TitanLabsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"titan-labs", organizationName:"Titan Laboratories", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(800, 875), moneyAvailable:getRandomInt(750e6, 900e6),
|
|
|
|
hackDifficulty:getRandomInt(70, 80), serverGrowth:getRandomInt(60, 80), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
TitanLabsServer.messages.push("coded-intelligence.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(TitanLabsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var MicrodyneTechnologiesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"microdyne", organizationName:"Microdyne Technologies", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(800, 875), moneyAvailable:getRandomInt(500e6, 700e6),
|
|
|
|
hackDifficulty:getRandomInt(65, 75), serverGrowth:getRandomInt(70, 90), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
MicrodyneTechnologiesServer.messages.push("synthetic-muscles.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(MicrodyneTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var TaiYangDigitalServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"taiyang-digital", organizationName:"Taiyang Digital",
|
|
|
|
requiredHackingSkill:getRandomInt(850, 950), moneyAvailable:getRandomInt(800e6, 900e6),
|
|
|
|
hackDifficulty:getRandomInt(70, 80), serverGrowth:getRandomInt(70, 80), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
TaiYangDigitalServer.messages.push("A-Green-Tomorrow.lit");
|
|
|
|
TaiYangDigitalServer.messages.push("brighter-than-the-sun.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(TaiYangDigitalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var GalacticCyberSystemsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"galactic-cyber", organizationName:"Galactic Cybersystems",
|
|
|
|
requiredHackingSkill:getRandomInt(825, 875), moneyAvailable:getRandomInt(750e6, 850e6),
|
|
|
|
hackDifficulty:getRandomInt(55, 65), serverGrowth:getRandomInt(70, 90), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(GalacticCyberSystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Defense Companies ("Large" Companies)
|
2018-05-05 22:23:57 +02:00
|
|
|
var AeroCorpServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"aerocorp", organizationName:"AeroCorp",
|
|
|
|
requiredHackingSkill:getRandomInt(850, 925), moneyAvailable:getRandomInt(1e9, 1.2e9),
|
|
|
|
hackDifficulty:getRandomInt(80, 90), serverGrowth:getRandomInt(55, 65), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
AeroCorpServer.messages.push("man-and-machine.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(AeroCorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var OmniaCybersystemsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"omnia", organizationName:"Omnia Cybersystems", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(850, 950), moneyAvailable:getRandomInt(900e6, 1e9),
|
|
|
|
hackDifficulty:getRandomInt(85, 95), serverGrowth:getRandomInt(60, 70), numOpenPortsRequired:5
|
|
|
|
});
|
|
|
|
OmniaCybersystemsServer.messages.push("history-of-synthoids.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(OmniaCybersystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var ZBDefenseServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"zb-def", organizationName:"ZB Defense Industries",
|
|
|
|
requiredHackingSkill:getRandomInt(775, 825), moneyAvailable:getRandomInt(900e6, 1.1e9),
|
|
|
|
hackDifficulty:getRandomInt(55, 65), serverGrowth:getRandomInt(65, 75), numOpenPortsRequired:4
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
ZBDefenseServer.messages.push("synthetic-muscles.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(ZBDefenseServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var AppliedEnergeticsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"applied-energetics", organizationName:"Applied Energetics",
|
|
|
|
requiredHackingSkill:getRandomInt(775, 850), moneyAvailable:getRandomInt(700e6, 1e9),
|
|
|
|
hackDifficulty:getRandomInt(60, 80), serverGrowth:getRandomInt(70, 75), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(AppliedEnergeticsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var SolarisSpaceSystemsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"solaris", organizationName:"Solaris Space Systems", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(750, 850), moneyAvailable:getRandomInt(700e6, 900e6),
|
|
|
|
hackDifficulty:getRandomInt(70, 80), serverGrowth:getRandomInt(70, 80), numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
SolarisSpaceSystemsServer.messages.push("A-Green-Tomorrow.lit");
|
|
|
|
SolarisSpaceSystemsServer.messages.push("the-failed-frontier.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(SolarisSpaceSystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var DeltaOneServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"deltaone", organizationName:"Delta One",
|
|
|
|
requiredHackingSkill:getRandomInt(800, 900), moneyAvailable:getRandomInt(1.3e9, 1.7e9),
|
|
|
|
hackDifficulty:getRandomInt(75, 85), serverGrowth:getRandomInt(50, 70), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(DeltaOneServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Health, medicine, pharmaceutical companies ("Large" targets)
|
2018-05-05 22:23:57 +02:00
|
|
|
var GlobalPharmaceuticalsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"global-pharm", organizationName:"Global Pharmaceuticals", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(750, 850), moneyAvailable:getRandomInt(1.5e9, 1.75e9),
|
|
|
|
hackDifficulty:getRandomInt(75, 85), serverGrowth:getRandomInt(80, 90), numOpenPortsRequired:4
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
GlobalPharmaceuticalsServer.messages.push("A-Green-Tomorrow.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(GlobalPharmaceuticalsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var NovaMedicalServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"nova-med", organizationName:"Nova Medical",
|
|
|
|
requiredHackingSkill:getRandomInt(775, 850), moneyAvailable:getRandomInt(1.1e9, 1.25e9),
|
|
|
|
hackDifficulty:getRandomInt(60, 80), serverGrowth:getRandomInt(65, 85), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(NovaMedicalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var ZeusMedicalServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"zeus-med", organizationName:"Zeus Medical",
|
|
|
|
requiredHackingSkill:getRandomInt(800, 850), moneyAvailable:getRandomInt(1.3e9, 1.5e9),
|
|
|
|
hackDifficulty:getRandomInt(70, 90), serverGrowth:getRandomInt(70, 80), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(ZeusMedicalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var UnitaLifeGroupServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"unitalife", organizationName:"UnitaLife Group", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(775, 825), moneyAvailable:getRandomInt(1e9, 1.1e9),
|
|
|
|
hackDifficulty:getRandomInt(70, 80), serverGrowth:getRandomInt(70, 80), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(UnitaLifeGroupServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//"Medium level" targets
|
2018-05-05 22:23:57 +02:00
|
|
|
var LexoCorpServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"lexo-corp", organizationName:"Lexo Corporation", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(650, 750), moneyAvailable:getRandomInt(700e6, 800e6),
|
|
|
|
hackDifficulty:getRandomInt(60, 80), serverGrowth:getRandomInt(55, 65), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(LexoCorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var RhoConstructionServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"rho-construction", organizationName:"Rho Construction",
|
|
|
|
requiredHackingSkill:getRandomInt(475, 525), moneyAvailable:getRandomInt(500e6, 700e6),
|
|
|
|
hackDifficulty:getRandomInt(40, 60), serverGrowth:getRandomInt(40, 60), numOpenPortsRequired:3
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(RhoConstructionServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var AlphaEnterprisesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"alpha-ent", organizationName:"Alpha Enterprises", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(500, 600), moneyAvailable:getRandomInt(600e6, 750e6),
|
|
|
|
hackDifficulty:getRandomInt(50, 70), serverGrowth:getRandomInt(50, 60),numOpenPortsRequired:4
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
AlphaEnterprisesServer.messages.push("sector-12-crime.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(AlphaEnterprisesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var AevumPoliceServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"aevum-police", organizationName:"Aevum Police Network", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(400, 450), moneyAvailable:getRandomInt(200e6, 400e6),
|
|
|
|
hackDifficulty:getRandomInt(70, 80), serverGrowth:getRandomInt(30, 50), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(AevumPoliceServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var RothmanUniversityServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"rothman-uni", organizationName:"Rothman University Network", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(370, 430), moneyAvailable:getRandomInt(175e6, 250e6),
|
|
|
|
hackDifficulty:getRandomInt(45, 55), serverGrowth:getRandomInt(35, 45), numOpenPortsRequired:3
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
RothmanUniversityServer.messages.push("secret-societies.lit");
|
|
|
|
RothmanUniversityServer.messages.push("the-failed-frontier.lit");
|
|
|
|
RothmanUniversityServer.messages.push("tensions-in-tech-race.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(RothmanUniversityServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var ZBInstituteOfTechnologyServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"zb-institute", organizationName:"ZB Institute of Technology Network", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(725, 775), moneyAvailable:getRandomInt(800e6, 1.1e9),
|
|
|
|
hackDifficulty:getRandomInt(65, 85), serverGrowth:getRandomInt(75, 85), numOpenPortsRequired:5
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(ZBInstituteOfTechnologyServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var SummitUniversityServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"summit-uni", organizationName:"Summit University Network", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(425, 475), moneyAvailable:getRandomInt(200e6, 350e6),
|
|
|
|
hackDifficulty:getRandomInt(45, 65), serverGrowth:getRandomInt(40, 60), numOpenPortsRequired:3
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
SummitUniversityServer.messages.push("secret-societies.lit");
|
|
|
|
SummitUniversityServer.messages.push("the-failed-frontier.lit");
|
|
|
|
SummitUniversityServer.messages.push("synthetic-muscles.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(SummitUniversityServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var SysCoreSecuritiesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"syscore", organizationName:"SysCore Securities",
|
|
|
|
requiredHackingSkill:getRandomInt(550, 650), moneyAvailable:getRandomInt(400e6, 600e6),
|
|
|
|
hackDifficulty:getRandomInt(60, 80), serverGrowth:getRandomInt(60, 70), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(SysCoreSecuritiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var CatalystVenturesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"catalyst", organizationName:"Catalyst Ventures",
|
|
|
|
requiredHackingSkill:getRandomInt(400, 450), moneyAvailable:getRandomInt(300e6, 550e6),
|
|
|
|
hackDifficulty:getRandomInt(60, 70), serverGrowth:getRandomInt(25, 55), numOpenPortsRequired:3,
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
CatalystVenturesServer.messages.push("tensions-in-tech-race.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(CatalystVenturesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var TheHubServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"the-hub", organizationName:"The Hub",
|
|
|
|
requiredHackingSkill:getRandomInt(275, 325), moneyAvailable:getRandomInt(150e6, 200e6),
|
|
|
|
hackDifficulty:getRandomInt(35, 45), serverGrowth:getRandomInt(45, 55), numOpenPortsRequired:2
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(TheHubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var CompuTekServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"comptek", organizationName:"CompuTek",
|
|
|
|
requiredHackingSkill:getRandomInt(300, 400), moneyAvailable:getRandomInt(220e6, 250e6),
|
|
|
|
hackDifficulty:getRandomInt(55, 65), serverGrowth:getRandomInt(45, 65), numOpenPortsRequired:3
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
CompuTekServer.messages.push("man-and-machine.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(CompuTekServer);
|
2016-10-20 20:07:12 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var NetLinkTechnologiesServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"netlink", organizationName:"NetLink Technologies", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(375, 425), moneyAvailable:275e6,
|
|
|
|
hackDifficulty:getRandomInt(60, 80), serverGrowth:getRandomInt(45, 75), numOpenPortsRequired:3
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
NetLinkTechnologiesServer.messages.push("simulated-reality.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(NetLinkTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var JohnsonOrthopedicsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"johnson-ortho", organizationName:"Johnson Orthopedics",
|
|
|
|
requiredHackingSkill:getRandomInt(250, 300), moneyAvailable:getRandomInt(70e6, 85e6),
|
|
|
|
hackDifficulty:getRandomInt(35, 65), serverGrowth:getRandomInt(35, 65), numOpenPortsRequired:2
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(JohnsonOrthopedicsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//"Low level" targets
|
2018-05-05 22:23:57 +02:00
|
|
|
var FoodNStuffServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"foodnstuff", organizationName:"Food N Stuff Supermarket", maxRam:16,
|
|
|
|
requiredHackingSkill:1, moneyAvailable:2e6,
|
|
|
|
hackDifficulty:10, serverGrowth:5, numOpenPortsRequired:0
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
FoodNStuffServer.messages.push("sector-12-crime.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(FoodNStuffServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var SigmaCosmeticsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"sigma-cosmetics", organizationName:"Sigma Cosmetics", maxRam:16,
|
|
|
|
requiredHackingSkill:5, moneyAvailable:2.3e6,
|
|
|
|
hackDifficulty:10, serverGrowth:10, numOpenPortsRequired:0
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(SigmaCosmeticsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var JoesGunsServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"joesguns", organizationName:"Joe's Guns", maxRam:16,
|
|
|
|
requiredHackingSkill:10, moneyAvailable:2.5e6,
|
|
|
|
hackDifficulty:15, serverGrowth:20, numOpenPortsRequired:0
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(JoesGunsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var Zer0NightclubServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"zer0", organizationName:"ZER0 Nightclub", maxRam:32,
|
|
|
|
requiredHackingSkill:75, moneyAvailable:7.5e6,
|
|
|
|
hackDifficulty:25, serverGrowth:40, numOpenPortsRequired:1
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(Zer0NightclubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var NectarNightclubServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"nectar-net", organizationName:"Nectar Nightclub Network", maxRam:16,
|
|
|
|
requiredHackingSkill:20, moneyAvailable:2.75e6,
|
|
|
|
hackDifficulty:20, serverGrowth:25, numOpenPortsRequired:0
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(NectarNightclubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var NeoNightclubServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"neo-net", organizationName:"Neo Nightclub Network", maxRam:32,
|
|
|
|
requiredHackingSkill:50, moneyAvailable:5e6,
|
|
|
|
hackDifficulty:25, serverGrowth:25, numOpenPortsRequired:1
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
NeoNightclubServer.messages.push("the-hidden-world.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(NeoNightclubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var SilverHelixServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"silver-helix", organizationName:"Silver Helix", maxRam:64,
|
|
|
|
requiredHackingSkill:150, moneyAvailable:45e6,
|
|
|
|
hackDifficulty:30, serverGrowth:30, numOpenPortsRequired:2
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
SilverHelixServer.messages.push("new-triads.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(SilverHelixServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var HongFangTeaHouseServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"hong-fang-tea", organizationName:"HongFang Teahouse", maxRam:16,
|
|
|
|
requiredHackingSkill:30, moneyAvailable:3e6,
|
|
|
|
hackDifficulty:15, serverGrowth:20, numOpenPortsRequired:0
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
HongFangTeaHouseServer.messages.push("brighter-than-the-sun.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(HongFangTeaHouseServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var HaraKiriSushiBarServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"harakiri-sushi", organizationName:"HaraKiri Sushi Bar Network",maxRam:16,
|
|
|
|
requiredHackingSkill:40, moneyAvailable:4e6,
|
|
|
|
hackDifficulty:15, serverGrowth:40, numOpenPortsRequired:0
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(HaraKiriSushiBarServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var PhantasyServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"phantasy", organizationName:"Phantasy Club", maxRam:32,
|
|
|
|
requiredHackingSkill:100, moneyAvailable:24e6,
|
|
|
|
hackDifficulty:20, serverGrowth:35, numOpenPortsRequired:2
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(PhantasyServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var MaxHardwareServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"max-hardware", organizationName:"Max Hardware Store", maxRam:32,
|
|
|
|
requiredHackingSkill:80, moneyAvailable:10e6,
|
|
|
|
hackDifficulty:15, serverGrowth:30, numOpenPortsRequired:1,
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(MaxHardwareServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var OmegaSoftwareServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"omega-net", organizationName:"Omega Software", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(180, 220), moneyAvailable:getRandomInt(60e6, 70e6),
|
|
|
|
hackDifficulty:getRandomInt(25, 35), serverGrowth:getRandomInt(30, 40), numOpenPortsRequired:2
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
OmegaSoftwareServer.messages.push("the-new-god.lit");
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(OmegaSoftwareServer);
|
|
|
|
|
|
|
|
//Gyms
|
2018-05-05 22:23:57 +02:00
|
|
|
var CrushFitnessGymServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"crush-fitness", organizationName:"Crush Fitness",
|
|
|
|
requiredHackingSkill:getRandomInt(225, 275), moneyAvailable:getRandomInt(40e6, 60e6),
|
|
|
|
hackDifficulty:getRandomInt(35, 45), serverGrowth:getRandomInt(27, 33), numOpenPortsRequired:2
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(CrushFitnessGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var IronGymServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"iron-gym", organizationName:"Iron Gym Network", maxRam:32,
|
|
|
|
requiredHackingSkill:100, moneyAvailable:20e6,
|
|
|
|
hackDifficulty:30, serverGrowth:20, numOpenPortsRequired:1
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(IronGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var MilleniumFitnessGymServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"millenium-fitness", organizationName:"Millenium Fitness Network",
|
|
|
|
requiredHackingSkill:getRandomInt(475, 525), moneyAvailable:250e6,
|
|
|
|
hackDifficulty:getRandomInt(45, 55), serverGrowth:getRandomInt(25, 45), numOpenPortsRequired:3,
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(MilleniumFitnessGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var PowerhouseGymServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"powerhouse-fitness", organizationName:"Powerhouse Fitness",
|
|
|
|
requiredHackingSkill:getRandomInt(950, 1100), moneyAvailable:900e6,
|
|
|
|
hackDifficulty:getRandomInt(55, 65), serverGrowth:getRandomInt(50, 60), numOpenPortsRequired:5,
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(PowerhouseGymServer);
|
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var SnapFitnessGymServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"snap-fitness", organizationName:"Snap Fitness",
|
|
|
|
requiredHackingSkill:getRandomInt(675, 800), moneyAvailable:450e6,
|
|
|
|
hackDifficulty:getRandomInt(40, 60), serverGrowth:getRandomInt(40, 60), numOpenPortsRequired:4
|
|
|
|
});
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(SnapFitnessGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
//Faction servers, cannot hack money from these
|
|
|
|
var BitRunnersServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"run4theh111z", organizationName:"The Runners", maxRam:128,
|
|
|
|
requiredHackingSkill:getRandomInt(505, 550), moneyAvailable:0,
|
|
|
|
hackDifficulty:0, serverGrowth:0, numOpenPortsRequired:4
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
BitRunnersServer.messages.push("simulated-reality.lit");
|
|
|
|
BitRunnersServer.messages.push("the-new-god.lit");
|
2018-05-05 22:23:57 +02:00
|
|
|
AddToAllServers(BitRunnersServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.BitRunnersServer, BitRunnersServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var TheBlackHandServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"I.I.I.I", organizationName:"I.I.I.I", maxRam:64,
|
|
|
|
requiredHackingSkill:getRandomInt(340, 365), moneyAvailable:0,
|
|
|
|
hackDifficulty:0, serverGrowth:0, numOpenPortsRequired:3,
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
TheBlackHandServer.messages.push("democracy-is-dead.lit");
|
2017-06-01 04:19:14 +02:00
|
|
|
AddToAllServers(TheBlackHandServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.TheBlackHandServer, TheBlackHandServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var NiteSecServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"avmnite-02h", organizationName:"NiteSec", maxRam:32,
|
|
|
|
requiredHackingSkill:getRandomInt(202, 220), moneyAvailable:0,
|
|
|
|
hackDifficulty:0, serverGrowth:0, numOpenPortsRequired:2
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
NiteSecServer.messages.push("democracy-is-dead.lit");
|
2018-05-05 22:23:57 +02:00
|
|
|
AddToAllServers(NiteSecServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.NiteSecServer, NiteSecServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var DarkArmyServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:".", organizationName:".", maxRam:16,
|
|
|
|
requiredHackingSkill:getRandomInt(505, 550), moneyAvailable:0,
|
|
|
|
hackDifficulty:0, serverGrowth:0, numOpenPortsRequired:4
|
|
|
|
});
|
|
|
|
AddToAllServers(DarkArmyServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.TheDarkArmyServer, DarkArmyServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var CyberSecServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"CSEC", organizationName:"CyberSec", maxRam:8,
|
|
|
|
requiredHackingSkill:getRandomInt(51, 60), moneyAvailable:0,
|
|
|
|
hackDifficulty:0, serverGrowth:0, numOpenPortsRequired:1
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
CyberSecServer.messages.push("democracy-is-dead.lit");
|
2018-05-05 22:23:57 +02:00
|
|
|
AddToAllServers(CyberSecServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.CyberSecServer, CyberSecServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-05-05 22:23:57 +02:00
|
|
|
var DaedalusServer = new Server({
|
|
|
|
ip:createRandomIp(), hostname:"The-Cave", organizationName:"Helios",
|
|
|
|
requiredHackingSkill:925, moneyAvailable:0,
|
|
|
|
hackDifficulty:0, serverGrowth:0, numOpenPortsRequired:5
|
|
|
|
});
|
2017-08-18 19:20:51 +02:00
|
|
|
DaedalusServer.messages.push("alpha-omega.lit");
|
2017-06-02 06:15:45 +02:00
|
|
|
AddToAllServers(DaedalusServer);
|
|
|
|
SpecialServerIps.addIp(SpecialServerNames.DaedalusServer, DaedalusServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2017-06-02 06:15:45 +02:00
|
|
|
//Super special Servers
|
2018-05-05 22:23:57 +02:00
|
|
|
var WorldDaemon = new Server({
|
|
|
|
ip:createRandomIp(), hostname:SpecialServerNames.WorldDaemon, organizationName:SpecialServerNames.WorldDaemon,
|
|
|
|
requiredHackingSkill:3000, moneyAvailable:0,
|
|
|
|
hackDifficulty:0, serverGrowth:0, numOpenPortsRequired:5
|
|
|
|
});
|
2017-06-02 06:15:45 +02:00
|
|
|
AddToAllServers(WorldDaemon);
|
|
|
|
SpecialServerIps.addIp(SpecialServerNames.WorldDaemon, WorldDaemon.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
/* Create a randomized network for all the foreign servers */
|
|
|
|
//Groupings for creating a randomized network
|
|
|
|
var NetworkGroup1 = [IronGymServer, FoodNStuffServer, SigmaCosmeticsServer, JoesGunsServer, HongFangTeaHouseServer, HaraKiriSushiBarServer];
|
2017-06-02 06:15:45 +02:00
|
|
|
var NetworkGroup2 = [MaxHardwareServer, NectarNightclubServer, Zer0NightclubServer, CyberSecServer];
|
2016-12-01 23:18:18 +01:00
|
|
|
var NetworkGroup3 = [OmegaSoftwareServer, PhantasyServer, SilverHelixServer, NeoNightclubServer];
|
2017-06-02 06:15:45 +02:00
|
|
|
var NetworkGroup4 = [CrushFitnessGymServer, NetLinkTechnologiesServer, CompuTekServer, TheHubServer, JohnsonOrthopedicsServer, NiteSecServer];
|
|
|
|
var NetworkGroup5 = [CatalystVenturesServer, SysCoreSecuritiesServer, SummitUniversityServer, ZBInstituteOfTechnologyServer, RothmanUniversityServer, TheBlackHandServer];
|
2017-06-02 21:46:14 +02:00
|
|
|
var NetworkGroup6 = [LexoCorpServer, RhoConstructionServer, AlphaEnterprisesServer, AevumPoliceServer, MilleniumFitnessGymServer];
|
2016-12-01 23:18:18 +01:00
|
|
|
var NetworkGroup7 = [GlobalPharmaceuticalsServer, AeroCorpServer, GalacticCyberSystemsServer, SnapFitnessGymServer];
|
2017-06-02 21:46:14 +02:00
|
|
|
var NetworkGroup8 = [DeltaOneServer, UnitaLifeGroupServer, OmniaCybersystemsServer];
|
2016-12-01 23:18:18 +01:00
|
|
|
var NetworkGroup9 = [ZeusMedicalServer, SolarisSpaceSystemsServer, UniversalEnergyServer, IcarusMicrosystemsServer, DefCommServer];
|
|
|
|
var NetworkGroup10 = [NovaMedicalServer, ZBDefenseServer, TaiYangDigitalServer, InfoCommServer];
|
2016-12-22 17:19:02 +01:00
|
|
|
var NetworkGroup11 = [AppliedEnergeticsServer, MicrodyneTechnologiesServer, TitanLabsServer, BitRunnersServer];
|
2016-12-01 23:18:18 +01:00
|
|
|
var NetworkGroup12 = [VitaLifeServer, HeliosLabsServer, StormTechnologiesServer, FulcrumTechnologiesServer];
|
2016-12-22 17:19:02 +01:00
|
|
|
var NetworkGroup13 = [KuaiGongInternationalServer, FourSigmaServer, OmniTekIncorporatedServer, DarkArmyServer];
|
2016-12-01 23:18:18 +01:00
|
|
|
var NetworkGroup14 = [PowerhouseGymServer, ClarkeIncorporatedServer, NWOServer, BladeIndustriesServer, BachmanAndAssociatesServer];
|
2017-06-02 06:15:45 +02:00
|
|
|
var NetworkGroup15 = [FulcrumSecretTechnologiesServer, MegaCorpServer, ECorpServer, DaedalusServer];
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup2.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup1[Math.floor(Math.random() * NetworkGroup1.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup2[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup2[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup3.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup2[Math.floor(Math.random() * NetworkGroup2.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup3[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup3[i].ip);
|
2016-10-24 08:34:04 +02:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup4.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup3[Math.floor(Math.random() * NetworkGroup3.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup4[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup4[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup5.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup4[Math.floor(Math.random() * NetworkGroup4.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup5[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup5[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup6.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup5[Math.floor(Math.random() * NetworkGroup5.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup6[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup6[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup7.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup6[Math.floor(Math.random() * NetworkGroup6.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup7[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup7[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup8.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup7[Math.floor(Math.random() * NetworkGroup7.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup8[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup8[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup9.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup8[Math.floor(Math.random() * NetworkGroup8.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup9[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup9[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup10.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup9[Math.floor(Math.random() * NetworkGroup9.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup10[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup10[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup11.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup10[Math.floor(Math.random() * NetworkGroup10.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup11[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup11[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup12.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup11[Math.floor(Math.random() * NetworkGroup11.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup12[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup12[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup13.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup12[Math.floor(Math.random() * NetworkGroup12.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup13[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup13[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup14.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup13[Math.floor(Math.random() * NetworkGroup13.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup14[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup14[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var i = 0; i < NetworkGroup15.length; i++) {
|
|
|
|
var randomServerFromPrevGroup = NetworkGroup14[Math.floor(Math.random() * NetworkGroup14.length)];
|
2016-12-14 00:52:32 +01:00
|
|
|
NetworkGroup15[i].serversOnNetwork.push(randomServerFromPrevGroup.ip);
|
|
|
|
randomServerFromPrevGroup.serversOnNetwork.push(NetworkGroup15[i].ip);
|
2016-12-01 23:18:18 +01:00
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Connect the first tier of servers to the player's home computer
|
|
|
|
for (var i = 0; i < NetworkGroup1.length; i++) {
|
|
|
|
Player.getHomeComputer().serversOnNetwork.push(NetworkGroup1[i].ip);
|
|
|
|
NetworkGroup1[i].serversOnNetwork.push(Player.homeComputer);
|
|
|
|
}
|
2017-05-02 18:28:54 +02:00
|
|
|
}
|
2016-12-01 23:18:18 +01:00
|
|
|
|
2018-06-13 23:12:58 +02:00
|
|
|
function numCycleForGrowth(server, growth) {
|
|
|
|
let ajdGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;
|
|
|
|
if(ajdGrowthRate > CONSTANTS.ServerMaxGrowthRate) {
|
|
|
|
ajdGrowthRate = CONSTANTS.ServerMaxGrowthRate;
|
|
|
|
}
|
|
|
|
|
|
|
|
const serverGrowthPercentage = server.serverGrowth / 100;
|
|
|
|
|
|
|
|
const cycles = Math.log(growth)/(Math.log(ajdGrowthRate)*Player.hacking_grow_mult*serverGrowthPercentage);
|
|
|
|
return cycles;
|
|
|
|
}
|
|
|
|
|
2017-05-02 18:28:54 +02:00
|
|
|
//Applied server growth for a single server. Returns the percentage growth
|
2017-08-30 19:44:29 +02:00
|
|
|
function processSingleServerGrowth(server, numCycles) {
|
2017-05-02 18:28:54 +02:00
|
|
|
//Server growth processed once every 450 game cycles
|
2018-06-13 23:12:58 +02:00
|
|
|
const numServerGrowthCycles = Math.max(Math.floor(numCycles / 450), 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2017-06-06 23:22:57 +02:00
|
|
|
//Get adjusted growth rate, which accounts for server security
|
2018-06-13 23:12:58 +02:00
|
|
|
const growthRate = CONSTANTS.ServerBaseGrowthRate;
|
2017-07-28 16:19:28 +02:00
|
|
|
var adjGrowthRate = 1 + (growthRate - 1) / server.hackDifficulty;
|
2017-06-06 23:22:57 +02:00
|
|
|
if (adjGrowthRate > CONSTANTS.ServerMaxGrowthRate) {adjGrowthRate = CONSTANTS.ServerMaxGrowthRate;}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2017-06-06 23:22:57 +02:00
|
|
|
//Calculate adjusted server growth rate based on parameters
|
2018-06-13 23:12:58 +02:00
|
|
|
const serverGrowthPercentage = server.serverGrowth / 100;
|
|
|
|
const numServerGrowthCyclesAdjusted = numServerGrowthCycles * serverGrowthPercentage * BitNodeMultipliers.ServerGrowthRate;
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2017-05-02 18:28:54 +02:00
|
|
|
//Apply serverGrowth for the calculated number of growth cycles
|
2017-06-14 03:07:02 +02:00
|
|
|
var serverGrowth = Math.pow(adjGrowthRate, numServerGrowthCyclesAdjusted * Player.hacking_grow_mult);
|
2017-05-30 00:37:38 +02:00
|
|
|
if (serverGrowth < 1) {
|
|
|
|
console.log("WARN: serverGrowth calculated to be less than 1");
|
|
|
|
serverGrowth = 1;
|
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2018-06-13 23:12:58 +02:00
|
|
|
const oldMoneyAvailable = server.moneyAvailable;
|
2017-05-02 18:28:54 +02:00
|
|
|
server.moneyAvailable *= serverGrowth;
|
2018-06-13 23:12:58 +02:00
|
|
|
|
|
|
|
// in case of data corruption
|
2017-07-06 00:33:46 +02:00
|
|
|
if (server.moneyMax && isNaN(server.moneyAvailable)) {
|
|
|
|
server.moneyAvailable = server.moneyMax;
|
|
|
|
}
|
2018-06-13 23:12:58 +02:00
|
|
|
|
|
|
|
// cap at max
|
2017-07-06 00:33:46 +02:00
|
|
|
if (server.moneyMax && server.moneyAvailable > server.moneyMax) {
|
2017-06-07 02:04:18 +02:00
|
|
|
server.moneyAvailable = server.moneyMax;
|
|
|
|
}
|
2018-07-04 04:12:46 +02:00
|
|
|
|
2018-06-13 23:12:58 +02:00
|
|
|
// if there was any growth at all, increase security
|
|
|
|
if(oldMoneyAvailable !== server.moneyAvailable) {
|
|
|
|
//Growing increases server security twice as much as hacking
|
2018-06-22 21:41:55 +02:00
|
|
|
let usedCycles = numCycleForGrowth(server, server.moneyAvailable / oldMoneyAvailable);
|
|
|
|
usedCycles = Math.max(0, usedCycles);
|
2018-06-13 23:12:58 +02:00
|
|
|
server.fortify(2 * CONSTANTS.ServerFortifyAmount * Math.ceil(usedCycles));
|
|
|
|
}
|
|
|
|
return server.moneyAvailable / oldMoneyAvailable;
|
2017-05-02 18:28:54 +02:00
|
|
|
}
|
2016-12-20 21:18:34 +01:00
|
|
|
|
2017-08-30 19:44:29 +02:00
|
|
|
function prestigeHomeComputer(homeComp) {
|
2018-02-24 23:55:06 +01:00
|
|
|
homeComp.programs.length = 0; //Remove programs
|
2017-08-30 19:44:29 +02:00
|
|
|
homeComp.runningScripts = [];
|
|
|
|
homeComp.serversOnNetwork = [];
|
|
|
|
homeComp.isConnectedTo = true;
|
|
|
|
homeComp.ramUsed = 0;
|
2018-06-02 01:31:34 +02:00
|
|
|
homeComp.programs.push(Programs.NukeProgram.name);
|
2017-08-30 19:44:29 +02:00
|
|
|
|
2017-12-11 06:04:00 +01:00
|
|
|
//Update RAM usage on all scripts
|
2017-12-11 06:07:16 +01:00
|
|
|
homeComp.scripts.forEach(function(script) {
|
2017-12-11 06:04:00 +01:00
|
|
|
script.updateRamUsage();
|
|
|
|
});
|
|
|
|
|
2018-02-24 23:55:06 +01:00
|
|
|
homeComp.messages.length = 0; //Remove .lit and .msg files
|
2017-12-07 04:45:47 +01:00
|
|
|
homeComp.messages.push("hackers-starting-handbook.lit");
|
2017-08-30 19:44:29 +02:00
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//List of all servers that exist in the game, indexed by their ip
|
2017-08-30 19:44:29 +02:00
|
|
|
let AllServers = {};
|
2016-12-01 23:18:18 +01:00
|
|
|
|
2017-08-30 19:44:29 +02:00
|
|
|
function prestigeAllServers() {
|
|
|
|
for (var member in AllServers) {
|
|
|
|
delete AllServers[member];
|
|
|
|
}
|
|
|
|
AllServers = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
function loadAllServers(saveString) {
|
|
|
|
AllServers = JSON.parse(saveString, Reviver);
|
|
|
|
}
|
|
|
|
|
|
|
|
function SizeOfAllServers() {
|
2018-05-05 22:23:57 +02:00
|
|
|
var size = 0, key;
|
|
|
|
for (key in AllServers) {
|
|
|
|
if (AllServers.hasOwnProperty(key)) size++;
|
|
|
|
}
|
|
|
|
return size;
|
2016-12-15 18:51:23 +01:00
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Add a server onto the map of all servers in the game
|
2017-08-30 19:44:29 +02:00
|
|
|
function AddToAllServers(server) {
|
2016-12-01 23:18:18 +01:00
|
|
|
var serverIp = server.ip;
|
|
|
|
if (ipExists(serverIp)) {
|
|
|
|
console.log("IP of server that's being added: " + serverIp);
|
|
|
|
console.log("Hostname of the server thats being added: " + server.hostname);
|
|
|
|
console.log("The server that already has this IP is: " + AllServers[serverIp].hostname);
|
|
|
|
throw new Error("Error: Trying to add a server with an existing IP");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
AllServers[serverIp] = server;
|
2016-10-18 23:37:53 +02:00
|
|
|
}
|
2016-12-01 23:18:18 +01:00
|
|
|
|
2016-12-15 18:51:23 +01:00
|
|
|
//Returns server object with corresponding hostname
|
2018-05-05 22:23:57 +02:00
|
|
|
// Relatively slow, would rather not use this a lot
|
2017-08-30 19:44:29 +02:00
|
|
|
function GetServerByHostname(hostname) {
|
2018-05-05 22:23:57 +02:00
|
|
|
for (var ip in AllServers) {
|
|
|
|
if (AllServers.hasOwnProperty(ip)) {
|
|
|
|
if (AllServers[ip].hostname == hostname) {
|
|
|
|
return AllServers[ip];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
2016-12-15 18:51:23 +01:00
|
|
|
}
|
|
|
|
|
2017-05-11 06:20:17 +02:00
|
|
|
//Get server by IP or hostname. Returns null if invalid
|
2017-08-30 19:44:29 +02:00
|
|
|
function getServer(s) {
|
2017-05-11 06:20:17 +02:00
|
|
|
if (!isValidIPAddress(s)) {
|
|
|
|
return GetServerByHostname(s);
|
2018-06-13 18:34:32 +02:00
|
|
|
}
|
|
|
|
if(AllServers[s] !== undefined) {
|
2017-05-11 06:20:17 +02:00
|
|
|
return AllServers[s];
|
|
|
|
}
|
2018-06-13 18:34:32 +02:00
|
|
|
return null;
|
2017-05-11 06:20:17 +02:00
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Debugging tool
|
2017-08-30 19:44:29 +02:00
|
|
|
function PrintAllServers() {
|
2016-12-01 23:18:18 +01:00
|
|
|
for (var ip in AllServers) {
|
|
|
|
if (AllServers.hasOwnProperty(ip)) {
|
|
|
|
console.log("Ip: " + ip + ", hostname: " + AllServers[ip].hostname);
|
|
|
|
}
|
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
}
|
2017-08-30 19:44:29 +02:00
|
|
|
|
2017-10-10 06:56:48 +02:00
|
|
|
// Directory object (folders)
|
|
|
|
function Directory(server, parent, name) {
|
|
|
|
this.s = server; //Ref to server
|
|
|
|
this.p = parent; //Ref to parent directory
|
|
|
|
this.c = []; //Subdirs
|
|
|
|
this.n = name;
|
|
|
|
this.d = parent.d + 1; //We'll only have a maximum depth of 3 or something
|
|
|
|
this.scrs = []; //Holds references to the scripts in server.scripts
|
|
|
|
this.pgms = [];
|
|
|
|
this.msgs = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
Directory.prototype.createSubdir = function(name) {
|
|
|
|
var subdir = new Directory(this.s, this, name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Directory.prototype.getPath = function(name) {
|
|
|
|
var res = [];
|
|
|
|
var i = this;
|
|
|
|
while (i !== null) {
|
|
|
|
res.unshift(i.n, "/");
|
|
|
|
i = i.parent;
|
|
|
|
}
|
|
|
|
res.unshift("/");
|
|
|
|
return res.join("");
|
|
|
|
}
|
|
|
|
|
2017-08-30 19:44:29 +02:00
|
|
|
export {Server, AllServers, getServer, GetServerByHostname, loadAllServers,
|
|
|
|
AddToAllServers, processSingleServerGrowth, initForeignServers,
|
|
|
|
prestigeAllServers, prestigeHomeComputer};
|