Files
WT-Offline/mod-dev-docs/en/05-server-tuning.md
T

32 lines
1.4 KiB
Markdown

# 05 · Server Code-Free Tuning Overlays
The local server stores all offline-defined economy, battle, store, marketplace, chest, redeem-code, clan, and limit values in **12 `.jsonc` tuning files**. Mods can overlay any of them under `server/tuning/<name>.jsonc` without writing code.
## 1. Merge Precedence
1. Shipped defaults (`apps/server/tuning/<name>.jsonc`)
2. Enabled mods' `server/tuning/<name>.jsonc` in load order
3. Player overrides (`<dataFolder>/tuning/<name>.jsonc`, highest priority)
## 2. All 12 Tuning Files
`battle.jsonc`, `battle-economy.jsonc`, `store.jsonc`, `marketplace.jsonc`, `trophies.jsonc`, `supply-chests.jsonc`, `recycling.jsonc`, `redeem-codes.jsonc`, `new-profile.jsonc`, `research.jsonc`, `clans.jsonc`, `limits.jsonc`.
## 3. Additive List Operations (`$listOps`)
Objects merge recursively by key; plain arrays replace the previous array. To stack items across multiple mods without clobbering, wrap list edits in `{ "$listOps": [...] }`:
```jsonc
{
"multiVehiclePacks": {
"$listOps": [
{ "op": "append", "items": [{ "id": "mod_duo_pack", "priceGjn": 49.99, "vehicles": ["us_m2a4"] }] },
{ "op": "upsertBy", "key": "id", "item": { "id": "wto_pack_two_fronts", "priceGjn": 19.99 } },
{ "op": "removeBy", "key": "id", "value": "some_pack_id" }
]
}
}
```
Supported ops: `append`, `prepend`, `upsertBy`, `removeBy`.