Keep multi-account refresh responsive and batch monster feeding

This commit is contained in:
AttilaNet
2026-11-08 00:24:21 +08:00
parent 5f0a9eaac3
commit 67b4658e00
23 changed files with 780 additions and 107 deletions
+32 -2
View File
@@ -19,7 +19,7 @@ writes stop with a persisted pending record; no automatic replay occurs.
VIP daily gifts and mail attachment claims. Refreshes remain read-only; explicit
selection and execution are required. Null VIPs, millisecond/second timestamps,
JSON mail rewards and stale reads are handled. New policy and budget files remain
role-isolated. Full local suite: 101 tests passed. Live reward/sweep use is still
role-isolated. Full local suite: 113 tests passed. Live reward/sweep use is still
unverified; no real account or phone was operated during this work.
The screenshot page remains necessary for ADB real battles such as special
@@ -199,7 +199,8 @@ method informs the configurable strategy; numeric values come from the APK.
## Validation and remaining inputs
101 unit/integration tests pass: mature incubator dispatch contract, eligible-stage sweep and daily claim workflows,
113 unit/integration tests pass: responsive multi-account snapshots, batched feeding,
mature incubator dispatch contract, eligible-stage sweep and daily claim workflows,
pending writes and role/day budgets, stage tree/rule restoration and scroll
geometry, plus local encrypted HTTP and inventory actions,
SDK password form/headers -> two Android regions -> selected region entry ->
@@ -300,3 +301,32 @@ while they were playing.
The activity's standalone daily-limit field remains unidentified. Farming checks
available tickets plus a labeled local daily attempt limit, including failures
and interruptions. This is not claimed to query the official daily quota.
## Refresh performance and batch feeding
The reported freeze occurred after HTTP completion: hidden pages/accounts rebuilt
all tables and thousands of stage controls on the GUI thread. The all-stage build
alone measured about 1506ms before the fix. Repeated ResizeToContents layout work
and formatting hidden debug JSON added avoidable GUI work.
Pure attribute/stage presentation is now prepared by each account's existing
worker. Queued Qt slots own all widgets. Hidden account/page tables are deferred;
map, monster and egg rows use bounded ~8ms batches and reuse existing controls.
Column sizes are interactive, and closed debug windows do not format JSON.
Background requests remain serial within one account, concurrent across accounts.
The trace separates worker total (including HTTP), preparation and UI callbacks.
The local 80-monster/4000-egg plus 500-monster two-account fixture, with 700ms mock
network waits, recorded 2.1/10.5ms UI callbacks and 30.75ms maximum event-loop gap.
See REFRESH_PERFORMANCE.json. This is a local synthetic measurement, not a live
server or hardware-wide guarantee. No real inventory mutations were performed.
NetStack.moveMonster accepts per-room arrays, allowing capacity-checked collection
batches. NetMonster.feedMonster accepts foods arrays; MonsterSelectPanel.modeFeed
allows multiple materials without a small fixed count. monster_level now supplies
the cumulative experience thresholds. Automatic feeding combines eligible managed
materials until the target stop level's required experience is met, retaining all
per-monster protections. Continuous actions advance after fresh reads, while the
monitor interval governs idle waiting. Logs include ID and species/nickname for
both target and each material. Regression tests verify batches, caps, target
priority, capacity accounting and responsive two-account GUI event processing.
+17
View File
@@ -0,0 +1,17 @@
{
"fixture": "80 monsters and 4000 eggs; second account 500 monsters",
"network_delay_ms": 700,
"accounts": [
{
"worker_total_ms": 805.8,
"data_prepare_ms": 36.5,
"ui_callback_ms": 10.5
},
{
"worker_total_ms": 801.2,
"data_prepare_ms": 47.5,
"ui_callback_ms": 2.1
}
],
"max_ui_event_gap_ms": 30.75
}