config

package
v0.0.0-...-2f1cb99 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UseNetCheck bool

Functions

func Load

func Load()

Types

type AllowList

type AllowList struct {

	// A list of players that are allowed to join the server - These players will be able to join the server only if they pass all other authentication checks
	Players []string `` /* 176-byte string literal not displayed */
}

type AuthAdminConfig

type AuthAdminConfig map[string]PlayerPermissionsConfig

An array of permissions for each player (use only for admins)

type AuthIdleConfig

type AuthIdleConfig struct {

	// Whether idle player detection is enabled
	Enable bool `toml:"Enable" comment:"Whether idle player detection is enabled"`

	// The maximum amount of time a player is allowed to be idle before being kicked (in minutes)
	MaxTime string `` /* 138-byte string literal not displayed */

	// The max time in Go Time format
	MaxTimeTime time.Duration

	// The minimum distance a player must have moved to not be considered idle
	MinDistance int `toml:"MinDistance" comment:"The minimum distance a player must have moved to not be considered idle"`
}

type AuthKickConfig

type AuthKickConfig struct {

	// The minimum amount of time a player is prevented from joining the server after being kicked by an admin (in seconds)
	AdminDuration string `` /* 168-byte string literal not displayed */

	// The admin duration time in Go Time format
	AdminDurationTime time.Duration

	// The amount of time a player is prevented from joining the server after being kicked for being idle (in seconds)
	IdleDuration string `` /* 164-byte string literal not displayed */

	//	The idle duration time in Go Time format
	IdleDurationTime time.Duration

	// The amount of time a player is prevented from joining the server after being kicked for reaching their online time quota limit (in seconds)
	OnlineDuration string `` /* 194-byte string literal not displayed */

	// The online duration time in Go Time format
	OnlineDurationTime time.Duration
}

type AuthOnlineConfig

type AuthOnlineConfig struct {

	// Whether players should be kicked for reaching their quota limit
	Enable bool `toml:"Enable" comment:"Whether players should be kicked for reaching their quota limit"`

	// The maximum amount of time a player is allowed to be on the server before being kicked (in minutes)
	Quota string `` /* 145-byte string literal not displayed */

	// The quota time in Go Time format
	QuotaTime time.Duration
}

type AuthProxyConfig

type AuthProxyConfig struct {

	// Whether proxy detection is enabled
	Enable bool `toml:"Enable" comment:"Whether proxy detection is enabled"`

	// The default behaviour for proxy connections
	DefaultBehaviour string `` /* 128-byte string literal not displayed */

	// The ACL for proxy providers
	ACL map[string]bool `toml:"ACL" comment:"A list of proxy providers and whether they are allowed to join the server"`
}

type AuthVPNConfig

type AuthVPNConfig struct {

	// Whether VPN detection is enabled
	Enable bool `toml:"Enable" comment:"Whether VPN detection is enabled"`

	// The default behaviour for VPN connections
	DefaultBehaviour string `` /* 126-byte string literal not displayed */

	// The ACL for VPN providers
	ACL map[string]bool `toml:"ACL" comment:"A list of VPN providers and whether they are allowed to join the server"`
}

type AuthenticationConfig

type AuthenticationConfig struct {

	// Whether guests are allowed to join the server
	AllowGuests bool `` /* 182-byte string literal not displayed */

	// Whether content creators are allowed to join the server
	AllowContentCreators bool `` /* 195-byte string literal not displayed */

	// Whether BeamMP staff are allowed to join the server
	AllowStaff bool `` /* 177-byte string literal not displayed */

	// Idle player detection settings
	Idle AuthIdleConfig `toml:"Idle" comment:"Idle player detection settings"`

	// Online player detection settings
	Online AuthOnlineConfig `toml:"Online" comment:"Online player detection settings"`

	// VPN detection settings
	VPN AuthVPNConfig `toml:"VPN" comment:"VPN detection settings"`

	// Proxy detection settings
	Proxy AuthProxyConfig `toml:"Proxy" comment:"Proxy detection settings"`

	// Kick player detection settings
	Kick AuthKickConfig `toml:"Kick" comment:"Kick player detection settings"`

	// Admin player detection settings
	Admin AuthAdminConfig `toml:"Admin" comment:"Admin player detection settings"`
}

AuthenticationConfig is the authentication settings specific to NetBeams

type BaseConfig

type BaseConfig struct {
	// General server settings
	General GeneralConfig `` /* 301-byte string literal not displayed */

	// Miscellaneous server settings
	Misc MiscConfig `toml:"Misc"     comment:"This is for miscellaneous server settings provided by the official implementation of BeamMP"`

	// NetBeams specific settings
	NetBeams NetBeamsConfig `toml:"NetBeams" comment:"Configuration options specific to the NetBeams project"`

	// Authentication settings (also NetBeams specific, but seperated for organizational purposes)
	Auth AuthenticationConfig `` /* 161-byte string literal not displayed */
}

BaseConfig is the main config struct for the server

var Configuration BaseConfig

func LoadDefault

func LoadDefault() BaseConfig

func (*BaseConfig) Validate

func (c *BaseConfig) Validate() []ConfigError

type BlockList

type BlockList struct {

	// A list of players that are blocked from joining the server - This is effectively a perma-ban
	Players []string `toml:"Players" comment:"A list of players that are blocked from joining the server - This is effectively a perma-ban"`
}

