logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class EpicAchievementGateway

    Reference template for mirroring unlocks to Epic Online Services achievements. Reports itself unavailable and writes nothing.

    Inheritance
    object
    InertAchievementPlatformGateway
    EpicAchievementGateway
    Implements
    IAchievementPlatformGateway
    Inherited Members
    InertAchievementPlatformGateway.InitializeAsync(CancellationToken)
    InertAchievementPlatformGateway.UnlockAsync(AchievementDefinition, CancellationToken)
    InertAchievementPlatformGateway.SetProgressAsync(AchievementDefinition, long, long, CancellationToken)
    InertAchievementPlatformGateway.QueryUnlockedAsync(CancellationToken)
    InertAchievementPlatformGateway.ClearAsync(CancellationToken)
    InertAchievementPlatformGateway.PlatformName
    InertAchievementPlatformGateway.IsAvailable
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Achievements.Infrastructure.Platforms.Gateways
    Assembly: Serenity.UnityAchievements.Infrastructure.dll
    Syntax
    public sealed class EpicAchievementGateway : InertAchievementPlatformGateway, IAchievementPlatformGateway
    Remarks

    The EOS C# SDK is downloaded from the Epic developer portal under its own agreement and is not redistributable, so it cannot ship inside Serenity and this type stays inert. The define SERENITY_ACHIEVEMENTS_EOS is reserved now so a licensee's build wiring does not have to change later; the real branch lands when redistribution is signed off.

    To write real achievements today, implement IAchievementPlatformGateway in your own assembly — where you may reference the SDK — and register it through SetFactory(Func<IAchievementPlatformGateway>). The registry is consulted before the platform definition assets, so no Serenity source needs editing and the override survives a package update.

    What such an implementation has to do, and the knowledge this template exists to preserve:

    • Take the PlatformInterface the project already created from its product, sandbox, deployment and client credentials — the four fields UnityEpicAchievementPlatformDefinition carries — and tick it every frame. EOS does nothing between PlatformInterface.Tick() calls.
    • Reach achievements through PlatformInterface.GetAchievementsInterface(), and the signed-in player through GetConnectInterface().GetLoggedInProductUserByIndex(0). Achievements are keyed by ProductUserId, not by the Epic account id.
    • Unlock with UnlockAchievements(ref UnlockAchievementsOptions { UserId, AchievementIds }), where the ids are AchievementPlatformMapping.EpicAchievementId. The call is asynchronous: the completion delegate carries the result code, so the gateway's Task completes there rather than at the call.
    • Read the account back with QueryPlayerAchievements and then CopyPlayerAchievementByAchievementId per id; the copied struct's UnlockTime is what says "unlocked".
    • Progress is NOT written through the achievements interface. An EOS achievement unlocks when the stat thresholds its definition names are met, so progress is StatsInterface.IngestStat against the stat the portal bound to it — which means a project must author that binding before progress does anything.
    • There is no clear outside the developer portal's own reset. Answer false rather than pretending.

    Constructors

    EpicAchievementGateway(AchievementPlatformGatewayContext)

    Initializes the Epic template gateway.

    Declaration
    public EpicAchievementGateway(AchievementPlatformGatewayContext context)
    Parameters
    Type Name Description
    AchievementPlatformGatewayContext context

    The gateway context. Only its log service is read while inert.

    Implements

    IAchievementPlatformGateway
    In this article
    © 2026 Serenity. All Rights Reserved