2021-09-16 01:50:44 +02:00
|
|
|
import { ITerminal } from "../ITerminal";
|
2021-09-17 08:58:02 +02:00
|
|
|
import { IRouter } from "../../ui/Router";
|
2021-09-16 01:50:44 +02:00
|
|
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
|
|
|
import { BaseServer } from "../../Server/BaseServer";
|
|
|
|
|
|
|
|
export function home(
|
|
|
|
terminal: ITerminal,
|
2021-09-17 08:58:02 +02:00
|
|
|
router: IRouter,
|
2021-09-16 01:50:44 +02:00
|
|
|
player: IPlayer,
|
|
|
|
server: BaseServer,
|
|
|
|
args: (string | number)[],
|
|
|
|
): void {
|
|
|
|
if (args.length !== 0) {
|
|
|
|
terminal.error("Incorrect usage of home command. Usage: home");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
player.getCurrentServer().isConnectedTo = false;
|
2021-10-07 23:55:49 +02:00
|
|
|
player.currentServer = player.getHomeComputer().hostname;
|
2021-09-16 01:50:44 +02:00
|
|
|
player.getCurrentServer().isConnectedTo = true;
|
|
|
|
terminal.print("Connected to home");
|
|
|
|
terminal.setcwd("/");
|
|
|
|
}
|