logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IAchievementScreenshotStore

    Application port for storing the screenshot captured alongside an unlock.

    Namespace: Serenity.Achievements.Application.Interfaces.Repositories
    Assembly: Serenity.Achievements.Application.dll
    Syntax
    public interface IAchievementScreenshotStore
    Remarks

    Screenshots are addressed by an opaque key the store hands back; the unlock record stores only that key, never the bytes.

    Methods

    DeleteAllAsync(PlayerId, CancellationToken)

    Removes every screenshot stored for a player.

    Declaration
    Task DeleteAllAsync(PlayerId player, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    PlayerId player

    The player to clear.

    CancellationToken cancellationToken

    Token used to cancel the operation.

    Returns
    Type Description
    Task

    SaveAsync(PlayerId, AchievementId, byte[], CancellationToken)

    Stores the screenshot bytes for an unlock and returns the key to read them back by.

    Declaration
    Task<string> SaveAsync(PlayerId player, AchievementId achievement, byte[] pngBytes, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    PlayerId player

    The player the unlock belongs to.

    AchievementId achievement

    The achievement that was unlocked.

    byte[] pngBytes

    The encoded PNG bytes to store.

    CancellationToken cancellationToken

    Token used to cancel the operation.

    Returns
    Type Description
    Task<string>

    The key the screenshot can be read back by, or null when nothing was stored.

    In this article
    © 2026 Serenity. All Rights Reserved