diff options
| author | stonedDiscord <Tukz@gmx.de> | 2024-08-31 14:30:52 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2024-08-31 14:30:52 +0200 |
| commit | 84db1ce9a2eaf6670605104d2ede8683159b67df (patch) | |
| tree | 57f22ac4384b78ec80f23ffac7445a5cc63c8ef3 /webAO/dom | |
| parent | c4f8f6fac11d9a40302d00ed3b3bee70a77b695c (diff) | |
playerlist fixes
Diffstat (limited to 'webAO/dom')
| -rw-r--r-- | webAO/dom/banPlayer.ts | 17 | ||||
| -rw-r--r-- | webAO/dom/window.ts | 1 |
2 files changed, 16 insertions, 2 deletions
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; } |
