server

package
v0.0.0-...-0159b02 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2017 License: GPL-3.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PlayerDisconnected string = "playerDisc"
	PlayerSubstituted  string = "playerSub"
	PlayerConnected    string = "playerConn"
	PlayerChat         string = "playerChat"

	DisconnectedFromServer string = "discFromServer"
	MatchEnded             string = "matchEnded"
	Test                   string = "test"
	ReservationOver        string = "reservationOver"

	PlayersList string = "playersList"
)

Variables

View Source
var ErrInvalidMap = errors.New("Invalid Map Name.")
View Source
var (
	ErrNoServer = errors.New("Server doesn't exist.")
)
View Source
var (
	Listener *TF2RconWrapper.Listener
)

Functions

func ConfigName

func ConfigName(mapName string, lobbyType format.Format, ruleset string) (string, error)

func CreateDB

func CreateDB()

CreateDB initializes the sqlite database

func DeleteServer

func DeleteServer(id uint)

func ExecFile

func ExecFile(path string, rcon *tf2rcon.TF2RconConnection) error

Execute file located at path on rcon TODO: Shouldn't this be in TF2RconWrapper?

func FormatConfigName

func FormatConfigName(lobbyType format.Format) string

func ResetReportCount

func ResetReportCount(target string, lobbyID uint) error

ResetReportCount resets the !rep count for the given player in lobby lobbyID

func SetServer

func SetServer(id uint, s *Server)

func StartListener

func StartListener()

Types

type Event

type Event struct {
	Name    string
	SteamID string

	LobbyID uint
	LogsID  int //logs.tf ID
	Players []TF2RconWrapper.Player

	Self bool // true if player has repped themselves
}

Mirrored across github.com/TF2Stadium/Helen/event

type Server

type Server struct {
	Map       string // lobby map
	League    string
	Type      format.Format // 9v9 6v6 4v4...
	Whitelist string

	LobbyId uint

	StopVerifier chan struct{}

	Info gameserver.ServerRecord
	// contains filtered or unexported fields
}

func GetServer

func GetServer(id uint) (s *Server, err error)

func NewServer

func NewServer() *Server

func (*Server) CVarChange

func (s *Server) CVarChange(variable string, value string)

func (*Server) GameOver

func (s *Server) GameOver()

func (*Server) GetPlayers

func (s *Server) GetPlayers() ([]TF2RconWrapper.Player, error)

func (*Server) KickAll

func (s *Server) KickAll() error

func (*Server) KickPlayer

func (s *Server) KickPlayer(commID string, reason string) error

func (*Server) PlayerConnected

func (s *Server) PlayerConnected(data TF2RconWrapper.PlayerData)

func (*Server) PlayerDisconnected

func (s *Server) PlayerDisconnected(data TF2RconWrapper.PlayerData)

func (*Server) PlayerGlobalMessage

func (s *Server) PlayerGlobalMessage(data TF2RconWrapper.PlayerData, text string)

func (*Server) RconCommand

func (s *Server) RconCommand(_, command string)

func (*Server) Reset

func (s *Server) Reset(changeMap bool)

func (*Server) Say

func (s *Server) Say(text string) error

func (*Server) Setup

func (s *Server) Setup() error

func (*Server) StartVerifier

func (s *Server) StartVerifier(ticker *time.Ticker)

func (*Server) StopListening

func (s *Server) StopListening()

func (*Server) TournamentStarted

func (s *Server) TournamentStarted()

func (*Server) Verify

func (s *Server) Verify() bool

runs each 10 sec

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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