type ConfigError

type ConfigError struct {
	// contains filtered or unexported fields
}

A ConfigError represents a single error in a config file

func (ConfigError) Error

func (e ConfigError) Error() string

type ConfigService

type ConfigService struct {
	types.Service
	// contains filtered or unexported fields
}

func Service

func Service() *ConfigService

func (*ConfigService) OnFileChange

func (s *ConfigService) OnFileChange(event fsnotify.Event)

func (*ConfigService) Start

func (s *ConfigService) Start() (types.Status, error)

func (*ConfigService) Stop

func (s *ConfigService) Stop() (types.Status, error)

func (*ConfigService) Watch

func (s *ConfigService) Watch()

type GeneralConfig

type GeneralConfig struct {
	// Name of the server
	Name string `` /* 161-byte string literal not displayed */

	// Port to listen on
	Port int `` /* 176-byte string literal not displayed */

	// Authentication key
	AuthKey string `` /* 157-byte string literal not displayed */

	// Whether to log chat messages in the console / log
	LogChat bool `toml:"LogChat" comment:"If the output log should contain chat messages"`

	// Add custom identifying tags to your server to make it easier to find. Format should be TagA,TagB,TagC. Note the comma seperation.
	Tags string `toml:"Tags" comment:""`

	// Whether to log debug messages
	Debug bool `toml:"Debug" comment:""`

	// Whether the server is private or public
	Private bool `toml:"Private" comment:""`

	// Maximum number of cars on the server
	MaxCars int `toml:"MaxCars" comment:""`

	// Maximum number of players on the server
	MaxPlayers int `toml:"MaxPlayers" comment:""`

	// Map to use
	Map string `toml:"Map" comment:""`

	// Description of the server
	Description string `toml:"Description" comment:""`

	// Folder to load resources from
	ResourceFolder string `toml:"ResourceFolder" comment:""`

	// Password to use for the server
	Password string `toml:"Password" comment:""`
}

GeneralConfig is the general server settings

func (*GeneralConfig) Validate

func (c *GeneralConfig) Validate() []ConfigError

type MiscConfig

type MiscConfig struct {

	// Hides the periodic update message which notifies you of a new server version. You should really keep this on and always update as soon as possible. For more information visit https://wiki.beammp.com/en/home/server-maintenance#updating-the-server. An update message will always appear at startup regardless.
	ImScaredOfUpdates bool `toml:"ImScaredOfUpdates"`

	// You can turn on/off the SendErrors message you get on startup here
	SendErrorsShowMessage bool `toml:"SendErrorsShowMessage"`

	// If SendErrors is `true`, the server will send helpful info about crashes and other issues back to the BeamMP developers. This info may include your config, who is on your server at the time of the error, and similar general information. This kind of data is vital in helping us diagnose and fix issues faster. This has no impact on server performance. You can opt-out of this system by setting this to `false`
	SendErrors bool `toml:"SendErrors"`
}

MiscConfig is the miscellaneous server settings

func (*MiscConfig) Validate

func (c *MiscConfig) Validate() []ConfigError

type NetBeamsConfig

type NetBeamsConfig struct {

	// The IP address of the master node
	MasterNode string `toml:"MasterNode"`

	// The port of the master node
	MasterPort int `toml:"MasterPort"`

	// The log level of the server
	LogLevel string `toml:"LogLevel"`

	// The log file of the server
	LogFile string `toml:"LogFile"`

	// The IP address of the mod server (This can be grabbed from the master node at startup)
	ModServer string `toml:"ModServer"`

	// Whether to use UPnP to automatically map the server to a port on the router
	UseUPnP bool `toml:"UseUPnP" comment:"Whether to use UPnP to automatically map the server to a port on the router"`
}

NetBeamsConfig is the settings specific to NetBeams

func (*NetBeamsConfig) Validate

func (c *NetBeamsConfig) Validate() []ConfigError

type PlayerPermissionsConfig

type PlayerPermissionsConfig struct {

	// If the player may bypass VPN connection filtering
	BypassVpn bool `toml:"BypassVpn" comment:"Whether VPN connections are allowed to join the server"`

	// If the player may bypass proxy connection filtering
	BypassProxy bool `toml:"BypassProxy" comment:"Whether proxy connections are allowed to join the server"`

	// If the player may bypass idle timeouts
	BypassIdle bool `toml:"BypassIdle" comment:"Whether idle connections are allowed to join the server"`

	// If the player may bypass online quota limits
	BypassOnline bool `toml:"BypassOnline" comment:"Whether online connections are allowed to join the server"`

	// If the player may bypass vehicle limiting
	BypassVehicles bool `toml:"BypassVehicles" comment:"Whether vehicles are allowed to join the server"`

	// If the player may hide their name in the leaderboard
	HideName bool `toml:"HideName" comment:"Whether the player's name is hidden in the leaderboard"`

	// If the player may kick other players
	KickPlayers bool `toml:"KickPlayers" comment:"Whether the user can kick other players"`

	// If the player may ban other players
	BanPlayers bool `toml:"BanPlayers" comment:"Whether the user can ban other players"`

	// If the player may mute other players
	MutePlayers bool `toml:"MutePlayers" comment:"Whether the user can mute other players"`
}

A struct representing the permissions for each player

Jump to

Keyboard shortcuts

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