]> git.cworth.org Git - empires-server/commitdiff
Drop the "name" entry from the game-engine exports
authorCarl Worth <cworth@cworth.org>
Mon, 1 Jun 2020 00:35:17 +0000 (17:35 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 1 Jun 2020 00:35:17 +0000 (17:35 -0700)
This is now available as "identifier" within the game metadata, so use
that consistently instead.

empires.js
lmno.js
tictactoe.js

index 8c0b8338f1837a3ca7d9dde42fa4c215ca339979..78e7f2591d6b18cd14927b466d0f7b55399a1d94 100644 (file)
@@ -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 7fe42659c28d8dde86a9c734fdb83659c0923086..69e445a24e3ab1fde24bdc4df4a0e50c059ff993 100644 (file)
--- 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 () {
index ca67834ecc5790da0a1d125b9a0038d4a58a28cf..12bf6801ac0f20e4f36e444bbb9fab1909fce116 100644 (file)
@@ -61,7 +61,6 @@ router.get('/events', (request, response) => {
 });
 
 exports.router = router;
-exports.name = engine_name;
 exports.Game = TicTacToe;
 
 TicTacToe.meta = {