2023-03-21 23:54:49 +01:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
exports[`load/saveAllServers 1`] = `
|
|
|
|
"{
|
|
|
|
"home": {
|
|
|
|
"ctor": "Server",
|
|
|
|
"data": {
|
|
|
|
"contracts": [],
|
|
|
|
"cpuCores": 1,
|
|
|
|
"ftpPortOpen": false,
|
|
|
|
"hasAdminRights": true,
|
|
|
|
"hostname": "home",
|
|
|
|
"httpPortOpen": false,
|
|
|
|
"ip": "67.4.8.1",
|
|
|
|
"isConnectedTo": true,
|
|
|
|
"maxRam": 8,
|
|
|
|
"messages": [
|
|
|
|
"hackers-starting-handbook.lit"
|
|
|
|
],
|
|
|
|
"organizationName": "Home PC",
|
|
|
|
"programs": [
|
|
|
|
"NUKE.exe"
|
|
|
|
],
|
2023-04-28 00:21:06 +02:00
|
|
|
"scripts": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": [
|
|
|
|
[
|
|
|
|
"script.js",
|
|
|
|
{
|
|
|
|
"ctor": "Script",
|
|
|
|
"data": {
|
|
|
|
"code": "/** @param {NS} ns */\\\\nexport async function main(ns) {\\\\n return ns.asleep(1000000);\\\\n}",
|
|
|
|
"filename": "script.js",
|
|
|
|
"server": "home"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"serversOnNetwork": [
|
|
|
|
"n00dles"
|
|
|
|
],
|
|
|
|
"smtpPortOpen": false,
|
|
|
|
"sqlPortOpen": false,
|
|
|
|
"sshPortOpen": false,
|
FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 16:26:57 +02:00
|
|
|
"textFiles": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": []
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"purchasedByPlayer": true,
|
|
|
|
"backdoorInstalled": false,
|
|
|
|
"baseDifficulty": 1,
|
|
|
|
"hackDifficulty": 1,
|
|
|
|
"minDifficulty": 1,
|
|
|
|
"moneyAvailable": 0,
|
|
|
|
"moneyMax": 0,
|
|
|
|
"numOpenPortsRequired": 5,
|
|
|
|
"openPortCount": 0,
|
|
|
|
"requiredHackingSkill": 1,
|
2023-04-28 00:21:06 +02:00
|
|
|
"serverGrowth": 1,
|
|
|
|
"runningScripts": [
|
|
|
|
{
|
|
|
|
"ctor": "RunningScript",
|
|
|
|
"data": {
|
|
|
|
"args": [],
|
|
|
|
"dataMap": {},
|
|
|
|
"filename": "script.js",
|
|
|
|
"offlineExpGained": 0,
|
|
|
|
"offlineMoneyMade": 0,
|
|
|
|
"offlineRunningTime": 123456789.01,
|
|
|
|
"onlineExpGained": 0,
|
|
|
|
"onlineMoneyMade": 0,
|
|
|
|
"onlineRunningTime": 7.210000000000004,
|
|
|
|
"ramUsage": 1.6,
|
|
|
|
"server": "home",
|
|
|
|
"scriptKey": "script.js*[]",
|
2023-05-26 14:07:37 +02:00
|
|
|
"title": "Awesome Script",
|
2023-04-28 00:21:06 +02:00
|
|
|
"threads": 1,
|
|
|
|
"temporary": false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2023-03-21 23:54:49 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"n00dles": {
|
|
|
|
"ctor": "Server",
|
|
|
|
"data": {
|
|
|
|
"contracts": [],
|
|
|
|
"cpuCores": 1,
|
|
|
|
"ftpPortOpen": false,
|
|
|
|
"hasAdminRights": false,
|
|
|
|
"hostname": "n00dles",
|
|
|
|
"httpPortOpen": false,
|
|
|
|
"ip": "61.6.6.2",
|
|
|
|
"isConnectedTo": false,
|
|
|
|
"maxRam": 4,
|
|
|
|
"messages": [],
|
|
|
|
"organizationName": "Noodle Bar",
|
|
|
|
"programs": [],
|
2023-04-18 09:19:45 +02:00
|
|
|
"scripts": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": []
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"serversOnNetwork": [
|
|
|
|
"home"
|
|
|
|
],
|
|
|
|
"smtpPortOpen": false,
|
|
|
|
"sqlPortOpen": false,
|
|
|
|
"sshPortOpen": false,
|
FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 16:26:57 +02:00
|
|
|
"textFiles": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": []
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"purchasedByPlayer": false,
|
|
|
|
"backdoorInstalled": false,
|
|
|
|
"baseDifficulty": 1,
|
|
|
|
"hackDifficulty": 1,
|
|
|
|
"minDifficulty": 1,
|
|
|
|
"moneyAvailable": 70000,
|
|
|
|
"moneyMax": 1750000,
|
|
|
|
"numOpenPortsRequired": 0,
|
|
|
|
"openPortCount": 0,
|
|
|
|
"requiredHackingSkill": 1,
|
2023-04-28 00:21:06 +02:00
|
|
|
"serverGrowth": 3000,
|
|
|
|
"runningScripts": []
|
2023-03-21 23:54:49 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}"
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`load/saveAllServers pruning RunningScripts 1`] = `
|
|
|
|
"{
|
|
|
|
"home": {
|
|
|
|
"ctor": "Server",
|
|
|
|
"data": {
|
|
|
|
"contracts": [],
|
|
|
|
"cpuCores": 1,
|
|
|
|
"ftpPortOpen": false,
|
|
|
|
"hasAdminRights": true,
|
|
|
|
"hostname": "home",
|
|
|
|
"httpPortOpen": false,
|
|
|
|
"ip": "67.4.8.1",
|
|
|
|
"isConnectedTo": true,
|
|
|
|
"maxRam": 8,
|
|
|
|
"messages": [
|
|
|
|
"hackers-starting-handbook.lit"
|
|
|
|
],
|
|
|
|
"organizationName": "Home PC",
|
|
|
|
"programs": [
|
|
|
|
"NUKE.exe"
|
|
|
|
],
|
2023-04-28 00:21:06 +02:00
|
|
|
"scripts": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": [
|
|
|
|
[
|
|
|
|
"script.js",
|
|
|
|
{
|
|
|
|
"ctor": "Script",
|
|
|
|
"data": {
|
|
|
|
"code": "/** @param {NS} ns */\\\\nexport async function main(ns) {\\\\n return ns.asleep(1000000);\\\\n}",
|
|
|
|
"filename": "script.js",
|
|
|
|
"server": "home"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"serversOnNetwork": [
|
|
|
|
"n00dles"
|
|
|
|
],
|
|
|
|
"smtpPortOpen": false,
|
|
|
|
"sqlPortOpen": false,
|
|
|
|
"sshPortOpen": false,
|
FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 16:26:57 +02:00
|
|
|
"textFiles": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": []
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"purchasedByPlayer": true,
|
|
|
|
"backdoorInstalled": false,
|
|
|
|
"baseDifficulty": 1,
|
|
|
|
"hackDifficulty": 1,
|
|
|
|
"minDifficulty": 1,
|
|
|
|
"moneyAvailable": 0,
|
|
|
|
"moneyMax": 0,
|
|
|
|
"numOpenPortsRequired": 5,
|
|
|
|
"openPortCount": 0,
|
|
|
|
"requiredHackingSkill": 1,
|
2023-04-28 00:21:06 +02:00
|
|
|
"serverGrowth": 1,
|
|
|
|
"runningScripts": []
|
2023-03-21 23:54:49 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"n00dles": {
|
|
|
|
"ctor": "Server",
|
|
|
|
"data": {
|
|
|
|
"contracts": [],
|
|
|
|
"cpuCores": 1,
|
|
|
|
"ftpPortOpen": false,
|
|
|
|
"hasAdminRights": false,
|
|
|
|
"hostname": "n00dles",
|
|
|
|
"httpPortOpen": false,
|
|
|
|
"ip": "61.6.6.2",
|
|
|
|
"isConnectedTo": false,
|
|
|
|
"maxRam": 4,
|
|
|
|
"messages": [],
|
|
|
|
"organizationName": "Noodle Bar",
|
|
|
|
"programs": [],
|
2023-04-18 09:19:45 +02:00
|
|
|
"scripts": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": []
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"serversOnNetwork": [
|
|
|
|
"home"
|
|
|
|
],
|
|
|
|
"smtpPortOpen": false,
|
|
|
|
"sqlPortOpen": false,
|
|
|
|
"sshPortOpen": false,
|
FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 16:26:57 +02:00
|
|
|
"textFiles": {
|
|
|
|
"ctor": "JSONMap",
|
|
|
|
"data": []
|
|
|
|
},
|
2023-03-21 23:54:49 +01:00
|
|
|
"purchasedByPlayer": false,
|
|
|
|
"backdoorInstalled": false,
|
|
|
|
"baseDifficulty": 1,
|
|
|
|
"hackDifficulty": 1,
|
|
|
|
"minDifficulty": 1,
|
|
|
|
"moneyAvailable": 70000,
|
|
|
|
"moneyMax": 1750000,
|
|
|
|
"numOpenPortsRequired": 0,
|
|
|
|
"openPortCount": 0,
|
|
|
|
"requiredHackingSkill": 1,
|
2023-04-28 00:21:06 +02:00
|
|
|
"serverGrowth": 3000,
|
|
|
|
"runningScripts": []
|
2023-03-21 23:54:49 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}"
|
|
|
|
`;
|