MJ: attack coordinator update / various fixes . captcha and back button and jitterloop 2 secs

This commit is contained in:
2026-05-03 12:40:20 +03:00
parent 47381a9304
commit eb31072c87
16 changed files with 1492 additions and 31 deletions

View File

@@ -193,7 +193,27 @@ function gatherState() {
};
});
return { player, player_id, alliance_id, total_points, world_id: world, towns: townList };
// ---- World speed & unit speed table (for attack planner calculations) -----
let world_speed = 1;
let unit_speeds = {};
try {
world_speed = uw.Game?.world_speed || 1;
const gdUnits = uw.GameData?.units || {};
for (const [uid, ud] of Object.entries(gdUnits)) {
if (ud.speed !== undefined) {
unit_speeds[uid] = {
speed: ud.speed || 0,
population: ud.population || 1,
is_naval: !!(ud.naval || ud.is_naval || false),
capacity: ud.capacity || 0, // transport ship cargo
};
}
}
} catch (e) { log(`unit speed gather failed: ${e}`); }
return { player, player_id, alliance_id, total_points, world_id: world,
world_speed, unit_speeds, towns: townList };
}
function pushState() {