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:
@@ -72,6 +72,21 @@ public enum EYContractObjectiveType {
|
||||
MAX = 8
|
||||
}
|
||||
|
||||
public static class ContractObjectiveTypeExtensions {
|
||||
// Objectives that can only be observed while a raid is running (kills, dead-drops,
|
||||
// visiting an area, looting a container). The raid is hosted by the player's own
|
||||
// client and there is no dedicated game server, so their progress is never reported
|
||||
// to the backend (UpdatePlayerActiveContracts is never called). They are therefore
|
||||
// auto-credited server-side, otherwise these contracts can never be completed.
|
||||
// OwnNumOfItem is excluded (validated against the real stash) and so are the meta
|
||||
// objectives FactionLevel / CompletedMission (validated from persisted player data).
|
||||
public static bool IsRaidRuntime(this EYContractObjectiveType type) =>
|
||||
type is EYContractObjectiveType.Kills
|
||||
or EYContractObjectiveType.DeadDrop
|
||||
or EYContractObjectiveType.VisitArea
|
||||
or EYContractObjectiveType.LootContainer;
|
||||
}
|
||||
|
||||
public enum EYContractDifficulty
|
||||
{
|
||||
Invalid = 0,
|
||||
|
||||
Reference in New Issue
Block a user