config

package
v0.0.0-...-382259f Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RealmTypeNone   = 0
	RealmTypePvP    = 1
	RealmTypeNormal = 4
	RealmTypeRP     = 6
	RealmTypeRP_PvP = 8
)
View Source
const DefaultAuth = `` /* 884-byte string literal not displayed */
View Source
const DefaultWorld = `` /* 1125-byte string literal not displayed */

Variables

View Source
var (
	ErrAlreadyExists = fmt.Errorf("config: already exists")
)
View Source
var (
	Presets = map[RealmType]WorldVars{}
)

Functions

func GenerateDefaultAuth

func GenerateDefaultAuth(dbDriver, dbURL, user, pass, at string) error

func GenerateDefaultWorld

func GenerateDefaultWorld(version uint32, name string, id uint64, sqlDriver, sqlDB string, at string, authServer, serverFingerprint string) error

func GenerateTLSKeyPair

func GenerateTLSKeyPair(at string) error

Types

type Auth

type Auth struct {
	Path        etc.Path
	Certificate tls.Certificate
	AuthFile
}

func LoadAuth

func LoadAuth(at string) (*Auth, error)

func (*Auth) GenerateDefaultWorld

func (a *Auth) GenerateDefaultWorld(version uint32, name string, id uint64, sqlDriver, sqlDB string, at string) error

func (*Auth) RealmsFile

func (a *Auth) RealmsFile() (*RealmsFile, error)

func (*Auth) SetRealm

func (a *Auth) SetRealm(id uint64, realm Realm) error

type AuthFile

type AuthFile struct {
	HTTPInternal         string
	HostExternal         string
	AuthListen           string
	BnetListen           string
	BnetRESTListen       string
	AlphaRealmlistListen string
	DBDriver             string
	DBURL                string
	Admin                map[string]string
}

type Realm

type Realm struct {
	FP     string
	Armory string
}

type RealmType

type RealmType uint8

func (RealmType) DecodeWord

func (RealmType) DecodeWord(out reflect.Value, wdata string) error

func (RealmType) EncodeWord

func (rt RealmType) EncodeWord() (string, error)

type RealmsFile

type RealmsFile struct {
	Realms map[uint64]Realm
}

type World

type World struct {
	Path etc.Path
	WorldFile
	Certificate tls.Certificate
}

func LoadWorld

func LoadWorld(at string) (*World, error)

func (*World) Bool

func (c *World) Bool(name string) bool

func (*World) Float32

func (c *World) Float32(name string) float32

func (*World) GetString

func (c *World) GetString(name string) string

func (*World) Int64

func (c *World) Int64(name string) int64

func (*World) String

func (c *World) String() string

func (*World) Uint32

func (c *World) Uint32(name string) uint32

func (*World) Uint64

func (c *World) Uint64(name string) uint64

type WorldFile

type WorldFile struct {
	Version               vsn.Build
	Listen                string
	RealmID               uint64
	RealmType             RealmType
	RealmName             string
	RealmDescription      string
	DBDriver              string
	DBURL                 string
	PublicAddress         string
	WardenEnabled         bool
	ShowSQL               bool
	DatapackDir           string
	AuthServer            string
	AuthServerFingerprint string
	CPUProfile            string
	WorldVars
}

type WorldVars

type WorldVars map[string]string

Jump to

Keyboard shortcuts

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