greekbuilding names ,live synch button ,market capacity
This commit is contained in:
@@ -157,6 +157,21 @@
|
||||
log(`storage capacity lookup failed: ${e}`);
|
||||
}
|
||||
|
||||
// ---- Market / Trade capacity -----------------------------------------
|
||||
let marketCapacity = 0;
|
||||
try {
|
||||
const marketLevel = buildings.market ?? 0;
|
||||
const gd = uw.GameData?.buildingData?.market;
|
||||
marketCapacity = gd?.capacity_per_level?.[marketLevel] || 0;
|
||||
|
||||
// Add Trade Office bonus if present
|
||||
if (buildings.trade_office && buildings.trade_office > 0) {
|
||||
marketCapacity += (uw.GameData?.buildingData?.trade_office?.capacity_extra_per_level || 500) * marketLevel;
|
||||
}
|
||||
} catch (e) {
|
||||
log(`market capacity lookup failed: ${e}`);
|
||||
}
|
||||
|
||||
// ---- Coordinates & sea zone -----------------------------------------
|
||||
let x = null, y = null, sea = null;
|
||||
try {
|
||||
@@ -234,6 +249,7 @@
|
||||
stone: res.stone,
|
||||
iron: res.iron,
|
||||
storage: storageCapacity,
|
||||
market_capacity: marketCapacity,
|
||||
population: res.population,
|
||||
points: town.getPoints?.() ?? 0,
|
||||
god: town.god?.() ?? null,
|
||||
@@ -466,6 +482,11 @@
|
||||
const recruitCmd = cmdData.recruit;
|
||||
const marketCmd = cmdData.market;
|
||||
|
||||
if (cmdData.sync_requested) {
|
||||
log('Sync requested by server — pushing state immediately');
|
||||
pushState();
|
||||
}
|
||||
|
||||
const execute = async (cmd) => {
|
||||
if (!cmd) return;
|
||||
log(`Executing command #${cmd.id} — type:${cmd.type} town:${cmd.town_id}`);
|
||||
|
||||
Reference in New Issue
Block a user