logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IAchievementDefinitionSyncConnector

    Application port for reading and writing achievement definitions — display text, icons, hidden flag, progress target — on one storefront's editor-facing API (Steam, Xbox, Epic, PlayStation).

    Namespace: Serenity.Achievements.Application.Sync.Connectors
    Assembly: Serenity.Achievements.Application.dll
    Syntax
    public interface IAchievementDefinitionSyncConnector
    Remarks

    This is the editor-time sibling of IAchievementPlatformGateway, which stays deliberately unlock-state-only: that gateway ships inside the game and talks to a storefront client at runtime to unlock or advance an achievement a player already earned, on whatever machine the player is running. A definition sync connector does the opposite job — it runs only in the editor, talks to a storefront's authoring/publishing API instead of its runtime client, and moves the achievement's own metadata rather than a player's progress through it. Neither port should grow the other's responsibility: a gateway that started editing display names would need editor-only credentials in a runtime assembly, and a connector that unlocked achievements would run authoring-time code against a real account.

    Implementations live editor-side (an editor assembly, never shipped in a build) and are looked up by Platform rather than referenced by concrete type, so the sync window can list whichever connectors happen to be installed. Capabilities must be honest — see its own remarks — because the sync UI builds its checkboxes and disabled buttons straight from it.

    Properties

    Capabilities

    What this connector can and cannot do.

    Declaration
    AchievementSyncCapabilities Capabilities { get; }
    Property Value
    Type Description
    AchievementSyncCapabilities

    DisplayName

    The human-readable name shown for this connector in the sync window.

    Declaration
    string DisplayName { get; }
    Property Value
    Type Description
    string

    Platform

    The storefront this connector talks to.

    Declaration
    AchievementPlatformKind Platform { get; }
    Property Value
    Type Description
    AchievementPlatformKind

    Methods

    CheckConnectionAsync(CancellationToken)

    Checks whether the platform is currently reachable.

    Declaration
    Task<AchievementSyncConnectionCheck> CheckConnectionAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Token used to cancel the operation.

    Returns
    Type Description
    Task<AchievementSyncConnectionCheck>

    The connection check result.

    DownloadIconAsync(AchievementStorefrontIcon, CancellationToken)

    Downloads one icon the platform offered while a snapshot was pulled.

    Declaration
    Task<AchievementIconDownload> DownloadIconAsync(AchievementStorefrontIcon icon, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AchievementStorefrontIcon icon

    The icon the snapshot offered.

    CancellationToken cancellationToken

    Token used to cancel the operation.

    Returns
    Type Description
    Task<AchievementIconDownload>

    The image, already checked to decode, or why there is none.

    Remarks

    Called only while a pull is applied, once per icon the author accepted, never while it is planned or previewed. A connector that offers no icons answers every call with a failed download. An implementation must not throw for an address it refuses, an answer it cannot use or a transport failure: each is a failed download, so one icon cannot end the rest of the pull.

    PullSnapshotAsync(CancellationToken)

    Reads back every achievement the platform currently lists.

    Declaration
    Task<AchievementStorefrontSnapshot> PullSnapshotAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Token used to cancel the operation.

    Returns
    Type Description
    Task<AchievementStorefrontSnapshot>

    A snapshot of the platform's achievement list.

    PushAsync(AchievementPushBatch, IProgress<AchievementSyncProgress>, CancellationToken)

    Sends a batch of achievement definitions to the platform.

    Declaration
    Task<AchievementPushOutcome> PushAsync(AchievementPushBatch batch, IProgress<AchievementSyncProgress> progress, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    AchievementPushBatch batch

    The achievements and locales to send.

    IProgress<AchievementSyncProgress> progress

    Reports progress as the batch is sent. May be null.

    CancellationToken cancellationToken

    Token used to cancel the operation.

    Returns
    Type Description
    Task<AchievementPushOutcome>

    What the platform accepted, and what failed.

    In this article
    © 2026 Serenity. All Rights Reserved