In the previous commit, we ensured that a game object always knows its
own ID, so it's unnecessary to store it alongside.
Delete this field from this anonymous object and change all references
to instead access game.id.
const game = new engine.Game(id);
this.games[id] = {
- id: id,
game: game
};
response.sendStatus(404);
return;
}
- response.redirect(301, `/${game.game.meta.identifier}/${game.id}/`);
+ response.redirect(301, `/${game.game.meta.identifier}/${game.game.id}/`);
});
/* LMNO middleware to lookup the game. */
<ul>
{% for game in games.active %}
<li>
- {{ game.id }} ({{ game.game.clients.length }}/{{ game.game._players.length }} active)
+ {{ game.game.id }} ({{ game.game.clients.length }}/{{ game.game._players.length }} active)
{% for player in game.game._players %}
{{ player.name }}
{% endfor %}
<ul>
{% for game in games.idle %}
<li>
- {{ game.id }} ({{ game.game._players.length }})
+ {{ game.game.id }} ({{ game.game._players.length }})
{% for player in game.game._players %}
{{ player.name }}
{% endfor %}