Table of Contents

Class AppSettingsService

Namespace
McServerLauncher.Services
Assembly
McServerLauncher.dll

Loads and saves the global settings in %APPDATA%\McServerLauncher\settings.json.

public class AppSettingsService
Inheritance
AppSettingsService
Inherited Members

Constructors

AppSettingsService(string?)

Default constructor uses %APPDATA%; dataDir is for tests.

public AppSettingsService(string? dataDir = null)

Parameters

dataDir string

Properties

LastSaveCouldNotProtectKey

True when the last Save(AppSettings) could not encrypt the Playit key: the key was NOT written to disk (a secret is never persisted in plaintext) and keeps working only for this session. The failure is also recorded in the daily log; the UI shows a one-time warning.

public bool LastSaveCouldNotProtectKey { get; }

Property Value

bool

Methods

Load()

public AppSettings Load()

Returns

AppSettings

LoadLanguage()

The saved language and nothing else, for before any window exists.

public string? LoadLanguage()

Returns

string

Remarks

App needs only this, and used to call Load() for it — decrypting the Playit keys and, for an older file, migrating and saving it — just before the main view model did all of that again.

Save(AppSettings)

public void Save(AppSettings settings)

Parameters

settings AppSettings