From 9727cb0f120f84f1d94df7d2a6c423ebd9862997 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Tue, 2 Aug 2022 18:46:09 +0200 Subject: add new commands --- webAO/client.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'webAO/client.ts') diff --git a/webAO/client.ts b/webAO/client.ts index 64b8f9a..9640b8e 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -264,6 +264,10 @@ class Client extends EventEmitter { this.on("CharsCheck", this.handleCharsCheck.bind(this)); this.on("PV", this.handlePV.bind(this)); this.on("ASS", this.handleASS.bind(this)); + this.on("ackMS", this.handleackMS.bind(this)); + this.on("SP", this.handleSP.bind(this)); + this.on("JD", this.handleJD.bind(this)); + this.on("decryptor", () => {}); this.on("CHECK", () => {}); this.on("CH", () => {}); @@ -1981,6 +1985,35 @@ class Client extends EventEmitter { AO_HOST = args[1]; } + /** + * server got our message + */ + handleackMS() { + resetICParams(); + } + + /** +* position change +* @param {string} pos new position +*/ + handleSP(pos: string) { + updateActionCommands(pos); + } + + /** +* show/hide judge controls +* @param {number} show either a 1 or a 0 +*/ + handleJD(show: number) { + if (show === 1) { + document.getElementById("judge_action").style.display = "inline-table"; + document.getElementById("no_action").style.display = "none"; + } else { + document.getElementById("judge_action").style.display = "none"; + document.getElementById("no_action").style.display = "inline-table"; + } + } + /** * we are asking ourselves what characters there are * @param {Array} args packet arguments -- cgit