agoara update

This commit is contained in:
2026-05-06 23:41:52 +03:00
parent 7e98f1292e
commit b824144a6a
9 changed files with 1283 additions and 6 deletions

View File

@@ -247,11 +247,31 @@ function gatherState() {
}
} catch (e) { log(`unit speed gather failed: ${e}`); }
// Active celebrations — tracks running parties/processions per town
// finished_at is a unix timestamp (seconds). 0 means not running.
const celebrations = [];
try {
const celebModels = uw.MM.getModels()?.Celebration;
if (celebModels) {
for (const cel of Object.values(celebModels)) {
const a = cel.attributes;
if (!a || !a.town_id) continue;
celebrations.push({
town_id: String(a.town_id),
celebration_type: a.celebration_type, // 'party' | 'triumph'
finished_at: a.finished_at ?? 0
});
}
}
} catch (e) { log(`celebrations gather failed: ${e}`); }
return { player, player_id, alliance_id, total_points, battle_points, world_id: world,
world_speed, unit_speeds, towns: townList };
world_speed, unit_speeds, towns: townList, celebrations };
}
function pushState() {
if (paused) return;
try {