Class EpicAchievementGateway
Reference template for mirroring unlocks to Epic Online Services achievements. Reports itself unavailable and writes nothing.
Implements
Inherited Members
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
PlatformInterfacethe project already created from its product, sandbox, deployment and client credentials — the four fieldsUnityEpicAchievementPlatformDefinitioncarries — and tick it every frame. EOS does nothing betweenPlatformInterface.Tick()calls. - Reach achievements through
PlatformInterface.GetAchievementsInterface(), and the signed-in player throughGetConnectInterface().GetLoggedInProductUserByIndex(0). Achievements are keyed byProductUserId, not by the Epic account id. - Unlock with
UnlockAchievements(ref UnlockAchievementsOptions { UserId, AchievementIds }), where the ids areAchievementPlatformMapping.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
QueryPlayerAchievementsand thenCopyPlayerAchievementByAchievementIdper id; the copied struct'sUnlockTimeis 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.IngestStatagainst 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. |