Skip to content

Sync mission acceptance requirements (opt-in mission_requirements) - #390

Open
blevouschurverantunt wants to merge 1 commit into
STFC-Mod:devfrom
blevouschurverantunt:feature/sync-mission-requirements
Open

blevouschurverantunt wants to merge 1 commit into
STFC-Mod:devfrom
blevouschurverantunt:feature/sync-mission-requirements

Conversation

@blevouschurverantunt

@blevouschurverantunt blevouschurverantunt commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Adds an opt-in sync option, mission_requirements, that sends one mission_requirement record per mission spec the client receives: {"type":"mission_requirement","mid":1002,"req":[{"t":3,"v":1001}]}. It is off by default, and only targets that enable it receive the records. Closes #389.

Why: sync consumers already receive active and completed missions, but they cannot tell which offered missions a player can start. The server's offer list is unfiltered, so a mission can be offered while its requirement (usually "mission X completed") is not met. Only the mission spec carries that requirement.

  • mission_requirements under [sync] and per target, as one SyncOptions row. All example settings files list it as false, next to missions.
  • src/mod/sync/records.cc: Requirement() maps one MissionRequirement to JSON. AddRequirements() emits one record per spec, [] included, so a consumer can tell "needs nothing" from "not seen". ProcessMissionSpecs (group 58, at login and for active missions) and ProcessNodeMissions (group 60, on system entry) sit next to the other mission processors. Both merge into one stream, so a system's specs add to the login specs and never remove them. The type-6 float goes out through ShortNumber, like fleet stats.
  • src/mod/sync/state.cc, src/mod/sync/sync.h: new Stream::kMissionRequirements, gated by SyncConfig::mission_requirements.
  • zig/deps/protobuf_roots.txt: MissionSpecsResponse and NodeMissionsResponse.
  • docs/FEATURES.md: a "Mission requirements" row in the data sync table.
[sync.targets.example]
mission_requirements = true

Record shape: req is always an array, and each entry is {"t":<MissionRequirementType 0-8>, ...}:

t Fields
0, 1 s core stat, v value
2 m module type, v level
3 v previously completed mission id
4 h hull type, v value
5 g grade, v value
6 c component, v value (shortest float form)
7 min, max player level
8 f faction id, v amount
unset t only

Validation

  • Run locally on Windows with Zig 0.16: zig build mods build-tests -Dtarget=x86_64-windows-msvc, zig build test-sync test-mod test-codegen, the full ReleaseFast DLL build, and zig build fmt.
  • The new mission requirements test checks:
    • exact records for login specs, including an empty list;
    • nothing for a target with missions on and mission_requirements off;
    • no re-upload when nothing changed;
    • only the changed spec is sent again;
    • a system's specs merge with the login specs instead of replacing them;
    • a float component value is sent in shortest form.
  • test-mod checks that the English example's new key is read.
  • In game: the same record logic, ported to the 1.1.10 release layout where it ran under missions, sent records to a private sync endpoint. Login produced 66 records (49 login specs, 17 active-mission specs). 3 had a type-3 requirement and the rest were []. Entering a system with mission givers produced that system's two specs. Nothing else in sync changed. The dev-layout build is compile- and unit-tested only, not run in game.
  • CI: build-win currently fails on the runner's newer MSVC toolset, with STL1000 in every unit including dependencies. This is unrelated to this change. The Linux and macOS jobs passed on the previous revision.

Settings and platforms

  • New option mission_requirements, off by default, under [sync] and per target.
  • For sync-site maintainers: nothing is sent unless a target opts in. Targets with missions on see no change.
  • Unchanged records are not re-sent within a session. A spec is sent again only when its requirement list changes. Volume is tens of records at login and a few per system entry.
  • The data is read-only and the client already receives it. There is no new hook, server call or game-side action. Not tested on macOS beyond CI.

🤖 Generated with Claude Code

Add an opt-in sync option, mission_requirements, off by default, that sends
one mission_requirement record per mission spec the client receives: the
MissionSpecs (login, active missions) and NodeMissions (system entry) entity
groups. Both merge into one stream, so a system's specs never remove the
login specs. Each record lists the spec's acceptance requirements as short
{t, ...} entries; an empty list is sent too. A spec is sent again only when
its list changes. Example settings list the option as false.

Refs STFC-Mod#389

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@blevouschurverantunt
blevouschurverantunt force-pushed the feature/sync-mission-requirements branch from ee5a2c0 to 5736682 Compare November 21, 2026 04:21
@blevouschurverantunt blevouschurverantunt changed the title feat: sync mission acceptance requirements (mission_requirement) Sync mission acceptance requirements (opt-in mission_requirements) Nov 21, 2026
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.

1 participant