server

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Q3DemoEULA = `` /* 9886-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type BotConfig

type BotConfig struct {
	MinPlayers int  `name:"bot_minplayers"`
	NoChat     bool `name:"bot_nochat"`
}

type Config

type Config struct {
	FragLimit int             `name:"fraglimit"`
	TimeLimit metav1.Duration `name:"timelimit"`

	BotConfig        `json:"bot"`
	GameConfig       `json:"game"`
	FileServerConfig `json:"fs"`
	ServerConfig     `json:"server"`
	Commands         []string `json:"commands"`

	Maps
}

func Default

func Default() *Config

func (*Config) Marshal

func (c *Config) Marshal() ([]byte, error)

type FileServerConfig

type FileServerConfig struct {
	// allows people to base mods upon mods syntax to follow
	BaseGame string `name:"fs_basegame"`
	// set base path root C:\Program Files\Quake III Arena for files to be
	// downloaded from this path may change for TC's and MOD's
	BasePath string `name:"fs_basepath"`
	// toggle if files can be copied from servers or if client will download
	CopyFiles bool `name:"fs_copyfiles"`
	// possibly enables file server debug mode for download/uploads or
	// something
	Debug bool `name:"fs_debug"`
	// set gamedir set the game folder/dir default is baseq3
	Game string `name:"fs_game"`
	// possibly for TC's and MODS the default is the path to quake3.exe
	HomePath string `name:"fs_homepath"`
}

type GameConfig

type GameConfig struct {
	ForceRespawn      bool            `name:"g_forcerespawn"`
	GameType          GameType        `json:"type" name:"g_gametype"`
	Inactivity        metav1.Duration `name:"g_inactivity"`
	Log               string          `name:"g_log"`
	MOTD              string          `name:"g_motd"`
	Password          string          `name:"g_password"`
	QuadFactor        int             `name:"g_quadfactor"`
	SinglePlayerSkill int             `name:"g_spSkill"`
	WeaponRespawn     int             `name:"g_weaponrespawn"`
}

type GameType

type GameType int
const (
	FreeForAll     GameType = 0
	Tournament     GameType = 1
	SinglePlayer   GameType = 2
	TeamDeathmatch GameType = 3
	CaptureTheFlag GameType = 4
)

func (GameType) String

func (gt GameType) String() string

func (*GameType) UnmarshalText

func (gt *GameType) UnmarshalText(data []byte) error

type Map

type Map struct {
	Name string   `json:"name"`
	Type GameType `json:"type"`

	CaptureLimit int             `json:"captureLimit"`
	FragLimit    int             `json:"fragLimit"`
	TimeLimit    metav1.Duration `json:"timeLimit"`
}

type Maps

type Maps []Map

func (Maps) Marshal

func (maps Maps) Marshal() ([]byte, error)

type Server

type Server struct {
	Dir           string
	WatchInterval time.Duration
	ConfigFile    string
	Addr          string
}

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

type ServerConfig

type ServerConfig struct {
	AllowDownload bool   `name:"sv_allowDownload"`
	DownloadURL   string `name:"sv_dlURL"`
	Hostname      string `name:"sv_hostname"`
	MaxClients    int    `name:"sv_maxclients"`
	Password      string `name:"rconpassword"`
}

Jump to

Keyboard shortcuts

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