IPlayerActivityManager14.1
Interface in Unbroken.LaunchBox.Plugins.Services.Activity
public interface IPlayerActivityManagerProvides recent games and optional recent unlocks for the configured player, independently of profiles, achievements, and library playtime synchronization.
Remarks
Request this service by declaring a public constructor with an IPlayerActivityManager parameter and call asynchronously after activation. Reads never sign in, change accounts, or modify library statistics. Caller cancellation throws OperationCanceledException; retrieval problems are reported in results. Each request resolves the selected account independently, so separate pages are not a fixed historical snapshot.Methods
GetAsyncReads a page of the configured player's activity, reusing a recent observation after confirming the selected account.GetSourcesAsyncLists registered activity sources without querying accounts or making network requests.RefreshAsyncRefreshes the requested activity page, bypassing its recent observation cache.
GetAsync
Task<PluginServiceResult<PlayerActivityPage>> GetAsync(
string sourceId,
PlayerActivityRequest? request,
CancellationToken cancellationToken
)Reads a page of the configured player's activity, reusing a recent observation after confirming the selected account.
sourceId- The activity source identity.
request- Page bounds and recent unlock count, or null for the default window. Both counts must be from zero through 100; the offset must be nonnegative and its sum with the page size must fit in an Int32.
cancellationToken- Cancels retrieval.
Returns
The requested page with its observed account identity and retrieval state. Fewer games than requested on Success means the end of the list. Null data is unavailable, distinct from an empty successful page with a known account. Achievement sections can be null when unsupported or unknown.Remarks
Account resolution and cache misses can make provider requests. The default 10-game, 10-achievement window at offset zero shares the persisted frontend cache. Other request windows use a bounded memory cache. Inspect Status, IsStale, and ObservedAt when using retained data.GetSourcesAsync
Task<IReadOnlyList<PluginSourceInfo>> GetSourcesAsync(
CancellationToken cancellationToken
)Lists registered activity sources without querying accounts or making network requests.
cancellationToken- Cancels discovery.
Returns
One entry per registered source, including disabled or conflicting sources marked unavailable. Removed sources are omitted.RefreshAsync
Task<PluginServiceResult<PlayerActivityPage>> RefreshAsync(
string sourceId,
PlayerActivityRequest? request,
CancellationToken cancellationToken
)Refreshes the requested activity page, bypassing its recent observation cache.
sourceId- The activity source identity.
request- Page bounds and recent unlock count, or null for the default window. Both counts must be from zero through 100; the offset must be nonnegative and its sum with the page size must fit in an Int32.
cancellationToken- Cancels retrieval.