models

package
v0.0.0-...-2102788 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandsArgs

type CommandsArgs struct {
	Server   *Server
	PlayerId string
	Params   []string
	IsGlobal bool
	Usage    string
}

func (*CommandsArgs) RconBigText

func (c *CommandsArgs) RconBigText(text string, a ...any)

func (*CommandsArgs) RconCommand

func (c *CommandsArgs) RconCommand(command string, a ...any) (res string)

func (*CommandsArgs) RconCommandExtractValue

func (c *CommandsArgs) RconCommandExtractValue(command string, a ...any) string

func (*CommandsArgs) RconList

func (c *CommandsArgs) RconList(list []string)

func (*CommandsArgs) RconText

func (c *CommandsArgs) RconText(text string, a ...any)

func (*CommandsArgs) RconUsage

func (c *CommandsArgs) RconUsage(text string, a ...any)

type Player

type Player struct {
	Id   string
	Guid string
	Name string
	Role int
}

type Players

type Players struct {
	Mutex sync.RWMutex
	List  map[string]Player
}

func (*Players) AddPlayer

func (players *Players) AddPlayer(playerNumber string, player Player)

func (*Players) GetPlayer

func (players *Players) GetPlayer(searchCriteria string) (*Player, error)

func (*Players) RemovePlayer

func (players *Players) RemovePlayer(playerNumber string)

type RconFunction

type RconFunction func(format string, a ...any)

type Server

type Server struct {
	Db          *sql.DB
	Rcon        quake3_rcon.Rcon
	UrtConfig   UrtConfig
	Players     Players
	Settings    ServerSettings
	Api         *api.Api
	VoteChannel chan Vote
}

func (*Server) GetCurrentMap

func (server *Server) GetCurrentMap() string

func (*Server) GetMapList

func (server *Server) GetMapList() []string

func (*Server) GetMapWithCriteria

func (server *Server) GetMapWithCriteria(searchCriteria string) (*string, error)

func (*Server) GetNextMap

func (server *Server) GetNextMap() string

func (*Server) Init

func (server *Server) Init()

func (*Server) InitSettings

func (server *Server) InitSettings()

func (*Server) IsMapAlreadyDownloaded

func (server *Server) IsMapAlreadyDownloaded(mapname string) bool

func (*Server) NewVote

func (server *Server) NewVote(v Vote)

func (*Server) RconBigText

func (server *Server) RconBigText(text string, a ...any)

func (*Server) RconCommand

func (server *Server) RconCommand(text string, a ...any)

func (*Server) RconPrint

func (server *Server) RconPrint(text string, a ...any)

func (*Server) RconText

func (server *Server) RconText(isGlobal bool, playerId string, text string, a ...any)

func (*Server) SetMapList

func (server *Server) SetMapList()

func (*Server) SetMapName

func (server *Server) SetMapName(mapName string)

func (*Server) SetNextMap

func (server *Server) SetNextMap(nextMapName string)

type ServerSettings

type ServerSettings struct {
	Mapname string
	Nextmap string
	Maplist []string
}

type UrtConfig

type UrtConfig struct {
	BasePath      string
	DownloadPath  string
	GotosPath     string
	MapRepository string
}

type Vote

type Vote struct {
	Params   []string
	PlayerId string
}

Jump to

Keyboard shortcuts

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