IPlayerActivityCapability14.1
Interface in Unbroken.LaunchBox.Plugins.Capabilities.Activity
public interface IPlayerActivityCapability : IPluginComponentMetadataSupplies recent player activity independently of profiles and library playtime synchronization.
Remarks
Implement on an existing managed component; no separate activation, profile, or achievement capability is required. Use the shared connection capability to signal account changes. Reads must not initiate sign-in or change the configured account.Inheritance and interfaces
Properties
ActivitySourceIdGets the stable logical activity source ID. Use the associated profile, storefront, or achievement source ID where applicable.
ActivitySourceId
string ActivitySourceId { get; }Gets the stable logical activity source ID. Use the associated profile, storefront, or achievement source ID where applicable.
Remarks
Game IDs use the same namespace as other capabilities sharing this logical source ID. Separate logical source IDs are required for different game-ID namespaces.Methods
GetCurrentAccountIdAsyncGets the currently selected service account ID, independent of connection handles.GetRecentGamesAsyncRetrieves recent games for a player, including games outside the host library.
GetCurrentAccountIdAsync
Task<string?> GetCurrentAccountIdAsync(CancellationToken cancellationToken)Gets the currently selected service account ID, independent of connection handles.
cancellationToken- Cancels account resolution.
Returns
The selected player ID, or null when no player is selected. Throw when the account cannot be determined; failure must not be reported as logout.GetRecentGamesAsync
Task<IReadOnlyList<PlayerActivityGame>?> GetRecentGamesAsync(
string accountId,
PlayerActivityRequest request,
CancellationToken cancellationToken
)Retrieves recent games for a player, including games outside the host library.
accountId- The requested service account ID.
request- The nonnull page bounds and maximum number of recent achievements per game.
cancellationToken- Cancels retrieval.
Returns
The requested page in most-recent-first order. Fewer games than requested indicates the end of the list; an empty collection means no games at that offset, or null when activity is unavailable. Unsupported achievement sections remain null. Account IDs in progress observations must use the requested player's canonical identity.- Exception: ArgumentOutOfRangeException
- A numeric bound is negative or the offset plus page size exceeds Int32.MaxValue.
- Exception: NotSupportedException
- The requested activity selection cannot be supported, including an offset the provider cannot honor. The host reports Unsupported; providers must not substitute the first page. Unsupported achievement details alone remain null sections.