From 84db1ce9a2eaf6670605104d2ede8683159b67df Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Sat, 31 Aug 2024 14:30:52 +0200 Subject: playerlist fixes --- webAO/dom/banPlayer.ts | 17 +++++++++++++++-- webAO/dom/window.ts | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'webAO/dom') diff --git a/webAO/dom/banPlayer.ts b/webAO/dom/banPlayer.ts index 5a8894a..f122a1b 100644 --- a/webAO/dom/banPlayer.ts +++ b/webAO/dom/banPlayer.ts @@ -1,4 +1,5 @@ import { client } from '../client' + /** * Tries to ban a player from the playerlist * @param {Number} id the players id @@ -6,9 +7,21 @@ import { client } from '../client' export function banPlayer(id: number) { let reason; let length; - reason = prompt("Please enter the ban reason", "Being annoying"); + reason = prompt("Please enter the reason", "Being annoying"); length = Number(prompt("Please enter the ban length in minutes", "60")); client.sender.sendMA(id, length, reason); } -window.banPlayer = banPlayer; \ No newline at end of file +window.banPlayer = banPlayer; + +/** + * Tries to kick a player from the playerlist + * @param {Number} id the players id + */ +export function kickPlayer(id: number) { + let reason; + reason = prompt("Please enter the reason", "Being annoying"); + + client.sender.sendMA(id, 0, reason); +} +window.kickPlayer = kickPlayer; \ No newline at end of file diff --git a/webAO/dom/window.ts b/webAO/dom/window.ts index f2cd86c..59ad575 100644 --- a/webAO/dom/window.ts +++ b/webAO/dom/window.ts @@ -52,6 +52,7 @@ declare global { onEnter: (event: any) => void; onReplayGo: (_event: any) => void; onOOCEnter: (_event: any) => void; + kickPlayer: (id: number) => void; banPlayer: (id: number) => void; hcallback: (_event: any) => void; } -- cgit