Repository navigation
Sync faction store offers (opt-in store_offers) - #342
Merged
netniV merged 1 commit intoOct 22, 2026
Merged
Conversation
Add an opt-in sync type, store_offers, that emits store_offer events. Offers come from Platform service responses seen by the existing response detour, and are routed only when the option is on. One snapshot is built for the factions category and re-sent when its content changes. Resource.amount is corrected to fixed32 in the Platform content proto. Refs STFC-Mod#301 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
netniV
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in sync type
store_offersthat emitsstore_offerevents: the Faction Store's consumable offers (the favor levels) with their prices and rank gates. It is off by default and only emitted for targets that enable it. Refs #301 (faction-store half only; refinery conversions are not covered).What changes
store_offersunder[sync]and per target (oneSyncOptionsrow,config.ccuntouched). English example only.ProcessResultInternaldetour (both registries share one compiled method, seen on Windows). The detour checkssync_options.store_offersfirst and only then recognises a PlatformServiceResponseand hands it to a small handler. With the option off, behaviour is exactly as before. No new hook, no new server calls.store_offerevent holds the wholefactionssnapshot of consumable offers (about 120 favor levels plus a couple of other items), sorted bybidthencid, and is queued only when its hash changes:{"type":"store_offer","category":"factions","offers":[{"bid":1879677865,"cid":4257393301,"cost":[{"rid":1622589916,"amount":1390}],"req":[{"type":"faction_standing","id":4138978039,"amount":4}],"valid_count":2,"same_remaining_count":2}]}costandreqare arrays of small objects, likeofficer_traits. A snapshot replaces the previous one so a bought level drops out; per-offer events would need removal events for that.Digit.PrimePlatform.Content.proto:Resource.amountis nowfixed32. The server sends it as fixed32 (0d e8 03 00 00= field 1, wire type 5, value 1000; check withprotoc --decode_raw), but the proto saiduint32, so the generated parser dropped it into unknown fields. Nothing else in the mod uses this message.Notes
req[].amountforfaction_standingis a zero-based tier index.valid_count/same_remaining_countare the rawOfferDetails.validCount/sameRemainingCount, not the in-game "Available" number.EntityGrouptypes use a different enum than PrimeServer (type 0 isSTATICTRANSLATIONSthere butUserProfileshere), so with the option on these responses skipHandleEntityGroup. With it off they go through it exactly as before. Skipping them unconditionally would also stop that existing misread, but I kept this change scoped to the option.SyncOptions/example-config lines as Sync: opt-in live fleet state (fleets) #325 and Add in-game Mod Settings with persistent preferences and shortcut editing #333; I'll rebase whichever lands second.Verified
Windows, client build 272, against a live sync target:
cost), and an identical replay queues 0. The earlier revision (hand-decoded fixed32) showed the same behaviour. macOS not tested.Checks
Fork CI not run (Actions unavailable on my account this month). Local MSVC release build clean;
git diff --checkand clang-format clean on changed lines. Example-config validator not run locally. No tests, CHANGELOG, version or other-locale changes.🤖 Generated with Claude Code