Private
Public Access
1
0

refacto: Replaced useless DB queries by websocket calls + patching WS auth-token leak

This commit is contained in:
gauvainboiche
2026-04-01 18:47:37 +02:00
parent e28a2d6e9c
commit f161ccb0f0
33 changed files with 6246 additions and 43 deletions

View File

@@ -0,0 +1,26 @@
import {
getEconScores,
getElementBonus,
getMilitaryDeductions,
getActivePlayerCounts,
getVictoryPoints,
} from "./db/gameDb.js";
export async function buildRealtimeSnapshot(worldSeed) {
const [scores, elementBonus, militaryDeductions, activePlayers, victoryPoints] = await Promise.all([
getEconScores(worldSeed),
getElementBonus(worldSeed),
getMilitaryDeductions(worldSeed),
getActivePlayerCounts(worldSeed),
getVictoryPoints(),
]);
return {
worldSeed,
scores,
elementBonus,
militaryDeductions,
activePlayers,
victoryPoints,
};
}