diff options
| author | stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> | 2020-12-29 21:59:14 +0100 |
|---|---|---|
| committer | stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> | 2020-12-29 21:59:14 +0100 |
| commit | 5df13bf27cdab798bad80676b3916649b00f87e5 (patch) | |
| tree | 2a1fa03c641160128466e2e80893768fed517304 | |
| parent | 15e66c059f84a362e3d38dd483f224c6b9ca43b6 (diff) | |
use wait for the timing
| -rw-r--r-- | webAO/client.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/webAO/client.js b/webAO/client.js index 3294a81..0b14050 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -567,12 +567,20 @@ class Client extends EventEmitter { */ handleReplay() { const ooclog = document.getElementById("client_ooclog"); - const rtime = document.getElementById("client_replaytimer").value; + const rawLog = false; + let rtime = document.getElementById("client_replaytimer").value; const clines = ooclog.value.split(/\r?\n/); if (clines[0]) { - this.handleSelf(clines[0]); + const currentLine = String(clines[0]); + this.handleSelf(currentLine); ooclog.value = clines.slice(1).join("\r\n"); + if (currentLine.substr(0,4)==="wait" && rawLog === false) { + rtime = currentLine.split("#")[1]; + } else if (currentLine.substr(0,2)!=="MS"){ + rtime = 0; + } + setTimeout(() => onReplayGo(""), rtime); } } |
