fix(contracts): persist raid-zone objective progress (client-hosted raids)
Build & Deploy / build (push) Successful in 36s
Build & Deploy / build (push) Successful in 36s
Symptom: missions done in raid zones weren't saved -> contracts stuck on 'Objective not met', no claim possible. Root cause: client-hosted raids have no dedicated game server, so UpdatePlayerActiveContracts is never called (confirmed: 0 calls in prod logs). Only Kills and OwnNumOfItem objectives were handled; DeadDrop/VisitArea/ LootContainer had Progress[i]=0 forever -> unclaimable and not shown at station. Fix: EYContractObjectiveType.IsRaidRuntime() groups the objectives that can only be observed in a live raid (Kills/DeadDrop/VisitArea/LootContainer). Auto-credit them on deploy (EnterMatchmakingMatch, persisted) so the station shows them complete, and accept them in ClaimActiveContract. OwnNumOfItem still validated against the real stash; FactionLevel/CompletedMission unchanged. Added a defensive guard against a Progress array shorter than the objective list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -131,16 +131,17 @@ public class ClaimActiveContract : ICloudScriptFunction<FYClaimCompletedActiveCo
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (objective.Type == EYContractObjectiveType.Kills) {
|
||||
// Kill objectives can't be tracked in a client-hosted raid (no dedicated
|
||||
// game server reports kills). They are auto-credited on deploy
|
||||
// (EnterMatchmakingMatch); accept them here even if a contract was
|
||||
// activated before that so kill contracts remain completable.
|
||||
} else if (objective.Type.IsRaidRuntime()) {
|
||||
// Raid-runtime objectives (kills, dead-drops, visited areas, looted
|
||||
// containers) can't be tracked in a client-hosted raid — no dedicated
|
||||
// game server reports them, so their progress is never saved. They are
|
||||
// auto-credited on deploy (EnterMatchmakingMatch); accept them here too
|
||||
// (safety net for a contract activated after deploy) so these contracts
|
||||
// remain completable instead of being stuck on "Objective not met".
|
||||
remaining = 0;
|
||||
} else {
|
||||
// NOTE: A game server must write the correct progress
|
||||
// for other types of objectives.
|
||||
// The objectives are mapped by array index.
|
||||
// Meta objectives (FactionLevel / CompletedMission): validated from the
|
||||
// persisted progress. The objectives are mapped by array index.
|
||||
remaining -= targetContract.Progress[i];
|
||||
}
|
||||
if (remaining > 0) {
|
||||
|
||||
Reference in New Issue
Block a user