Implement kickall command

This commit is contained in:
memetrollsXD 2022-09-24 11:20:53 +02:00
parent 20df17be83
commit 24c7f0e155
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD

14
src/commands/kickall.ts Normal file
View File

@ -0,0 +1,14 @@
import SRServer from "../server/kcp/SRServer";
import Logger from "../util/Logger";
import { Command } from "./Interface";
const c = new Logger("/kickall", "blue");
export default async function handle(command: Command) {
const hard = command.args[0];
for (const [key, session] of SRServer.getInstance().sessions) {
session.kick(!!hard);
}
c.log(`Kicked all players. Hard kick: ${!!hard}`);
}