mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-02 04:23:48 +01:00
16 lines
490 B
TypeScript
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;
|
|
}
|