Skip to content

Restore vendor reputation and faction rank rewards - #150

Open
gagefulwood wants to merge 45 commits into
stanuwu:masterfrom
gagefulwood:fix/vendor-reputation-runtime-integration
Open

gagefulwood wants to merge 45 commits into
stanuwu:masterfrom
gagefulwood:fix/vendor-reputation-runtime-integration

Conversation

@gagefulwood

Copy link
Copy Markdown
Contributor

Summary

  • restores material turn-ins and repeatable faction rank rewards for Zavala, Shaxx, and Banshee.
  • reads vendor/faction links, progression steps, and supported offer/reply conditions from installed content.
  • opens the installed reward package through the existing reward resolver instead of maintaining weapon or armor hash lists.
  • saves payment, reputation, granted items, and claim credit through the existing prepare/commit transaction paths. Refused claims preserve credit.
  • publishes the prepared character/account after-images so the claimed offer reflects spent credit.
  • preserves WS901's required extra Boolean without setting it from purchase success; WS904 keeps its status-pair response.

Dependency and shared changes

Depends on Throg's Extract runtime reward definitions and replace hardcoded grants (#146), reviewed here at 05ce3ea7ea5e74449d2a6a98a4b58b80945be127.

Throg's work provides the item/reward catalogs, nested reward-pool resolver, conditions/socket overrides, inventory grants, and ordinary multi-cost sale handling. My contribution adds vendor reputation, rank-claim handling, faction metadata, claim-credit revalidation, and the spent-credit after-image on top of that foundation.

The tables below list my additions and modifications relative to his dependency revision, not his full file changes. Shared-file rows distinguish my changes from Throg's or upstream's existing implementation. His reward resolver and validating cache decoder are unchanged.

I also corrected the inherited Season Pass cache encoder to encode only active conditions and write canonical unused slots. Condition padding stays zero; socket padding retains Throg's absent-reference defaults. The combined vendor cache layout uses version 73 so older derived caches rebuild.

Save compatibility

This PR retains investment schema-v3 support so existing version-3 saves continue to open, including the migration from older saves and cleanup of objective rows for removed characters. Vendor XP and claim credit still use the existing unlock banks, not the objective table. This compatibility is my addition, not part of Throg's dependency. Schema-v2-only builds cannot open saves after migration to version 3.

Notes / limits

  • Token XP comes from 22 archived build-era rows checked against installed sales/factions; those values are not runtime-extracted from packages.
  • Three rowless reply-to-offer links and the rank-crossing credit policy remain explicit reconstructions. The original native relationships are not claimed recovered.
  • Supported rowless claims require one authored reply. Unknown selectors, warning replies, and unsupported shapes refuse; this is not arbitrary multi-reply selection support.
  • Postmaster overflow and Rahool decryption are outside this PR. A payout that cannot fit refuses without consuming claim credit.
  • Gameplay coverage is for Zavala, Shaxx, and Banshee in the Tower. Planetary vendors whose destination scripts or spawns are not in place remain unverified; this PR does not supply those scripts or make the vendors accessible.
  • Reputation turn-ins support one static cost. Ordinary sales retain the dependency's complete multi-cost handling; conditional/unreadable prices are not guessed.
  • WS901's extra Boolean has unresolved native semantics; these purchase replies keep it clear while status and the inventory revision carry the result.
Files added and modified (my vendor/cache and save-compatibility changes)

My added files

