mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-03 21:13:49 +01:00
20 lines
566 B
TypeScript
20 lines
566 B
TypeScript
import { Settings } from "../Settings/Settings";
|
|
import { Remote } from "./Remote";
|
|
|
|
let server: Remote;
|
|
|
|
export function newRemoteFileApiConnection(): void {
|
|
if (server == undefined) {
|
|
server = new Remote("localhost", Settings.RemoteFileApiPort);
|
|
server.startConnection();
|
|
} else {
|
|
server.stopConnection();
|
|
server = new Remote("localhost", Settings.RemoteFileApiPort);
|
|
server.startConnection();
|
|
}
|
|
}
|
|
|
|
export function isRemoteFileApiConnectionLive(): boolean {
|
|
return server.connection != undefined && server.connection.readyState == 1;
|
|
}
|