ServerCurrencyAuthority.V2 is the gameplay-side gate that prevents clients
from mutating currency state directly. It complements the broader
V2OnlineServices server economy validator by rejecting suspicious currency
mutations before they are applied to CurrencyLedger.V2.
Runtime Surface#
FV2ServerCurrencyAuthorityPolicydefines the server-only rules: trusted source ids, mutation batch size, required server-authoritative ledger flags, unique server request ids, client-authored rejection, and client balance mismatch rejection.FV2ServerCurrencyMutationwraps aFV2CurrencyLedgerRequestwith server request id, server authority id, client-reported balance, client-authored status, and trusted-source status.FV2ServerCurrencyAuthorityResultreturns the initial ledger, the committed ledger, applied transactions, the last ledger result, rejection evidence, and blocking issues.ApplyServerCurrencyMutationsevaluates a batch against policy and applies mutations throughApplyCurrencyLedgerTransactiononly after server authority checks pass.
Authority Rules#
- Currency changes originate from the server authority, not client-side balance writes.
- Every mutation must include
ServerRequestId,ServerAuthorityId, and a ledger request markedbServerAuthoritative. SourceIdmust be allowed by the server authority policy and the mutation must be marked trusted by the caller.- Client-authored mutations are rejected before ledger application.
- Client-reported balance must match the server ledger result. Mismatches fail closed and preserve the pre-request ledger.
- Duplicate server request ids are rejected to prevent replayed or duplicated mutation batches.
- Batch application is atomic. If any mutation is rejected, no candidate ledger updates are committed.
- Accepted mutations still flow through
CurrencyLedger.V2, so currency definitions, caps, negative-balance rules, duplicate transaction ids, and audit trail fields remain authoritative.
Validation Commands#
Run these checks when touching server-authoritative currency management:
bash
python3 V2/ue/Tools/check-v2-server-currency-authority.py
python3 V2/ue/Tools/check-v2-currency-ledger.py
python3 V2/ue/Tools/check-v2-currency-definition.py
python3 V2/ue/Tools/check-v2-ci-workflow.py
python3 -m json.tool V2/ue/Content/V2/Gameplay/Economy/ServerCurrencyAuthority_V2_Contract.json
python3 -m json.tool V2/ue/Build/Horde/v2-buildgraph-job.json
python3 V2/tools/validate-v2-docs.py