Files
metin2-server/tools/ava2-itemshop

Native AVA2 item shop

Active UI is uiitemshopnew.py. GC93 retains the native catalogue/log layouts; GD/DG76 transports authenticated account/character requests to the DB coordinator. Purchase requests add a durable random token and the confirmed item/total quote.

data/ava2-itemshop/original-products.tsv contains all 217 original offers recovered from the supplied MySQL56 archive. source.json records hashes. No prices are invented. compatibility.json records 55 absent prototypes, 55 ITEM_NONE placeholders and 107 actual types needing item-system verification. verified-products.json selects 49 existing implemented mount, mount-skin, fixed-enchant and third-hand products.

Generate migration SQL with explicit configured schema names, review it and back up account/award data before executing it:

python3 tools/ava2-itemshop/migrate.py --player player_sb --account account_sb --output /tmp/itemshop.sql
python3 tools/ava2-itemshop/enable_verified.py --player player_sb --output /tmp/itemshop-enable.sql

The migration uses InnoDB for account, catalogue, orders and awards. Account/player SQL configurations must target the same MySQL host and port. Purchase failures leave all four unchanged. A transaction temporarily disables reconnect and caps lock waits at three seconds, restoring the original connection options afterwards. Unknown COMMIT outcomes retry the same order. Unique (account_id,token) orders survive process restarts.

The old prototype loader indexed vector pointers before sorting; it now sorts before building the index so lookup keys always match their templates.

Awards use the existing mall redemption path; non-stackable purchases create separate award rows. New clients use revision mt20261020. Legacy clients cannot request GC93. No web recharge service or wheel reward service is enabled.

Acceptance evidence: metin2-client/docs/AVA2-ITEMSHOP.md and metin2-client/audit/evidence/itemshop/.

Production release, 2026-10-20 (server CEST)

203 now runs the verified sbtest game/db pair: game 56975b48aa2fd40389c57eab84d017b0a2518cf6e1b573d967bf239f4ae04aba, db dc940401fe6ccc3410c8d90ce98d2a5bad2e2c023279665bcd664c008d011699. The deployment retains the existing native battle pass, wiki, calendar and other cumulative game changes. The release delta is the native shop, DB prototype-index fix, transactional schema and 49 enabled original offers. The remaining 168 offers, recharge and wheel services stay disabled. Production 70002 was still ITEM_NONE; its text/SQL prototype is now ITEM_USE/USE_SPECIAL, matching the tested third-hand implementation. Other prototypes were not replaced with test data.

Deployment package: /root/deploy-features/20261020-itemshop. Backup: /root/backup-itemshop/20261020-014955 (old binaries, original prototype, full account/player SQL dump and pre-deployment error-log offsets). deploy.py gracefully stops game/auth, then db; backs up SQL before migration; starts db first and then auth and all 13 production game cores. sbtest remains independent.

Read-only health check:

/usr/local/bin/python3.9 /root/deploy-features/20261020-itemshop/deploy.py check

Binary rollback:

/usr/local/bin/python3.9 /root/deploy-features/20261020-itemshop/deploy.py rollback --backup /root/backup-itemshop/20261020-014955

Rollback retains InnoDB, coins, orders, awards and the compatible third-hand prototype. Never restore the pre-release SQL dump over subsequent player purchases.

CH1 acceptance with a temporary ordinary account verified all 49 catalogue entries/icons, insufficient funds without an order, a 99-coin purchase, same-token replay without another charge/order, purchase history and mall redemption into inventory. Test account, character, coins, orders, awards and items were removed; its one test sale was subtracted without resetting other sales. Existing players received no test currency. db/auth/13 cores remained healthy after cleanup. macOS release bundle and connected Android client's APK/resources were updated; Android in-game purchase acceptance is not claimed by this release.

2026-10-20 safety fixes (not deployed)

build_isolated.py now requires a reviewed --dependency-manifest: JSON with source_sha256 from source_digest(source) and archives mapping every source-relative .a path to SHA-256. The manifest binds reviewed dependency provenance to the exact server/extern sources; generating hashes alone does not certify provenance. FreeBSD is required. A fresh game-release, db-release, game-warnings or db-warnings directory is created beneath --output; reusing a target/mode directory fails. Source/dependency mismatches also fail. --warnings removes -w, enables format/conversion diagnostics and makes format/narrowing warnings errors. Build evidence and binary hashes are written to the new directory. FreeBSD validation remains required.

The wear40 planner now binds database/server identity, a persistent target UUID, item identity/state, quickslots and a plan checksum. --apply requires --offline --backup-id ID. Reuse the exact saved v2 plan for interrupted runs; old unbound plans are rejected. A completed marker is rechecked against actual data and schema; corrupt extra is rejected before mutation. Backups and stopping writers remain operational prerequisites, not facts inferred from command success.

Offline shop mutation and startup expiry cleanup are explicitly closed in game/db until durable custody/payment/delivery orders and crash recovery are implemented and accepted. Stored assets are preserved. This closure is a containment measure, not completion of offline trading.

Pending-reward journal maintenance

PointJournal keeps its own durable pending set. Startup recovery and the retry event compact a log above 1 MiB when enough completed history can be removed. Compaction retains every pending token/request/time, writes a new file exclusively, fsyncs it, atomically renames it and fsyncs the directory. It does not cap the queue at 4096 entries. Do not pass a subset of runtime requests to replace the journal; there is deliberately no such API.

Keep the .lock sidecar in place for the writer's lifetime. Stop old binaries before upgrading a process that uses the same journal path; mixed old/new concurrent writers are unsupported. An I/O error pauses issuance, retaining a complete recovery source; fix the storage problem and preserve journal evidence before restarting. A corrupt log is not automatically truncated or compacted. These changes have standalone fault tests, including ELF32 probes, and do not replace real database/process-crash acceptance.

Strict builds also promote -Wshorten-64-to-32 to an error. The broader strict warning gate is still failing on legacy code; see the maintenance evidence for the exact blockers.