- Rudder.Core.dll rebuilt from csharp-sdk effects rewrite (96,768 bytes) - Realtime/ adapters, UnityRealtimeTransportFactory, UnityPlanStateStore, UnityPlanScheduler, WebGL jslib and RealtimeUrl config deleted (with .meta) - Scenarios sample rewired to client.Effects; samples login path updated - AGENTS.md/README/CHANGELOG/package docs + agent skill updated; realtime.md skill doc removed
2.8 KiB
Battle pass
client.BattlePass (BattlePassService), verified against the bundled
Rudder.Core.dll. There is no sample scene for this feature.
Progress is tied to a scenario battle-pass node. Prefer BattlePassEffect
delivered by Effects.OnBattlePass — it binds scenarioId/nodeId/
runId for you. Direct BattlePassService calls need those ids manually.
BattlePassEffect (preferred)
client.Effects.OnBattlePass += async effect =>
{
var progress = await effect.GetProgressAsync();
await effect.AddXpAsync("kills", 100);
var claim = await effect.ClaimRewardAsync(level, BattlePassService.TrackFree);
};
Task<GetBattlePassProgressResponse> GetProgressAsync(CancellationToken = default)Task<AddBattlePassXpResponse> AddXpAsync(string source, long amount, CancellationToken = default)Task<ClaimBattlePassRewardResponse> ClaimRewardAsync(int level, string track, CancellationToken = default)Task<PurchaseBattlePassPremiumResponse> PurchasePremiumAsync(CancellationToken = default)— postsonPremiumPurchaseon successLevelUp()/LevelUpAsync()— postsonLevelUpEnd()/EndAsync()— postsonCompleteGet<T>(key, fallback),RunId,ScenarioId,NodeId,Datalike other effects
BattlePassLevelEffect (from OnBattlePassLevel) has Claim() /
ClaimAsync() (posts onComplete) and a Level property.
BattlePassService (direct)
Task<GetBattlePassProgressResponse> GetProgressAsync(string scenarioId, string nodeId, CancellationToken = default)Task<AddBattlePassXpResponse> AddXpAsync(AddBattlePassXpRequest request, CancellationToken = default)Task<ClaimBattlePassRewardResponse> ClaimRewardAsync(ClaimBattlePassRewardRequest request, CancellationToken = default)Task<PurchaseBattlePassPremiumResponse> PurchasePremiumAsync(PurchaseBattlePassPremiumRequest request, CancellationToken = default)- Track constants:
BattlePassService.TrackFree,BattlePassService.TrackPremium(static fields).
Request models carry ScenarioId, NodeId, and (except progress)
RunId; PurchaseBattlePassPremiumRequest also takes IdempotencyKey.
Response models
GetBattlePassProgressResponse—Level(int?),Xp(long?),PremiumOwned(bool?),ClaimedTiers(List<ClaimedTier>:Level,Track).AddBattlePassXpResponse—Xp(long?),Level(int?),LeveledUp(bool?),MaxLevel(bool?).ClaimBattlePassRewardResponse—Success(bool?),AlreadyClaimed(bool?),Granted(List<Reward>),Error.PurchaseBattlePassPremiumResponse—Success(bool?),Error.
Business failures come back in the response (Success != true, Error)
with codes from RudderErrorCodes (LevelNotReached,
ObjectivesIncomplete, NodeNotActive, RunExpired, ...); transport
failures throw RudderApiException subclasses.