2016-10-14 23:02:06 +02:00
|
|
|
//Netburner Server class
|
2016-11-30 00:38:50 +01:00
|
|
|
//TODO Make a map of all IPS in the game so far so that we don't accidentally
|
|
|
|
// get duplicate IPs..however unlikely it is
|
2016-10-20 20:26:38 +02:00
|
|
|
function Server() {
|
2016-10-17 23:23:23 +02:00
|
|
|
/* Properties */
|
2016-10-14 23:02:06 +02:00
|
|
|
//Connection information
|
2016-10-19 23:43:49 +02:00
|
|
|
this.ip = "0.0.0.0";
|
|
|
|
this.hostname = "";
|
|
|
|
this.organizationName = "";
|
2017-07-28 16:19:28 +02:00
|
|
|
this.isOnline = true;
|
2016-10-19 23:43:49 +02:00
|
|
|
this.isConnectedTo = false; //Whether the player is connected to this server
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-10-17 23:23:23 +02:00
|
|
|
//Access information
|
2016-10-19 23:43:49 +02:00
|
|
|
this.hasAdminRights = false; //Whether player has admin rights
|
|
|
|
this.purchasedByPlayer = false;
|
2017-06-02 06:15:45 +02:00
|
|
|
this.manuallyHacked = false; //Flag that tracks whether or not the server has been hacked at least once
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-10-18 23:37:53 +02:00
|
|
|
//RAM, CPU speed and Scripts
|
2017-07-28 16:19:28 +02:00
|
|
|
this.maxRam = 1; //GB
|
2016-10-19 23:43:49 +02:00
|
|
|
this.ramUsed = 0;
|
|
|
|
this.cpuSpeed = 1; //MHz
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-10-19 23:43:49 +02:00
|
|
|
this.scripts = [];
|
2017-06-17 04:53:57 +02:00
|
|
|
this.runningScripts = []; //Stores RunningScript objects
|
2016-10-19 23:43:49 +02:00
|
|
|
this.programs = [];
|
2017-06-01 15:36:49 +02:00
|
|
|
this.messages = [];
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-10-17 23:23:23 +02:00
|
|
|
/* Hacking information (only valid for "foreign" aka non-purchased servers) */
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-10-17 23:23:23 +02:00
|
|
|
//Skill required to attempt a hack. Whether a hack is successful will be determined
|
2017-07-28 16:19:28 +02:00
|
|
|
//by a separate formula
|
|
|
|
this.requiredHackingSkill = 1;
|
|
|
|
|
2017-06-07 02:04:18 +02:00
|
|
|
//Total money available on this server
|
2016-12-20 21:18:34 +01:00
|
|
|
this.moneyAvailable = 0;
|
2017-06-07 02:04:18 +02:00
|
|
|
this.moneyMax = 0;
|
2017-07-28 16:19:28 +02:00
|
|
|
|
|
|
|
//Parameters used in formulas that dictate how moneyAvailable and requiredHackingSkill change.
|
2016-10-19 23:43:49 +02:00
|
|
|
this.hackDifficulty = 1; //Affects hack success rate and how the requiredHackingSkill increases over time (1-100)
|
2017-06-07 23:18:21 +02:00
|
|
|
this.baseDifficulty = 1; //Starting difficulty
|
|
|
|
this.minDifficulty = 1;
|
2016-12-20 21:18:34 +01:00
|
|
|
this.serverGrowth = 0; //Affects how the moneyAvailable increases (0-100)
|
2016-10-19 23:43:49 +02:00
|
|
|
this.timesHacked = 0;
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//The IP's of all servers reachable from this one (what shows up if you run scan/netstat)
|
|
|
|
// NOTE: Only contains IP and not the Server objects themselves
|
2016-10-19 23:43:49 +02:00
|
|
|
this.serversOnNetwork = [];
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-10-24 23:16:51 +02:00
|
|
|
//Port information, required for porthacking servers to get admin rights
|
|
|
|
this.numOpenPortsRequired = 5;
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
//Initialize the properties of a server
|
2016-10-18 23:37:53 +02:00
|
|
|
Server.prototype.init = function(ip, hostname, organizationName, onlineStatus, isConnectedTo, adminRights, purchasedByPlayer, maxRam) {
|
2016-10-17 23:23:23 +02:00
|
|
|
this.ip = ip;
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2017-05-06 21:12:45 +02:00
|
|
|
//Check if hostname is unique
|
|
|
|
var i = 0;
|
|
|
|
while (GetServerByHostname(hostname) != null) {
|
|
|
|
//Server already exists
|
|
|
|
hostname = hostname + "-" + i;
|
|
|
|
++i;
|
|
|
|
}
|
2016-10-17 23:23:23 +02:00
|
|
|
this.hostname = hostname;
|
2016-10-18 23:37:53 +02:00
|
|
|
this.organizationName = organizationName;
|
2016-10-17 23:23:23 +02:00
|
|
|
this.isOnline = onlineStatus;
|
|
|
|
this.isConnectedTo = isConnectedTo;
|
|
|
|
this.hasAdminRights = adminRights;
|
|
|
|
this.purchasedByPlayer = purchasedByPlayer;
|
|
|
|
this.maxRam = maxRam;
|
|
|
|
}
|
|
|
|
|
2016-10-18 23:37:53 +02:00
|
|
|
//Set the hacking properties of a server
|
2016-10-19 23:43:49 +02:00
|
|
|
Server.prototype.setHackingParameters = function(requiredHackingSkill, moneyAvailable, hackDifficulty, serverGrowth) {
|
2016-10-18 23:37:53 +02:00
|
|
|
this.requiredHackingSkill = requiredHackingSkill;
|
2017-07-28 16:19:28 +02:00
|
|
|
if (isNaN(moneyAvailable)) {
|
|
|
|
this.moneyAvailable = 1000000;
|
|
|
|
} else {
|
|
|
|
this.moneyAvailable = moneyAvailable;
|
|
|
|
}
|
2017-08-01 21:03:45 +02:00
|
|
|
this.moneyMax = 25 * moneyAvailable;
|
2016-10-18 23:37:53 +02:00
|
|
|
this.hackDifficulty = hackDifficulty;
|
2017-06-07 23:18:21 +02:00
|
|
|
this.baseDifficulty = hackDifficulty;
|
2017-06-18 06:36:16 +02:00
|
|
|
this.minDifficulty = Math.max(1, Math.round(hackDifficulty / 3));
|
2016-10-18 23:37:53 +02:00
|
|
|
this.serverGrowth = serverGrowth;
|
|
|
|
}
|
|
|
|
|
2016-10-24 23:16:51 +02:00
|
|
|
//Set the port properties of a server
|
2017-07-28 16:19:28 +02:00
|
|
|
//Right now its only the number of open ports needed to PortHack the server.
|
2016-10-24 23:16:51 +02:00
|
|
|
Server.prototype.setPortProperties = function(numOpenPortsReq) {
|
|
|
|
this.numOpenPortsRequired = numOpenPortsReq;
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
for (var i = 0; i < this.scripts.length; i++) {
|
|
|
|
if (this.scripts[i].filename == scriptName) {
|
|
|
|
return this.scripts[i];
|
|
|
|
}
|
|
|
|
}
|
2017-07-28 16:19:28 +02:00
|
|
|
return null;
|
2016-12-15 18:51:23 +01:00
|
|
|
}
|
|
|
|
|
2017-05-31 18:45:30 +02:00
|
|
|
//Strengthens a server's security level (difficulty) by the specified amount
|
|
|
|
Server.prototype.fortify = function(amt) {
|
2017-07-28 16:19:28 +02:00
|
|
|
this.hackDifficulty += amt;
|
2017-05-31 18:45:30 +02:00
|
|
|
if (this.hackDifficulty > 99) {this.hackDifficulty = 99;}
|
|
|
|
}
|
|
|
|
|
|
|
|
Server.prototype.weaken = function(amt) {
|
2017-07-28 16:19:28 +02:00
|
|
|
this.hackDifficulty -= amt;
|
2017-06-18 06:36:16 +02:00
|
|
|
if (this.hackDifficulty < this.minDifficulty) {this.hackDifficulty = this.minDifficulty;}
|
2017-05-31 18:45:30 +02:00
|
|
|
if (this.hackDifficulty < 1) {this.hackDifficulty = 1;}
|
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Functions for loading and saving a Server
|
|
|
|
Server.prototype.toJSON = function() {
|
|
|
|
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) {
|
|
|
|
return Generic_fromJSON(Server, value.data);
|
|
|
|
}
|
|
|
|
|
|
|
|
Reviver.constructors.Server = Server;
|
|
|
|
|
|
|
|
initForeignServers = function() {
|
|
|
|
//MegaCorporations
|
|
|
|
var ECorpServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
ECorpServer.init(createRandomIp(), "ecorp", "ECorp", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
ECorpServer.setHackingParameters(getRandomInt(1150, 1300), getRandomInt(30000000000, 70000000000), 99, 99);
|
2016-12-01 23:18:18 +01:00
|
|
|
ECorpServer.setPortProperties(5);
|
|
|
|
AddToAllServers(ECorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var MegaCorpServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
MegaCorpServer.init(createRandomIp(), "megacorp", "MegaCorp", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
MegaCorpServer.setHackingParameters(getRandomInt(1150, 1300), getRandomInt(40000000000, 60000000000), 99, 99);
|
2016-12-01 23:18:18 +01:00
|
|
|
MegaCorpServer.setPortProperties(5);
|
|
|
|
AddToAllServers(MegaCorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var BachmanAndAssociatesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
BachmanAndAssociatesServer.init(createRandomIp(), "b-and-a", "Bachman & Associates", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
BachmanAndAssociatesServer.setHackingParameters(getRandomInt(1000, 1050), getRandomInt(20000000000, 25000000000), getRandomInt(75, 85), getRandomInt(65, 75));
|
2016-12-01 23:18:18 +01:00
|
|
|
BachmanAndAssociatesServer.setPortProperties(5);
|
|
|
|
AddToAllServers(BachmanAndAssociatesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var BladeIndustriesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
BladeIndustriesServer.init(createRandomIp(), "blade", "Blade Industries", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
BladeIndustriesServer.setHackingParameters(getRandomInt(1000, 1100), getRandomInt(12000000000, 20000000000), getRandomInt(90, 95), getRandomInt(60, 75));
|
2016-12-01 23:18:18 +01:00
|
|
|
BladeIndustriesServer.setPortProperties(5);
|
|
|
|
AddToAllServers(BladeIndustriesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var NWOServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
NWOServer.init(createRandomIp(), "nwo", "New World Order", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
NWOServer.setHackingParameters(getRandomInt(1000, 1200), getRandomInt(25000000000, 35000000000), 99, getRandomInt(75, 85));
|
2016-12-01 23:18:18 +01:00
|
|
|
NWOServer.setPortProperties(5);
|
|
|
|
AddToAllServers(NWOServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var ClarkeIncorporatedServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
ClarkeIncorporatedServer.init(createRandomIp(), "clarkeinc", "Clarke Incorporated", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
ClarkeIncorporatedServer.setHackingParameters(getRandomInt(1000, 1200), getRandomInt(15000000000, 25000000000), getRandomInt(50, 60), getRandomInt(50, 70));
|
2016-12-01 23:18:18 +01:00
|
|
|
ClarkeIncorporatedServer.setPortProperties(5);
|
|
|
|
AddToAllServers(ClarkeIncorporatedServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var OmniTekIncorporatedServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
OmniTekIncorporatedServer.init(createRandomIp(), "omnitek", "OmniTek Incorporated", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
OmniTekIncorporatedServer.setHackingParameters(getRandomInt(900, 1100), getRandomInt(15000000000, 20000000000), getRandomInt(90, 99), getRandomInt(95, 99));
|
2016-12-01 23:18:18 +01:00
|
|
|
OmniTekIncorporatedServer.setPortProperties(5);
|
|
|
|
AddToAllServers(OmniTekIncorporatedServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var FourSigmaServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
FourSigmaServer.init(createRandomIp(), "4sigma", "FourSigma", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
FourSigmaServer.setHackingParameters(getRandomInt(950, 1200), getRandomInt(15000000000, 25000000000), getRandomInt(60, 70), getRandomInt(75, 99));
|
2016-12-01 23:18:18 +01:00
|
|
|
FourSigmaServer.setPortProperties(5);
|
|
|
|
AddToAllServers(FourSigmaServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var KuaiGongInternationalServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
KuaiGongInternationalServer.init(createRandomIp(), "kuai-gong", "KuaiGong International", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
KuaiGongInternationalServer.setHackingParameters(getRandomInt(1000, 1250), getRandomInt(20000000000, 30000000000), getRandomInt(95, 99), getRandomInt(90, 99));
|
2016-12-01 23:18:18 +01:00
|
|
|
KuaiGongInternationalServer.setPortProperties(5);
|
|
|
|
AddToAllServers(KuaiGongInternationalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Technology and communications companies (large targets)
|
|
|
|
var FulcrumTechnologiesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
FulcrumTechnologiesServer.init(createRandomIp(), "fulcrumtech", "Fulcrum Technologies", true, false, false, false, 64);
|
2017-07-28 16:19:28 +02:00
|
|
|
FulcrumTechnologiesServer.setHackingParameters(getRandomInt(1000, 1200), getRandomInt(1400000000, 1800000000), getRandomInt(85, 95), getRandomInt(80, 99));
|
2016-12-01 23:18:18 +01:00
|
|
|
FulcrumTechnologiesServer.setPortProperties(5);
|
|
|
|
AddToAllServers(FulcrumTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var FulcrumSecretTechnologiesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
FulcrumSecretTechnologiesServer.init(createRandomIp(), "fulcrumassets", "Fulcrum Technologies Assets", true, false, false, false, 0);
|
2017-07-22 00:54:55 +02:00
|
|
|
FulcrumSecretTechnologiesServer.setHackingParameters(getRandomInt(1200, 1500), 1000000, 99, 1);
|
2016-12-01 23:18:18 +01:00
|
|
|
FulcrumSecretTechnologiesServer.setPortProperties(5);
|
|
|
|
AddToAllServers(FulcrumSecretTechnologiesServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.FulcrumSecretTechnologies, FulcrumSecretTechnologiesServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var StormTechnologiesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
StormTechnologiesServer.init(createRandomIp(), "stormtech", "Storm Technologies", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
StormTechnologiesServer.setHackingParameters(getRandomInt(900, 1050), getRandomInt(1000000000, 1200000000), getRandomInt(80, 90), getRandomInt(70, 90));
|
2016-12-01 23:18:18 +01:00
|
|
|
StormTechnologiesServer.setPortProperties(5);
|
|
|
|
AddToAllServers(StormTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var DefCommServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
DefCommServer.init(createRandomIp(), "defcomm", "DefComm", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
DefCommServer.setHackingParameters(getRandomInt(900, 1000), getRandomInt(800000000, 950000000), getRandomInt(85, 95), getRandomInt(50, 70));
|
2016-12-01 23:18:18 +01:00
|
|
|
DefCommServer.setPortProperties(5);
|
|
|
|
AddToAllServers(DefCommServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var InfoCommServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
InfoCommServer.init(createRandomIp(), "infocomm", "InfoComm", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
InfoCommServer.setHackingParameters(getRandomInt(875, 950), getRandomInt(600000000, 900000000), getRandomInt(70, 90), getRandomInt(35, 75));
|
2016-12-01 23:18:18 +01:00
|
|
|
InfoCommServer.setPortProperties(5);
|
|
|
|
AddToAllServers(InfoCommServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var HeliosLabsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
HeliosLabsServer.init(createRandomIp(), "helios", "Helios Labs", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
HeliosLabsServer.setHackingParameters(getRandomInt(800, 900), getRandomInt(550000000, 750000000), getRandomInt(85, 95), getRandomInt(70, 80));
|
2016-12-01 23:18:18 +01:00
|
|
|
HeliosLabsServer.setPortProperties(5);
|
|
|
|
AddToAllServers(HeliosLabsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var VitaLifeServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
VitaLifeServer.init(createRandomIp(), "vitalife", "VitaLife", true, false, false, false, 32);
|
2017-07-28 16:19:28 +02:00
|
|
|
VitaLifeServer.setHackingParameters(getRandomInt(775, 900), getRandomInt(700000000, 800000000), getRandomInt(80, 90), getRandomInt(60, 80));
|
2016-12-01 23:18:18 +01:00
|
|
|
VitaLifeServer.setPortProperties(5);
|
|
|
|
AddToAllServers(VitaLifeServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var IcarusMicrosystemsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
IcarusMicrosystemsServer.init(createRandomIp(), "icarus", "Icarus Microsystems", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
IcarusMicrosystemsServer.setHackingParameters(getRandomInt(850, 925), getRandomInt(900000000, 1000000000), getRandomInt(85, 95), getRandomInt(85, 95));
|
2016-12-01 23:18:18 +01:00
|
|
|
IcarusMicrosystemsServer.setPortProperties(5);
|
|
|
|
AddToAllServers(IcarusMicrosystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var UniversalEnergyServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
UniversalEnergyServer.init(createRandomIp(), "univ-energy", "Universal Energy", true, false, false, false, 32);
|
2017-07-28 16:19:28 +02:00
|
|
|
UniversalEnergyServer.setHackingParameters(getRandomInt(800, 900), getRandomInt(1100000000, 1200000000), getRandomInt(80, 90), getRandomInt(80, 90));
|
2016-12-01 23:18:18 +01:00
|
|
|
UniversalEnergyServer.setPortProperties(4);
|
|
|
|
AddToAllServers(UniversalEnergyServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var TitanLabsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
TitanLabsServer.init(createRandomIp(), "titan-labs", "Titan Laboratories", true, false, false, false, 32);
|
2017-07-28 16:19:28 +02:00
|
|
|
TitanLabsServer.setHackingParameters(getRandomInt(800, 875), getRandomInt(750000000, 900000000), getRandomInt(70, 80), getRandomInt(60, 80));
|
2016-12-01 23:18:18 +01:00
|
|
|
TitanLabsServer.setPortProperties(5);
|
|
|
|
AddToAllServers(TitanLabsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var MicrodyneTechnologiesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
MicrodyneTechnologiesServer.init(createRandomIp(), "microdyne", "Microdyne Technologies", true, false, false, false, 16);
|
2017-07-28 16:19:28 +02:00
|
|
|
MicrodyneTechnologiesServer.setHackingParameters(getRandomInt(800, 875), getRandomInt(500000000, 700000000), getRandomInt(65, 75), getRandomInt(70, 90));
|
2016-12-01 23:18:18 +01:00
|
|
|
MicrodyneTechnologiesServer.setPortProperties(5);
|
|
|
|
AddToAllServers(MicrodyneTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var TaiYangDigitalServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
TaiYangDigitalServer.init(createRandomIp(), "taiyang-digital", "Taiyang Digital", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
TaiYangDigitalServer.setHackingParameters(getRandomInt(850, 950), getRandomInt(800000000, 900000000), getRandomInt(70, 80), getRandomInt(70, 80));
|
2016-12-01 23:18:18 +01:00
|
|
|
TaiYangDigitalServer.setPortProperties(5);
|
|
|
|
AddToAllServers(TaiYangDigitalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var GalacticCyberSystemsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
GalacticCyberSystemsServer.init(createRandomIp(), "galactic-cyber", "Galactic Cybersystems", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
GalacticCyberSystemsServer.setHackingParameters(getRandomInt(825, 875), getRandomInt(750000000, 850000000), getRandomInt(55, 65), getRandomInt(70, 90));
|
2016-12-01 23:18:18 +01:00
|
|
|
GalacticCyberSystemsServer.setPortProperties(5);
|
|
|
|
AddToAllServers(GalacticCyberSystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Defense Companies ("Large" Companies)
|
|
|
|
var AeroCorpServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
AeroCorpServer.init(createRandomIp(), "aerocorp", "AeroCorp", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
AeroCorpServer.setHackingParameters(getRandomInt(850, 925), getRandomInt(1000000000, 1200000000), getRandomInt(80, 90), getRandomInt(55, 65));
|
2016-12-01 23:18:18 +01:00
|
|
|
AeroCorpServer.setPortProperties(5);
|
|
|
|
AddToAllServers(AeroCorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var OmniaCybersystemsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
OmniaCybersystemsServer.init(createRandomIp(), "omnia", "Omnia Cybersystems", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
OmniaCybersystemsServer.setHackingParameters(getRandomInt(850, 950), getRandomInt(900000000, 1000000000), getRandomInt(85, 95), getRandomInt(60, 70));
|
2016-12-01 23:18:18 +01:00
|
|
|
OmniaCybersystemsServer.setPortProperties(5);
|
|
|
|
AddToAllServers(OmniaCybersystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var ZBDefenseServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
ZBDefenseServer.init(createRandomIp(), "zb-def", "ZB Defense Industries", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
ZBDefenseServer.setHackingParameters(getRandomInt(775, 825), getRandomInt(900000000, 1100000000), getRandomInt(55, 65), getRandomInt(65, 75));
|
2016-12-01 23:18:18 +01:00
|
|
|
ZBDefenseServer.setPortProperties(4);
|
|
|
|
AddToAllServers(ZBDefenseServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var AppliedEnergeticsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
AppliedEnergeticsServer.init(createRandomIp(), "applied-energetics", "Applied Energetics", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
AppliedEnergeticsServer.setHackingParameters(getRandomInt(775, 850), getRandomInt(700000000, 1000000000), getRandomInt(60, 80), getRandomInt(70, 75));
|
2016-12-01 23:18:18 +01:00
|
|
|
AppliedEnergeticsServer.setPortProperties(4);
|
|
|
|
AddToAllServers(AppliedEnergeticsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var SolarisSpaceSystemsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
SolarisSpaceSystemsServer.init(createRandomIp(), "solaris", "Solaris Space Systems", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
SolarisSpaceSystemsServer.setHackingParameters(getRandomInt(750, 850), getRandomInt(700000000, 900000000), getRandomInt(70, 80), getRandomInt(70, 80));
|
2016-12-01 23:18:18 +01:00
|
|
|
SolarisSpaceSystemsServer.setPortProperties(5);
|
|
|
|
AddToAllServers(SolarisSpaceSystemsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var DeltaOneServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
DeltaOneServer.init(createRandomIp(), "deltaone", "Delta One", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
DeltaOneServer.setHackingParameters(getRandomInt(800, 900), getRandomInt(1300000000, 1700000000), getRandomInt(75, 85), getRandomInt(50, 70));
|
2016-12-01 23:18:18 +01:00
|
|
|
DeltaOneServer.setPortProperties(5);
|
|
|
|
AddToAllServers(DeltaOneServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Health, medicine, pharmaceutical companies ("Large" targets)
|
|
|
|
var GlobalPharmaceuticalsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
GlobalPharmaceuticalsServer.init(createRandomIp(), "global-pharm", "Global Pharmaceuticals", true, false, false, false, 16);
|
2017-07-28 16:19:28 +02:00
|
|
|
GlobalPharmaceuticalsServer.setHackingParameters(getRandomInt(750, 850), getRandomInt(1500000000, 1750000000), getRandomInt(75, 85), getRandomInt(80, 90));
|
2016-12-01 23:18:18 +01:00
|
|
|
GlobalPharmaceuticalsServer.setPortProperties(4);
|
|
|
|
AddToAllServers(GlobalPharmaceuticalsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var NovaMedicalServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
NovaMedicalServer.init(createRandomIp(), "nova-med", "Nova Medical", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
NovaMedicalServer.setHackingParameters(getRandomInt(775, 850), getRandomInt(1100000000, 1250000000), getRandomInt(60, 80), getRandomInt(65, 85));
|
2016-12-01 23:18:18 +01:00
|
|
|
NovaMedicalServer.setPortProperties(4);
|
|
|
|
AddToAllServers(NovaMedicalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var ZeusMedicalServer = new Server();
|
2017-07-22 00:54:55 +02:00
|
|
|
ZeusMedicalServer.init(createRandomIp(), "zeus-med", "Zeus Medical", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
ZeusMedicalServer.setHackingParameters(getRandomInt(800, 850), getRandomInt(1300000000, 1500000000), getRandomInt(70, 90), getRandomInt(70, 80));
|
2016-12-01 23:18:18 +01:00
|
|
|
ZeusMedicalServer.setPortProperties(5);
|
|
|
|
AddToAllServers(ZeusMedicalServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var UnitaLifeGroupServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
UnitaLifeGroupServer.init(createRandomIp(), "unitalife", "UnitaLife Group", true, false, false, false, 32);
|
2017-07-28 16:19:28 +02:00
|
|
|
UnitaLifeGroupServer.setHackingParameters(getRandomInt(775, 825), getRandomInt(1000000000, 1100000000), getRandomInt(70, 80), getRandomInt(70, 80));
|
2016-12-01 23:18:18 +01:00
|
|
|
UnitaLifeGroupServer.setPortProperties(4);
|
|
|
|
AddToAllServers(UnitaLifeGroupServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//"Medium level" targets
|
|
|
|
var LexoCorpServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
LexoCorpServer.init(createRandomIp(), "lexo-corp", "Lexo Corporation", true, false, false, false, 16);
|
2017-07-28 16:19:28 +02:00
|
|
|
LexoCorpServer.setHackingParameters(getRandomInt(650, 750), getRandomInt(700000000, 800000000), getRandomInt(60, 80), getRandomInt(55, 65));
|
2016-12-01 23:18:18 +01:00
|
|
|
LexoCorpServer.setPortProperties(4);
|
|
|
|
AddToAllServers(LexoCorpServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var RhoConstructionServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
RhoConstructionServer.init(createRandomIp(), "rho-construction", "Rho Construction", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
RhoConstructionServer.setHackingParameters(getRandomInt(475, 525), getRandomInt(500000000, 700000000), getRandomInt(40, 60), getRandomInt(40, 60));
|
2016-12-01 23:18:18 +01:00
|
|
|
RhoConstructionServer.setPortProperties(3);
|
|
|
|
AddToAllServers(RhoConstructionServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var AlphaEnterprisesServer = new Server();
|
2017-04-25 22:18:00 +02:00
|
|
|
AlphaEnterprisesServer.init(createRandomIp(), "alpha-ent", "Alpha Enterprises", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
AlphaEnterprisesServer.setHackingParameters(getRandomInt(500, 600), getRandomInt(600000000, 750000000), getRandomInt(50, 70), getRandomInt(50, 60));
|
2016-12-01 23:18:18 +01:00
|
|
|
AlphaEnterprisesServer.setPortProperties(4);
|
|
|
|
AddToAllServers(AlphaEnterprisesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var AevumPoliceServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
AevumPoliceServer.init(createRandomIp(), "aevum-police", "Aevum Police Network", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
AevumPoliceServer.setHackingParameters(getRandomInt(400, 450), getRandomInt(200000000, 400000000), getRandomInt(70, 80), getRandomInt(30, 50));
|
2016-12-01 23:18:18 +01:00
|
|
|
AevumPoliceServer.setPortProperties(4);
|
|
|
|
AddToAllServers(AevumPoliceServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var RothmanUniversityServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
RothmanUniversityServer.init(createRandomIp(), "rothman-uni", "Rothman University Network", true, false, false, false, 4);
|
2017-07-28 16:19:28 +02:00
|
|
|
RothmanUniversityServer.setHackingParameters(getRandomInt(370, 430), getRandomInt(175000000, 250000000), getRandomInt(45, 55), getRandomInt(35, 45));
|
2016-12-01 23:18:18 +01:00
|
|
|
RothmanUniversityServer.setPortProperties(3);
|
|
|
|
AddToAllServers(RothmanUniversityServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var ZBInstituteOfTechnologyServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
ZBInstituteOfTechnologyServer.init(createRandomIp(), "zb-institute", "ZB Institute of Technology Network", true, false, false, false, 4);
|
2017-07-28 16:19:28 +02:00
|
|
|
ZBInstituteOfTechnologyServer.setHackingParameters(getRandomInt(725, 775), getRandomInt(800000000, 1100000000), getRandomInt(65, 85), getRandomInt(75, 85));
|
2016-12-01 23:18:18 +01:00
|
|
|
ZBInstituteOfTechnologyServer.setPortProperties(5);
|
|
|
|
AddToAllServers(ZBInstituteOfTechnologyServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var SummitUniversityServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
SummitUniversityServer.init(createRandomIp(), "summit-uni", "Summit University Network", true, false, false, false, 4);
|
2017-07-28 16:19:28 +02:00
|
|
|
SummitUniversityServer.setHackingParameters(getRandomInt(425, 475), getRandomInt(200000000, 350000000), getRandomInt(45, 65), getRandomInt(40, 60));
|
2016-12-01 23:18:18 +01:00
|
|
|
SummitUniversityServer.setPortProperties(3);
|
|
|
|
AddToAllServers(SummitUniversityServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var SysCoreSecuritiesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
SysCoreSecuritiesServer.init(createRandomIp(), "syscore", "SysCore Securities", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
SysCoreSecuritiesServer.setHackingParameters(getRandomInt(550, 650), getRandomInt(400000000, 600000000), getRandomInt(60, 80), getRandomInt(60, 70));
|
2016-12-01 23:18:18 +01:00
|
|
|
SysCoreSecuritiesServer.setPortProperties(4);
|
|
|
|
AddToAllServers(SysCoreSecuritiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var CatalystVenturesServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
CatalystVenturesServer.init(createRandomIp(), "catalyst", "Catalyst Ventures", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
CatalystVenturesServer.setHackingParameters(getRandomInt(400, 450), getRandomInt(300000000, 550000000), getRandomInt(60, 70), getRandomInt(25, 55));
|
2016-12-01 23:18:18 +01:00
|
|
|
CatalystVenturesServer.setPortProperties(3);
|
|
|
|
AddToAllServers(CatalystVenturesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var TheHubServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
TheHubServer.init(createRandomIp(), "the-hub", "The Hub", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
TheHubServer.setHackingParameters(getRandomInt(275, 325), getRandomInt(150000000, 200000000), getRandomInt(35, 45), getRandomInt(45, 55));
|
2016-12-01 23:18:18 +01:00
|
|
|
TheHubServer.setPortProperties(2);
|
|
|
|
AddToAllServers(TheHubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var CompuTekServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
CompuTekServer.init(createRandomIp(), "comptek", "CompuTek", true, false, false, false, 8);
|
2017-07-28 16:19:28 +02:00
|
|
|
CompuTekServer.setHackingParameters(getRandomInt(300, 400), getRandomInt(220000000, 250000000), getRandomInt(55, 65), getRandomInt(45, 65));
|
2016-12-01 23:18:18 +01:00
|
|
|
CompuTekServer.setPortProperties(3);
|
|
|
|
AddToAllServers(CompuTekServer);
|
2016-10-20 20:07:12 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var NetLinkTechnologiesServer = new Server();
|
2017-04-25 22:18:00 +02:00
|
|
|
NetLinkTechnologiesServer.init(createRandomIp(), "netlink", "NetLink Technologies", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
NetLinkTechnologiesServer.setHackingParameters(getRandomInt(375, 425), 275000000, getRandomInt(60, 80), getRandomInt(45, 75));
|
2016-12-01 23:18:18 +01:00
|
|
|
NetLinkTechnologiesServer.setPortProperties(3);
|
|
|
|
AddToAllServers(NetLinkTechnologiesServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var JohnsonOrthopedicsServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
JohnsonOrthopedicsServer.init(createRandomIp(), "johnson-ortho", "Johnson Orthopedics", true, false, false, false, 4);
|
2017-07-28 16:19:28 +02:00
|
|
|
JohnsonOrthopedicsServer.setHackingParameters(getRandomInt(250, 300), getRandomInt(70000000, 85000000), getRandomInt(35, 65), getRandomInt(35, 65));
|
2016-12-01 23:18:18 +01:00
|
|
|
JohnsonOrthopedicsServer.setPortProperties(2);
|
|
|
|
AddToAllServers(JohnsonOrthopedicsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//"Low level" targets
|
|
|
|
var FoodNStuffServer = new Server();
|
2017-08-01 21:03:45 +02:00
|
|
|
FoodNStuffServer.init(createRandomIp(), "foodnstuff", "Food N Stuff Supermarket", true, false, false, false, 8);
|
2017-07-29 18:25:40 +02:00
|
|
|
FoodNStuffServer.setHackingParameters(1, 2000000, 10, 5);
|
2016-12-01 23:18:18 +01:00
|
|
|
FoodNStuffServer.setPortProperties(0);
|
|
|
|
AddToAllServers(FoodNStuffServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var SigmaCosmeticsServer = new Server();
|
2017-08-01 21:03:45 +02:00
|
|
|
SigmaCosmeticsServer.init(createRandomIp(), "sigma-cosmetics", "Sigma Cosmetics", true, false, false, false, 8);
|
2017-07-29 18:25:40 +02:00
|
|
|
SigmaCosmeticsServer.setHackingParameters(5, 2300000, 10, 10);
|
2016-12-01 23:18:18 +01:00
|
|
|
SigmaCosmeticsServer.setPortProperties(0);
|
|
|
|
AddToAllServers(SigmaCosmeticsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var JoesGunsServer = new Server();
|
2017-08-01 21:03:45 +02:00
|
|
|
JoesGunsServer.init(createRandomIp(), "joesguns", "Joe's Guns", true, false, false, false, 8);
|
2017-07-30 21:11:30 +02:00
|
|
|
JoesGunsServer.setHackingParameters(10, 2500000, 15, 20);
|
2016-12-01 23:18:18 +01:00
|
|
|
JoesGunsServer.setPortProperties(0);
|
|
|
|
AddToAllServers(JoesGunsServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var Zer0NightclubServer = new Server();
|
2017-05-31 19:52:30 +02:00
|
|
|
Zer0NightclubServer.init(createRandomIp(), "zer0", "ZER0 Nightclub", true, false, false, false, 4);
|
2017-05-22 17:55:39 +02:00
|
|
|
Zer0NightclubServer.setHackingParameters(75, 7500000, 25, 40);
|
2016-12-01 23:18:18 +01:00
|
|
|
Zer0NightclubServer.setPortProperties(1);
|
|
|
|
AddToAllServers(Zer0NightclubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var NectarNightclubServer = new Server();
|
2017-08-01 21:03:45 +02:00
|
|
|
NectarNightclubServer.init(createRandomIp(), "nectar-net", "Nectar Nightclub Network", true, false, false, false, 8);
|
2017-07-29 18:25:40 +02:00
|
|
|
NectarNightclubServer.setHackingParameters(20, 2750000, 20, 25);
|
2016-12-01 23:18:18 +01:00
|
|
|
NectarNightclubServer.setPortProperties(0);
|
|
|
|
AddToAllServers(NectarNightclubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var NeoNightclubServer = new Server();
|
2017-05-31 19:52:30 +02:00
|
|
|
NeoNightclubServer.init(createRandomIp(), "neo-net", "Neo Nightclub Network", true, false, false, false, 4);
|
2017-07-29 18:25:40 +02:00
|
|
|
NeoNightclubServer.setHackingParameters(50, 5000000, 25, 25);
|
2016-12-01 23:18:18 +01:00
|
|
|
NeoNightclubServer.setPortProperties(1);
|
|
|
|
AddToAllServers(NeoNightclubServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var SilverHelixServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
SilverHelixServer.init(createRandomIp(), "silver-helix", "Silver Helix", true, false, false, false, 2);
|
2017-07-28 16:19:28 +02:00
|
|
|
SilverHelixServer.setHackingParameters(150, 45000000, 30, 30);
|
2016-12-01 23:18:18 +01:00
|
|
|
SilverHelixServer.setPortProperties(2);
|
|
|
|
AddToAllServers(SilverHelixServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var HongFangTeaHouseServer = new Server();
|
2017-08-01 21:03:45 +02:00
|
|
|
HongFangTeaHouseServer.init(createRandomIp(), "hong-fang-tea", "HongFang Teahouse", true, false, false, false, 8);
|
2017-07-30 21:11:30 +02:00
|
|
|
HongFangTeaHouseServer.setHackingParameters(30, 3000000, 15, 20);
|
2017-04-23 04:32:51 +02:00
|
|
|
HongFangTeaHouseServer.setPortProperties(0);
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(HongFangTeaHouseServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var HaraKiriSushiBarServer = new Server();
|
2017-08-01 21:03:45 +02:00
|
|
|
HaraKiriSushiBarServer.init(createRandomIp(), "harakiri-sushi", "HaraKiri Sushi Bar Network", true, false, false, false, 8);
|
2017-07-29 18:25:40 +02:00
|
|
|
HaraKiriSushiBarServer.setHackingParameters(40, 4000000, 15, 40);
|
2017-05-15 19:49:49 +02:00
|
|
|
HaraKiriSushiBarServer.setPortProperties(0);
|
2016-12-01 23:18:18 +01:00
|
|
|
AddToAllServers(HaraKiriSushiBarServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var PhantasyServer = new Server();
|
2017-05-10 23:10:06 +02:00
|
|
|
PhantasyServer.init(createRandomIp(), "phantasy", "Phantasy Club", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
PhantasyServer.setHackingParameters(100, 24000000, 20, 35);
|
2016-12-01 23:18:18 +01:00
|
|
|
PhantasyServer.setPortProperties(2);
|
|
|
|
AddToAllServers(PhantasyServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var MaxHardwareServer = new Server();
|
2017-05-31 19:52:30 +02:00
|
|
|
MaxHardwareServer.init(createRandomIp(), "max-hardware", "Max Hardware Store", true, false, false, false, 4);
|
2017-07-28 16:19:28 +02:00
|
|
|
MaxHardwareServer.setHackingParameters(80, 10000000, 15, 25);
|
2016-12-01 23:18:18 +01:00
|
|
|
MaxHardwareServer.setPortProperties(1);
|
|
|
|
AddToAllServers(MaxHardwareServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var OmegaSoftwareServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
OmegaSoftwareServer.init(createRandomIp(), "omega-net", "Omega Software", true, false, false, false, 8);
|
2017-07-28 16:19:28 +02:00
|
|
|
OmegaSoftwareServer.setHackingParameters(getRandomInt(180, 220), getRandomInt(60000000, 70000000), getRandomInt(25, 35), getRandomInt(30, 40));
|
2016-12-01 23:18:18 +01:00
|
|
|
OmegaSoftwareServer.setPortProperties(2);
|
|
|
|
AddToAllServers(OmegaSoftwareServer);
|
|
|
|
|
|
|
|
//Gyms
|
|
|
|
var CrushFitnessGymServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
CrushFitnessGymServer.init(createRandomIp(), "crush-fitness", "Crush Fitness", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
CrushFitnessGymServer.setHackingParameters(getRandomInt(225, 275), getRandomInt(40000000, 60000000), getRandomInt(35, 45), getRandomInt(27, 33));
|
2016-12-01 23:18:18 +01:00
|
|
|
CrushFitnessGymServer.setPortProperties(2);
|
|
|
|
AddToAllServers(CrushFitnessGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var IronGymServer = new Server();
|
2017-05-31 19:52:30 +02:00
|
|
|
IronGymServer.init(createRandomIp(), "iron-gym", "Iron Gym Network", true, false, false, false, 4);
|
2017-05-22 17:55:39 +02:00
|
|
|
IronGymServer.setHackingParameters(100, 20000000, 30, 20);
|
2016-12-01 23:18:18 +01:00
|
|
|
IronGymServer.setPortProperties(1);
|
|
|
|
AddToAllServers(IronGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var MilleniumFitnessGymServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
MilleniumFitnessGymServer.init(createRandomIp(), "millenium-fitness", "Millenium Fitness Network", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
MilleniumFitnessGymServer.setHackingParameters(getRandomInt(475, 525), 250000000, getRandomInt(45, 55), getRandomInt(25, 45));
|
2016-12-01 23:18:18 +01:00
|
|
|
MilleniumFitnessGymServer.setPortProperties(3);
|
|
|
|
AddToAllServers(MilleniumFitnessGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
var PowerhouseGymServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
PowerhouseGymServer.init(createRandomIp(), "powerhouse-fitness", "Powerhouse Fitness", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
PowerhouseGymServer.setHackingParameters(getRandomInt(950, 1100), 900000000, getRandomInt(55, 65), getRandomInt(50, 60));
|
2016-12-01 23:18:18 +01:00
|
|
|
PowerhouseGymServer.setPortProperties(5);
|
|
|
|
AddToAllServers(PowerhouseGymServer);
|
|
|
|
|
|
|
|
var SnapFitnessGymServer = new Server();
|
2017-04-23 04:32:51 +02:00
|
|
|
SnapFitnessGymServer.init(createRandomIp(), "snap-fitness", "Snap Fitness", true, false, false, false, 0);
|
2017-07-28 16:19:28 +02:00
|
|
|
SnapFitnessGymServer.setHackingParameters(getRandomInt(675, 800), 450000000, getRandomInt(40, 60), getRandomInt(40, 60));
|
2016-12-01 23:18:18 +01:00
|
|
|
SnapFitnessGymServer.setPortProperties(4);
|
|
|
|
AddToAllServers(SnapFitnessGymServer);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-22 17:19:02 +01:00
|
|
|
//Faction servers, cannot hack money from these
|
|
|
|
var BitRunnersServer = new Server();
|
2017-04-25 22:18:00 +02:00
|
|
|
BitRunnersServer.init(createRandomIp(), "run4theh111z", "The Runners", true, false, false, false, 0);
|
2017-06-02 06:15:45 +02:00
|
|
|
BitRunnersServer.setHackingParameters(getRandomInt(505, 550), 0, 0, 0);
|
2016-12-22 17:19:02 +01:00
|
|
|
BitRunnersServer.setPortProperties(4);
|
|
|
|
AddToAllServers(BitRunnersServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.BitRunnersServer, BitRunnersServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2017-06-01 04:19:14 +02:00
|
|
|
var TheBlackHandServer = new Server();
|
2017-06-11 03:46:02 +02:00
|
|
|
TheBlackHandServer.init(createRandomIp(), "I.I.I.I", "I.I.I.I", true, false, false, false, 0);
|
2017-07-03 21:42:11 +02:00
|
|
|
TheBlackHandServer.setHackingParameters(getRandomInt(340, 365), 0, 0, 0);
|
2017-06-01 04:19:14 +02:00
|
|
|
TheBlackHandServer.setPortProperties(3);
|
|
|
|
AddToAllServers(TheBlackHandServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.TheBlackHandServer, TheBlackHandServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-22 17:19:02 +01:00
|
|
|
var NiteSecServer = new Server();
|
2017-04-25 22:18:00 +02:00
|
|
|
NiteSecServer.init(createRandomIp(), "avmnite-02h", "NiteSec", true, false, false, false, 0);
|
2017-06-02 16:36:17 +02:00
|
|
|
NiteSecServer.setHackingParameters(getRandomInt(202, 220), 0, 0, 0);
|
2016-12-22 17:19:02 +01:00
|
|
|
NiteSecServer.setPortProperties(2);
|
|
|
|
AddToAllServers(NiteSecServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.NiteSecServer, NiteSecServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-22 17:19:02 +01:00
|
|
|
var DarkArmyServer = new Server();
|
2017-04-25 22:18:00 +02:00
|
|
|
DarkArmyServer.init(createRandomIp(), ".", ".", true, false, false, false, 0);
|
2017-06-02 06:15:45 +02:00
|
|
|
DarkArmyServer.setHackingParameters(getRandomInt(505, 550), 0, 0, 0);
|
|
|
|
DarkArmyServer.setPortProperties(4);
|
2016-12-22 17:19:02 +01:00
|
|
|
AddToAllServers(DarkArmyServer);
|
2017-06-02 06:15:45 +02:00
|
|
|
SpecialServerIps.addIp(SpecialServerNames.TheDarkArmyServer, DarkArmyServer.ip);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2016-12-22 17:19:02 +01:00
|
|
|
var CyberSecServer = new Server();
|
2017-04-25 22:18:00 +02:00
|
|
|
CyberSecServer.init(createRandomIp(), "CSEC", "CyberSec", true, false, false, false, 0);
|
2017-06-02 06:15:45 +02:00
|
|
|
CyberSecServer.setHackingParameters(getRandomInt(51, 60), 0, 0, 0);
|
|
|
|
CyberSecServer.setPortProperties(1);
|
2016-12-22 17:19:02 +01: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
|
|
|
|
2017-06-02 06:15:45 +02:00
|
|
|
var DaedalusServer = new Server();
|
2017-07-22 00:54:55 +02:00
|
|
|
DaedalusServer.init(createRandomIp(), "The-Cave", "Helios", true, false, false, false, 0);
|
2017-06-02 06:15:45 +02:00
|
|
|
DaedalusServer.setHackingParameters(925, 0, 0, 0);
|
|
|
|
DaedalusServer.setPortProperties(5);
|
|
|
|
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
|
|
|
|
var WorldDaemon = new Server();
|
|
|
|
WorldDaemon.init(createRandomIp(), SpecialServerNames.WorldDaemon, SpecialServerNames.WorldDaemon, true, false, false, false, 0);
|
2017-07-22 00:54:55 +02:00
|
|
|
WorldDaemon.setHackingParameters(3000, 0, 0, 0);
|
2017-06-02 06:15:45 +02:00
|
|
|
WorldDaemon.setPortProperties(5);
|
|
|
|
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
|
|
|
|
2017-05-02 18:28:54 +02:00
|
|
|
//Applied server growth for a single server. Returns the percentage growth
|
|
|
|
processSingleServerGrowth = function(server, numCycles) {
|
|
|
|
//Server growth processed once every 450 game cycles
|
|
|
|
var 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
|
2017-07-28 16:19:28 +02:00
|
|
|
var growthRate = CONSTANTS.ServerBaseGrowthRate;
|
|
|
|
var adjGrowthRate = 1 + (growthRate - 1) / server.hackDifficulty;
|
2017-06-06 23:22:57 +02:00
|
|
|
if (adjGrowthRate > CONSTANTS.ServerMaxGrowthRate) {adjGrowthRate = CONSTANTS.ServerMaxGrowthRate;}
|
2017-07-03 21:42:11 +02:00
|
|
|
//console.log("Adjusted growth rate: " + adjGrowthRate);
|
2017-07-28 16:19:28 +02:00
|
|
|
|
2017-06-06 23:22:57 +02:00
|
|
|
//Calculate adjusted server growth rate based on parameters
|
2017-05-02 18:28:54 +02:00
|
|
|
var serverGrowthPercentage = server.serverGrowth / 100;
|
|
|
|
var numServerGrowthCyclesAdjusted = numServerGrowthCycles * serverGrowthPercentage;
|
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
|
|
|
|
2017-05-02 18:28:54 +02:00
|
|
|
server.moneyAvailable *= serverGrowth;
|
2017-07-06 00:33:46 +02:00
|
|
|
if (server.moneyMax && isNaN(server.moneyAvailable)) {
|
|
|
|
server.moneyAvailable = server.moneyMax;
|
|
|
|
}
|
|
|
|
if (server.moneyMax && server.moneyAvailable > server.moneyMax) {
|
2017-06-07 02:04:18 +02:00
|
|
|
server.moneyAvailable = server.moneyMax;
|
|
|
|
return 1;
|
|
|
|
}
|
2017-06-11 22:28:20 +02:00
|
|
|
server.fortify(2 * CONSTANTS.ServerFortifyAmount * numServerGrowthCycles);
|
2017-05-02 18:28:54 +02:00
|
|
|
return serverGrowth;
|
|
|
|
}
|
2016-12-20 21:18:34 +01:00
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//List of all servers that exist in the game, indexed by their ip
|
|
|
|
AllServers = {};
|
|
|
|
|
2016-12-15 18:51:23 +01:00
|
|
|
SizeOfAllServers = function() {
|
|
|
|
var size = 0, key;
|
|
|
|
for (key in AllServers) {
|
|
|
|
if (AllServers.hasOwnProperty(key)) size++;
|
|
|
|
}
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Add a server onto the map of all servers in the game
|
|
|
|
AddToAllServers = function(server) {
|
|
|
|
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
|
|
|
|
// Relatively slow, would rather not use this a lot
|
|
|
|
GetServerByHostname = function(hostname) {
|
|
|
|
for (var ip in AllServers) {
|
|
|
|
if (AllServers.hasOwnProperty(ip)) {
|
|
|
|
if (AllServers[ip].hostname == hostname) {
|
2016-12-20 21:18:34 +01:00
|
|
|
return AllServers[ip];
|
2016-12-15 18:51:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2017-05-11 06:20:17 +02:00
|
|
|
//Get server by IP or hostname. Returns null if invalid
|
|
|
|
getServer = function(s) {
|
|
|
|
if (!isValidIPAddress(s)) {
|
|
|
|
return GetServerByHostname(s);
|
|
|
|
} else {
|
|
|
|
return AllServers[s];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-01 23:18:18 +01:00
|
|
|
//Debugging tool
|
|
|
|
PrintAllServers = function() {
|
|
|
|
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
|
|
|
}
|