File My addition Throg / upstream dependency used
Sunrise/resources/database/vendor_reputation_content.sql Embedded build-scoped material/XP definitions with labels and source limits. Cross-checks definitions against installed sales/factions; uses no new player database.
Sunrise/src/client/content/vendors/package_vendor_gate_build.cpp Extracts installed interaction/reply and sale-gate programs and binds their inputs. Uses the existing package readers and shared unlock-expression representation.
Sunrise/src/state/build_data/vendors/reconstructed_rank_claim_links.h Isolates the three bounded rowless claim associations. Links retained vendor metadata; does not supply a replacement loot pool.
Sunrise/src/state/build_data/vendors/reputation_sale_catalog.h Declares the turn-in catalog and checked lookups. Uses installed vendor, item, and progression identities.
Sunrise/src/state/build_data/vendors/reputation_sale_catalog.cpp Loads and validates the embedded XP rows; exposes turn-in lookups. Checks rows against existing build-data catalogs.
Sunrise/src/state/build_data/vendors/vendor_gate_catalog.h Declares retained vendor conditions, input bindings, and catalog interfaces. Reuses the shared condition representation.
Sunrise/src/state/build_data/vendors/vendor_gate_catalog.cpp Validates and publishes owned gates, copies lookups, and invalidates replaced data. Follows the existing build-data catalog lifecycle.
Sunrise/src/state/runtime/state_vendor_reputation_runtime.h Declares pending reputation mutations and rank-claim preparation/revalidation. Uses the shared reward transaction types.
Sunrise/src/state/runtime/state_vendor_reputation_runtime.cpp Prepares turn-ins and claims, evaluates gates, and revalidates before commit. Calls Throg's package resolver and grant path, plus the shared expression evaluator.

My modifications to shared files

