Documentation
¶
Index ¶
- Constants
- func DownloadMods(cacheDir string, modVersions []ModVersion, binaryType aumgr.BinaryType, ...) error
- func PrepareProfileDirectory(profileDir string, cacheDir string, modVersions []ModVersion, ...) error
- func ResolveDependencies(initialMods []ModVersion, provider VersionProvider) (map[string]ModVersion, error)
- func SaveInstallationInfo(gameRoot *os.Root, installation *ModInstallation) errordeprecated
- func UninstallMod(modInstallLocation *os.Root, progress progress.Progress, ...) error
- type CacheMetadata
- type HashCheckingWriter
- type InstallStatus
- type InstalledVersionInfo
- type Mod
- type ModDependencydeprecated
- type ModDependencyType
- type ModInstallationdeprecated
- type ModPackdeprecated
- type ModType
- type ModVersion
- func (m ModVersion) CompatibleFilesCount(binaryType aumgr.BinaryType) int
- func (m ModVersion) Downloads(binaryType aumgr.BinaryType) iter.Seq[model.ModVersionFile]
- func (m ModVersion) HasFeature(feature string) bool
- func (m ModVersion) IsCompatible(launcherType aumgr.LauncherType, binaryType aumgr.BinaryType, ...) bool
- type ProfileMetadata
- type RestoreInfo
- type VersionProvider
Constants ¶
const FeatureDirectJoin = "direct_join"
const InstallationInfoFileName = ".mod_installation"
Variables ¶
This section is empty.
Functions ¶
func DownloadMods ¶ added in v1.1.0
func DownloadMods(cacheDir string, modVersions []ModVersion, binaryType aumgr.BinaryType, progressListener progress.Progress, force bool) error
func PrepareProfileDirectory ¶ added in v1.1.0
func PrepareProfileDirectory(profileDir string, cacheDir string, modVersions []ModVersion, binaryType aumgr.BinaryType, gameVersion string, force bool, progressListener progress.Progress) error
PrepareProfileDirectory installs mods from cache to the profile directory and generates doorstop_config.ini.
func ResolveDependencies ¶ added in v1.1.0
func ResolveDependencies(initialMods []ModVersion, provider VersionProvider) (map[string]ModVersion, error)
ResolveDependencies recursively finds all required dependencies for a given set of mod versions. It returns a map of ModID to ModVersion containing all original mods and their required dependencies. The algorithm attempts to find the best compatible version combination, trying newer versions first but backtracking to older versions if conflicts arise. When multiple MODs require the same dependency, it merges constraints to find a version that satisfies all.
func SaveInstallationInfo
deprecated
func SaveInstallationInfo(gameRoot *os.Root, installation *ModInstallation) error
Deprecated: Should use profile.Profile to track installed mods instead.
func UninstallMod ¶
func UninstallMod(modInstallLocation *os.Root, progress progress.Progress, remainMods []ModVersion) error
For legacy support
Types ¶
type CacheMetadata ¶ added in v1.6.5
type CacheMetadata struct {
ModVersion ModVersion `json:"mod_version"`
}
type HashCheckingWriter ¶ added in v1.4.2
type InstallStatus ¶
type InstallStatus string
const ( InstallStatusCompatible InstallStatus = "compatible" InstallStatusIncompatible InstallStatus = "incompatible" InstallStatusBroken InstallStatus = "broken" InstallStatusUnknown InstallStatus = "unknown" )
type InstalledVersionInfo ¶ added in v1.1.0
type InstalledVersionInfo struct {
ModVersion `json:",inline"`
Paths []string `json:"paths"`
}
func UninstallRemainingMods ¶
func UninstallRemainingMods(modInstallLocation *os.Root, progress progress.Progress, remainMods []ModVersion) ([]InstalledVersionInfo, error)
type Mod ¶
type Mod struct {
model.ModDetails
}
type ModDependency
deprecated
type ModDependency struct {
ID string `json:"id"`
Version string `json:"version,omitempty"`
Type ModDependencyType `json:"type"`
}
Deprecated: use model.ModVersionDependency instead
type ModDependencyType ¶
type ModDependencyType = model.DependencyType
const ( ModDependencyTypeRequired ModDependencyType = model.DependencyTypeRequired ModDependencyTypeOptional ModDependencyType = model.DependencyTypeOptional ModDependencyTypeConflict ModDependencyType = model.DependencyTypeConflict ModDependencyTypeEmbedded ModDependencyType = model.DependencyTypeEmbedded )
type ModInstallation
deprecated
type ModInstallation struct {
FileVersion int `json:"file_version"`
InstalledMods []InstalledVersionInfo `json:"installed_mods"`
InstalledGameVersion string `json:"installed_game_version"`
Status InstallStatus `json:"status"`
// contains filtered or unexported fields
}
Deprecated: Should use profile.Profile to track installed mods instead.
func LoadInstallationInfo
deprecated
func LoadInstallationInfo(modInstallLocation *os.Root) (*ModInstallation, error)
Deprecated: Should use profile.Profile to track installed mods instead.
func (*ModInstallation) MarshalJSON ¶
func (mi *ModInstallation) MarshalJSON() ([]byte, error)
func (*ModInstallation) OldVanillaFiles ¶
func (mi *ModInstallation) OldVanillaFiles() []string
For file versions 0 and 1, return the list of vanilla files stored in the installation data.
func (*ModInstallation) UnmarshalJSON ¶
func (mi *ModInstallation) UnmarshalJSON(data []byte) error
type ModVersion ¶
type ModVersion struct {
model.ModVersionDetails
}
func (ModVersion) CompatibleFilesCount ¶
func (m ModVersion) CompatibleFilesCount(binaryType aumgr.BinaryType) int
func (ModVersion) Downloads ¶
func (m ModVersion) Downloads(binaryType aumgr.BinaryType) iter.Seq[model.ModVersionFile]
func (ModVersion) HasFeature ¶ added in v1.6.0
func (m ModVersion) HasFeature(feature string) bool
func (ModVersion) IsCompatible ¶
func (m ModVersion) IsCompatible(launcherType aumgr.LauncherType, binaryType aumgr.BinaryType, gameVersion string) bool
type ProfileMetadata ¶ added in v1.1.0
type ProfileMetadata struct {
GameVersion string `json:"game_version"`
BinaryType aumgr.BinaryType `json:"binary_type"`
ModVersions []ModVersion `json:"mod_versions"`
ModFiles []string `json:"mod_files,omitempty"`
}
func GetProfileMetadata ¶ added in v1.1.0
func GetProfileMetadata(profileDir string) (*ProfileMetadata, error)
type RestoreInfo ¶ added in v1.1.0
type VersionProvider ¶ added in v1.1.0
type VersionProvider interface {
GetModVersion(modID string, versionID string) (*ModVersion, error)
GetLatestModVersion(modID string) (*ModVersion, error)
GetModVersionIDs(modID string, limit int, after string) ([]string, error)
}
VersionProvider is an interface to fetch mod version details.