diff options
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/webAO/client.js b/webAO/client.js index b5e4706..6d4a13d 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -36,9 +36,8 @@ let mode = queryDict.mode; // Unless there is an asset URL specified, use the wasabi one const DEFAULT_HOST = "http://attorneyoffline.de/base/"; -const AO_HOST = queryDict.asset || DEFAULT_HOST; +let AO_HOST = queryDict.asset || DEFAULT_HOST; const THEME = queryDict.theme || "default"; -const MUSIC_HOST = AO_HOST + "sounds/music/"; const UPDATE_INTERVAL = 60; @@ -214,6 +213,7 @@ class Client extends EventEmitter { this.on("RD", this.handleRD.bind(this)); this.on("CharsCheck", this.handleCharsCheck.bind(this)); this.on("PV", this.handlePV.bind(this)); + this.on("ASS", this.handleASS.bind(this)); this.on("CHECK", () => { }); this.on("CH", () => { }); @@ -775,7 +775,7 @@ class Client extends EventEmitter { if(track.startsWith("http")) { music.src = track; } else { - music.src = MUSIC_HOST + encodeURI(track.toLowerCase()); + music.src = AO_HOST + "/sounds/music/" + encodeURI(track.toLowerCase()); } music.loop = looping; music.play(); @@ -1507,6 +1507,14 @@ class Client extends EventEmitter { } /** + * new asset url!! + * @param {Array} args packet arguments + */ + handleASS(args) { + AO_HOST = args[1]; + } + + /** * we are asking ourselves what characters there are * @param {Array} args packet arguments */ |
