Implement kickall command
This commit is contained in:
parent
20df17be83
commit
24c7f0e155
14
src/commands/kickall.ts
Normal file
14
src/commands/kickall.ts
Normal 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}`);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user