This commit is contained in:
Olivier Gagnon
2021-11-11 20:31:26 -05:00
parent d91d7c564e
commit 6e74716940
3 changed files with 20 additions and 19 deletions
@@ -18,12 +18,13 @@ export function hasTorRouter(this: IPlayer): boolean {
export function getCurrentServer(this: IPlayer): BaseServer {
const server = GetServer(this.currentServer);
if (server === null) throw new Error("somehow connected to a server that does not exist.");
if (server === null) throw new Error(`somehow connected to a server that does not exist. ${this.currentServer}`);
return server;
}
export function getHomeComputer(this: IPlayer): Server {
const home = GetServer("home");
console.log(home);
if (home instanceof Server) return home;
throw new Error("home computer was not a normal server");
}