fix reserved turn daemon api serialization

This commit is contained in:
2026-07-26 19:23:25 +00:00
parent d1e9d5fc75
commit 8f1fe73bad
12 changed files with 1003 additions and 74 deletions
+11 -6
View File
@@ -503,13 +503,18 @@ const createTurnDaemonRuntimeWithLease = async (
beforeExecuteGeneral: reservedTurnStoreHandle
? async (general) => {
const promises: Promise<unknown>[] = [];
promises.push(reservedTurnStoreHandle.store.refreshGeneralTurns(general.id));
promises.push(
reservedTurnStoreHandle.store.prepareTurnsForExecution(
general.id,
general.nationId > 0 && general.officerLevel >= 5
? {
nationId: general.nationId,
officerLevel: general.officerLevel,
}
: undefined
)
);
promises.push(refreshOccupiedAuctionUniqueItemKeys());
if (general.nationId > 0 && general.officerLevel >= 5) {
promises.push(
reservedTurnStoreHandle.store.refreshNationTurns(general.nationId, general.officerLevel)
);
}
if (general.nationId > 0 && general.officerLevel >= 5 && shouldUseAi(general, world.getState())) {
const key = `${general.nationId}:${world.getState().currentYear}:${world.getState().currentMonth}`;
if (!prefetchedNationTurns.has(key)) {