config

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: BSD-2-Clause Imports: 10 Imported by: 2

Documentation

Overview

Package config provides access to all of the tunable settings of a WolfMUD server. The server's default configuration values may be overridden using a configuration file. The name of the default configuration file is config.wrj in the server's data path. By default the server's data path is '../data', the data directory in the parent's path.

An alternative data path and/or configuration file can be specified using the WOLFMUD_DIR environment variable. The format is:

WOLFMUD_DIR=<data path><configuration file>

The default value, if not specified, is equivalent to:

WOLFMUD_DIR=../data/config.wrj

If only the data path is specified the default configuration file will be used. If only a configuration file is specified the default data path will be used. The data path may be absolute or relative to the current path.

NOTE: The server's data path is used to locate zone files and player files as well as the configuration file.

Alternative data directories and/or configuration files can be useful for testing environments or for running multiple server instances.

Index

Constants

This section is empty.

Variables

View Source
var Debug = struct {
	LongLog    bool // Long log with microseconds & filename?
	Panic      bool // Let goroutines panic and stop server?
	AllowDump  bool // Allow use of #DUMP/#UDUMP/#LDUMP commands?
	AllowDebug bool // Allow use of #DEBUG command?
	Events     bool // Log events? - this can make the log quite noisy
	Things     bool // Log additional information for Thing?
}{
	LongLog:    false,
	Panic:      false,
	AllowDump:  false,
	AllowDebug: false,
	Events:     false,
	Things:     false,
}

Debugging configuration

View Source
var Inventory = struct {
	CrowdSize int // If inventory has more player than this it's a crowd
}{
	CrowdSize: 10,
}

Inventory default configuration

View Source
var Login = struct {
	AccountLength  int
	PasswordLength int
	SaltLength     int
}{
	AccountLength:  10,
	PasswordLength: 10,
	SaltLength:     32,
}

Login default configuration

View Source
var Quota = struct {
	Window  time.Duration // Period quota records connections for
	Timeout time.Duration // Period after which quota are reset
	Stats   time.Duration // Minimum reporting period for quota stats
}{
	Window:  0,
	Timeout: 0,
	Stats:   0,
}

Per IP connection quota default configuration

View Source
var Server = struct {
	Host           string        // Host for server to listen on
	Port           string        // Port for server to listen on
	Greeting       []byte        // Connection greeting
	IdleTimeout    time.Duration // Idle connection disconnect time
	MaxPlayers     int           // Max number of players allowed to login at once
	LogClient      bool          // Log connecting IP address and port of client?
	DataDir        string        // Main data directory
	SetPermissions bool          // Set permissions on created account files?
}{
	Host:           "127.0.0.1",
	Port:           "4001",
	Greeting:       []byte(""),
	IdleTimeout:    10 * time.Minute,
	MaxPlayers:     1024,
	DataDir:        ".",
	SetPermissions: false,
}

Server default configuration

View Source
var Stats = struct {
	Rate time.Duration // Stats collection and display rate
	GC   bool          // Run garbage collection before stat collection
}{
	Rate: 10 * time.Second,
	GC:   false,
}

Stats default configuration

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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