0.3.0: UGC removed, battlepass context-carrying API, scenario behavior aligned with web SDK, CI publish
CI / check (push) Successful in 50s
CI / publish (push) Failing after 37s

This commit is contained in:
edmand46
2026-08-19 17:48:58 +03:00
parent 9d8fb29a7c
commit 2a8d5d4f2f
22 changed files with 234 additions and 388 deletions
@@ -3,7 +3,11 @@ using System.Threading.Tasks;
namespace RudderSdk.Core;
/// <summary>Session of a scenario battle-pass-level node.</summary>
/// <summary>
/// Session of a scenario battle-pass-level node — a single claimable tier.
/// <see cref="ClaimAsync"/> crosses onComplete, which the server accepts only
/// once the player has reached the node's configured level.
/// </summary>
public sealed class BattlePassLevelSession
{
internal BattlePassLevelSession(ScenarioNodeContext context) => Context = context;
@@ -14,12 +18,15 @@ public sealed class BattlePassLevelSession
/// <summary>Node id.</summary>
public string Id => Context.NodeId;
/// <summary>The tier level this node claims.</summary>
public int Level => Context.Get("levelNumber", 0);
/// <summary>Reads a typed value from the node data.</summary>
public T Get<T>(string key, T defaultValue = default!) => Context.Get(key, defaultValue);
/// <summary>Advances the run through the onComplete handle.</summary>
public Task CompleteAsync(CancellationToken cancellationToken = default) => Context.CompleteAsync("onComplete", cancellationToken);
/// <summary>Claims this tier; crosses onComplete (the server checks the level was reached).</summary>
public Task ClaimAsync(CancellationToken cancellationToken = default) => Context.CompleteAsync("onComplete", cancellationToken);
/// <summary>Advances the run through the onComplete handle (fire-and-forget).</summary>
public void Complete() => Context.Complete("onComplete");
/// <summary>Claims this tier (fire-and-forget).</summary>
public void Claim() => Context.Complete("onComplete");
}