From 73373ce08b060c97fcb6311e862b8261c3222d9f Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 7 Aug 2024 20:49:33 +0200 Subject: add ban button --- webAO/dom/banPlayer.ts | 14 ++++++++++++++ webAO/dom/window.ts | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 webAO/dom/banPlayer.ts (limited to 'webAO/dom') diff --git a/webAO/dom/banPlayer.ts b/webAO/dom/banPlayer.ts new file mode 100644 index 0000000..a8f6d5a --- /dev/null +++ b/webAO/dom/banPlayer.ts @@ -0,0 +1,14 @@ +import { client } from '../client' +/** + * Tries to ban a player from the playerlist + * @param {Number} id the players id + */ +export function banPlayer(id: number) { + let reason; + let length; + reason = prompt("Please enter the ban reason", ""); + length = Number(prompt("Please enter the ban length in hours", "")); + + client.sender.sendMA(id, length, reason); +} +window.banPlayer = banPlayer; \ No newline at end of file diff --git a/webAO/dom/window.ts b/webAO/dom/window.ts index 3215b89..f2cd86c 100644 --- a/webAO/dom/window.ts +++ b/webAO/dom/window.ts @@ -26,7 +26,7 @@ declare global { editEvidence: () => void; addEvidence: () => void; pickEvidence: (evidence: any) => void; - pickEmotion: (emo: any) => void; + pickEmotion: (emo: number) => void; pickChar: (ccharacter: any) => void; chartable_filter: (_event: any) => void; ReconnectButton: (_event: any) => void; @@ -52,6 +52,7 @@ declare global { onEnter: (event: any) => void; onReplayGo: (_event: any) => void; onOOCEnter: (_event: any) => void; + banPlayer: (id: number) => void; hcallback: (_event: any) => void; } } -- cgit From dc85197c9b966105813dd026480f9f6bc77d8b68 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 7 Aug 2024 23:40:05 +0200 Subject: correct units --- webAO/dom/banPlayer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webAO/dom') diff --git a/webAO/dom/banPlayer.ts b/webAO/dom/banPlayer.ts index a8f6d5a..5a8894a 100644 --- a/webAO/dom/banPlayer.ts +++ b/webAO/dom/banPlayer.ts @@ -6,8 +6,8 @@ import { client } from '../client' export function banPlayer(id: number) { let reason; let length; - reason = prompt("Please enter the ban reason", ""); - length = Number(prompt("Please enter the ban length in hours", "")); + reason = prompt("Please enter the ban reason", "Being annoying"); + length = Number(prompt("Please enter the ban length in minutes", "60")); client.sender.sendMA(id, length, reason); } -- cgit