mcserver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicState

type PublicState struct {
	ServerName       string            `json:"version"`
	PrevWorldVersion string            `json:"worldVersionPrev"`
	WorldVersion     string            `json:"worldVersion"`
	Whitelist        []string          `json:"whitelist"`
	Op               []string          `json:"op"`
	ServerProps      map[string]string `json:"serverProps"`
}

type ServerProperties

type ServerProperties map[string]string

func LoadServerProperties

func LoadServerProperties() (ServerProperties, error)

func (ServerProperties) GetOr

func (sp ServerProperties) GetOr(key, defaultValue string) string

func (ServerProperties) GetRconSettings

func (sp ServerProperties) GetRconSettings() (bool, string, string, int)

type State

type State struct {
	PrevWoldVersion string              `json:"-"`
	WorldVersion    string              `json:"worldVersion"`
	WhitelistUsers  map[string]struct{} `json:"whitelist"`
	OpUsers         map[string]struct{} `json:"op"`
	ServerProps     ServerProperties    `json:"serverProps"`
	// contains filtered or unexported fields
}

func CreateState

func CreateState(serverProps ServerProperties) (*State, error)

func (*State) AddToOp

func (s *State) AddToOp(user string)

func (*State) AddToWhitelist

func (s *State) AddToWhitelist(user string)

func (*State) Save

func (s *State) Save() error

func (*State) ToPublicState

func (s *State) ToPublicState() PublicState

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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