Skip to content

Commit ab94030

Browse files
committed
get rid of the server if the connection closes
inb4 shit breaks
1 parent a22e5ff commit ab94030

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/services/gamebridge/GameServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "websocket";
88
import { NodeSSH, SSHExecOptions } from "node-ssh";
99
import { RconResponse } from "./payloads/structures/index.js";
10-
import { WebhookClient } from "discord.js";
1110
import GameBridge from "./GameBridge.js";
1211
import sshConfig from "@/config/ssh.json" with { type: "json" };
1312

@@ -128,6 +127,7 @@ export default class GameServer {
128127
this.connection?.on("close", (code, desc) => {
129128
this.discord.destroy();
130129
console.log(`'${this.config.name}' Game Server disconnected - [${code}] ${desc}`);
130+
delete this.bridge.servers[this.config.id];
131131
});
132132

133133
console.log(`'${this.config.name}' Game Server connected`);

0 commit comments

Comments
 (0)