configs

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackupScheduleDisabled = ``
	BackupScheduleNever    = `never`
	BackupScheduleNightly  = `nightly`
	BackupScheduleWeekly   = `weekly`
	BackupScheduleMonthly  = `monthly`
)
View Source
const (
	PVPEnabled  = `enabled`
	PVPDisabled = `disabled`
	PVPOff      = `off`
	PVPLimited  = `limited`
)
View Source
const RedactedValue = `*** REDACTED ***`

Variables

View Source
var (
	ErrInvalidConfigName = errors.New("invalid config name")
	ErrLockedConfig      = errors.New("config name is locked")
	ErrRedactedValue     = errors.New("cannot save a redacted placeholder as a config value")
)

Functions

func AddOverlayOverrides

func AddOverlayOverrides(dotMap map[string]any) error

func FindFullPath

func FindFullPath(inputKey string) (properKey string, typeName string)

func Flatten

func Flatten(input map[string]any) map[string]any

flatten recursively flattens a map[string]any. It supports both map[string]any and map[any]any values, which is useful when unmarshaling YAML.

func GetOverrides

func GetOverrides() map[string]any

func GetSecret

func GetSecret(v ConfigSecret) string

Usage: configs.GetSecret(c.DiscordWebhookUrl)

func OnChanged added in v0.9.8

func OnChanged(fn func(key string))

OnChanged registers a callback that is invoked after SetVal successfully applies a config change. The callback receives the full dot-path key.

func ReloadConfig

func ReloadConfig() error

func RestoreOverrides added in v0.9.8

func RestoreOverrides(flatSnapshot map[string]any) error

RestoreOverrides replaces the current overrides with the supplied flat dot-path map and re-applies them to the live config. It is used by the test-mode middleware to revert changes made during a dry-run request.

func SetVal

func SetVal(propertyPath string, newVal string) error

Types

type Backup added in v0.9.8

type Backup struct {
	Schedule ConfigString `yaml:"Schedule"` // nightly, weekly, monthly, or empty to disable
	S3       BackupS3     `yaml:"S3"`
}

func GetBackupConfig added in v0.9.8

func GetBackupConfig() Backup

func (*Backup) Validate added in v0.9.8

func (b *Backup) Validate()

type BackupS3 added in v0.9.8

type BackupS3 struct {
	Enabled   ConfigBool   `yaml:"Enabled"`
	Bucket    ConfigString `yaml:"Bucket"`
	Region    ConfigString `yaml:"Region"`
	Prefix    ConfigString `yaml:"Prefix"` // key prefix / folder within the bucket
	AccessKey ConfigSecret `yaml:"AccessKey" env:"BACKUP_S3_ACCESS_KEY"`
	SecretKey ConfigSecret `yaml:"SecretKey" env:"BACKUP_S3_SECRET_KEY"`
}

type CombatConfig added in v0.9.8

type CombatConfig struct {
	ConsistentAttackMessages ConfigBool `yaml:"ConsistentAttackMessages"` // Whether each weapon has consistent attack messages

	// Damage bonus (Strength delta drives this)
	DamageBonusMin ConfigInt `yaml:"DamageBonusMin"` // Minimum flat damage bonus
	DamageBonusMax ConfigInt `yaml:"DamageBonusMax"` // Maximum flat damage bonus

	// Chance to hit (Speed delta drives this)
	ToHitMin ConfigInt `yaml:"ToHitMin"` // Minimum hit chance (percent, 0-100)
	ToHitMax ConfigInt `yaml:"ToHitMax"` // Maximum hit chance (percent, 0-100)

	// Extra attacks - weaponless/claws only (Speed delta drives this)
	ExtraAttacksMin ConfigInt `yaml:"ExtraAttacksMin"` // Minimum extra attacks
	ExtraAttacksMax ConfigInt `yaml:"ExtraAttacksMax"` // Maximum extra attacks

	// Chance to crit (Smarts delta drives this)
	CritChanceMin ConfigInt `yaml:"CritChanceMin"` // Minimum crit chance (percent, 0-100)
	CritChanceMax ConfigInt `yaml:"CritChanceMax"` // Maximum crit chance (percent, 0-100)

	// Crit damage multiplier (Perception delta drives this)
	CritMultMin ConfigFloat `yaml:"CritMultMin"` // Minimum crit damage multiplier
	CritMultMax ConfigFloat `yaml:"CritMultMax"` // Maximum crit damage multiplier

	// Chance to dodge (Perception delta drives this)
	DodgeChanceMin ConfigInt `yaml:"DodgeChanceMin"` // Minimum dodge chance (percent, 0-100)
	DodgeChanceMax ConfigInt `yaml:"DodgeChanceMax"` // Maximum dodge chance (percent, 0-100)
}

