common

package
v1.0.18-0...-26f8a7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllBranches = []struct {
	Value  GameBranch
	TSName string
}{
	{BranchStable, "STABLE"},
	{BranchExperimental, "EXPERIMENTAL"},
}
View Source
var AllInstallTypes = []struct {
	Value  InstallType
	TSName string
}{
	{InstallTypeWindowsClient, "WINDOWS"},
	{InstallTypeWindowsServer, "WINDOWS_SERVER"},
	{InstallTypeLinuxServer, "LINUX_SERVER"},
}
View Source
var AllLocationTypes = []struct {
	Value  LocationType
	TSName string
}{
	{LocationTypeLocal, "LOCAL"},
	{LocationTypeRemote, "REMOTE"},
}

Functions

func OsPathEqual

func OsPathEqual(path1, path2 string) bool

Types

type GameBranch

type GameBranch string
var (
	BranchStable       GameBranch = "Stable"
	BranchExperimental GameBranch = "Experimental"
)

type GameVersionFile

type GameVersionFile struct {
	MajorVersion         int    `json:"MajorVersion"`
	MinorVersion         int    `json:"MinorVersion"`
	PatchVersion         int    `json:"PatchVersion"`
	Changelist           int    `json:"Changelist"`
	CompatibleChangelist int    `json:"CompatibleChangelist"`
	IsLicenseeVersion    int    `json:"IsLicenseeVersion"`
	IsPromotedBuild      int    `json:"IsPromotedBuild"`
	BranchName           string `json:"BranchName"`
	BuildID              string `json:"BuildId"`
}

type InstallFindError

type InstallFindError struct {
	Inner error  `json:"cause"`
	Path  string `json:"path"`
}

func (InstallFindError) Cause

func (e InstallFindError) Cause() error

func (InstallFindError) Error

func (e InstallFindError) Error() string

type InstallFinderFunc

type InstallFinderFunc func() ([]*Installation, []error)

type InstallType

type InstallType string
var (
	InstallTypeWindowsClient InstallType = "WindowsClient"
	InstallTypeWindowsServer InstallType = "WindowsServer"
	InstallTypeLinuxServer   InstallType = "LinuxServer"
)

func GetGameInfo

func GetGameInfo(path string, platform Platform) (InstallType, int, string, error)

type Installation

type Installation struct {
	Path       string       `json:"path"`
	Version    int          `json:"version"`
	Type       InstallType  `json:"type"`
	Location   LocationType `json:"location"`
	Branch     GameBranch   `json:"branch"`
	Launcher   string       `json:"launcher"`
	LaunchPath []string     `json:"launchPath"`
	SavedPath  string       `json:"-"`
}

func FindAll

func FindAll(finders ...InstallFinderFunc) ([]*Installation, []error)

type LauncherPlatform

type LauncherPlatform struct {
	Platform
	// contains filtered or unexported fields
}

func MakeLauncherPlatform

func MakeLauncherPlatform(platform Platform, launcherCommand func(arg string) []string) LauncherPlatform

func (LauncherPlatform) LauncherCommand

func (p LauncherPlatform) LauncherCommand(arg string) []string

type LocationType

type LocationType string
var (
	LocationTypeLocal  LocationType = "Local"
	LocationTypeRemote LocationType = "Remote"
)

type Platform

type Platform interface {
	ProcessPath(path string) string
	CacheDir() (string, error)
	Os() string
}

func NativePlatform

func NativePlatform() Platform

func WineLauncherPlatform

func WineLauncherPlatform(winePrefix string) Platform

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL