Class InertAchievementPlatformGateway
A storefront gateway that exists but cannot reach its platform in this build: it accepts nothing, reports nothing, and explains itself exactly once.
Inheritance
Implements
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Platforms.Gateways
Assembly: Serenity.UnityAchievements.Infrastructure.dll
Syntax
public abstract class InertAchievementPlatformGateway : IAchievementPlatformGateway
Remarks
Every shipped gateway needs this shape, because the SDK that would make it real is absent far more often than it is present — in the editor, in a headless CI run, in a PC build that ships to no storefront, and in this repository, where none of the four SDKs is installed. Written once here so a gateway's own file carries only what is specific to its platform: its name and the sentence that tells the reader how to make it work.
Being inert is not being broken, so nothing here throws and nothing returns null. The warning is emitted once per instance rather than per call: the sync pass retries on a timer, and a per-call warning would bury the console under a fact that does not change.
Constructors
InertAchievementPlatformGateway(string, string, ILogService)
Initializes a gateway that cannot reach its platform.
Declaration
protected InertAchievementPlatformGateway(string platformName, string unavailableReason, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| string | platformName | The storefront this gateway stands for, reported even while inert. |
| string | unavailableReason | Why the platform cannot be reached, and what the reader should do about it. |
| ILogService | logService | Logging service used for the single warning. May be |
Properties
IsAvailable
Declaration
public bool IsAvailable { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Always false. A gateway with no SDK behind it is never reachable.
PlatformName
Declaration
public string PlatformName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
ClearAsync(CancellationToken)
Declaration
public Task<bool> ClearAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
InitializeAsync(CancellationToken)
Declaration
public Task<bool> InitializeAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
QueryUnlockedAsync(CancellationToken)
Declaration
public Task<PlatformUnlockQueryResult> QueryUnlockedAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<PlatformUnlockQueryResult> |
Remarks
Answered, not unreachable: an inert template has no SDK to fail, so the account it reports (empty) is not a guess — it is simply the whole truth this build can offer.
SetProgressAsync(AchievementDefinition, long, long, CancellationToken)
Declaration
public Task<bool> SetProgressAsync(AchievementDefinition definition, long current, long target, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementDefinition | definition | |
| long | current | |
| long | target | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
UnlockAsync(AchievementDefinition, CancellationToken)
Declaration
public Task<bool> UnlockAsync(AchievementDefinition definition, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementDefinition | definition | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |