diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-01-02 17:59:07 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-01-06 12:40:25 +0100 |
commit | 74166074606cdba810b1b42f87af8cbe0bab6519 (patch) | |
tree | b88170560eb9dcd584766c300792fb6457ee91de /public/join.js | |
parent | 72ebf85bc7f3a5f8fdf37e96a319ccbb8ea5768d (diff) | |
download | server-74166074606cdba810b1b42f87af8cbe0bab6519.tar.gz |
Add game replay functionality.
Handle missing replay data.
Add replay/rematch/exit buttons on game-over.
Set 'player' to active player during replays.
Replace space with underscore in role class names.
Fix critical undo bug!
Set game_over state during replays.
Fix jumpy view in battle replays.
Nuke undo states from all actions, not just 'undo'.
Log play and replay page requests.
Clean up client.js and allow selecting replay viewpoint.
Add debug mode to replay prompt showing active, state, and next action.
Init client roles from HTML structure.
Remove unused rematch functions.
Drop /info/ prefix on game pages.
Update body role classList when replay viewpoint changes.
Diffstat (limited to 'public/join.js')
-rw-r--r-- | public/join.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/public/join.js b/public/join.js index 24e10ab..eef3833 100644 --- a/public/join.js +++ b/public/join.js @@ -68,11 +68,14 @@ function start_event_source() { }); evtsrc.addEventListener("deleted", function (evt) { console.log("DELETED"); - window.location.href = '/info/' + game.title_id; + window.location.href = '/' + game.title_id; }); evtsrc.onerror = function (err) { window.message.innerHTML = "Disconnected from server..."; }; + window.addEventListener('beforeunload', function (evt) { + evtsrc.close(); + }); } } |