CombatConfig holds configurable min/max bounds for every combat calculation.

func GetCombatConfig added in v0.9.8

func GetCombatConfig() CombatConfig

type Config

type Config struct {
	// Start config subsections
	Server       Server       `yaml:"Server"`
	Memory       Memory       `yaml:"Memory"`
	LootGoblin   LootGoblin   `yaml:"LootGoblin"`
	Timing       Timing       `yaml:"Timing"`
	FilePaths    FilePaths    `yaml:"FilePaths"`
	GamePlay     GamePlay     `yaml:"GamePlay"`
	Integrations Integrations `yaml:"Integrations"`
	TextFormats  TextFormats  `yaml:"TextFormats"`
	Translation  Translation  `yaml:"Translation"`
	Network      Network      `yaml:"Network"`
	Scripting    Scripting    `yaml:"Scripting"`
	SpecialRooms SpecialRooms `yaml:"SpecialRooms"`
	Validation   Validation   `yaml:"Validation"`
	Backup       Backup       `yaml:"Backup"`
	// Plugins is a special case
	Modules Modules `yaml:"Modules"`
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig() Config

func (Config) AllConfigData

func (c Config) AllConfigData(excludeStrings ...string) map[string]any

func (*Config) DotPaths

func (c *Config) DotPaths() map[string]any

func (Config) IsBannedName

func (c Config) IsBannedName(name string) (string, bool)

func (*Config) OverlayOverrides

func (c *Config) OverlayOverrides(dotMap map[string]any) error

OverlayDotMap overlays values from a dot-syntax map onto the Config.

func (Config) SeedInt

func (c Config) SeedInt() int64

func (*Config) SetOverrides

func (c *Config) SetOverrides(newOverrides map[string]any) error

func (*Config) Validate

func (c *Config) Validate()

Ensures certain ranges and defaults are observed

type ConfigBool

type ConfigBool bool

func (*ConfigBool) Set

func (c *ConfigBool) Set(value string) error

func (ConfigBool) String

func (c ConfigBool) String() string

type ConfigFloat

type ConfigFloat float64

func (*ConfigFloat) Set

func (c *ConfigFloat) Set(value string) error

func (ConfigFloat) String

func (c ConfigFloat) String() string

type ConfigInt

type ConfigInt int

func (*ConfigInt) Set

func (c *ConfigInt) Set(value string) error

func (ConfigInt) String

func (c ConfigInt) String() string

type ConfigSecret

type ConfigSecret string // special case string

func (ConfigSecret) MarshalJSON added in v0.9.8

func (c ConfigSecret) MarshalJSON() ([]byte, error)

func (*ConfigSecret) Set

func (c *ConfigSecret) Set(value string) error

func (ConfigSecret) String

func (c ConfigSecret) String() string

type ConfigSliceString

type ConfigSliceString []string

func (*ConfigSliceString) Set

func (c *ConfigSliceString) Set(value string) error

func (ConfigSliceString) String

func (c ConfigSliceString) String() string

type ConfigString

type ConfigString string

func (*ConfigString) Set

func (c *ConfigString) Set(value string) error

func (ConfigString) String

func (c ConfigString) String() string

type ConfigUInt64

type ConfigUInt64 uint64

func (*ConfigUInt64) Set

func (c *ConfigUInt64) Set(value string) error

func (ConfigUInt64) String

func (c ConfigUInt64) String() string

type ConfigValue

type ConfigValue interface {
	String() string
	Set(string) error
}

func StringToConfigValue

func StringToConfigValue(strVal string, typeName string) ConfigValue

type FilePaths

type FilePaths struct {
	WebDomain        ConfigString `yaml:"WebDomain"`
	WebCDNLocation   ConfigString `yaml:"WebCDNLocation"`
	DataFiles        ConfigString `yaml:"DataFiles"`
	PublicHtml       ConfigString `yaml:"PublicHtml"`
	AdminHtml        ConfigString `yaml:"AdminHtml"`
	HttpsCertFile    ConfigString `yaml:"HttpsCertFile"`
	HttpsKeyFile     ConfigString `yaml:"HttpsKeyFile"`
	SSHHostKeyFile   ConfigString `yaml:"SSHHostKeyFile"`
	HttpsEmail       ConfigSecret `yaml:"HttpsEmail"`
	HttpsCacheDir    ConfigString `yaml:"HttpsCacheDir"`
	CarefulSaveFiles ConfigBool   `yaml:"CarefulSaveFiles"`
}

func GetFilePathsConfig

func GetFilePathsConfig() FilePaths

func (*FilePaths) Validate

func (f *FilePaths) Validate()

type GamePlay

type GamePlay struct {
	AllowItemBuffRemoval ConfigBool `yaml:"AllowItemBuffRemoval"`
	// Death related settings
	Death GameplayDeath `yaml:"Death"`
	// Party settings
	Party GameplayParty `yaml:"Party"`
	// Progression settings
	Progression ProgressionConfig `yaml:"Progression"`

	LivesStart     ConfigInt `yaml:"LivesStart"`     // Starting permadeath lives
	LivesMax       ConfigInt `yaml:"LivesMax"`       // Maximum permadeath lives
	LivesOnLevelUp ConfigInt `yaml:"LivesOnLevelUp"` // # lives gained on level up
	PricePerLife   ConfigInt `yaml:"PricePerLife"`   // Price in gold to buy new lives
	// Shops/Containers
	ShopRestockRate       ConfigString `yaml:"ShopRestockRate"`       // Default time it takes to restock 1 quantity in shops
	MercHirePricePerLevel ConfigInt    `yaml:"MercHirePricePerLevel"` // Gold cost per mob level when auto-calculating mercenary hire price
	ContainerSizeMax      ConfigInt    `yaml:"ContainerSizeMax"`      // How many objects containers can hold before overflowing
	FloorItemCountMax     ConfigInt    `yaml:"FloorItemCountMax"`     // Maximum items allowed on the floor at once (0 = no limit)
	Combat                CombatConfig `yaml:"Combat"`

	// PVP Restrictions
	PVP GameplayPVP `yaml:"PVP"`
	// XpScale (difficulty)
	XPScale              ConfigFloat `yaml:"XPScale"`
	MobConverseChance    ConfigInt   `yaml:"MobConverseChance"`    // Chance 1-100 of attempting to converse when idle
	AlignmentDecayRounds ConfigInt   `yaml:"AlignmentDecayRounds"` // Rounds between each alignment decay step toward neutral (0 = disabled)
	// Elite mob settings
	EliteLevelBonus ConfigInt `yaml:"EliteLevelBonus"` // Percent level increase for elite mob spawns (e.g. 20 = 20% higher level)
	EliteXPBonus    ConfigInt `yaml:"EliteXPBonus"`    // Percent XP bonus for killing an elite mob (e.g. 10 = 10% more XP)
}

func GetGamePlayConfig

func GetGamePlayConfig() GamePlay

func (*GamePlay) Validate

func (g *GamePlay) Validate()

type GameplayDeath

type GameplayDeath struct {
	EquipmentDropChance ConfigFloat  `yaml:"EquipmentDropChance"` // Chance a player will drop a given piece of equipment on death
	AlwaysDropBackpack  ConfigBool   `yaml:"AlwaysDropBackpack"`  // If true, players will always drop their backpack items on death
	XPPenalty           ConfigString `yaml:"XPPenalty"`           // Possible values are: none, level, 10%, 25%, 50%, 75%, 90%, 100%
	ProtectionLevels    ConfigInt    `yaml:"ProtectionLevels"`    // How many levels is the user protected from death penalties for?
	PermaDeath          ConfigBool   `yaml:"PermaDeath"`          // Is permadeath enabled?
	CorpsesEnabled      ConfigBool   `yaml:"CorpsesEnabled"`      // Whether corpses are left behind after mob/player deaths
	CorpseDecayTime     ConfigString `yaml:"CorpseDecayTime"`     // How long until corpses decay to dust (go away)
	CorpseItems         ConfigBool   `yaml:"CorpseItems"`         // If true, items/gold go onto the corpse instead of the floor
}

type GameplayPVP added in v0.9.8

type GameplayPVP struct {
	Enabled      ConfigString `yaml:"Enabled"`      // Possible values: enabled, disabled, limited
	MinimumLevel ConfigInt    `yaml:"MinimumLevel"` // Minimum level required to participate in PVP
}

func GetPVPConfig added in v0.9.8

func GetPVPConfig() GameplayPVP

type GameplayParty added in v0.9.8

type GameplayParty struct {
	MaxPlayerCount ConfigInt  `yaml:"MaxPlayerCount"` // Maximum number of players allowed in a party (0 = unlimited)
	SameRoomOnly   ConfigBool `yaml:"SameRoomOnly"`   // Whether players must be in the same room to create/invite/join parties
}

type Integrations

type Integrations struct {
	Discord IntegrationsDiscord `yaml:"Discord"`
}

func GetIntegrationsConfig

func GetIntegrationsConfig() Integrations

func (*Integrations) Validate

func (i *Integrations) Validate()

type IntegrationsDiscord

type IntegrationsDiscord struct {
	WebhookUrl ConfigSecret `yaml:"WebhookUrl" env:"DISCORD_WEBHOOK_URL"` // Optional Discord URL to post updates to
}

type LootGoblin

type LootGoblin struct {
	// Item/floor cleanup
	RoomId             ConfigInt  `yaml:"RoomId"`             // The room the loot goblin spawns in
	RoundCount         ConfigInt  `yaml:"RoundCount"`         // How often to spawn a loot goblin
	MinimumItems       ConfigInt  `yaml:"MinimumItems"`       // How many items on the ground to attract the loot goblin
	MinimumGold        ConfigInt  `yaml:"MinimumGold"`        // How much gold on the ground to attract the loot goblin
	IncludeRecentRooms ConfigBool `yaml:"IncludeRecentRooms"` // should the goblin include rooms that have been visited recently?

}

func GetLootGoblinConfig

func GetLootGoblinConfig() LootGoblin

func (*LootGoblin) Validate

func (l *LootGoblin) Validate()

type Memory

type Memory struct {
	// Mob/Room memory unload thresholds
	MaxMobBoredom       ConfigInt `yaml:"MaxMobBoredom"`
	MobUnloadThreshold  ConfigInt `yaml:"MobUnloadThreshold"`
	RoomUnloadRounds    ConfigInt `yaml:"RoomUnloadRounds"`
	RoomUnloadThreshold ConfigInt `yaml:"RoomUnloadThreshold"`
}

func GetMemoryConfig

func GetMemoryConfig() Memory

func (*Memory) Validate

func (m *Memory) Validate()

type Modules

type Modules map[string]any

func GetModulesConfig

func GetModulesConfig() Modules

func (*Modules) Validate

func (p *Modules) Validate()

type Network

type Network struct {
	MaxTelnetConnections ConfigInt         `yaml:"MaxTelnetConnections"` // Maximum number of telnet connections to accept
	TelnetPort           ConfigSliceString `yaml:"TelnetPort"`           // One or more Ports used to accept telnet connections
	LocalPort            ConfigInt         `yaml:"LocalPort"`            // Port used for admin connections, localhost only
	HttpPort             ConfigInt         `yaml:"HttpPort"`             // Port used for web requests
	HttpsPort            ConfigInt         `yaml:"HttpsPort"`            // Port used for web https requests
	HttpsRedirect        ConfigBool        `yaml:"HttpsRedirect"`        // If true, http traffic will be redirected to https
	SSHPort              ConfigInt         `yaml:"SSHPort"`              // Port used for SSH connections (0 to disable)
	MaxSSHConnections    ConfigInt         `yaml:"MaxSSHConnections"`    // Maximum number of SSH connections to accept
	AfkSeconds           ConfigInt         `yaml:"AfkSeconds"`           // How long until a player is marked as afk?
	MaxIdleSeconds       ConfigInt         `yaml:"MaxIdleSeconds"`       // How many seconds a player can go without a command in game before being kicked.
	TimeoutMods          ConfigBool        `yaml:"TimeoutMods"`          // Whether to kick admin/mods when idle too long.
	LinkDeadSeconds      ConfigInt         `yaml:"LinkDeadSeconds"`      // How many seconds a player will be link-dead allowing them to reconnect.
	LogoutRounds         ConfigInt         `yaml:"LogoutRounds"`         // How many rounds of uninterrupted meditation must be completed to log out.
}

func GetNetworkConfig

func GetNetworkConfig() Network

func (*Network) Validate

func (n *Network) Validate()

type ProgressionConfig added in v0.9.8

type ProgressionConfig struct {
	// Stat gain formula: GainsForLevel
	//   racial_value = floor(base * BaseModFactor * (level-1)^BaseModExponent)
	//                + floor(NaturalGainsModFactor * level^NaturalGainsExponent)
	//
	// BaseModFactor controls how much a racial base stat matters at high levels.
	// Higher values cause races with strong bases to diverge more from weak-base races.
	BaseModFactor ConfigFloat `yaml:"BaseModFactor"`
	// BaseModExponent controls the shape of the base-scaled component.
	// 1.0 = linear growth, <1.0 = diminishing returns, >1.0 = accelerating returns.
	BaseModExponent ConfigFloat `yaml:"BaseModExponent"`
	// NaturalGainsModFactor controls the universal flat gains every character receives
	// per level, regardless of race. Higher values raise the floor for weak-base races.
	NaturalGainsModFactor ConfigFloat `yaml:"NaturalGainsModFactor"`
	// NaturalGainsExponent controls the shape of the flat gains component.
	// 1.0 = linear, <1.0 = diminishing returns, >1.0 = accelerating.
	NaturalGainsExponent ConfigFloat `yaml:"NaturalGainsExponent"`

	// HP formula: HealthMax = HPBase + level*HPPerLevel + Vitality_adj*HPPerVitality + mods
	HPBase        ConfigInt   `yaml:"HPBase"`
	HPPerLevel    ConfigFloat `yaml:"HPPerLevel"`
	HPPerVitality ConfigFloat `yaml:"HPPerVitality"`

	// Mana formula: ManaMax = ManaBase + level*ManaPerLevel + Mysticism_adj*ManaPerMysticism + mods
	ManaBase         ConfigInt   `yaml:"ManaBase"`
	ManaPerLevel     ConfigFloat `yaml:"ManaPerLevel"`
	ManaPerMysticism ConfigFloat `yaml:"ManaPerMysticism"`

	// Points awarded to the player on each level-up.
	TrainingPointsPerLevel     ConfigInt `yaml:"TrainingPointsPerLevel"`
	TrainingPointsEveryNLevels ConfigInt `yaml:"TrainingPointsEveryNLevels"`
	StatPointsPerLevel         ConfigInt `yaml:"StatPointsPerLevel"`
	StatPointsEveryNLevels     ConfigInt `yaml:"StatPointsEveryNLevels"`

	// XP curve: XP_to_level(L) = (XPBase + L^XPLevelPower * XPLevelFactor * XPBase) * TNLScale
	// XPBase is the flat XP cost at level 1.
	XPBase ConfigInt `yaml:"XPBase"`
	// XPLevelFactor scales how fast the curve rises. Higher = more XP per level.
	XPLevelFactor ConfigFloat `yaml:"XPLevelFactor"`
	// XPLevelPower is the exponent. 2.0 = quadratic, 1.5 = gentler, 3.0 = steeper.
	XPLevelPower ConfigFloat `yaml:"XPLevelPower"`

	// MaxLevel is the soft display cap used in admin charts and any future level-cap enforcement.
	MaxLevel ConfigInt `yaml:"MaxLevel"`

	// Stat value compression (applied in Recalculate).
	// Once a stat's Value reaches StatCapThreshold, further gains are compressed:
	//   ValueAdj = StatCapAnchor + round((Value-StatCapAnchor)^StatCapExponent * StatCapScale)
	// StatCapThreshold: the Value at which compression begins. Default 105.
	StatCapThreshold ConfigInt `yaml:"StatCapThreshold"`
	// StatCapAnchor: the value the compression formula is anchored to. Default 100.
	// Overage is measured from this point: overage = Value - StatCapAnchor.
	StatCapAnchor ConfigInt `yaml:"StatCapAnchor"`
	// StatCapExponent: controls how aggressively gains are compressed above the threshold.
	// 0.5 = sqrt (default, strong compression), 1.0 = linear pass-through (no compression),
	// 0.25 = very aggressive. Valid range: 0.01 to 1.0.
	StatCapExponent ConfigFloat `yaml:"StatCapExponent"`
	// StatCapScale: multiplier applied after the exponent. Default 2.0.
	StatCapScale ConfigFloat `yaml:"StatCapScale"`
	// StatCapExemptBonus: when true, only the racial portion of a stat is compressed.
	// Training points and equipment/buff mods are added on top of the compressed racial
	// value without being subject to the cap. This ensures deliberate investment always
	// pays off fully. Default false (original behaviour: everything compressed together).
	StatCapExemptBonus ConfigBool `yaml:"StatCapExemptBonus"`
}

func GetProgressionConfig added in v0.9.8

func GetProgressionConfig() ProgressionConfig

func (*ProgressionConfig) Validate added in v0.9.8

func (p *ProgressionConfig) Validate()

type Scripting

type Scripting struct {
	LoadTimeoutMs ConfigInt `yaml:"LoadTimeoutMs"` // How long to spend the first time a script is loaded into memory
	RoomTimeoutMs ConfigInt `yaml:"RoomTimeoutMs"` // How many milliseconds to allow a script to run before it is interrupted
}

func GetScriptingConfig

func GetScriptingConfig() Scripting

func (*Scripting) Validate

func (s *Scripting) Validate()

type Server

type Server struct {
	MudName         ConfigString      `yaml:"MudName"`         // Name of the MUD
	CurrentVersion  ConfigString      `yaml:"CurrentVersion"`  // Current version this mud has been updated to
	Seed            ConfigSecret      `yaml:"Seed"`            // Seed that may be used for generating content
	MaxCPUCores     ConfigInt         `yaml:"MaxCPUCores"`     // How many cores to allow for multi-core operations
	OnLoginCommands ConfigSliceString `yaml:"OnLoginCommands"` // Commands to run when a user logs in
	Motd            ConfigString      `yaml:"Motd"`            // Message of the day to display when a user logs in
	NextRoomId      ConfigInt         `yaml:"NextRoomId"`      // The next room id to use when creating a new room
	Locked          ConfigSliceString `yaml:"Locked"`          // List of locked config properties that cannot be changed without editing the file directly.
}

func GetServerConfig

func GetServerConfig() Server

func (*Server) Validate

func (s *Server) Validate()

type SpecialRooms

type SpecialRooms struct {
	StartRoom         ConfigInt         `yaml:"StartRoom"`         // Default starting room.
	DeathRecoveryRoom ConfigInt         `yaml:"DeathRecoveryRoom"` // Recovery room after dying.
	TutorialRooms     ConfigSliceString `yaml:"TutorialRooms"`     // List of all rooms that can be used to begin the tutorial process
}

func GetSpecialRoomsConfig

func GetSpecialRoomsConfig() SpecialRooms

func (*SpecialRooms) Validate

func (s *SpecialRooms) Validate()

type TextFormats

type TextFormats struct {
	Prompt                  ConfigString `yaml:"Prompt"`                  // The in-game status prompt style
	EnterRoomMessageWrapper ConfigString `yaml:"EnterRoomMessageWrapper"` // Special enter messages
	ExitRoomMessageWrapper  ConfigString `yaml:"ExitRoomMessageWrapper"`  // Special exit messages
	Time                    ConfigString `yaml:"Time"`                    // How to format time when displaying real time
	TimeShort               ConfigString `yaml:"TimeShort"`               // How to format time when displaying real time (shortform)
}

func GetTextFormatsConfig

func GetTextFormatsConfig() TextFormats

func (*TextFormats) Validate

func (m *TextFormats) Validate()

type Timing

type Timing struct {
	TurnMs            ConfigInt `yaml:"TurnMs"`
	RoundSeconds      ConfigInt `yaml:"RoundSeconds"`
	RoundsPerAutoSave ConfigInt `yaml:"RoundsPerAutoSave"`
	// contains filtered or unexported fields
}

func GetTimingConfig

func GetTimingConfig() Timing

func (Timing) MinutesToRounds

func (e Timing) MinutesToRounds(minutes int) int

func (Timing) MinutesToTurns

func (e Timing) MinutesToTurns(minutes int) int

func (Timing) RoundsToSeconds

func (e Timing) RoundsToSeconds(rounds int) int

func (Timing) SecondsToRounds

func (e Timing) SecondsToRounds(seconds int) int

func (Timing) SecondsToTurns

func (e Timing) SecondsToTurns(seconds int) int

func (Timing) TurnsPerAutoSave

func (e Timing) TurnsPerAutoSave() int

func (Timing) TurnsPerRound

func (e Timing) TurnsPerRound() int

func (Timing) TurnsPerSecond

func (e Timing) TurnsPerSecond() int

func (*Timing) Validate

func (e *Timing) Validate()

type Translation

type Translation struct {
	DefaultLanguage ConfigString      `yaml:"DefaultLanguage"` // Specify the default game language (fallback)
	Language        ConfigString      `yaml:"Language"`        // Specify the game language
	LanguagePaths   ConfigSliceString `yaml:"LanguagePaths"`   // Specify the game language file paths
}

func GetTranslationConfig

func GetTranslationConfig() Translation

func (*Translation) Validate

func (t *Translation) Validate()

type Validation

type Validation struct {
	NameSizeMin      ConfigInt         `yaml:"NameSizeMin"`
	NameSizeMax      ConfigInt         `yaml:"NameSizeMax"`
	PasswordSizeMin  ConfigInt         `yaml:"PasswordSizeMin"`
	PasswordSizeMax  ConfigInt         `yaml:"PasswordSizeMax"`
	NameRejectRegex  ConfigString      `yaml:"NameRejectRegex"`
	NameRejectReason ConfigString      `yaml:"NameRejectReason"`
	EmailOnJoin      ConfigString      `yaml:"EmailOnJoin"`
	BannedNames      ConfigSliceString `yaml:"BannedNames"` // List of names that are not allowed to be used
}

func GetValidationConfig

func GetValidationConfig() Validation

func (*Validation) Validate

func (v *Validation) Validate()

Jump to

Keyboard shortcuts

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