From d1318d147297161691f5048e1f2cb4e516159144 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 14 Nov 2021 17:17:49 +0100 Subject: Add 'hidden' column to titles for beta-testing games. --- server.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index cf5a9d0..0e6c548 100644 --- a/server.js +++ b/server.js @@ -306,7 +306,7 @@ function must_be_logged_in(req, res, next) { } app.get('/', function (req, res) { - res.render('index.ejs', { user: req.user, flash: req.flash('message') }); + res.render('index.ejs', { user: req.user, titles: TITLES, flash: req.flash('message') }); }); app.get('/about', function (req, res) { @@ -1741,12 +1741,7 @@ io.on('connection', (socket) => { * HIDDEN EXTRAS */ -const QUERY_STATS = db.prepare(` - SELECT title_id, scenario, result, count(*) AS count - FROM game_full_view - WHERE status=2 AND is_solo=0 - GROUP BY title_name, scenario, result - `); +const QUERY_STATS = db.prepare("SELECT * FROM game_stat_view"); app.get('/stats', function (req, res) { LOG(req, "GET /stats"); @@ -1754,6 +1749,8 @@ app.get('/stats', function (req, res) { res.render('stats.ejs', { user: req.user, stats: stats, - title_role_map: ROLES, title_name_map: TITLES, title_rule_map: RULES + title_role_map: ROLES, + title_name_map: TITLES, + title_rule_map: RULES, }); }); -- cgit v1.2.3