bitburner-src/src/RemoteFileAPI/RemoteFileAPI.ts
2022-08-29 15:56:38 -04:00

16 lines
490 B
TypeScript

import { Settings } from "../Settings/Settings";
import { Remote } from "./Remote";
let server: Remote;
export function newRemoteFileApiConnection(): void {
if (server) server.stopConnection();
if (Settings.RemoteFileApiPort === 0) return;
server = new Remote("localhost", Settings.RemoteFileApiPort);
server.startConnection();
}
export function isRemoteFileApiConnectionLive(): boolean {
return server && server.connection != undefined && server.connection.readyState == 1;
}