config

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: 21 Imported by: 0

Documentation

Index

Constants

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

Variables

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

	"XP.Rate": Uint,

	"Network.ConnectionsPerAddress": Int,

	"Network.SessionsPerAccount": Int,

	"Network.MaxPlayers": Int,

	"Network.WaitQueue": Bool,

	"Sync.VisibilityRange": Float,

	"PvP.CombatantUponEnteringContestedTerritory": Bool,

	"PvP.Deathmatch": Bool,

	"PvP.AtWar": Bool,

	"PvP.CrossFactionGroups": Bool,

	"PvP.AllowTreason": Bool,

	"Chat.LanguageBarrier": Bool,

	"Chat.MutualIntelligibility": Bool,

	"Chat.HostAnnounceChannel": Bool,

	"Char.AllowSpecialCombos": Bool,

	"Char.StartLevel": Int,

	"Char.Cinematic":     Bool,
	"Char.StartPosition": String,

	"Item.Binding": Bool,

	"Item.LootQuality": Float,

	"Item.IgnoreRestrictions": Bool,

	"Weather.On":    Bool,
	"Weather.Crazy": Bool,
}

Functions

func DefaultLocation

func DefaultLocation() string

func GenerateTLSKeyPair

func GenerateTLSKeyPair(at string) error

func ListHomeConfigs

func ListHomeConfigs(dir string) ([]string, error)

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

func ListWorldConfigs

func ListWorldConfigs(dir string) ([]string, error)

List all World configs in the chosen Gophercraft root directory.

func WorldExists

func WorldExists(at string) bool

Types

type Home

type Home struct {
	Dir         string
	Certificate tls.Certificate
	HomeFile
}

func LoadHome

func LoadHome(at string) (*Home, error)

func (*Home) Fingerprint

func (h *Home) Fingerprint() string

func (*Home) GenerateKeyPair

func (h *Home) GenerateKeyPair() error

type HomeFile

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

type Realm

type Realm struct {
	FP     string
	Armory string
}

type RealmType

type RealmType uint8

func (*RealmType) DecodeWord

func (rt *RealmType) DecodeWord(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 {
	Dir string
	WorldFile
	Certificate tls.Certificate
}

func LoadWorld

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

func (*World) Fingerprint

func (c *World) Fingerprint() string

func (*World) GenerateKeyPair

func (c *World) GenerateKeyPair() error

func (*World) String

func (c *World) String() string

type WorldFile

type WorldFile struct {
	Version               vsn.Build
	Listen                string
	Redirect              string
	PublicRedirect        string
	RealmID               uint64
	Timezone              i18n.Timezone
	RealmType             RealmType
	RealmName             string
	RealmDescription      string
	FederalSovereignty    bool
	DBDriver              string
	DBURL                 string
	PublicAddress         string
	WardenEnabled         bool
	ShowSQL               bool
	HomeServer            string
	HomeServerFingerprint string
	CPUProfile            string
	WorldVars             WorldVars
}

type WorldVarType

type WorldVarType int
const (
	Bool WorldVarType = iota
	Uint
	Int
	Float
	String
)

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