@@ 32,6 32,7 @@ let admin_commands = new Map([
["!cancelMatch", "Cancel the ongoing match"],
["!finish <WINNER>", "Finish the ongoing match with WINNER (TEAM1, TEAM2)"],
["!set <STEAMID64> <ATTRIBUTE> <VALUE>", "Set ATTRIBUTE (elo) to VALUE"],
+ ["!move <DIRECTION>", "Move clients in DIRECTION (optional, back)"],
]);
teamspeak.on("ready", async () => {
@@ 78,6 79,9 @@ teamspeak.on("textmessage", (ev) => {
case "!help":
help(clid, teamspeakID);
break;
+ case "!move":
+ move_clients_wrapper(clid, teamspeakID, argv[1]);
+ break;
}
});
@@ 369,6 373,25 @@ async function start_match() {
}
}
+// move clients manually, in case match was started from website
+async function move_clients_wrapper(
+ clid: string,
+ teamspeakID: string,
+ direction: string
+) {
+ const admin = await is_admin(clid, teamspeakID);
+ if (!admin) {
+ message(clid, "Only an admin can do that.");
+ return;
+ }
+
+ if (direction === "back") {
+ move_clients(true);
+ } else {
+ move_clients(false);
+ }
+}
+
async function move_clients(back: boolean = false) {
const query = gql`
query {