config

package
v1.0.49 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFileName = "SSM.json"
	ConfigFile     = ""
	SSMHomeDir     = ""
)

Functions

func LoadConfigFile

func LoadConfigFile()

func SaveConfig

func SaveConfig()

func SetDefaultValues

func SetDefaultValues()

func UpdateIniFiles

func UpdateIniFiles() error

Types

type Backup

type Backup struct {
	Keep       int       `json:"keep"`
	Interval   int       `json:"interval"`
	NextBackup time.Time `json:"nextBackup"`
}

type Config

type Config struct {
	HomeDir       string   `json:"homedir"`
	DataDir       string   `json:"datadir"`
	SFDir         string   `json:"sfdir"`
	LogDir        string   `json:"logdir"`
	BackupDir     string   `json:"backupdir"`
	SFConfigDir   string   `json:"sfconfigdir"`
	ModsDir       string   `json:"sfmodsdir"`
	ModConfigsDir string   `json:"sfmodconfigsdir"`
	APIKey        string   `json:"apikey"`
	URL           string   `json:"ssmurl"`
	SF            SFConfig `json:"sf"`
	Version       string   `json:"version"`
	Backup        Backup   `json:"backup"`
}

func GetConfig

func GetConfig() *Config

type SFConfig

type SFConfig struct {
	PortOffset           int    `json:"portOffset"`
	UpdateSFOnStart      bool   `json:"updateSFOnStart"`
	AutoRestart          bool   `json:"autoRestart"`
	AutoPause            bool   `json:"autoPause"`
	AutoSaveOnDisconnect bool   `json:"autoSaveOnDisconnect"`
	SFBranch             string `json:"sfbranch"`
	InstalledVer         int    `json:"installedVer"`
	AvilableVer          int    `json:"avaliableVer"`
	WorkerThreads        int    `json:"workerThreads"`
	MaxPlayers           int    `json:"maxPlayers"`
}

Jump to

Keyboard shortcuts

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