wizard

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DBPackName = "!db.zip"
View Source
const DefaultHomeTemplate = `` /* 930-byte string literal not displayed */
View Source
const DefaultWorldTemplate = `` /* 1544-byte string literal not displayed */
View Source
const MapPackName = "!maps.zip"

Variables

This section is empty.

Functions

func FormatHomeConfig

func FormatHomeConfig(hcf HomeConfigFormatted) []byte

func FormatWorldConfig

func FormatWorldConfig(wcf WorldConfigFormatted) []byte

func MakeDefaultHomeConfig

func MakeDefaultHomeConfig(conf *config.Home) []byte

func MakeDefaultWorldConfig

func MakeDefaultWorldConfig(conf *config.World) []byte

Types

type Configurator

type Configurator struct {
	Dir string
}

func NewConfigurator

func NewConfigurator(d string) *Configurator

func (*Configurator) ListHomeConfigs

func (c *Configurator) ListHomeConfigs() ([]string, error)

List all home configs in the chosen Gophercraft root directory. On a typical deployment, it will return []string{"Home"}, nil

func (*Configurator) ListWorldConfigs

func (c *Configurator) ListWorldConfigs() ([]string, error)

List all home configs in the chosen Gophercraft root directory. On a typical deployment, it will return []string{"Home"}, nil

func (*Configurator) NewHomeConfigurator

func (co *Configurator) NewHomeConfigurator() *HomeConfigurator

func (*Configurator) NewWorldConfigurator

func (co *Configurator) NewWorldConfigurator() *WorldConfigurator

type ExDb

type ExDb struct {
	Name string
	Type reflect.Type
}

type Extractor

type Extractor struct {
	Source content.Volume
	Dir    string
}

func (*Extractor) AuthorPack

func (ex *Extractor) AuthorPack(name string, cfg datapack.PackConfig) (*datapack.Pack, error)

func (*Extractor) ExtractDatabases

func (ex *Extractor) ExtractDatabases() error

func (*Extractor) ExtractMaps

func (ex *Extractor) ExtractMaps() error

type HomeConfigFormatted

type HomeConfigFormatted struct {
	DBDriver string

	DBURL string

	OpenRegistration string
}

type HomeConfigurator

type HomeConfigurator struct {
	Configurator *Configurator
	Config       *config.Home
}

func (*HomeConfigurator) CreateDB

func (hc *HomeConfigurator) CreateDB() error

func (*HomeConfigurator) GenerateConfig

func (hc *HomeConfigurator) GenerateConfig() error

func (*HomeConfigurator) RegisterAccount

func (hc *HomeConfigurator) RegisterAccount(username, password string, tier rpcnet.Tier) error

func (*HomeConfigurator) SetDirName

func (hc *HomeConfigurator) SetDirName(dirName string)

type LocalHomeConfig

type LocalHomeConfig struct {
	*WorldConfigurator

	HomeConfigName string
}

Uses locally-stored Home config to register a World Has the advantage that the home server doesn't have to be online to work

func (*LocalHomeConfig) Auth

func (l *LocalHomeConfig) Auth(username, password string) error

func (*LocalHomeConfig) Begin

func (l *LocalHomeConfig) Begin(wc *WorldConfigurator, name string) error

func (*LocalHomeConfig) Check

func (l *LocalHomeConfig) Check() (*ValidationCheck, error)

func (*LocalHomeConfig) Confirm

func (l *LocalHomeConfig) Confirm(check *ValidationCheck) error

func (*LocalHomeConfig) Enlist

func (l *LocalHomeConfig) Enlist() error

func (*LocalHomeConfig) MustAuth

func (l *LocalHomeConfig) MustAuth() bool

type Registrar

type Registrar interface {
	Begin(wc *WorldConfigurator, location string) error
	Check() (*ValidationCheck, error)
	Confirm(check *ValidationCheck) error
	MustAuth() bool
	Auth(username, password string) error
	Enlist() error
}

type RegistrarParams

type RegistrarParams struct {
	DBDriver, DBURL string
}

type RemoteHomeserverRegistrar

type RemoteHomeserverRegistrar struct {
	WorldConfigurator *WorldConfigurator
	Address           string
	ValidFingerprint  string

	Token  string
	Client rpcnet.HomeServiceClient
}

talks to Home server over GRPC to enlist a World

func (*RemoteHomeserverRegistrar) Auth

func (rhr *RemoteHomeserverRegistrar) Auth(username, password string) error

func (*RemoteHomeserverRegistrar) Begin

func (rhr *RemoteHomeserverRegistrar) Begin(wc *WorldConfigurator, address string) error

func (*RemoteHomeserverRegistrar) Check

func (*RemoteHomeserverRegistrar) Confirm

func (rhr *RemoteHomeserverRegistrar) Confirm(check *ValidationCheck) error

func (*RemoteHomeserverRegistrar) Enlist

func (rhr *RemoteHomeserverRegistrar) Enlist() error

func (*RemoteHomeserverRegistrar) MustAuth

func (rhr *RemoteHomeserverRegistrar) MustAuth() bool

type ValidationCheck

type ValidationCheck struct {
	Question string
	Object   string
}

type WorldConfigFormatted

type WorldConfigFormatted struct {
	Version   string
	RealmName string
	RealmID   string

	DBDriver string
	DBURL    string

	HomeServer            string
	HomeServerFingerprint string
}

type WorldConfigurator

type WorldConfigurator struct {
	Configurator *Configurator
	Config       *config.World
	GamePath     string
	ConfigName   string
	Registrar    Registrar
}

func (*WorldConfigurator) ConfigExists

func (w *WorldConfigurator) ConfigExists() bool

func (*WorldConfigurator) CreateDB

func (wc *WorldConfigurator) CreateDB() error

func (*WorldConfigurator) GenerateConfigDir

func (w *WorldConfigurator) GenerateConfigDir() error

func (*WorldConfigurator) LoadConfig

func (w *WorldConfigurator) LoadConfig(confName string) (err error)

func (*WorldConfigurator) NewExtractor

func (w *WorldConfigurator) NewExtractor() (*Extractor, error)

func (*WorldConfigurator) RegistrarAuth

func (w *WorldConfigurator) RegistrarAuth(username, password string) error

func (*WorldConfigurator) RegistrarBegin

func (wc *WorldConfigurator) RegistrarBegin(location string) error

func (*WorldConfigurator) RegistrarCheck

func (w *WorldConfigurator) RegistrarCheck() (*ValidationCheck, error)

func (*WorldConfigurator) RegistrarConfirm

func (w *WorldConfigurator) RegistrarConfirm(vc *ValidationCheck) error

func (*WorldConfigurator) RegistrarEnlist

func (w *WorldConfigurator) RegistrarEnlist() error

func (*WorldConfigurator) RegistrarMustAuth

func (w *WorldConfigurator) RegistrarMustAuth() bool

func (*WorldConfigurator) RemoveConfigDir

func (w *WorldConfigurator) RemoveConfigDir() error

func (*WorldConfigurator) SetConfigName

func (w *WorldConfigurator) SetConfigName(confName string)

func (*WorldConfigurator) SetName

func (wc *WorldConfigurator) SetName(name string)

func (*WorldConfigurator) SetRealmType

func (wc *WorldConfigurator) SetRealmType(t config.RealmType) error

func (*WorldConfigurator) SetRegistrar

func (wc *WorldConfigurator) SetRegistrar(reg Registrar) error

func (*WorldConfigurator) SetVolume

func (wc *WorldConfigurator) SetVolume(path string) error

type WorldOptions

type WorldOptions struct {
	RealmName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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