aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2024-08-07 20:49:33 +0200
committerstonedDiscord <Tukz@gmx.de>2024-08-07 20:49:33 +0200
commit73373ce08b060c97fcb6311e862b8261c3222d9f (patch)
treefd35bc89d22dcc0335c7e7ab276a843c69e3e526 /webAO/dom
parent8bbb97917a595ebbd2cef080b3df6cb331193663 (diff)
add ban button
Diffstat (limited to 'webAO/dom')
-rw-r--r--webAO/dom/banPlayer.ts14
-rw-r--r--webAO/dom/window.ts3
2 files changed, 16 insertions, 1 deletions
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;
}
}