agoara update
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user