mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 21:25:47 +01:00
REMOTE: add 'getAllServers' method to RFA (#1058)
This commit is contained in:
parent
e8311d4f05
commit
903f812424
@ -1,7 +1,7 @@
|
|||||||
import { resolveFilePath } from "../Paths/FilePath";
|
import { resolveFilePath } from "../Paths/FilePath";
|
||||||
import { hasTextExtension } from "../Paths/TextFilePath";
|
import { hasTextExtension } from "../Paths/TextFilePath";
|
||||||
import { hasScriptExtension } from "../Paths/ScriptFilePath";
|
import { hasScriptExtension } from "../Paths/ScriptFilePath";
|
||||||
import { GetServer } from "../Server/AllServers";
|
import { GetServer, GetAllServers } from "../Server/AllServers";
|
||||||
import {
|
import {
|
||||||
RFAMessage,
|
RFAMessage,
|
||||||
FileData,
|
FileData,
|
||||||
@ -111,4 +111,13 @@ export const RFARequestHandler: Record<string, (message: RFAMessage) => void | R
|
|||||||
getDefinitionFile: function (msg: RFAMessage): RFAMessage {
|
getDefinitionFile: function (msg: RFAMessage): RFAMessage {
|
||||||
return new RFAMessage({ result: libSource + "", id: msg.id });
|
return new RFAMessage({ result: libSource + "", id: msg.id });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getAllServers: function (msg: RFAMessage): RFAMessage {
|
||||||
|
const servers = GetAllServers().map((server) => ({
|
||||||
|
hostname: server.hostname,
|
||||||
|
hasAdminRights: server.hasAdminRights,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return new RFAMessage({ result: JSON.stringify(servers), id: msg.id });
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user