valheim

package
v1.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SeedLength = 10
)
View Source
const (
	// SteamAppID is Valheim's Steam app ID
	// which can be passed to `steamcmd`'s
	// `app_update` command.
	SteamAppID = "896660"
)

Variables

View Source
var (
	AdminListName     = "adminlist.txt"
	BannedListName    = "bannedlist.txt"
	PermittedListName = "permittedlist.txt"
)
View Source
var (
	// BepInEx is the thunderstore.io
	// BepInEx package for Valheim.
	BepInEx = &thunderstore.Package{
		Namespace: "denikson",
		Name:      "BepInExPack_Valheim",
	}
)

Functions

func NewCommand

func NewCommand(ctx context.Context, dir string, opts *Opts) (*exec.Cmd, error)

NewCommand builds an *exec.Cmd for the Valheim executable in the given directory with the given options.

func OpenDB added in v1.3.0

func OpenDB(savedir, world string) (io.ReadCloser, error)

func OpenFWL added in v1.3.0

func OpenFWL(savedir, world string) (io.ReadCloser, error)

func ReadPlayerList added in v1.0.0

func ReadPlayerList(r io.Reader) ([]int64, error)

func ReadSeed added in v1.0.0

func ReadSeed(r io.Reader, world string) (string, error)

func ReadWorldSeed added in v1.0.0

func ReadWorldSeed(savedir, world string) (string, error)

func WritePlayerList added in v1.0.0

func WritePlayerList(w io.Writer, playerIDs []int64) error

func WritePlayerListFile added in v1.0.0

func WritePlayerListFile(name string, playerIDs []int64) error

func WritePlayerLists added in v1.0.0

func WritePlayerLists(savedir string, playerLists *PlayerLists) error

Types

type CombatModifier added in v1.1.0

type CombatModifier string
var (
	CombatModifierVeryEasy CombatModifier = "veryeasy"
	CombatModifierEasy     CombatModifier = "easy"
	CombatModifierHard     CombatModifier = "hard"
	CombatModifierVeryHard CombatModifier = "veryhard"
)

func (CombatModifier) String added in v1.1.0

func (m CombatModifier) String() string

type DeathPenaltyModifier added in v1.1.0

type DeathPenaltyModifier string
var (
	DeathPenaltyModifierCasual   DeathPenaltyModifier = "casual"
	DeathPenaltyModifierVeryEasy DeathPenaltyModifier = "veryeasy"
	DeathPenaltyModifierEasy     DeathPenaltyModifier = "easy"
	DeathPenaltyModifierHard     DeathPenaltyModifier = "hard"
	DeathPenaltyModifierHardcore DeathPenaltyModifier = "hardcore"
)

func (DeathPenaltyModifier) String added in v1.1.0

func (m DeathPenaltyModifier) String() string

type Opts

type Opts struct {
	Name     string
	Port     int64
	World    string
	Password string
	SaveDir  string

	Public bool

	LogFile string

	SaveInterval time.Duration
	Backups      int64
	BackupShort  time.Duration
	BackupLong   time.Duration

	Crossplay bool

	InstanceID string

	Preset

	CombatModifier
	DeathPenaltyModifier
	ResourceModifier
	RaidModifier
	PortalModifier

	NoBuildCost  bool
	PlayerEvents bool
	PassiveMobs  bool
	NoMap        bool
}

Opts is a helper struct to build arguments to pass to the Valheim executable.

func (*Opts) ToArgs

func (o *Opts) ToArgs() []string

ToArgs transforms Opts into an array of strings to pass to the Valheim Executable.

type PlayerLists added in v1.0.0

type PlayerLists struct {
	AdminIDs     []int64
	BannedIDs    []int64
	PermittedIDs []int64
}

type PortalModifier added in v1.1.0

type PortalModifier string
var (
	PortalModifierCasual   PortalModifier = "casual"
	PortalModifierHard     PortalModifier = "hard"
	PortalModifierVeryHard PortalModifier = "veryhard"
)

func (PortalModifier) String added in v1.1.0

func (m PortalModifier) String() string

type Preset added in v1.1.0

type Preset string
var (
	PresetNormal    Preset = "normal"
	PresetCasual    Preset = "casual"
	PresetEasy      Preset = "easy"
	PresetHard      Preset = "hard"
	PresetHardcore  Preset = "hardcore"
	PresetImmersive Preset = "immersive"
	PresetHammer    Preset = "hammer"
)

func (Preset) String added in v1.1.0

func (p Preset) String() string

type RaidModifier added in v1.1.0

type RaidModifier string
var (
	RaidModifierNone     RaidModifier = "none"
	RaidModifierMuchLess RaidModifier = "muchless"
	RaidModifierLess     RaidModifier = "less"
	RaidModifierMore     RaidModifier = "more"
	RaidModifierMuchMore RaidModifier = "muchmore"
)

func (RaidModifier) String added in v1.1.0

func (m RaidModifier) String() string

type ResourceModifier added in v1.1.0

type ResourceModifier string
var (
	ResourceModifierMuchLess ResourceModifier = "muchless"
	ResourceModifierLess     ResourceModifier = "less"
	ResourceModifierMore     ResourceModifier = "more"
	ResourceModifierMuchMore ResourceModifier = "muchmore"
	ResourceModifierMost     ResourceModifier = "most"
)

func (ResourceModifier) String added in v1.1.0

func (m ResourceModifier) String() string

Jump to

Keyboard shortcuts

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