File My modification Throg / upstream code retained
Sunrise/Sunrise.vcxproj Registers my sources, headers, and embedded SQL. Existing project and dependency registrations.
Sunrise/resources/resource.h Adds the reputation-content resource ID. Existing resource definitions.
Sunrise/resources/sunrise.rc Embeds the reputation-content SQL. Existing resource loading.
Sunrise/src/client/content/items/packages/package_item_build.cpp Includes process-local vendor gates in readiness, including disk-cache startup. Throg's item/reward extraction and settled-domain behavior.
Sunrise/src/client/content/items/packages/package_progression_build.cpp Extracts and validates repeating-rank metadata. Existing progression extraction.
Sunrise/src/client/content/items/packages/package_reward_build.cpp Comment only: clarifies the supplemental reward reference. Throg's reward extraction code is unchanged.
Sunrise/src/client/content/vendors/layout.h Adds named faction/gate offsets. Throg's complete sale-price layout.
Sunrise/src/client/content/vendors/package_vendor_build.cpp Retains installed faction/progression links. Existing vendor extraction and Throg's full sale-cost handling.
Sunrise/src/client/content/vendors/vendor_build.h Adds borrowed map inputs and the gate-extraction entrypoint. Existing vendor builder interface.
Sunrise/src/middleware/content/packages/tables/definition_index_table.h Names the native repeat-last-step field. Existing table layout.
Sunrise/src/middleware/web_service/messages/opcode904/opcode904_codec.h Clarifies rowless sale/reply selector contracts. Existing request representation; unresolved sale-backed selectors remain unassigned.
Sunrise/src/middleware/web_service/messages/opcode904/opcode904_codec.cpp Comment only: describes acquisitions and interaction replies. Existing request decoder is unchanged.
Sunrise/src/server/web_service/web_service_runtime.h Adds pending reputation to service outcomes. Existing outcome and reward ownership model.
Sunrise/src/server/web_service/web_service_runtime.cpp Routes reputation mutations and keeps the required WS901 Boolean clear rather than deriving it from preparation success. Existing service routing, status/revision contracts and shared reward outcomes.
Sunrise/src/server/web_service/web_service_vendor_actions.cpp Dispatches supported turn-ins/claims before ordinary acquisition. Throg's full-price handling and the existing ordinary acquisition path.
Sunrise/src/server/bap/encrypted/internal.h Carries pending reputation through deferred outcomes. Existing deferred reward ownership.
Sunrise/src/server/bap/encrypted/body/bap_service_body.cpp Stages reputation updates and keeps opcode-specific response shapes without deriving WS901's Boolean from success. Existing BAP response construction, reward staging and withheld-output failure boundary.
Sunrise/src/server/bap/encrypted/transactions/service_outcome_commit.cpp Adds reputation to the commit dispatcher. Existing dispatcher and enclosing transaction.
Sunrise/src/server/bap/encrypted/encrypted_runtime.cpp Requests account resync after successful reputation commit. Existing successful-mutation publication boundary.
Sunrise/src/server/bap/encrypted/push/snapshot/family4_reward_updates.cpp Includes prepared spent-credit state in character/account after-images. Existing Family-4 reward and inventory encoding.
Sunrise/src/state/build_data/build_data_runtime.cpp Adds reputation/gate catalog lifecycle handling. Existing build-data lifecycle.
Sunrise/src/state/build_data/runtime/build_data_catalog_runtime.cpp Adds faction/progression startup and reset handling. Existing shared catalog initialization.
Sunrise/src/state/build_data/vendors/definition.h Adds faction identity/progression fields. Throg's multi-cost sale representation.
Sunrise/src/state/build_data/vendors/vendor_catalog.cpp Validates faction fields and invalidates replaced gates. Existing vendor catalog ownership and publication.
Sunrise/src/state/build_data/progressions/definition.h Retains repeat-last-step metadata. Existing progression definitions.
Sunrise/src/state/build_data/progressions/progression_catalog.h Adds checked step lookup and snapshot interfaces. Existing progression catalog.
Sunrise/src/state/build_data/progressions/progression_catalog.cpp Validates and exposes rank steps for XP arithmetic. Existing catalog storage/publication.
Sunrise/src/state/build_data/cache/records/cache_investment_records.cpp Retains repeat metadata; separately corrects inherited Season Pass encoding of active/unused cells. Throg's validating decoder and reward-row format.
Sunrise/src/state/build_data/cache/records/cache_vendor_records.cpp Caches faction/progression fields. Throg's complete sale costs and price-state representation.
Sunrise/src/state/build_data/cache/records/format.h Adds packed vendor/repeat fields and sets combined layout version 73. Throg's condition/socket and sale-price cache fields.
Sunrise/src/state/runtime/runtime.h Carries prepared rank credit with rewards. Shared reward transaction types used by Throg's grants.
Sunrise/src/state/runtime/state_account_reward_grant_runtime.cpp Revalidates and debits credit atomically with item grants. Throg's reward preparation, grant, and result semantics.
Sunrise/src/state/build_data/rewards/definition.h Comment only: clarifies the supplemental reference. Throg's reward definitions are unchanged.
Sunrise/src/state/unlocks/unlocks_expression.h Comment only: clarifies caller-owned external operands. Shared evaluator is unchanged and reused by vendor gates.
Sunrise/resources/database/investment_schema.sql Retains schema version 3 and the character-owned objective table for save compatibility. Additional persistence support from my earlier work; not part of Throg's reward definitions or required for vendor XP.
Sunrise/src/state/investment/investment_database.cpp Retains older-save migration and opening of version-3 saves. Existing database opening and transaction machinery.
Sunrise/src/state/investment/investment_account_store.cpp Deletes only removed characters' objective rows within the account-write transaction. Existing account writer; survivor rows and rollback semantics are preserved.

gagefulwood and others added 30 commits September 16, 2026 11:17
Read installed reward pools, item wrappers, conditions, and Season Pass rows
alongside item definitions. Resolve existing server grants through State and
publish inventory and acquisition flags in the same transaction.

Replace authored engram and material reward tables and Season Pass armor
rolls. Share the extracted class-package path, preserve native claim indices,
and apply earned progression flags as seasonal experience changes.
…ions' into fix/vendor-reputation-runtime-integration
gagefulwood and others added 15 commits September 24, 2026 01:46
Read installed reward pools, item wrappers, conditions, and Season Pass rows
alongside item definitions. Resolve existing server grants through State and
publish inventory and acquisition flags in the same transaction.

Replace authored engram and material reward tables and Season Pass armor
rolls. Share the extracted class-package path, preserve native claim indices,
and apply earned progression flags as seasonal experience changes.
Integrate runtime-item-definitions at 05ce3ea.
Include the verified cache and WS901 corrections, rank-claim handling,
and version-3 save compatibility while preserving both parent histories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants