Documentation ¶
Index ¶
- Constants
- Variables
- func NewCommand(ctx context.Context, dir string, opts *Opts) (*exec.Cmd, error)
- func OpenDB(savedir, world string) (io.ReadCloser, error)
- func OpenFWL(savedir, world string) (io.ReadCloser, error)
- func ReadPlayerList(r io.Reader) ([]int64, error)
- func ReadSeed(r io.Reader, world string) (string, error)
- func ReadWorldSeed(savedir, world string) (string, error)
- func WritePlayerList(w io.Writer, playerIDs []int64) error
- func WritePlayerListFile(name string, playerIDs []int64) error
- func WritePlayerLists(savedir string, playerLists *PlayerLists) error
- type CombatModifier
- type DeathPenaltyModifier
- type Opts
- type PlayerLists
- type PortalModifier
- type Preset
- type RaidModifier
- type ResourceModifier
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 ¶
NewCommand builds an *exec.Cmd for the Valheim executable in the given directory with the given options.
func ReadWorldSeed ¶ added in v1.0.0
func WritePlayerListFile ¶ added in v1.0.0
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.
type PlayerLists ¶ added in v1.0.0
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 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
Click to show internal directories.
Click to hide internal directories.