Private
Public Access
1
0
Files
star-wars-wild-space/server/realtimeSnapshot.js

27 lines
595 B
JavaScript

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,
};
}