mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
63 lines
1002 B
Markdown
63 lines
1002 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [getServer](./bitburner.ns.getserver.md)
|
|
|
|
## NS.getServer() method
|
|
|
|
Returns data of a server.
|
|
|
|
If the server is a darknet server and has recently gone offline, it will return a dummy server object with `isOnline: false`<!-- -->.
|
|
|
|
**Signature:**
|
|
|
|
```typescript
|
|
getServer(host?: string): Server | (DarknetServerData & { isOnline: boolean });
|
|
```
|
|
|
|
## Parameters
|
|
|
|
<table><thead><tr><th>
|
|
|
|
Parameter
|
|
|
|
|
|
</th><th>
|
|
|
|
Type
|
|
|
|
|
|
</th><th>
|
|
|
|
Description
|
|
|
|
|
|
</th></tr></thead>
|
|
<tbody><tr><td>
|
|
|
|
host
|
|
|
|
|
|
</td><td>
|
|
|
|
string
|
|
|
|
|
|
</td><td>
|
|
|
|
_(Optional)_ Optional. Hostname/IP of the server. Defaults to the hostname of the running script's server.
|
|
|
|
|
|
</td></tr>
|
|
</tbody></table>
|
|
|
|
**Returns:**
|
|
|
|
[Server](./bitburner.server.md) \| ([DarknetServerData](./bitburner.darknetserverdata.md) & { isOnline: boolean })
|
|
|
|
Data of the server.
|
|
|
|
## Remarks
|
|
|
|
RAM cost: 2 GB
|
|
|