From 40abb70f85a1f833c6dfcc8541db3bf876096616 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 31 May 2020 17:35:17 -0700 Subject: [PATCH] Drop the "name" entry from the game-engine exports This is now available as "identifier" within the game metadata, so use that consistently instead. --- empires.js | 1 - lmno.js | 5 ++--- tictactoe.js | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/empires.js b/empires.js index 8c0b833..78e7f25 100644 --- a/empires.js +++ b/empires.js @@ -347,7 +347,6 @@ router.get('/events', (request, response) => { }); exports.router = router; -exports.name = engine_name; exports.Game = Empires; Empires.meta = { diff --git a/lmno.js b/lmno.js index 7fe4265..69e445a 100644 --- a/lmno.js +++ b/lmno.js @@ -72,7 +72,6 @@ class LMNO { this.games[id] = { id: id, - engine: engine.name, game: game }; @@ -137,7 +136,7 @@ app.get('/[a-zA-Z0-9]{4}', (request, response) => { response.sendStatus(404); return; } - response.redirect(301, `/${game.engine}/${game.id}/`); + response.redirect(301, `/${game.game.meta.identifier}/${game.id}/`); }); /* LMNO middleware to lookup the game. */ @@ -263,7 +262,7 @@ for (let key in engines) { }); /* And mount the whole router at the path for the game. */ - app.use(`/${engine.name}/[a-zA-Z0-9]{4}/`, engine.router); + app.use(`/${engine.Game.meta.identifier}/[a-zA-Z0-9]{4}/`, engine.router); } app.listen(4000, function () { diff --git a/tictactoe.js b/tictactoe.js index ca67834..12bf680 100644 --- a/tictactoe.js +++ b/tictactoe.js @@ -61,7 +61,6 @@ router.get('/events', (request, response) => { }); exports.router = router; -exports.name = engine_name; exports.Game = TicTacToe; TicTacToe.meta = { -- 2.43.0