summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-11-26 11:42:13 +0100
committerTor Andersson <tor@ccxvii.net>2023-01-31 13:50:28 +0100
commit2ebdd020dd83d85b5437189ed12595f6ae781262 (patch)
treefbdfe3a5b07b0ef6f9148907748597621cd16e14 /server.js
parent8e20d731f055f5a0f6ce7c63157eb0c8b8ac6778 (diff)
downloadserver-2ebdd020dd83d85b5437189ed12595f6ae781262.tar.gz
Add breakpoints to game log in debugging view.
Diffstat (limited to 'server.js')
-rw-r--r--server.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/server.js b/server.js
index d5ce614..1ca151b 100644
--- a/server.js
+++ b/server.js
@@ -1593,6 +1593,15 @@ app.get('/play/:game_id', function (req, res) {
res.redirect('/'+title+'/play:'+game_id)
})
+app.get('/debug/:game_id', function (req, res) {
+ let game_id = req.params.game_id | 0
+ let user_id = req.user ? req.user.user_id : 0
+ let title = SQL_SELECT_GAME_TITLE.get(game_id)
+ if (!title)
+ return res.status(404).send("Invalid game ID.")
+ res.redirect('/'+title+'/debug:'+game_id)
+})
+
app.get('/:title_id/play\::game_id\::role', must_be_logged_in, function (req, res) {
let user_id = req.user ? req.user.user_id : 0
let title_id = req.params.title_id
@@ -1649,7 +1658,7 @@ app.get('/replay/:game_id', function (req, res) {
return res.json({players, state, replay})
})
-app.get('/debug/:game_id', function (req, res) {
+app.get('/replay-debug/:game_id', function (req, res) {
if (!req.user || req.user.user_id !== 1)
return res.status(401).send("Not authorized to debug.")
let game_id = req.params.game_id