Add backdoored servers to connect autocompletion

This commit is contained in:
chris380 2022-04-12 15:03:45 +02:00
parent 2d74b493ee
commit 6a941d57ed

@ -4,7 +4,8 @@ import { getSubdirectories } from "./DirectoryServerHelpers";
import { Aliases, GlobalAliases, substituteAliases } from "../Alias";
import { DarkWebItems } from "../DarkWeb/DarkWebItems";
import { IPlayer } from "../PersonObjects/IPlayer";
import { GetServer, GetAllServers } from "../Server/AllServers";
import { GetAllServers } from "../Server/AllServers";
import { Server } from "../Server/Server";
import { ParseCommand, ParseCommands } from "./Parser";
import { HelpTexts } from "./HelpText";
import { isScriptFilename } from "../Script/isScriptFilename";
@ -238,16 +239,11 @@ export async function determineAllPossibilitiesForTabCompletion(
}
if (isCommand("connect")) {
// All network connections
for (let i = 0; i < currServ.serversOnNetwork.length; ++i) {
const serv = GetServer(currServ.serversOnNetwork[i]);
if (serv == null) {
continue;
}
allPos.push(serv.hostname);
}
// All directly connected and backdoored servers are reachable
return allPos;
return GetAllServers()
.filter(server => currServ.serversOnNetwork.includes(server.hostname) || (server instanceof Server && server.backdoorInstalled))
.map(server => server.hostname);
}
if (isCommand("nano") || isCommand("vim")) {