aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/dom')
-rw-r--r--webAO/dom/banPlayer.ts17
-rw-r--r--webAO/dom/window.ts1
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;
}