Skip to main content

Core contracts

Desktop calls Core interfaces directly. Bootstrapper.Initialize registers default implementations and accepts a callback for host services before building the provider

Contract map

AreaContractsResponsibility
ConfigurationIConfigStorePreferences and selected identifiers
ProgressIProgressReporterInstance-scoped progress and errors
VersionsIGameVersionCatalog, IVersionSourceVersion lists, metadata, source selection
MirrorsIMirrorCatalog, IMirrorDiscoveryPersistence, discovery, source construction
InstancesIInstanceRepository, IInstanceMigratorPaths, registry, order, selection, imports, migrations
DownloadsIFileDownloader, IPatchManager, IButlerClientTransfer and patch application
RuntimeIRuntimeProvisionerJava and Visual C++ prerequisites
LaunchIGameLaunchCoordinator, IGameInstallationWorkflow, IGameLauncherPreparation through process start
ProcessesIGameProcessTrackerProcess identity, events, restoration and exit
ConsoleIGameConsoleServicePer-instance output buffers and line events
ModsIModManagerCatalog, files, imports, state, updates and changelogs
Official authenticationIHytaleAuthenticator, IOAuthCallbackPageRendererOAuth, token refresh and callback page
ProfilesIProfileManager, IProfileRepository, IUserIdentityProviderActive identity, lifecycle and ordering
Character dataIAvatarCache, ISkinRepositoryAvatars and skins
Local NodeILocalNodeServiceFactory, ILocalNodeServicePer-launch node, trust and process attachment
Host capabilitiesIGpuProvider, IDiscordPresenceGPU discovery and activity reporting

Contracts are colocated with implementations. Application/Ports contains only host-supplied capabilities, not a central collection of all interfaces

Read an instance snapshot

A consumer receives the narrowest interface it needs. For example, this helper lists persisted instances without constructing the entire launch graph

using Hyprism.Core.Game.Instances;

static void PrintInstances(IInstanceRepository instances)
{
foreach (var instance in instances.GetCachedInstances())
Console.WriteLine($"{instance.Id}: {instance.Name}");
}

Address a launch explicitly

The host supplies browser presentation. This helper is intended for an already installed instance and uses the current active profile

using Hyprism.Core.Accounts;
using Hyprism.Core.Game;

static Task LaunchInstalledAsync(
IGameLaunchCoordinator coordinator,
string instanceId,
AuthUriPresenter openAuthorizationUri)
=> coordinator.LaunchAsync(instanceId, openAuthorizationUri);

For a new installation, call DownloadAndLaunchInstanceAsync on IGameInstallationWorkflow and inspect its result. The instance supplies an explicit branch and numeric version; the workflow does not choose a version implicitly. Cancel using CancelDownload(instanceId). See Game lifecycle for the distinction

ZIP imports must include Meta.json with an explicit numeric version. Archives without that metadata are rejected

Events and cancellation

Repositories raise InstancesChanged and ProfilesChanged after mutations. Process start and exit use typed events on IGameProcessTracker. IGameLaunchCoordinator.LaunchFailed reports failures or cancellation returned by its launch workflow; preflight rejections can report through progress or return early

Progress scopes associate nested asynchronous operations with the correct instance. Stage changes and completion bypass same-stage throttling. Hosts must dispatch UI updates and unsubscribe when disposed

Where a contract accepts CancellationToken, forward it through network and file I/O. Installation owns cancellation per instance instead of accepting a token on its public entry point

Mod installation contract

IModManager.InstallModFileToInstanceAsync resolves the selected CurseForge file and its required dependency graph before writing files. The operation installs dependencies depth-first, stores CurseForge relations in InstalledMod, and returns false for unresolved required dependencies, cycles, or installed incompatible mods. Optional relations are stored but are not installed automatically

IModManager.GetModDependenciesAsync resolves the required relations for a catalog file and enriches them with best-effort display names, versions, and icon URLs for the installation preview

GetInstanceInstalledMods also reads a root manifest.json from each JAR or ZIP and stores Hytale plugin identifiers, required and optional dependency ranges, and load-order hints. RemoveInstalledModAsync refuses to remove a mod referenced by another installed mod's required dependency list

Official authentication

IHytaleAuthenticator.LoginAsync creates an OAuth PKCE challenge and passes an authorization URI to the host. The callback renderer returns success or failure HTML to the browser. Session storage is profile-scoped through TokenStore

LoginAsync completes the loopback HTTP response before continuing with token exchange, so the browser can render the callback page while the launcher finishes authentication

Switching profiles reloads the current session. Version discovery may request a valid session from any official profile, while game launch uses the selected profile. Do not confuse download authorization with active player identity

Never log or copy access, refresh, identity, or game-session tokens into UI diagnostics. Official account concurrency is coordinated by OfficialLaunchGate and the persistent process registry

Desktop-only services

IDesktopSettingsStore adapts preferences for the UI. IHytaleNewsClient and IGitHubClient own presentation data. Native file pickers and URI launchers stay in Desktop

The launcher release version comes from Hyprism.Desktop.csproj and configures LauncherUserAgent once at startup. Consumers use that shared value instead of maintaining their own version strings

Source: IGameLaunchCoordinator, IProfileRepository

Edit this page on GitHub