diff --git a/src/RemoteFileAPI/MessageHandlers.ts b/src/RemoteFileAPI/MessageHandlers.ts index fbf59647c..b6180d8a0 100644 --- a/src/RemoteFileAPI/MessageHandlers.ts +++ b/src/RemoteFileAPI/MessageHandlers.ts @@ -1,7 +1,7 @@ import { resolveFilePath } from "../Paths/FilePath"; import { hasTextExtension } from "../Paths/TextFilePath"; import { hasScriptExtension } from "../Paths/ScriptFilePath"; -import { GetServer } from "../Server/AllServers"; +import { GetServer, GetAllServers } from "../Server/AllServers"; import { RFAMessage, FileData, @@ -111,4 +111,13 @@ export const RFARequestHandler: Record void | R getDefinitionFile: function (msg: RFAMessage): RFAMessage { 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 }); + }, };