refacto: Displaying number of players for each team + adding logo at registration
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
setElementBonus,
|
||||
getDbCreatedAt,
|
||||
getVictoryPoints,
|
||||
getActivePlayerCounts,
|
||||
} from "../db/gameDb.js";
|
||||
import { computeCell, rowToCellPayload } from "../helpers/cell.js";
|
||||
|
||||
@@ -246,6 +247,18 @@ router.get("/victory-points", async (_req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// GET /api/active-players
|
||||
router.get("/active-players", async (_req, res) => {
|
||||
try {
|
||||
const worldSeed = await ensureSeedEpoch();
|
||||
const counts = await getActivePlayerCounts(worldSeed);
|
||||
res.json(counts);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
res.status(500).json({ error: "database_error" });
|
||||
}
|
||||
});
|
||||
|
||||
// GET /api/scores
|
||||
router.get("/scores", async (_req, res) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user