game

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRestartRequested = errors.New("restart requested")
)

Functions

func DetectAndUpdateVersion

func DetectAndUpdateVersion(config *runner.Config) error

func DetectServerVersion

func DetectServerVersion() (string, error)

func DownloadServerJar

func DownloadServerJar(url, savePath string) error

Types

type BeforeLaunchFunc

type BeforeLaunchFunc func(l *Launcher)

type Launcher

type Launcher struct {
	Rcon *Rcon
	// contains filtered or unexported fields
}

func NewLauncher

func NewLauncher(config *runner.Config, world *world.WorldService) *Launcher

func (*Launcher) AddToOp

func (l *Launcher) AddToOp(players []string)

func (*Launcher) AddToWhiteList

func (l *Launcher) AddToWhiteList(players []string)

func (*Launcher) Launch

func (l *Launcher) Launch() error

func (*Launcher) QuickUndo

func (l *Launcher) QuickUndo(slot int) error

func (*Launcher) RegisterBeforeLaunchHook

func (l *Launcher) RegisterBeforeLaunchHook(fn BeforeLaunchFunc)

func (*Launcher) RegisterOnHealthyHook

func (l *Launcher) RegisterOnHealthyHook(fn OnHealthyFunc)

func (*Launcher) SaveAll

func (l *Launcher) SaveAll() error

func (*Launcher) Stop

func (l *Launcher) Stop()

func (*Launcher) StopToRestart

func (l *Launcher) StopToRestart()

type LevelDat

type LevelDat struct {
	Data struct {
		Version struct {
			Name string
		}
	}
}

type OnHealthyFunc

type OnHealthyFunc func(l *Launcher)

type PlayerList

type PlayerList []string

type Rcon

type Rcon struct {
	// contains filtered or unexported fields
}

func NewRcon

func NewRcon(addr, password string) *Rcon

func (*Rcon) AddToOp

func (r *Rcon) AddToOp(player string) error

func (*Rcon) AddToWhiteList

func (r *Rcon) AddToWhiteList(player string) error

func (*Rcon) Execute

func (r *Rcon) Execute(cmd string) (string, error)

func (*Rcon) List

func (r *Rcon) List() (PlayerList, error)

func (*Rcon) SaveAll

func (r *Rcon) SaveAll() error

func (*Rcon) Say

func (r *Rcon) Say(message string) error

func (*Rcon) Seed

func (r *Rcon) Seed() (string, error)

func (*Rcon) Stop

func (r *Rcon) Stop() error

type ServerProperties

type ServerProperties struct {
	// contains filtered or unexported fields
}

func NewServerProperties

func NewServerProperties() *ServerProperties

func (*ServerProperties) DangerouslySetProperty

func (p *ServerProperties) DangerouslySetProperty(k, v string)

func (*ServerProperties) LoadConfig

func (p *ServerProperties) LoadConfig(config *runner.Config) error

func (*ServerProperties) OverrideProperties

func (p *ServerProperties) OverrideProperties(props map[string]string)

func (*ServerProperties) SetDifficulty

func (p *ServerProperties) SetDifficulty(difficulty string) error

func (*ServerProperties) SetLevelType

func (p *ServerProperties) SetLevelType(levelType string) error

func (*ServerProperties) SetMotd

func (p *ServerProperties) SetMotd(motd string)

func (*ServerProperties) SetSeed

func (p *ServerProperties) SetSeed(seed string)

func (*ServerProperties) Write

func (p *ServerProperties) Write(out io.Writer) error

Jump to

Keyboard shortcuts

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