]> git.cworth.org Git - empires-server/blobdiff - lmno.js
Return the actual game object from create_game, not just the ID
[empires-server] / lmno.js
diff --git a/lmno.js b/lmno.js
index 5d7d5687522a214c7c8a82633d74c8930eee45b2..9998c734a2dc63b8f0f0943a928a1d76c73e4102 100644 (file)
--- a/lmno.js
+++ b/lmno.js
@@ -72,7 +72,7 @@ class LMNO {
 
     this.games[id] = game;
 
-    return id;
+    return game;
   }
 }
 
@@ -108,8 +108,8 @@ function lmno_canonize(id) {
 
 app.post('/new/:game_engine', (request, response) =>  {
   const game_engine = request.params.game_engine;
-  const game_id = lmno.create_game(game_engine);
-  response.send(JSON.stringify(game_id));
+  const game = lmno.create_game(game_engine);
+  response.send(JSON.stringify(game.id));
 });
 
 /* Redirect any requests to a game ID at the top-level.