update add modules

This commit is contained in:
2026-04-23 18:45:54 +03:00
parent aec99fa00d
commit 54ec9a3db6
6 changed files with 826 additions and 10 deletions

View File

@@ -98,15 +98,27 @@ def get_pending_command():
build_cmd = _fetch_pending_of_type(c, 'build', player_id)
recruit_cmd = _fetch_pending_of_type(c, 'recruit', player_id)
market_cmd = _fetch_pending_of_type(c, 'market_offer', player_id)
farm_cmd = _fetch_pending_of_type(c, 'farm_loot', player_id)
sync_req = _check_and_reset_sync(c, player_id)
# Also return current farm settings so TM knows loot_option
farm_row = c.execute(
'SELECT enabled, loot_option FROM farm_settings WHERE player_id = ?', (player_id,)
).fetchone()
farm_settings = {
'enabled': bool(farm_row['enabled']) if farm_row else False,
'loot_option': farm_row['loot_option'] if farm_row else 1
}
conn.commit()
conn.close()
return jsonify({
'build': build_cmd,
'recruit': recruit_cmd,
'market': market_cmd,
'build': build_cmd,
'recruit': recruit_cmd,
'market': market_cmd,
'farm': farm_cmd,
'farm_settings': farm_settings,
'sync_requested': sync_req
})