mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +01:00
[refactor] Server RAM is exponent instead of concrete value
This will let us randomize the value down the line.
This commit is contained in:
parent
625734d326
commit
babbf00029
@ -155,11 +155,14 @@ function initForeignServers() {
|
|||||||
const serverParams = {
|
const serverParams = {
|
||||||
hostname: metadata.hostname,
|
hostname: metadata.hostname,
|
||||||
ip: createRandomIp(),
|
ip: createRandomIp(),
|
||||||
maxRam: metadata.maxRam || 0,
|
|
||||||
numOpenPortsRequired: metadata.numOpenPortsRequired,
|
numOpenPortsRequired: metadata.numOpenPortsRequired,
|
||||||
organizationName: metadata.organizationName
|
organizationName: metadata.organizationName
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (metadata.maxRamExponent !== undefined) {
|
||||||
|
serverParams.maxRam = Math.pow(2, metadata.maxRamExponent);
|
||||||
|
}
|
||||||
|
|
||||||
for (const prop of propertiesToPatternMatch) {
|
for (const prop of propertiesToPatternMatch) {
|
||||||
if (metadata[prop] !== undefined) {
|
if (metadata[prop] !== undefined) {
|
||||||
serverParams[prop] = toNumber(metadata[prop]);
|
serverParams[prop] = toNumber(metadata[prop]);
|
||||||
|
@ -40,9 +40,9 @@ interface IServerMetadata {
|
|||||||
literature?: string[];
|
literature?: string[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When populated, the amount of RAM the server has.
|
* When populated, the exponent of 2^x amount of RAM the server has.
|
||||||
*/
|
*/
|
||||||
maxRam?: number;
|
maxRamExponent?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How much money the server starts out with.
|
* How much money the server starts out with.
|
||||||
@ -147,7 +147,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "blade",
|
hostname: "blade",
|
||||||
literature: ["beyond-man.lit"],
|
literature: ["beyond-man.lit"],
|
||||||
maxRam: 128,
|
maxRamExponent: 7,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 20000000000,
|
max: 20000000000,
|
||||||
min: 12000000000,
|
min: 12000000000,
|
||||||
@ -220,7 +220,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
"coded-intelligence.lit",
|
"coded-intelligence.lit",
|
||||||
"history-of-synthoids.lit",
|
"history-of-synthoids.lit",
|
||||||
],
|
],
|
||||||
maxRam: 256,
|
maxRamExponent: 8,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 20000000000,
|
max: 20000000000,
|
||||||
min: 15000000000,
|
min: 15000000000,
|
||||||
@ -288,7 +288,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "fulcrumtech",
|
hostname: "fulcrumtech",
|
||||||
literature: ["simulated-reality.lit"],
|
literature: ["simulated-reality.lit"],
|
||||||
maxRam: 512,
|
maxRamExponent: 9,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 1800000000,
|
max: 1800000000,
|
||||||
min: 1400000000,
|
min: 1400000000,
|
||||||
@ -392,7 +392,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "helios",
|
hostname: "helios",
|
||||||
literature: ["beyond-man.lit"],
|
literature: ["beyond-man.lit"],
|
||||||
maxRam: 128,
|
maxRamExponent: 7,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 750000000,
|
max: 750000000,
|
||||||
min: 550000000,
|
min: 550000000,
|
||||||
@ -416,7 +416,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "vitalife",
|
hostname: "vitalife",
|
||||||
literature: ["A-Green-Tomorrow.lit"],
|
literature: ["A-Green-Tomorrow.lit"],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 800000000,
|
max: 800000000,
|
||||||
min: 700000000,
|
min: 700000000,
|
||||||
@ -461,7 +461,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
min: 80,
|
min: 80,
|
||||||
},
|
},
|
||||||
hostname: "univ-energy",
|
hostname: "univ-energy",
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 1200000000,
|
max: 1200000000,
|
||||||
min: 1100000000,
|
min: 1100000000,
|
||||||
@ -485,7 +485,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "titan-labs",
|
hostname: "titan-labs",
|
||||||
literature: ["coded-intelligence.lit"],
|
literature: ["coded-intelligence.lit"],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 900000000,
|
max: 900000000,
|
||||||
min: 750000000,
|
min: 750000000,
|
||||||
@ -509,7 +509,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "microdyne",
|
hostname: "microdyne",
|
||||||
literature: ["synthetic-muscles.lit"],
|
literature: ["synthetic-muscles.lit"],
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 700000000,
|
max: 700000000,
|
||||||
min: 500000000,
|
min: 500000000,
|
||||||
@ -604,7 +604,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "omnia",
|
hostname: "omnia",
|
||||||
literature: ["history-of-synthoids.lit"],
|
literature: ["history-of-synthoids.lit"],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 1000000000,
|
max: 1000000000,
|
||||||
min: 900000000,
|
min: 900000000,
|
||||||
@ -676,7 +676,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
"A-Green-Tomorrow.lit",
|
"A-Green-Tomorrow.lit",
|
||||||
"the-failed-frontier.lit",
|
"the-failed-frontier.lit",
|
||||||
],
|
],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 900000000,
|
max: 900000000,
|
||||||
min: 700000000,
|
min: 700000000,
|
||||||
@ -722,7 +722,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "global-pharm",
|
hostname: "global-pharm",
|
||||||
literature: ["A-Green-Tomorrow.lit"],
|
literature: ["A-Green-Tomorrow.lit"],
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 1750000000,
|
max: 1750000000,
|
||||||
min: 1500000000,
|
min: 1500000000,
|
||||||
@ -789,7 +789,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
min: 70,
|
min: 70,
|
||||||
},
|
},
|
||||||
hostname: "unitalife",
|
hostname: "unitalife",
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 1100000000,
|
max: 1100000000,
|
||||||
min: 1000000000,
|
min: 1000000000,
|
||||||
@ -812,7 +812,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
min: 60,
|
min: 60,
|
||||||
},
|
},
|
||||||
hostname: "lexo-corp",
|
hostname: "lexo-corp",
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 800000000,
|
max: 800000000,
|
||||||
min: 700000000,
|
min: 700000000,
|
||||||
@ -858,7 +858,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "alpha-ent",
|
hostname: "alpha-ent",
|
||||||
literature: ["sector-12-crime.lit"],
|
literature: ["sector-12-crime.lit"],
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 750000000,
|
max: 750000000,
|
||||||
min: 600000000,
|
min: 600000000,
|
||||||
@ -881,7 +881,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
min: 70,
|
min: 70,
|
||||||
},
|
},
|
||||||
hostname: "aevum-police",
|
hostname: "aevum-police",
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 400000000,
|
max: 400000000,
|
||||||
min: 200000000,
|
min: 200000000,
|
||||||
@ -909,7 +909,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
"the-failed-frontier.lit",
|
"the-failed-frontier.lit",
|
||||||
"tensions-in-tech-race.lit",
|
"tensions-in-tech-race.lit",
|
||||||
],
|
],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 250000000,
|
max: 250000000,
|
||||||
min: 175000000,
|
min: 175000000,
|
||||||
@ -932,7 +932,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
min: 65,
|
min: 65,
|
||||||
},
|
},
|
||||||
hostname: "zb-institute",
|
hostname: "zb-institute",
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 1100000000,
|
max: 1100000000,
|
||||||
min: 800000000,
|
min: 800000000,
|
||||||
@ -960,7 +960,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
"the-failed-frontier.lit",
|
"the-failed-frontier.lit",
|
||||||
"synthetic-muscles.lit",
|
"synthetic-muscles.lit",
|
||||||
],
|
],
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 350000000,
|
max: 350000000,
|
||||||
min: 200000000,
|
min: 200000000,
|
||||||
@ -1074,7 +1074,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "netlink",
|
hostname: "netlink",
|
||||||
literature: ["simulated-reality.lit"],
|
literature: ["simulated-reality.lit"],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: 275000000,
|
moneyAvailable: 275000000,
|
||||||
networkLayer: 4,
|
networkLayer: 4,
|
||||||
numOpenPortsRequired: 3,
|
numOpenPortsRequired: 3,
|
||||||
@ -1114,7 +1114,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
hackDifficulty: 10,
|
hackDifficulty: 10,
|
||||||
hostname: "foodnstuff",
|
hostname: "foodnstuff",
|
||||||
literature: ["sector-12-crime.lit"],
|
literature: ["sector-12-crime.lit"],
|
||||||
maxRam: 16,
|
maxRamExponent: 4,
|
||||||
moneyAvailable: 2000000,
|
moneyAvailable: 2000000,
|
||||||
networkLayer: 1,
|
networkLayer: 1,
|
||||||
numOpenPortsRequired: 0,
|
numOpenPortsRequired: 0,
|
||||||
@ -1125,7 +1125,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 10,
|
hackDifficulty: 10,
|
||||||
hostname: "sigma-cosmetics",
|
hostname: "sigma-cosmetics",
|
||||||
maxRam: 16,
|
maxRamExponent: 4,
|
||||||
moneyAvailable: 2300000,
|
moneyAvailable: 2300000,
|
||||||
networkLayer: 1,
|
networkLayer: 1,
|
||||||
numOpenPortsRequired: 0,
|
numOpenPortsRequired: 0,
|
||||||
@ -1136,7 +1136,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 15,
|
hackDifficulty: 15,
|
||||||
hostname: "joesguns",
|
hostname: "joesguns",
|
||||||
maxRam: 16,
|
maxRamExponent: 4,
|
||||||
moneyAvailable: 2500000,
|
moneyAvailable: 2500000,
|
||||||
networkLayer: 1,
|
networkLayer: 1,
|
||||||
numOpenPortsRequired: 0,
|
numOpenPortsRequired: 0,
|
||||||
@ -1147,7 +1147,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 25,
|
hackDifficulty: 25,
|
||||||
hostname: "zer0",
|
hostname: "zer0",
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: 7500000,
|
moneyAvailable: 7500000,
|
||||||
networkLayer: 2,
|
networkLayer: 2,
|
||||||
numOpenPortsRequired: 1,
|
numOpenPortsRequired: 1,
|
||||||
@ -1158,7 +1158,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 20,
|
hackDifficulty: 20,
|
||||||
hostname: "nectar-net",
|
hostname: "nectar-net",
|
||||||
maxRam: 16,
|
maxRamExponent: 4,
|
||||||
moneyAvailable: 2750000,
|
moneyAvailable: 2750000,
|
||||||
networkLayer: 2,
|
networkLayer: 2,
|
||||||
numOpenPortsRequired: 0,
|
numOpenPortsRequired: 0,
|
||||||
@ -1170,7 +1170,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
hackDifficulty: 25,
|
hackDifficulty: 25,
|
||||||
hostname: "neo-net",
|
hostname: "neo-net",
|
||||||
literature: ["the-hidden-world.lit"],
|
literature: ["the-hidden-world.lit"],
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: 5000000,
|
moneyAvailable: 5000000,
|
||||||
networkLayer: 3,
|
networkLayer: 3,
|
||||||
numOpenPortsRequired: 1,
|
numOpenPortsRequired: 1,
|
||||||
@ -1182,7 +1182,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
hackDifficulty: 30,
|
hackDifficulty: 30,
|
||||||
hostname: "silver-helix",
|
hostname: "silver-helix",
|
||||||
literature: ["new-triads.lit"],
|
literature: ["new-triads.lit"],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: 45000000,
|
moneyAvailable: 45000000,
|
||||||
networkLayer: 3,
|
networkLayer: 3,
|
||||||
numOpenPortsRequired: 2,
|
numOpenPortsRequired: 2,
|
||||||
@ -1194,7 +1194,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
hackDifficulty: 15,
|
hackDifficulty: 15,
|
||||||
hostname: "hong-fang-tea",
|
hostname: "hong-fang-tea",
|
||||||
literature: ["brighter-than-the-sun.lit"],
|
literature: ["brighter-than-the-sun.lit"],
|
||||||
maxRam: 16,
|
maxRamExponent: 4,
|
||||||
moneyAvailable: 3000000,
|
moneyAvailable: 3000000,
|
||||||
networkLayer: 1,
|
networkLayer: 1,
|
||||||
numOpenPortsRequired: 0,
|
numOpenPortsRequired: 0,
|
||||||
@ -1205,7 +1205,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 15,
|
hackDifficulty: 15,
|
||||||
hostname: "harakiri-sushi",
|
hostname: "harakiri-sushi",
|
||||||
maxRam: 16,
|
maxRamExponent: 4,
|
||||||
moneyAvailable: 4000000,
|
moneyAvailable: 4000000,
|
||||||
networkLayer: 1,
|
networkLayer: 1,
|
||||||
numOpenPortsRequired: 0,
|
numOpenPortsRequired: 0,
|
||||||
@ -1216,7 +1216,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 20,
|
hackDifficulty: 20,
|
||||||
hostname: "phantasy",
|
hostname: "phantasy",
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: 24000000,
|
moneyAvailable: 24000000,
|
||||||
networkLayer: 3,
|
networkLayer: 3,
|
||||||
numOpenPortsRequired: 2,
|
numOpenPortsRequired: 2,
|
||||||
@ -1227,7 +1227,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 15,
|
hackDifficulty: 15,
|
||||||
hostname: "max-hardware",
|
hostname: "max-hardware",
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: 10000000,
|
moneyAvailable: 10000000,
|
||||||
networkLayer: 2,
|
networkLayer: 2,
|
||||||
numOpenPortsRequired: 1,
|
numOpenPortsRequired: 1,
|
||||||
@ -1242,7 +1242,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
},
|
},
|
||||||
hostname: "omega-net",
|
hostname: "omega-net",
|
||||||
literature: ["the-new-god.lit"],
|
literature: ["the-new-god.lit"],
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: {
|
moneyAvailable: {
|
||||||
max: 70000000,
|
max: 70000000,
|
||||||
min: 60000000,
|
min: 60000000,
|
||||||
@ -1284,7 +1284,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 30,
|
hackDifficulty: 30,
|
||||||
hostname: "iron-gym",
|
hostname: "iron-gym",
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: 20000000,
|
moneyAvailable: 20000000,
|
||||||
networkLayer: 1,
|
networkLayer: 1,
|
||||||
numOpenPortsRequired: 1,
|
numOpenPortsRequired: 1,
|
||||||
@ -1356,7 +1356,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
"simulated-reality.lit",
|
"simulated-reality.lit",
|
||||||
"the-new-god.lit",
|
"the-new-god.lit",
|
||||||
],
|
],
|
||||||
maxRam: 128,
|
maxRamExponent: 7,
|
||||||
moneyAvailable: 0,
|
moneyAvailable: 0,
|
||||||
networkLayer: 11,
|
networkLayer: 11,
|
||||||
numOpenPortsRequired: 4,
|
numOpenPortsRequired: 4,
|
||||||
@ -1372,7 +1372,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
hackDifficulty: 0,
|
hackDifficulty: 0,
|
||||||
hostname: "I.I.I.I",
|
hostname: "I.I.I.I",
|
||||||
literature: ["democracy-is-dead.lit"],
|
literature: ["democracy-is-dead.lit"],
|
||||||
maxRam: 64,
|
maxRamExponent: 6,
|
||||||
moneyAvailable: 0,
|
moneyAvailable: 0,
|
||||||
networkLayer: 5,
|
networkLayer: 5,
|
||||||
numOpenPortsRequired: 3,
|
numOpenPortsRequired: 3,
|
||||||
@ -1388,7 +1388,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
hackDifficulty: 0,
|
hackDifficulty: 0,
|
||||||
hostname: "avmnite-02h",
|
hostname: "avmnite-02h",
|
||||||
literature: ["democracy-is-dead.lit"],
|
literature: ["democracy-is-dead.lit"],
|
||||||
maxRam: 32,
|
maxRamExponent: 5,
|
||||||
moneyAvailable: 0,
|
moneyAvailable: 0,
|
||||||
networkLayer: 4,
|
networkLayer: 4,
|
||||||
numOpenPortsRequired: 2,
|
numOpenPortsRequired: 2,
|
||||||
@ -1403,7 +1403,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
{
|
{
|
||||||
hackDifficulty: 0,
|
hackDifficulty: 0,
|
||||||
hostname: ".",
|
hostname: ".",
|
||||||
maxRam: 16,
|
maxRamExponent: 4,
|
||||||
moneyAvailable: 0,
|
moneyAvailable: 0,
|
||||||
networkLayer: 13,
|
networkLayer: 13,
|
||||||
numOpenPortsRequired: 4,
|
numOpenPortsRequired: 4,
|
||||||
@ -1419,7 +1419,7 @@ export const serverMetadata: IServerMetadata[] = [
|
|||||||
hackDifficulty: 0,
|
hackDifficulty: 0,
|
||||||
hostname: "CSEC",
|
hostname: "CSEC",
|
||||||
literature: ["democracy-is-dead.lit"],
|
literature: ["democracy-is-dead.lit"],
|
||||||
maxRam: 8,
|
maxRamExponent: 3,
|
||||||
moneyAvailable: 0,
|
moneyAvailable: 0,
|
||||||
networkLayer: 2,
|
networkLayer: 2,
|
||||||
numOpenPortsRequired: 1,
|
numOpenPortsRequired: 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user