0.3.0: UGC removed, battlepass context-carrying API, scenario behavior aligned with web SDK, CI publish
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user