LaunchBoxContributors
On this page

IPlayerProfileManager14.1

Interface in Unbroken.LaunchBox.Plugins.Services.Profiles

C#
public interface IPlayerProfileManager
Provides the configured player's profile from any installed profile provider, independently of achievement support.

Remarks

Request this service by declaring a public constructor with an IPlayerProfileManager parameter and call asynchronously after activation. Reads never sign in, change accounts, or expose credentials or provider instances. Caller cancellation throws OperationCanceledException; retrieval problems are reported in results. Recent player activity is separate from the profile.

Methods

  • GetAsyncReads the configured player's profile, reusing a recent host observation after confirming the selected account.
  • GetSourcesAsyncLists registered profile sources without querying accounts or making network requests.
  • RefreshAsyncRefreshes the configured player's profile, bypassing the host's recent observation cache.

GetAsync

C#
Task<PluginServiceResult<PlayerProfile>> GetAsync(
    string sourceId,
    CancellationToken cancellationToken
)
Reads the configured player's profile, reusing a recent host observation after confirming the selected account.
sourceId
The profile source identity.
cancellationToken
Cancels retrieval.

Returns

The existing PlayerProfile payload and explicit retrieval state. Account resolution and an expired cache can require provider requests. Saved data can be returned when the provider is unavailable or retrieval fails for the same confirmed account.

GetSourcesAsync

C#
Task<IReadOnlyList<PluginSourceInfo>> GetSourcesAsync(
    CancellationToken cancellationToken
)
Lists registered profile sources without querying accounts or making network requests.
cancellationToken
Cancels the operation.

Returns

One entry per source, including disabled or conflicting sources marked unavailable. Removed sources are omitted; saved profiles can still be read by a known source ID.

RefreshAsync

C#
Task<PluginServiceResult<PlayerProfile>> RefreshAsync(
    string sourceId,
    CancellationToken cancellationToken
)
Refreshes the configured player's profile, bypassing the host's recent observation cache.
sourceId
The profile source identity.
cancellationToken
Cancels retrieval.

Returns

The refreshed profile or an explicit unavailable, unconfigured, incomplete, or failed result. A confirmed account change retires the previous profile even if fetching the replacement fails.