const express = require("express");
const Game = require("./game.js");
-const router = express.Router();
-
const GamePhase = {
JOIN: 1,
REVEAL: 2,
this.next_player_id = 1;
this.characters_to_reveal = null;
this.phase = GamePhase.JOIN;
-
- /* Send a comment to every connected client every 15 seconds. */
- setInterval(() => {this.broadcast_string(":");}, 15000);
}
add_spectator(name, session_id) {
}
+Empires.router = express.Router();
+const router = Empires.router;
+
router.post('/spectator', (request, response) => {
const game = request.game;
var name = request.session.nickname;
response.send(game.players);
});
-router.get('/events', (request, response) => {
- const game = request.game;
- game.handle_events(request, response);
-});
-
-exports.router = router;
-exports.Game = Empires;
-
Empires.meta = {
name: "Empires",
identifier: "empires"
};
+
+exports.Game = Empires;