mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
DOCUMENTATION: Clarify scp and exec darknet permissions in API docs (#2634)
This commit is contained in:
@@ -132,4 +132,5 @@ ns.exec("generic-hack.js", "joesguns", {threads: 10});
|
|||||||
// arguments to the script.
|
// arguments to the script.
|
||||||
ns.exec("foo.js", "foodnstuff", 5, 1, "test");
|
ns.exec("foo.js", "foodnstuff", 5, 1, "test");
|
||||||
```
|
```
|
||||||
|
For darknet servers: A session must be established with the target server, and the script must be running on a server that is directly connected to the target, or the target must have a backdoor or stasis link installed.
|
||||||
|
|
||||||
|
|||||||
@@ -112,5 +112,5 @@ const server = ns.args[0];
|
|||||||
const files = ["hack.js", "weaken.js", "grow.js"];
|
const files = ["hack.js", "weaken.js", "grow.js"];
|
||||||
ns.scp(files, server, "home");
|
ns.scp(files, server, "home");
|
||||||
```
|
```
|
||||||
For password-protected servers (such as darknet servers), a session must be established with the destination server before using this function. (The source server does not require a session.)
|
For darknet servers: The destination requires a session, but unlike [exec](./bitburner.ns.exec.md)<!-- -->, does not require a direct connection — scp works at any distance. The source server has no darknet requirements (no session or connection needed). Use [dnet.authenticate](./bitburner.darknet.authenticate.md) (requires direct connection) or [dnet.connectToSession](./bitburner.darknet.connecttosession.md) (at any distance) to establish a session.
|
||||||
|
|
||||||
|
|||||||
11
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
11
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -7920,6 +7920,11 @@ export interface NS {
|
|||||||
* // arguments to the script.
|
* // arguments to the script.
|
||||||
* ns.exec("foo.js", "foodnstuff", 5, 1, "test");
|
* ns.exec("foo.js", "foodnstuff", 5, 1, "test");
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* For darknet servers: A session must be established with the target server, and the script must be
|
||||||
|
* running on a server that is directly connected to the target, or the target must have a backdoor or
|
||||||
|
* stasis link installed.
|
||||||
|
*
|
||||||
* @param script - Filename of script to execute. This file must already exist on the target server.
|
* @param script - Filename of script to execute. This file must already exist on the target server.
|
||||||
* @param host - Hostname/IP of the target server on which to execute the script.
|
* @param host - Hostname/IP of the target server on which to execute the script.
|
||||||
* @param threadOrOptions - Either an integer number of threads for new script, or a {@link RunOptions} object. Threads defaults to 1.
|
* @param threadOrOptions - Either an integer number of threads for new script, or a {@link RunOptions} object. Threads defaults to 1.
|
||||||
@@ -8057,7 +8062,11 @@ export interface NS {
|
|||||||
* ns.scp(files, server, "home");
|
* ns.scp(files, server, "home");
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* For password-protected servers (such as darknet servers), a session must be established with the destination server before using this function. (The source server does not require a session.)
|
* For darknet servers: The destination requires a session, but unlike {@link NS.exec | exec}, does not
|
||||||
|
* require a direct connection — scp works at any distance. The source server has no darknet requirements
|
||||||
|
* (no session or connection needed). Use {@link Darknet.authenticate | dnet.authenticate} (requires direct
|
||||||
|
* connection) or {@link Darknet.connectToSession | dnet.connectToSession} (at any distance) to
|
||||||
|
* establish a session.
|
||||||
*
|
*
|
||||||
* @param files - Filename or an array of filenames of script/literature files to copy. Note that if a file is located in a subdirectory, the filename must include the leading `/`.
|
* @param files - Filename or an array of filenames of script/literature files to copy. Note that if a file is located in a subdirectory, the filename must include the leading `/`.
|
||||||
* @param destination - Hostname/IP of the destination server, which is the server to which the file will be copied.
|
* @param destination - Hostname/IP of the destination server, which is the server to which the file will be copied.
|
||||||
|
|||||||
Reference in New Issue
Block a user