servermanager

package module
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 94 Imported by: 3

README

Assetto Server Manager

Build Status Discord

A web interface to manage an Assetto Corsa Server.

Features

  • Quick Race Mode
  • Custom Race Mode with saved presets
  • Live Timings for current sessions
  • Results pages for all previous sessions, with the ability to apply penalties
  • Content Management - Upload tracks, weather and cars
  • Sol Integration - Sol weather is compatible, including 24 hour time cycles (session start may advance/reverse time really fast before it syncs up - requires drivers to launch from content manager)
  • Championship mode - configure multiple race events and keep track of driver, class and team points
  • Race Weekends - a group of sequential sessions that can be run at any time. For example, you could set up a Qualifying session to run on a Saturday, then the Race to follow it on a Sunday. Server Manager handles the starting grid for you, and lets you organise Entrants into splits based on their results and other factors!
  • Integration with Assetto Corsa Skill Ratings!
  • Automatic event looping
  • Server Logs / Options Editing
  • Accounts system with different permissions levels
  • Linux and Windows Support!

If you like Assetto Server Manager, please consider supporting us with a donation!

Installation

Manual
  1. Download the latest release from the releases page
  2. Extract the release
  3. Edit the config.yml to suit your preferences
  4. Either:
    • Copy the server folder from your Assetto Corsa install into the directory you configured in config.yml, or
    • Make sure that you have steamcmd installed and in your $PATH and have configured the steam username and password in the config.yml file.
  5. Start the server using ./server-manager (on Linux) or by running server-manager.exe (on Windows)
Docker

A docker image is available under the name seejy/assetto-server-manager. We recommend using docker-compose to set up a docker environment for the server manager. This docker image has steamcmd pre-installed.

See Manual to set up server manager without Docker.

Note: if you are using a directory volume for the server install (as is shown below), be sure to make the directory before running docker-compose up - otherwise its permissions may be incorrect.

You will need a config.yml file to mount into the docker container.

An example docker-compose.yml looks like this:

version: "3"

services:
  server-manager:
    image: seejy/assetto-server-manager:latest
    ports:
    # the port that the server manager runs on
    - "8772:8772"
    # the port that the assetto server runs on (may vary depending on your configuration inside server manager)
    - "9600:9600"
    - "9600:9600/udp"
    # the port that the assetto server HTTP API runs on.
    - "8081:8081"
    # you may also wish to bind your configured UDP plugin ports here. 
    volumes: 
    # volume mount the entire server install so that 
    # content etc persists across restarts
    - ./server-install:/home/assetto/server-manager/assetto
    
    # volume mount the config
    - ./config.yml:/home/assetto/server-manager/config.yml
Post Installation

We recommend uploading your entire Assetto Corsa content/tracks folder to get the full features of Server Manager. This includes things like track images, all the correct layouts and any mod tracks you may have installed.

Also, we recommend installing Sol locally and uploading your Sol weather files to Server Manager as well so you can try out Day/Night cycles and cool weather!

Updating

Follow the steps below to update Server Manager:

  1. Back up your current Server Manager database and config.yml.
  2. Download the latest version of Server Manager
  3. Extract the zip file.
  4. Open the Changelog, read the entries between your current version and the new version. There may be configuration changes that you need to make!
  5. Make any necessary configuration changes.
  6. Find the Server Manager executable for your operating system. Replace your current Server Manager executable with it.
  7. Start the new Server Manager executable.

Build From Source Process

This is written with Linux in mind. Note that for other platforms this general flow should work, but specific commands may differ.

  1. Install Go 1.13; follow https://golang.org/doc/install#install

  2. Install Node js 12; this varies a lot based on os/distribution, Google is your friend.

  3. Enter the following commands in your terminal:

     # clone the repository (and dependencies) to your $GOPATH
     go get -u github.com/JustaPenguin/assetto-server-manager/...
     # move to the repository root
     cd $GOPATH/src/github.com/JustaPenguin/assetto-server-manager
    
  4. Set up the config.yml file in assetto-server-manager/cmd/server-manager (best to copy config.example.yml to config.yml then edit). There are important settings in here that need to be configured before sever manager will run, such as the path to steamcmd, default account information and more. Make sure you read it carefully!

  5. Time to run the manager, enter the following in your terminal:

     export GO111MODULE=on
     # run makefile commands to build and run server manager
     make clean
     make assets
     make asset-embed
     make run
    
  6. Server Manager should now be running! You can find the UI in your browser at your configured hostname (default 0.0.0.0:8772).

Credits & Thanks

Assetto Corsa Server Manager would not have been possible without the following people:

  • Henry Spencer - Twitter / GitHub
  • Callum Jones - Twitter / GitHub
  • Joseph Elton
  • The Pizzabab Championship
  • ACServerManager and its authors, for inspiration and reference on understanding the AC configuration files

Screenshots

Check out the screenshots folder!

Documentation

Index

Constants

View Source
const (
	ChampionshipEntrantAll      = "All"
	ChampionshipEntrantAccepted = "Accepted"
	ChampionshipEntrantRejected = "Rejected"
	ChampionshipEntrantPending  = "Pending Approval"
)
View Source
const (
	SessionOpennessNoJoin                                = 0
	SessionOpennessFreeJoin                              = 1
	SessionOpennessFreeJoinUntil20SecondsToTheGreenLight = 2
)
View Source
const (
	ContentTypeCar     = "Car"
	ContentTypeTrack   = "Track"
	ContentTypeWeather = "Weather"
)
View Source
const (
	ThemeDefault = "default"
	ThemeLight   = "light"
	ThemeDark    = "dark"
)
View Source
const (
	AnyCarModel = "any_car_model"
)
View Source
const (
	ContentManagerJoinLinkBase string = "https://acstuff.ru/s/q:race/online/join"
)
View Source
const IERP13c = "ier_p13c"
View Source
const MOTDFilename = "motd.txt"
View Source
const MaxLogSizeBytes = 1e6
View Source
const (
	RealPenaltySupportedVersion = "v3.02.01b"
)
View Source
const ServerExecutablePath = "acServer"

Variables

View Source
var (
	ErrInvalidChampionshipEvent = errors.New("servermanager: invalid championship event")
	ErrInvalidChampionshipClass = errors.New("servermanager: invalid championship class")
)
View Source
var (
	ErrSessionNotFound    = errors.New("servermanager: session not found")
	ErrResultFileNotFound = errors.New("servermanager: results files not found")
)
View Source
var (
	IsHosted           = os.Getenv("HOSTED") == "true"
	MaxClientsOverride = formValueAsInt(os.Getenv("MAX_CLIENTS_OVERRIDE"))
	IsPremium          = "false"
)
View Source
var (
	ErrRaceWeekendNotFound        = errors.New("servermanager: race weekend not found")
	ErrRaceWeekendSessionNotFound = errors.New("servermanager: race weekend session not found")
)
View Source
var (
	ErrNoSteamCMD = errors.New("servermanager: steamcmd was not found in $PATH")

	// ServerInstallPath is where the assetto corsa server should be/is installed
	ServerInstallPath = "assetto"

	ServerConfigPath = "cfg"
)
View Source
var BuildVersion string

BuildVersion is the time Server Manager was built at

View Source
var ChampionshipClassColors = []string{
	"#9ec6f5",
	"#91d8af",
	"#dba8ed",
	"#e3a488",
	"#e3819a",
	"#908ba1",
	"#a2b5b9",
	"#a681b4",
	"#c1929d",
	"#999ecf",
}

ChampionshipClassColors are sequentially selected to indicate different classes within a Championship

View Source
var Changelog template.HTML
View Source
var (
	CurrentMigrationVersion = len(migrations)
)
View Source
var (
	Debug = os.Getenv("DEBUG") == "true"
)
View Source
var DefaultChampionshipPoints = ChampionshipPoints{
	Places: []int{
		25,
		18,
		15,
		12,
		10,
		8,
		6,
		4,
		2,
		1,
	},
	BestLap:              0,
	PolePosition:         0,
	SecondRaceMultiplier: 1,

	CollisionWithDriver: 0,
	CollisionWithEnv:    0,
	CutTrack:            0,
}

DefaultChampionshipPoints is the Formula 1 points system.

View Source
var DefaultTrackSurfacePresets = []TrackSurfacePreset{
	{
		Name:            "Dusty",
		SessionStart:    86,
		SessionTransfer: 50,
		Randomness:      1,
		LapGain:         30,
		Description:     "A very slippery track, improves fast with more laps.",
	},
	{
		Name:            "Old",
		SessionStart:    89,
		SessionTransfer: 80,
		Randomness:      3,
		LapGain:         50,
		Description:     "Old tarmac. Bad grip that won't get better soon.",
	},
	{
		Name:            "Slow",
		SessionStart:    96,
		SessionTransfer: 80,
		Randomness:      1,
		LapGain:         300,
		Description:     "A slow track that doesn't improve much.",
	},
	{
		Name:            "Green",
		SessionStart:    95,
		SessionTransfer: 90,
		Randomness:      2,
		LapGain:         132,
		Description:     "A clean track, gets better with more laps.",
	},
	{
		Name:            "Fast",
		SessionStart:    98,
		SessionTransfer: 80,
		Randomness:      2,
		LapGain:         700,
		Description:     "Very grippy track right from the start.",
	},
	{
		Name:            "Optimum",
		SessionStart:    100,
		SessionTransfer: 100,
		Randomness:      0,
		LapGain:         1,
		Description:     "Perfect track for hotlapping.",
	},
}
View Source
var ErrAccountNeedsPassword = errors.New("servermanager: account needs to set a password")
View Source
var ErrAccountNotFound = errors.New("servermanager: account not found")
View Source
var ErrChampionshipNotFound = errors.New("servermanager: championship not found")
View Source
var ErrClassNotFound = errors.New("servermanager: championship class not found")
View Source
var ErrCommandUnstoppable = errors.New("servermanager: command is unstoppable")
View Source
var ErrCouldNotFindTyreForCar = errors.New("servermanager: could not find tyres for car")
View Source
var ErrCustomRaceNotFound = errors.New("servermanager: custom race not found")
View Source
var ErrEntryListFull = errors.New("servermanager: entry list is full")
View Source
var ErrEntryListTooBig = errors.New("servermanager: EntryList exceeds MaxClients setting")
View Source
var ErrInvalidUsernameOrPassword = errors.New("servermanager: invalid username or password")
View Source
var ErrMustSubmitCar = errors.New("servermanager: you must set a car")
View Source
var ErrNoActiveChampionshipEvent = errors.New("servermanager: no active championship event")
View Source
var ErrNoActiveRaceWeekendSession = errors.New("servermanager: no active race weekend session")
View Source
var ErrNoOpenUDPConnection = errors.New("servermanager: no open UDP connection found")
View Source
var ErrPluginConfigurationRequiresUDPPortSetup = errors.New("servermanager: kissmyrank and stracker configuration requires UDP plugin configuration in Server Options")
View Source
var ErrRaceWeekendFilterNotFound = errors.New("servermanager: race weekend filter not found")
View Source
var ErrRaceWeekendSessionDependencyIncomplete = errors.New("servermanager: race weekend session dependency incomplete")
View Source
var ErrRaceWeekendUnknownSplitType = errors.New("servermanager: unknown split type")
View Source
var ErrResultsPageNotFound = errors.New("servermanager: results page not found")
View Source
var ErrScheduledTimeIsZero = errors.New("servermanager: can't schedule race for zero time")
View Source
var ErrServerProcessTimeout = errors.New("servermanager: server process did not stop even after manual kill. please check your server configuration")
View Source
var ErrSessionCarNotFound = errors.New("servermanager: session car not found")
View Source
var ErrValueNotSet = errors.New("servermanager: value not set")
View Source
var HTTPCounter = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "web_requests_total",
		Help: "A counter for requests to the wrapped handler.",
	},
	[]string{"code", "method"},
)
View Source
var HTTPDuration = prometheus.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:    "request_duration_seconds",
		Help:    "A histogram of latencies for requests.",
		Buckets: []float64{.25, .5, 1, 2.5, 5, 10},
	},
	[]string{"handler", "method"},
)

HTTPDuration is partitioned by the HTTP method and handler. It uses custom buckets based on the expected request duration.

View Source
var HTTPInFlightGauge = prometheus.NewGauge(prometheus.GaugeOpts{
	Name: "in_flight_requests",
	Help: "A gauge of requests currently being served by the wrapped handler.",
})
View Source
var HTTPResponseSize = prometheus.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:    "response_size_bytes",
		Help:    "A histogram of response sizes for requests.",
		Buckets: []float64{200, 500, 900, 1500},
	},
	[]string{},
)

HTTPResponseSize has no labels, making it a zero-dimensional ObserverVec.

View Source
var IERP13cTyres = []string{"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8"}
View Source
var LaunchTime = time.Now()
View Source
var RaceWeekendEntryListSorters = []RaceWeekendEntryListSorterDescription{
	{
		Name:                  "No Sort (Use Finishing Grid)",
		Key:                   "",
		Sorter:                RaceWeekendEntryListSortFunc(UnchangedRaceWeekendEntryListSort),
		NeedsParentSession:    false,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Fastest Lap",
		Key:                   "fastest_lap",
		Sorter:                RaceWeekendEntryListSortFunc(FastestLapRaceWeekendEntryListSort),
		NeedsParentSession:    true,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Total Race Time",
		Key:                   "total_race_time",
		Sorter:                RaceWeekendEntryListSortFunc(TotalRaceTimeRaceWeekendEntryListSort),
		NeedsParentSession:    true,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Fastest Lap Across Multiple Results Files",
		Key:                   "fastest_multi_results_lap",
		Sorter:                RaceWeekendEntryListSortFunc(FastestResultsFileRaceWeekendEntryListSort),
		NeedsParentSession:    false,
		NeedsChampionship:     false,
		ShowInManageEntryList: false,
	},
	{
		Name:                  "Number of Laps Across Multiple Results Files",
		Key:                   "number_multi_results_lap",
		Sorter:                RaceWeekendEntryListSortFunc(NumberResultsFileRaceWeekendEntryListSort),
		NeedsParentSession:    false,
		NeedsChampionship:     false,
		ShowInManageEntryList: false,
	},
	{
		Name:                  "Fewest Collisions",
		Key:                   "fewest_collisions",
		Sorter:                RaceWeekendEntryListSortFunc(FewestCollisionsRaceWeekendEntryListSort),
		NeedsParentSession:    true,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Fewest Cuts",
		Key:                   "fewest_cuts",
		Sorter:                RaceWeekendEntryListSortFunc(FewestCutsRaceWeekendEntryListSort),
		NeedsParentSession:    true,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Safety (Collisions then Cuts)",
		Key:                   "safety",
		Sorter:                RaceWeekendEntryListSortFunc(SafetyRaceWeekendEntryListSort),
		NeedsParentSession:    true,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Championship Standings Order",
		Key:                   "championship_standings_order",
		Sorter:                &ChampionshipStandingsOrderEntryListSort{},
		NeedsParentSession:    false,
		NeedsChampionship:     true,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Championship Class",
		Key:                   "championship_class",
		Sorter:                &ChampionshipClassSort{},
		NeedsParentSession:    false,
		NeedsChampionship:     true,
		ShowInManageEntryList: false,
	},
	{
		Name:                  "Random",
		Key:                   "random",
		Sorter:                RaceWeekendEntryListSortFunc(RandomRaceWeekendEntryListSort),
		NeedsParentSession:    false,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
	{
		Name:                  "Alphabetical (Using Driver Name)",
		Key:                   "alphabetical",
		Sorter:                RaceWeekendEntryListSortFunc(AlphabeticalRaceWeekendEntryListSort),
		NeedsParentSession:    false,
		NeedsChampionship:     false,
		ShowInManageEntryList: true,
	},
}
View Source
var ThemeOptions = []ThemeDetails{
	{
		Theme: ThemeDefault,
		Name:  "Use Default",
	},
	{
		Theme: ThemeLight,
		Name:  "Light",
	},
	{
		Theme: ThemeDark,
		Name:  "Dark",
	},
}
View Source
var UseFallBackSorting = false
View Source
var UseShortenedDriverNames = true

Functions

func AddErrorFlash

func AddErrorFlash(w http.ResponseWriter, r *http.Request, message string)

func AddFlash

func AddFlash(w http.ResponseWriter, r *http.Request, message string)

Helper function to get message session and add a flash

func AdminAccess

func AdminAccess(r *http.Request) func() bool

func AnonymiseDriverGUID added in v1.7.3

func AnonymiseDriverGUID(guid string) string

func AssetCacheHeaders

func AssetCacheHeaders(next http.Handler, useRevalidation bool) http.HandlerFunc

func BuildICalEvent

func BuildICalEvent(event ScheduledEvent) *components.Event

func CarDataFile

func CarDataFile(carModel, dataFile string) (io.ReadCloser, error)

func CarNameFromFilepath

func CarNameFromFilepath(path string) (string, error)

CarNameFromFilepath takes a filepath e.g. content/cars/rss_formula_rss_4/data.acd and returns the car name, e.g. in this case: rss_formula_rss_4.

func ChampionshipClassColor

func ChampionshipClassColor(i int) string

func CleanGUIDs added in v1.7.8

func CleanGUIDs(guids []string) []string

func DecodeFormData added in v1.7.6

func DecodeFormData(out interface{}, r *http.Request) error

func DeleteAccess

func DeleteAccess(r *http.Request) func() bool

func EncodeFormData added in v1.7.6

func EncodeFormData(data interface{}, r *http.Request) (template.HTML, error)

EncodeFormData uses formulate to build template.HTML from a struct

func FastestResultsFileRaceWeekendEntryListSort

func FastestResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, filter *RaceWeekendSessionToSessionFilter) error

func FewestCollisionsRaceWeekendEntryListSort

func FewestCollisionsRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error

func FileServer

func FileServer(r chi.Router, path string, root http.FileSystem, useRevalidation bool)

func FreeUDPPort

func FreeUDPPort() (int, error)

func GenerateSummary

func GenerateSummary(raceSetup CurrentRaceConfig, eventType string) string

func GetResultDate

func GetResultDate(name string) (time.Time, error)

func InitLogging

func InitLogging()

func InitLua

func InitLua(raceControl *RaceControl)

func InitMonitoring

func InitMonitoring()

func InitWithResolver

func InitWithResolver(resolver *Resolver) error

func InstallAssettoCorsaServer

func InstallAssettoCorsaServer(login, password string, force bool) error

InstallAssettoCorsaServer takes a steam login and password and runs steamcmd to install the assetto server. If the "ServerInstallPath" exists, this function will exit without installing - unless force == true.

func IsAssettoInstalled

func IsAssettoInstalled() bool

func IsDirWriteable

func IsDirWriteable(dir string) error

func IsKissMyRankInstalled added in v1.7.2

func IsKissMyRankInstalled() bool

IsKissMyRankInstalled looks in the ServerInstallPath for a "kissmyrank" directory with the correct kissmyrank executable for the given platform

func IsRealPenaltyInstalled added in v1.7.5

func IsRealPenaltyInstalled() bool

func IsStrackerInstalled

func IsStrackerInstalled() bool

IsStrackerInstalled looks in the ServerInstallPath for an "stracker" directory with the correct stracker executable for the given platform

func KissMyRankConfigPath added in v1.7.2

func KissMyRankConfigPath() string

func KissMyRankExecutablePath added in v1.7.2

func KissMyRankExecutablePath() string

func KissMyRankFolderPath added in v1.7.2

func KissMyRankFolderPath() string

func ListSetupsForCar

func ListSetupsForCar(model string) (map[string][]string, error)

func LoadTrackMapImage

func LoadTrackMapImage(track, trackLayout string) (image.Image, error)

func LoadTyresFromACDINI

func LoadTyresFromACDINI(data []byte) (map[string]string, error)

LoadTyresFromACDINI reads the tyres.ini file from within the data.acd of a car and finds all available tyre compounds.

func LoggedIn

func LoggedIn(r *http.Request) func() bool

func LuaHTTPRequest

func LuaHTTPRequest(l *lua.LState) int

func Migrate

func Migrate(store Store) error

func NormaliseEntrantGUID added in v1.7.5

func NormaliseEntrantGUID(guid string) string

NormaliseEntrantGUID takes a guid which may have driverSwapEntrantSeparators in it, sorts all GUIDs in the string and then rejoins them by driverSwapEntrantSeparator

func NormaliseEntrantGUIDs added in v1.7.5

func NormaliseEntrantGUIDs(guids []string) string

NormaliseEntrantGUIDs takes a list of guids, sorts them and joins them by driverSwapEntrantSeparator

func NumberResultsFileRaceWeekendEntryListSort

func NumberResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, filter *RaceWeekendSessionToSessionFilter) error

func Premium added in v1.7.3

func Premium() bool

func ReadAccess

func ReadAccess(r *http.Request) func() bool

func RealPenaltyExecutablePath added in v1.7.5

func RealPenaltyExecutablePath() string

func RealPenaltyFolderPath added in v1.7.5

func RealPenaltyFolderPath() string

func RoundTripper

func RoundTripper(t http.RoundTripper) http.RoundTripper

func Router

func Router(
	fs http.FileSystem,
	quickRaceHandler *QuickRaceHandler,
	customRaceHandler *CustomRaceHandler,
	championshipsHandler *ChampionshipsHandler,
	accountHandler *AccountHandler,
	auditLogHandler *AuditLogHandler,
	carsHandler *CarsHandler,
	tracksHandler *TracksHandler,
	weatherHandler *WeatherHandler,
	penaltiesHandler *PenaltiesHandler,
	resultsHandler *ResultsHandler,
	contentUploadHandler *ContentUploadHandler,
	serverAdministrationHandler *ServerAdministrationHandler,
	raceControlHandler *RaceControlHandler,
	scheduledRacesHandler *ScheduledRacesHandler,
	raceWeekendHandler *RaceWeekendHandler,
	strackerHandler *StrackerHandler,
	healthCheck *HealthCheck,
	kissMyRankHandler *KissMyRankHandler,
	realPenaltyHandler *RealPenaltyHandler,
) http.Handler

func SetAssettoInstallPath

func SetAssettoInstallPath(installPath string)

func StrackerExecutablePath

func StrackerExecutablePath() string

func StrackerFolderPath

func StrackerFolderPath() string

func ToggleDRSForTrack

func ToggleDRSForTrack(track, layout string, drsEnabled bool) error

func TotalRaceTimeRaceWeekendEntryListSort

func TotalRaceTimeRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error

func TrackMapImageURL added in v1.7.5

func TrackMapImageURL(track, trackLayout string) string

func WriteAccess

func WriteAccess(r *http.Request) func() bool

Types

type ACHTTPPlayers

type ACHTTPPlayers struct {
	Cars []*CMCar `json:"Cars"`
}

type ACHTTPSessionInfo

type ACHTTPSessionInfo struct {
	Cars         []string    `json:"cars"`
	Clients      int64       `json:"clients"`
	Country      []string    `json:"country"`
	HTTPPort     int64       `json:"cport"`
	Durations    []int64     `json:"durations"`
	Extra        bool        `json:"extra"`
	Inverted     int64       `json:"inverted"`
	IP           string      `json:"ip"`
	JSON         interface{} `json:"json"`
	L            bool        `json:"l"`
	MaxClients   int64       `json:"maxclients"`
	Name         string      `json:"name"`
	Pass         bool        `json:"pass"`
	Pickup       bool        `json:"pickup"`
	Pit          bool        `json:"pit"`
	Port         int64       `json:"port"`
	Session      int64       `json:"session"`
	Sessiontypes []int64     `json:"sessiontypes"`
	Timed        bool        `json:"timed"`
	Timeleft     int64       `json:"timeleft"`
	Timeofday    int64       `json:"timeofday"`
	Timestamp    int64       `json:"timestamp"`
	TCPPort      int64       `json:"tport"`
	Track        string      `json:"track"`
}

type ACSRClient

type ACSRClient struct {
	Enabled   bool
	AccountID string
	APIKey    string
}

func NewACSRClient

func NewACSRClient(accountID, apiKey string, enabled bool) *ACSRClient

func (*ACSRClient) GetRanges added in v1.7.6

func (a *ACSRClient) GetRanges() ([]*ACSRRatingRanges, error)

func (*ACSRClient) GetRating added in v1.7.3

func (a *ACSRClient) GetRating(guids ...string) (map[string]*ACSRDriverRating, error)

func (*ACSRClient) SendChampionship

func (a *ACSRClient) SendChampionship(inChampionship Championship)

Sends a championship to ACSR, called OnEndSession and when a championship is created

type ACSRDriverRating added in v1.7.3

type ACSRDriverRating struct {
	DriverID         uint    `json:"driver_id"`
	SkillRatingGrade string  `json:"skill_rating_grade"`
	SkillRating      float64 `json:"skill_rating"`
	SafetyRating     int     `json:"safety_rating"`
	NumEvents        int     `json:"num_events"`
	IsProvisional    bool    `json:"is_provisional"`
}

type ACSRDriverRatingRequest added in v1.7.3

type ACSRDriverRatingRequest struct {
	GUIDs []string `json:"guids"`
}

type ACSRRanges added in v1.7.6

type ACSRRanges struct {
	Ranges             []*ACSRRatingRanges
	HighestSkillCount  int
	HighestSafetyCount int
}

type ACSRRatingGateMet added in v1.7.6

type ACSRRatingGateMet struct {
	ACSRDriverRating *ACSRDriverRating `json:"acsr_driver_rating"`
	GateMet          bool              `json:"gate_met"`
	ACSREnabled      bool              `json:"acsr_enabled"`
}

type ACSRRatingRanges added in v1.7.6

type ACSRRatingRanges struct {
	Name       string `json:"name"`
	RatingType string `json:"rating_type"`
	Count      int    `json:"count"`
	Min        int    `json:"min"`
	Max        int    `json:"max"`
}

type Account

type Account struct {
	ID uuid.UUID

	Created time.Time
	Updated time.Time
	Deleted time.Time

	Name   string
	Groups map[ServerID]Group

	DriverName, GUID, Team string

	PasswordHash string
	PasswordSalt string

	DefaultPassword   string
	LastSeenVersion   string
	HasSeenIntroPopup bool

	Theme Theme

	// Deprecated: Use Groups instead.
	DeprecatedGroup Group `json:"Group"`
}
var OpenAccount *Account

func AccountFromRequest

func AccountFromRequest(r *http.Request) *Account

func NewAccount

func NewAccount() *Account

func (Account) Group

func (a Account) Group() Group

func (Account) HasGroupPrivilege

func (a Account) HasGroupPrivilege(g Group) bool

func (Account) HasSeenCurrentVersion

func (a Account) HasSeenCurrentVersion() bool

func (Account) HasSeenVersion

func (a Account) HasSeenVersion(version string) bool

func (Account) IsDefaultHostedAccount added in v1.7.5

func (a Account) IsDefaultHostedAccount() bool

func (Account) NeedsPasswordReset

func (a Account) NeedsPasswordReset() bool

func (Account) ShouldSeeIntroPopup added in v1.7.5

func (a Account) ShouldSeeIntroPopup() bool

func (Account) ShouldSeeUpgradePopup added in v1.7.5

func (a Account) ShouldSeeUpgradePopup() bool

func (Account) ShowDarkTheme

func (a Account) ShowDarkTheme(serverManagerDarkThemeEnabled bool) bool

type AccountHandler

type AccountHandler struct {
	*BaseHandler
	SteamLoginHandler
	// contains filtered or unexported fields
}

func NewAccountHandler

func NewAccountHandler(baseHandler *BaseHandler, store Store, accountManager *AccountManager) *AccountHandler

func (*AccountHandler) AdminAccessMiddleware

func (ah *AccountHandler) AdminAccessMiddleware(next http.Handler) http.Handler

func (*AccountHandler) DeleteAccessMiddleware

func (ah *AccountHandler) DeleteAccessMiddleware(next http.Handler) http.Handler

func (*AccountHandler) MustLoginMiddleware

func (ah *AccountHandler) MustLoginMiddleware(requiredGroup Group, next http.Handler) http.Handler

MustLoginMiddleware determines whether an account needs to log in to access a given Group page

func (*AccountHandler) ReadAccessMiddleware

func (ah *AccountHandler) ReadAccessMiddleware(next http.Handler) http.Handler

func (*AccountHandler) WriteAccessMiddleware

func (ah *AccountHandler) WriteAccessMiddleware(next http.Handler) http.Handler

type AccountManager

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

func NewAccountManager

func NewAccountManager(store Store) *AccountManager

func (*AccountManager) ChangePassword

func (am *AccountManager) ChangePassword(account *Account, password string) error

func (*AccountManager) SetCurrentVersion

func (am *AccountManager) SetCurrentVersion(account *Account) error

type AccountsConfig

type AccountsConfig struct {
	AdminPasswordOverride string `yaml:"admin_password_override"`
}

type ActiveChampionship

type ActiveChampionship struct {
	Name                    string
	ChampionshipID, EventID uuid.UUID
	SessionType             SessionType
	OverridePassword        bool
	ReplacementPassword     string
	Description             string
	IsPracticeSession       bool
	RaceConfig              CurrentRaceConfig
	EntryList               EntryList

	NumLapsCompleted   int `json:"-"`
	NumRaceStartEvents int `json:"-"`
}

func (*ActiveChampionship) EventDescription

func (a *ActiveChampionship) EventDescription() string

func (*ActiveChampionship) EventName

func (a *ActiveChampionship) EventName() string

func (*ActiveChampionship) GetEntryList

func (a *ActiveChampionship) GetEntryList() EntryList

func (*ActiveChampionship) GetForceStopTime added in v1.7.2

func (a *ActiveChampionship) GetForceStopTime() time.Duration

func (*ActiveChampionship) GetForceStopWithDrivers added in v1.7.2

func (a *ActiveChampionship) GetForceStopWithDrivers() bool

func (*ActiveChampionship) GetRaceConfig

func (a *ActiveChampionship) GetRaceConfig() CurrentRaceConfig

func (*ActiveChampionship) GetURL

func (a *ActiveChampionship) GetURL() string

func (*ActiveChampionship) IsChampionship

func (a *ActiveChampionship) IsChampionship() bool

func (*ActiveChampionship) IsLooping

func (a *ActiveChampionship) IsLooping() bool

func (*ActiveChampionship) IsPractice

func (a *ActiveChampionship) IsPractice() bool

func (*ActiveChampionship) IsRaceWeekend

func (a *ActiveChampionship) IsRaceWeekend() bool

func (*ActiveChampionship) IsTimeAttack added in v1.7.4

func (a *ActiveChampionship) IsTimeAttack() bool

func (*ActiveChampionship) OverrideServerPassword

func (a *ActiveChampionship) OverrideServerPassword() bool

func (*ActiveChampionship) ReplacementServerPassword

func (a *ActiveChampionship) ReplacementServerPassword() string

type ActiveRaceWeekend

type ActiveRaceWeekend struct {
	Name                                     string
	RaceWeekendID, SessionID, ChampionshipID uuid.UUID
	OverridePassword                         bool
	ReplacementPassword                      string
	Description                              string
	IsPracticeSession                        bool
	RaceConfig                               CurrentRaceConfig
	EntryList                                EntryList
}

ActiveRaceWeekend indicates which RaceWeekend and RaceWeekendSession are currently running on the server.

func (ActiveRaceWeekend) EventDescription

func (a ActiveRaceWeekend) EventDescription() string

func (ActiveRaceWeekend) EventName

func (a ActiveRaceWeekend) EventName() string

func (ActiveRaceWeekend) GetEntryList

func (a ActiveRaceWeekend) GetEntryList() EntryList

func (ActiveRaceWeekend) GetForceStopTime added in v1.7.2

func (a ActiveRaceWeekend) GetForceStopTime() time.Duration

func (ActiveRaceWeekend) GetForceStopWithDrivers added in v1.7.2

func (a ActiveRaceWeekend) GetForceStopWithDrivers() bool

func (ActiveRaceWeekend) GetRaceConfig

func (a ActiveRaceWeekend) GetRaceConfig() CurrentRaceConfig

func (ActiveRaceWeekend) GetURL

func (a ActiveRaceWeekend) GetURL() string

func (ActiveRaceWeekend) IsChampionship

func (a ActiveRaceWeekend) IsChampionship() bool

func (ActiveRaceWeekend) IsLooping

func (a ActiveRaceWeekend) IsLooping() bool

func (ActiveRaceWeekend) IsPractice

func (a ActiveRaceWeekend) IsPractice() bool

func (ActiveRaceWeekend) IsRaceWeekend

func (a ActiveRaceWeekend) IsRaceWeekend() bool

func (ActiveRaceWeekend) IsTimeAttack added in v1.7.4

func (a ActiveRaceWeekend) IsTimeAttack() bool

func (ActiveRaceWeekend) OverrideServerPassword

func (a ActiveRaceWeekend) OverrideServerPassword() bool

func (ActiveRaceWeekend) ReplacementServerPassword

func (a ActiveRaceWeekend) ReplacementServerPassword() string

type AssetHelper

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

func NewAssetHelper

func NewAssetHelper(baseURL, prefix, suffix string, query map[string]string) *AssetHelper

func (*AssetHelper) GetURL

func (a *AssetHelper) GetURL(location string) string

type AssettoServerProcess

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

AssettoServerProcess manages the Assetto Corsa Server process.

func NewAssettoServerProcess

func NewAssettoServerProcess(callbackFunc udp.CallbackFunc, store Store, contentManagerWrapper *ContentManagerWrapper) *AssettoServerProcess

func (*AssettoServerProcess) Event

func (sp *AssettoServerProcess) Event() RaceEvent

func (*AssettoServerProcess) IsRunning

func (sp *AssettoServerProcess) IsRunning() bool

func (*AssettoServerProcess) Logs

func (sp *AssettoServerProcess) Logs() string

func (*AssettoServerProcess) NotifyDone added in v1.7.1

func (sp *AssettoServerProcess) NotifyDone(ch chan struct{})

func (*AssettoServerProcess) Restart

func (sp *AssettoServerProcess) Restart() error

func (*AssettoServerProcess) SendUDPMessage

func (sp *AssettoServerProcess) SendUDPMessage(message udp.Message) error

func (*AssettoServerProcess) Start

func (sp *AssettoServerProcess) Start(event RaceEvent, udpPluginAddress string, udpPluginLocalPort int, forwardingAddress string, forwardListenPort int) error

func (*AssettoServerProcess) Stop

func (sp *AssettoServerProcess) Stop() error

func (*AssettoServerProcess) UDPCallback

func (sp *AssettoServerProcess) UDPCallback(message udp.Message)

type AuditEntry

type AuditEntry struct {
	UserGroup Group
	Method    string
	URL       string
	User      string
	Time      time.Time
}

type AuditLogHandler

type AuditLogHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewAuditLogHandler

func NewAuditLogHandler(baseHandler *BaseHandler, store Store) *AuditLogHandler

func (*AuditLogHandler) Middleware

func (alh *AuditLogHandler) Middleware(next http.Handler) http.Handler

type BaseHandler

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

func NewBaseHandler

func NewBaseHandler(viewRenderer *Renderer) *BaseHandler

type BaseTemplateVars

type BaseTemplateVars struct {
	Messages              []interface{}
	Errors                []interface{}
	ServerStatus          bool
	ServerEvent           RaceEvent
	ServerName            string
	CustomCSS             template.CSS
	User                  *Account
	IsHosted              bool
	IsPremium             bool
	MaxClientsOverride    int
	IsDarkTheme           bool
	Request               *http.Request
	Debug                 bool
	MonitoringEnabled     bool
	SentryDSN             template.JSStr
	RecaptchaSiteKey      string
	WideContainer         bool
	OGImage               string
	ACSREnabled           bool
	BaseURLIsSet          bool
	BaseURLIsValid        bool
	ServerID              ServerID
	ShowEventDetailsPopup bool
}

func (*BaseTemplateVars) Get

type BlockListMode added in v1.7.8

type BlockListMode uint8
const (
	BlockListModeNormalKick BlockListMode = 0
	BlockListModeNoRejoin   BlockListMode = 1
	BlockListModeAddToList  BlockListMode = 2
)

func (BlockListMode) SelectMultiple added in v1.7.8

func (b BlockListMode) SelectMultiple() bool

func (BlockListMode) SelectOptions added in v1.7.8

func (b BlockListMode) SelectOptions() []formulate.Option

type BoltStore

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

func (*BoltStore) AddAuditEntry

func (rs *BoltStore) AddAuditEntry(entry *AuditEntry) error

func (*BoltStore) ClearLastRaceEvent

func (rs *BoltStore) ClearLastRaceEvent() error

func (*BoltStore) DeleteAccount

func (rs *BoltStore) DeleteAccount(id string) error

func (*BoltStore) DeleteChampionship

func (rs *BoltStore) DeleteChampionship(id string) error

func (*BoltStore) DeleteCustomRace

func (rs *BoltStore) DeleteCustomRace(race *CustomRace) error

func (*BoltStore) DeleteEntrant

func (rs *BoltStore) DeleteEntrant(id string) error

func (*BoltStore) DeleteRaceWeekend

func (rs *BoltStore) DeleteRaceWeekend(id string) error

func (*BoltStore) FindAccountByID

func (rs *BoltStore) FindAccountByID(id string) (*Account, error)

func (*BoltStore) FindAccountByName

func (rs *BoltStore) FindAccountByName(name string) (*Account, error)

func (*BoltStore) FindCustomRaceByID

func (rs *BoltStore) FindCustomRaceByID(uuid string) (*CustomRace, error)

func (*BoltStore) GetAuditEntries

func (rs *BoltStore) GetAuditEntries() ([]*AuditEntry, error)

func (*BoltStore) GetMeta

func (rs *BoltStore) GetMeta(key string, out interface{}) error

func (*BoltStore) ListAccounts

func (rs *BoltStore) ListAccounts() ([]*Account, error)

func (*BoltStore) ListChampionships

func (rs *BoltStore) ListChampionships() ([]*Championship, error)

func (*BoltStore) ListCustomRaces

func (rs *BoltStore) ListCustomRaces() ([]*CustomRace, error)

func (*BoltStore) ListEntrants

func (rs *BoltStore) ListEntrants() ([]*Entrant, error)

func (*BoltStore) ListPrevFrames

func (rs *BoltStore) ListPrevFrames() ([]string, error)

func (*BoltStore) ListRaceWeekends

func (rs *BoltStore) ListRaceWeekends() ([]*RaceWeekend, error)

func (*BoltStore) LoadChampionship

func (rs *BoltStore) LoadChampionship(id string) (*Championship, error)

func (*BoltStore) LoadKissMyRankOptions added in v1.7.2

func (rs *BoltStore) LoadKissMyRankOptions() (*KissMyRankConfig, error)

func (*BoltStore) LoadLastRaceEvent

func (rs *BoltStore) LoadLastRaceEvent() (RaceEvent, error)

func (*BoltStore) LoadLiveTimingsData

func (rs *BoltStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)

func (*BoltStore) LoadRaceWeekend

func (rs *BoltStore) LoadRaceWeekend(id string) (*RaceWeekend, error)

func (*BoltStore) LoadRealPenaltyOptions added in v1.7.5

func (rs *BoltStore) LoadRealPenaltyOptions() (*RealPenaltyConfig, error)

func (*BoltStore) LoadServerOptions

func (rs *BoltStore) LoadServerOptions() (*GlobalServerConfig, error)

func (*BoltStore) LoadStrackerOptions

func (rs *BoltStore) LoadStrackerOptions() (*StrackerConfiguration, error)

func (*BoltStore) SetMeta

func (rs *BoltStore) SetMeta(key string, value interface{}) error

func (*BoltStore) UpsertAccount

func (rs *BoltStore) UpsertAccount(a *Account) error

func (*BoltStore) UpsertChampionship

func (rs *BoltStore) UpsertChampionship(c *Championship) error

func (*BoltStore) UpsertCustomRace

func (rs *BoltStore) UpsertCustomRace(race *CustomRace) error

func (*BoltStore) UpsertEntrant

func (rs *BoltStore) UpsertEntrant(entrant Entrant) error

func (*BoltStore) UpsertKissMyRankOptions added in v1.7.2

func (rs *BoltStore) UpsertKissMyRankOptions(kmr *KissMyRankConfig) error

func (*BoltStore) UpsertLastRaceEvent

func (rs *BoltStore) UpsertLastRaceEvent(r RaceEvent) error

func (*BoltStore) UpsertLiveFrames

func (rs *BoltStore) UpsertLiveFrames(frameLinks []string) error

func (*BoltStore) UpsertLiveTimingsData

func (rs *BoltStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error

func (*BoltStore) UpsertRaceWeekend

func (rs *BoltStore) UpsertRaceWeekend(rw *RaceWeekend) error

func (*BoltStore) UpsertRealPenaltyOptions added in v1.7.5

func (rs *BoltStore) UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error

func (*BoltStore) UpsertServerOptions

func (rs *BoltStore) UpsertServerOptions(so *GlobalServerConfig) error

func (*BoltStore) UpsertStrackerOptions

func (rs *BoltStore) UpsertStrackerOptions(sto *StrackerConfiguration) error

type Broadcaster

type Broadcaster interface {
	Send(message udp.Message) ([]byte, error)
}

type CMAssists

type CMAssists struct {
	ABSState             FactoryAssist `json:"absState"`
	AllowedTyresOut      int           `json:"allowedTyresOut"`
	AutoClutchAllowed    bool          `json:"autoclutchAllowed"`
	DamageMultiplier     int           `json:"damageMultiplier"`
	ForceVirtualMirror   bool          `json:"forceVirtualMirror"`
	FuelRate             int           `json:"fuelRate"`
	StabilityAllowed     bool          `json:"stabilityAllowed"`
	TractionControlState FactoryAssist `json:"tcState"`
	TyreBlanketsAllowed  bool          `json:"tyreBlanketsAllowed"`
	TyreWearRate         int           `json:"tyreWearRate"`
}

type CMCar

type CMCar struct {
	DriverName      string `json:"DriverName"`
	DriverNation    string `json:"DriverNation"`
	DriverTeam      string `json:"DriverTeam"`
	ID              string `json:"ID"`
	IsConnected     bool   `json:"IsConnected"`
	IsEntryList     bool   `json:"IsEntryList"`
	IsRequestedGUID bool   `json:"IsRequestedGUID"`
	Model           string `json:"Model"`
	Skin            string `json:"Skin"`
}

type CMContent

type CMContent struct {
	Cars  map[string]ContentURL `json:"cars"`
	Track ContentURL            `json:"track"`

	// @TODO not functional
	Password bool `json:"password"`
}

type CalendarObject

type CalendarObject struct {
	ID                string    `json:"id"`
	ScheduledServerID ServerID  `json:"scheduledServerID"`
	GroupID           string    `json:"groupId"`
	AllDay            bool      `json:"allDay"`
	Start             time.Time `json:"start"`
	End               time.Time `json:"end"`
	Title             string    `json:"title"`
	Description       string    `json:"description"`
	URL               string    `json:"url"`
	SignUpURL         string    `json:"signUpURL"`
	ClassNames        []string  `json:"classNames"`
	Editable          bool      `json:"editable"`
	StartEditable     bool      `json:"startEditable"`
	DurationEditable  bool      `json:"durationEditable"`
	ResourceEditable  bool      `json:"resourceEditable"`
	Rendering         string    `json:"rendering"`
	Overlap           bool      `json:"overlap"`

	Constraint      string `json:"constraint"`
	BackgroundColor string `json:"backgroundColor"`
	BorderColor     string `json:"borderColor"`
	TextColor       string `json:"textColor"`
}

func BuildCalObject

func BuildCalObject(scheduled []ScheduledEvent, calendarObjects []CalendarObject) ([]CalendarObject, error)

type Car

type Car struct {
	Name    string
	Skins   []string
	Tyres   map[string]string
	Details CarDetails
}

func (Car) IsMod

func (c Car) IsMod() bool

func (Car) IsPaidDLC

func (c Car) IsPaidDLC() bool

func (Car) PrettyName

func (c Car) PrettyName() string

type CarDetails

type CarDetails struct {
	Author        string          `json:"author"`
	Brand         string          `json:"brand"`
	Class         string          `json:"class"`
	Country       string          `json:"country"`
	Description   string          `json:"description"`
	Name          string          `json:"name"`
	PowerCurve    [][]json.Number `json:"powerCurve"`
	Specs         CarSpecs        `json:"specs"`
	SpecsNumeric  CarSpecsNumeric `json:"spec"`
	Tags          []string        `json:"tags"`
	TorqueCurve   [][]json.Number `json:"torqueCurve"`
	URL           string          `json:"url"`
	Version       string          `json:"version"`
	Year          ShouldBeAnInt   `json:"year"`
	IsStock       bool            `json:"stock"`
	IsDLC         bool            `json:"dlc"`
	IsMod         bool            `json:"mod"`
	Key           string          `json:"key"`
	PrettifiedKey string          `json:"prettified_key"`

	DownloadURL string `json:"downloadURL"`
	Notes       string `json:"notes"`
}

func (*CarDetails) AddTag

func (cd *CarDetails) AddTag(name string)

func (*CarDetails) DelTag

func (cd *CarDetails) DelTag(name string)

func (*CarDetails) Load

func (cd *CarDetails) Load(carName string) error

func (*CarDetails) Save

func (cd *CarDetails) Save(carName string) error

type CarManager

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

func NewCarManager

func NewCarManager(trackManager *TrackManager, watchForCarChanges, useCarNameCache bool) *CarManager

func (*CarManager) AddTag

func (cm *CarManager) AddTag(carName, tag string) error

func (*CarManager) CreateOrOpenSearchIndex

func (cm *CarManager) CreateOrOpenSearchIndex() error

CreateSearchIndex builds a search index for the cars

func (*CarManager) DeIndexCar

func (cm *CarManager) DeIndexCar(name string) error

DeIndexCar removes a car from the index.

func (*CarManager) DelTag

func (cm *CarManager) DelTag(carName, tag string) error

func (*CarManager) DeleteCar

func (cm *CarManager) DeleteCar(carName string) error

DeleteCar removes a car from the file system and search index.

func (*CarManager) DeleteSkin

func (cm *CarManager) DeleteSkin(car, skin string) error

func (*CarManager) IndexAllCars

func (cm *CarManager) IndexAllCars() error

IndexAllCars loads all current cars and adds them to the search index

func (*CarManager) IndexCar

func (cm *CarManager) IndexCar(car *Car) error

IndexCar indexes an individual car.

func (*CarManager) ListCars

func (cm *CarManager) ListCars() (Cars, error)

func (*CarManager) LoadCar

func (cm *CarManager) LoadCar(name string, tyres Tyres) (*Car, error)

LoadCar reads a car from the content folder on the filesystem

func (*CarManager) RandomSkin

func (cm *CarManager) RandomSkin(model string) string

func (*CarManager) ResultsForCar

func (cm *CarManager) ResultsForCar(car string) ([]SessionResults, error)

ResultsForCar finds results for a given car.

func (*CarManager) SaveCarDetails

func (cm *CarManager) SaveCarDetails(carName string, car *Car) error

SaveCarDetails saves a car's details, and indexes that car.

func (*CarManager) Search

func (cm *CarManager) Search(ctx context.Context, term string, from, size int) (*bleve.SearchResult, Cars, error)

Search looks for cars in the search index.

func (*CarManager) UpdateCarMetadata

func (cm *CarManager) UpdateCarMetadata(carName string, r *http.Request) error

func (*CarManager) UpdateTyres added in v1.7.5

func (cm *CarManager) UpdateTyres(car *Car) error

func (*CarManager) UploadSkin

func (cm *CarManager) UploadSkin(carName string, files map[string][]*multipart.FileHeader) error

type CarSetups

type CarSetups map[string]map[string][]string

CarSetups is a map of car name to the setups for that car. it is a map of car name => track name => []setup

func ListAllSetups

func ListAllSetups() (CarSetups, error)

type CarSpecs

type CarSpecs struct {
	Acceleration string `json:"acceleration"`
	BHP          string `json:"bhp"`
	PWRatio      string `json:"pwratio"`
	TopSpeed     string `json:"topspeed"`
	Torque       string `json:"torque"`
	Weight       string `json:"weight"`
}

func (CarSpecs) Numeric

func (cs CarSpecs) Numeric() CarSpecsNumeric

type CarSpecsNumeric

type CarSpecsNumeric struct {
	Acceleration int `json:"acceleration"`
	BHP          int `json:"bhp"`
	PWRatio      int `json:"pwratio"`
	TopSpeed     int `json:"topspeed"`
	Torque       int `json:"torque"`
	Weight       int `json:"weight"`
}

type Cars

type Cars []*Car

func (Cars) AsMap

func (cs Cars) AsMap() map[string][]string

type CarsHandler

type CarsHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewCarsHandler

func NewCarsHandler(baseHandler *BaseHandler, carManager *CarManager) *CarsHandler

type Championship

type Championship struct {
	ID                  uuid.UUID
	Name                string
	Created             time.Time
	Updated             time.Time
	Deleted             time.Time
	OverridePassword    bool
	ReplacementPassword string

	// acsr integration - sends the championship to acsr on save and event complete
	ACSR                 bool
	ACSRSkillGate        string
	ACSRSafetyGate       int
	EnableACSRSafetyGate bool
	EnableACSRSkillGate  bool

	// Raw html can be attached to championships, used to share tracks/cars etc.
	Info template.HTML

	// URL to a specific OG Image for the championship
	OGImage string

	// OpenEntrants indicates that entrant names do not need to be specified in the EntryList.
	// As Entrants join a championship, the available Entrant slots will be filled by the information
	// provided by a join message. The EntryList for each class will still need creating, but
	// can omit names/GUIDs/teams as necessary. These can then be edited after the fact.
	OpenEntrants bool

	// PersistOpenEntrants (used with OpenEntrants) indicates that drivers who join the Championship
	// should be added to the Championship EntryList. This is ON by default.
	PersistOpenEntrants bool

	// SignUpForm gives anyone on the web access to a Championship Sign Up Form so that they can
	// mark themselves for participation in this Championship.
	SignUpForm ChampionshipSignUpForm

	Classes []*ChampionshipClass
	Events  []*ChampionshipEvent

	// SpectatorCar is a car defined in the Championship settings that if set up is added to the back of the grid
	// of every event in the Championship.
	SpectatorCar        Entrant
	SpectatorCarEnabled bool

	DefaultTab ChampionshipTab
}

A Championship is a collection of ChampionshipEvents for a group of Entrants. Each Entrant in a Championship is awarded Points for their position in a ChampionshipEvent.

func NewChampionship

func NewChampionship(name string) *Championship

NewChampionship creates a Championship with a given name, creating a UUID for the championship as well.

func (*Championship) AddClass

func (c *Championship) AddClass(class *ChampionshipClass)

AddClass to the championship

func (*Championship) AddEntrantFromSession

func (c *Championship) AddEntrantFromSession(potentialEntrant PotentialChampionshipEntrant) (foundFreeEntrantSlot bool, entrant *Entrant, entrantClass *ChampionshipClass, err error)

func (*Championship) AddEntrantInFirstFreeSlot

func (c *Championship) AddEntrantInFirstFreeSlot(potentialEntrant PotentialChampionshipEntrant) (foundFreeEntrantSlot bool, entrant *Entrant, entrantClass *ChampionshipClass, err error)

func (*Championship) AllEntrants

func (c *Championship) AllEntrants() EntryList

AllEntrants returns the list of all entrants in the championship (across ALL classes)

func (*Championship) AttachClassIDToResults

func (c *Championship) AttachClassIDToResults(results *SessionResults)

func (*Championship) ClassByID

func (c *Championship) ClassByID(id string) (*ChampionshipClass, error)

ClassByID finds a ChampionshipClass by its ID string.

func (*Championship) ClearEntrant

func (c *Championship) ClearEntrant(entrantGUID string)

func (*Championship) DriverMeetsACSRGates added in v1.7.6

func (c *Championship) DriverMeetsACSRGates(rating *ACSRDriverRating) bool

func (*Championship) EnhanceResults

func (c *Championship) EnhanceResults(results *SessionResults)

EnhanceResults takes a set of SessionResults and attaches Championship information to them.

func (*Championship) EntrantAttendance

func (c *Championship) EntrantAttendance(guid string) int

func (*Championship) EventByID

func (c *Championship) EventByID(id string) (*ChampionshipEvent, int, error)

EventByID finds a ChampionshipEvent by its ID string.

func (*Championship) FindClassForCarModel

func (c *Championship) FindClassForCarModel(model string) (*ChampionshipClass, error)

func (*Championship) FindLastResultForDriver

func (c *Championship) FindLastResultForDriver(guid string) (out *SessionResult, teamName string)

func (*Championship) GetPlayerSummary

func (c *Championship) GetPlayerSummary(guid string) string

func (*Championship) GetURL

func (c *Championship) GetURL() string

func (*Championship) HasScheduledEvents

func (c *Championship) HasScheduledEvents() bool

func (*Championship) HasSpectatorCar added in v1.7.5

func (c *Championship) HasSpectatorCar() bool

func (*Championship) HasTeamNames

func (c *Championship) HasTeamNames() bool

func (*Championship) ImportEvent

func (c *Championship) ImportEvent(eventToImport interface{}) (*ChampionshipEvent, error)

func (*Championship) IsMultiClass

func (c *Championship) IsMultiClass() bool

IsMultiClass is true if the Championship has more than one Class

func (*Championship) MostRecentScheduledDateFormat added in v1.7.5

func (c *Championship) MostRecentScheduledDateFormat(format string) string

func (*Championship) NumCompletedEvents

func (c *Championship) NumCompletedEvents() int

func (*Championship) NumEntrants

func (c *Championship) NumEntrants() int

NumEntrants is the number of entrants across all Classes in a Championship.

func (*Championship) NumPendingSignUps

func (c *Championship) NumPendingSignUps() int

func (*Championship) Progress

func (c *Championship) Progress() float64

Progress of the Championship as a percentage

func (*Championship) SignUpAvailable

func (c *Championship) SignUpAvailable() bool

func (*Championship) ValidCarIDs

func (c *Championship) ValidCarIDs() []string

ValidCarIDs returns a set of all of the valid cars in the Championship - that is, the smallest possible list of Cars driven by the Entrants.

type ChampionshipClass

type ChampionshipClass struct {
	ID   uuid.UUID
	Name string

	Entrants      EntryList
	Points        ChampionshipPoints
	AvailableCars []string

	DriverPenalties, TeamPenalties map[string]int
}

ChampionshipClass contains a Name, Entrants (including Cars, Skins) and Points for those Entrants

func NewChampionshipClass

func NewChampionshipClass(name string) *ChampionshipClass

NewChampionshipClass creates a championship class with the default points

func (*ChampionshipClass) AssignToFreeEntrantSlot

func (c *ChampionshipClass) AssignToFreeEntrantSlot(entrant *Entrant, potentialEntrant PotentialChampionshipEntrant)

func (*ChampionshipClass) AttachEntrantToResult

func (c *ChampionshipClass) AttachEntrantToResult(entrant *Entrant, results *SessionResults)

func (*ChampionshipClass) CountPositionsForDriver added in v1.7.8

func (c *ChampionshipClass) CountPositionsForDriver(i int, guid string, inEvents []*ChampionshipEvent) int

func (*ChampionshipClass) CountPositionsForTeam added in v1.7.8

func (c *ChampionshipClass) CountPositionsForTeam(i int, team string, inEvents []*ChampionshipEvent) int

func (*ChampionshipClass) DriverInClass

func (c *ChampionshipClass) DriverInClass(result *SessionResult) bool

func (*ChampionshipClass) HadBetterFinishingPositions added in v1.7.8

func (c *ChampionshipClass) HadBetterFinishingPositions(guidA, guidB string, inEvents []*ChampionshipEvent, numPositions int) bool

func (*ChampionshipClass) PenaltyForGUID

func (c *ChampionshipClass) PenaltyForGUID(guid string) int

func (*ChampionshipClass) PenaltyForTeam

func (c *ChampionshipClass) PenaltyForTeam(name string) int

func (*ChampionshipClass) ResultsForClass

func (c *ChampionshipClass) ResultsForClass(results []*SessionResult, championship *Championship) (filtered []*SessionResult)

func (*ChampionshipClass) Standings

func (c *ChampionshipClass) Standings(championship *Championship, inEvents []*ChampionshipEvent, standingOpts ...StandingsOption) []*ChampionshipStanding

Standings returns the current Driver Standings for the Championship.

func (*ChampionshipClass) StandingsForEntrantAtEvent added in v1.7.5

func (c *ChampionshipClass) StandingsForEntrantAtEvent(championship *Championship, event *ChampionshipEvent, entrant *ChampionshipStanding) *ChampionshipStandingWithTableInfo

func (*ChampionshipClass) StandingsForEvent

func (c *ChampionshipClass) StandingsForEvent(championship *Championship, event *ChampionshipEvent) []*ChampionshipStanding

StandingsForEvent reports the standings for a single event, not including any generic points penalties applied to the championship.

func (*ChampionshipClass) TeamHadBetterFinishingPositions added in v1.7.8

func (c *ChampionshipClass) TeamHadBetterFinishingPositions(teamA, teamB string, inEvents []*ChampionshipEvent, numPositions int) bool

func (*ChampionshipClass) TeamStandings

func (c *ChampionshipClass) TeamStandings(championship *Championship, inEvents []*ChampionshipEvent) []*TeamStanding

TeamStandings returns the current position of Teams in the Championship.

func (*ChampionshipClass) ValidCarIDs

func (c *ChampionshipClass) ValidCarIDs() []string

ValidCarIDs returns a set of all cars chosen within the given class

type ChampionshipClassSort added in v1.7.5

type ChampionshipClassSort struct{}

func (ChampionshipClassSort) Sort added in v1.7.5

type ChampionshipEntrantStatus

type ChampionshipEntrantStatus string

type ChampionshipEvent

type ChampionshipEvent struct {
	ScheduledEventBase

	ID uuid.UUID

	RaceSetup CurrentRaceConfig
	EntryList EntryList

	Sessions map[SessionType]*ChampionshipSession `json:",omitempty"`

	// RaceWeekendID is the ID of the linked RaceWeekend for this ChampionshipEvent
	RaceWeekendID uuid.UUID
	// If RaceWeekendID is non-nil, RaceWeekend will be populated on loading the Championship.
	RaceWeekend *RaceWeekend

	StartedTime   time.Time
	CompletedTime time.Time
	// contains filtered or unexported fields
}

A ChampionshipEvent is a given RaceSetup with Sessions.

func DuplicateChampionshipEvent

func DuplicateChampionshipEvent(event *ChampionshipEvent) *ChampionshipEvent

copied an existing ChampionshipEvent but assigns a new ID

func ExtractRaceWeekendSessionsIntoIndividualEvents

func ExtractRaceWeekendSessionsIntoIndividualEvents(inEvents []*ChampionshipEvent) []*ChampionshipEvent

extractRaceWeekendSessionsIntoIndividualEvents looks for race weekend events, and makes each indiivdual session of that race weekend a Championship Event, to aide with points tallying

func NewChampionshipEvent

func NewChampionshipEvent() *ChampionshipEvent

NewChampionshipEvent creates a ChampionshipEvent with an ID

func (*ChampionshipEvent) Cars

func (cr *ChampionshipEvent) Cars(c *Championship) []string

func (*ChampionshipEvent) CombineEntryLists

func (cr *ChampionshipEvent) CombineEntryLists(championship *Championship) EntryList

func (*ChampionshipEvent) Completed

func (cr *ChampionshipEvent) Completed() bool

Completed ChampionshipEvents have a non-zero CompletedTime

func (*ChampionshipEvent) GetID

func (cr *ChampionshipEvent) GetID() uuid.UUID

func (*ChampionshipEvent) GetRaceSetup

func (cr *ChampionshipEvent) GetRaceSetup() CurrentRaceConfig

func (*ChampionshipEvent) GetScheduledServerID added in v1.7.8

func (cr *ChampionshipEvent) GetScheduledServerID() ServerID

func (*ChampionshipEvent) GetSummary

func (cr *ChampionshipEvent) GetSummary() string

func (*ChampionshipEvent) GetURL

func (cr *ChampionshipEvent) GetURL() string

func (*ChampionshipEvent) HasSignUpForm

func (cr *ChampionshipEvent) HasSignUpForm() bool

func (*ChampionshipEvent) InProgress

func (cr *ChampionshipEvent) InProgress() bool

InProgress indicates whether a ChampionshipEvent has been started but not stopped

func (*ChampionshipEvent) IsRaceWeekend

func (cr *ChampionshipEvent) IsRaceWeekend() bool

func (*ChampionshipEvent) LastSession

func (cr *ChampionshipEvent) LastSession() SessionType

LastSession returns the last configured session in the championship, in the following order: Race, Qualifying, Practice, Booking

func (*ChampionshipEvent) ReadOnlyEntryList

func (cr *ChampionshipEvent) ReadOnlyEntryList() EntryList

type ChampionshipManager

type ChampionshipManager struct {
	*RaceManager
	// contains filtered or unexported fields
}

func NewChampionshipManager

func NewChampionshipManager(raceManager *RaceManager, acsrClient *ACSRClient) *ChampionshipManager

func (*ChampionshipManager) AddEntrantFromSessionData

func (cm *ChampionshipManager) AddEntrantFromSessionData(championship *Championship, potentialEntrant PotentialChampionshipEntrant, overwriteSkinForAllEvents bool, takeFirstFreeSlot bool) (foundFreeEntrantSlot bool, entrantClass *ChampionshipClass, err error)

func (*ChampionshipManager) BuildChampionshipEventOpts

func (cm *ChampionshipManager) BuildChampionshipEventOpts(r *http.Request) (*RaceTemplateVars, error)

func (*ChampionshipManager) BuildChampionshipOpts

func (cm *ChampionshipManager) BuildChampionshipOpts(r *http.Request) (championship *Championship, opts *ChampionshipTemplateVars, err error)

func (*ChampionshipManager) BuildICalFeed

func (cm *ChampionshipManager) BuildICalFeed(championshipID string, w io.Writer) error

func (*ChampionshipManager) CancelEvent

func (cm *ChampionshipManager) CancelEvent(championshipID string, eventID string) error

func (*ChampionshipManager) ChampionshipEventCallback

func (cm *ChampionshipManager) ChampionshipEventCallback(message udp.Message)

func (*ChampionshipManager) ChampionshipEventIsRunning

func (cm *ChampionshipManager) ChampionshipEventIsRunning() bool

func (*ChampionshipManager) DeleteChampionship

func (cm *ChampionshipManager) DeleteChampionship(id string) error

func (*ChampionshipManager) DeleteEvent

func (cm *ChampionshipManager) DeleteEvent(championshipID string, eventID string) error

func (*ChampionshipManager) DuplicateChampionship added in v1.7.5

func (cm *ChampionshipManager) DuplicateChampionship(championshipID string) (*Championship, error)

func (*ChampionshipManager) DuplicateEvent added in v1.7.2

func (cm *ChampionshipManager) DuplicateEvent(event *ChampionshipEvent, championship *Championship) (*ChampionshipEvent, error)

func (*ChampionshipManager) DuplicateEventInChampionship added in v1.7.5

func (cm *ChampionshipManager) DuplicateEventInChampionship(championshipID, eventID string) (*ChampionshipEvent, error)

func (*ChampionshipManager) FinalEventConfigurationFiles added in v1.7.5

func (cm *ChampionshipManager) FinalEventConfigurationFiles(championship *Championship, event *ChampionshipEvent, isPreChampionshipPracticeEvent bool) (CurrentRaceConfig, EntryList)

func (*ChampionshipManager) FindNextEventRecurrence

func (cm *ChampionshipManager) FindNextEventRecurrence(event *ChampionshipEvent, start time.Time) time.Time

func (*ChampionshipManager) GetChampionshipAndEvent

func (cm *ChampionshipManager) GetChampionshipAndEvent(championshipID string, eventID string) (*Championship, *ChampionshipEvent, error)

func (*ChampionshipManager) HandleChampionshipSignUp

func (cm *ChampionshipManager) HandleChampionshipSignUp(r *http.Request) (response *ChampionshipSignUpResponse, foundSlot bool, err error)

func (*ChampionshipManager) HandleCreateChampionship

func (cm *ChampionshipManager) HandleCreateChampionship(r *http.Request) (championship *Championship, edited bool, err error)

func (*ChampionshipManager) ImportChampionship

func (cm *ChampionshipManager) ImportChampionship(jsonData string) (string, error)

func (*ChampionshipManager) ImportEvent

func (cm *ChampionshipManager) ImportEvent(championshipID string, eventID string, r *http.Request) error

func (*ChampionshipManager) ImportEventSetup

func (cm *ChampionshipManager) ImportEventSetup(championshipID string, eventID string) error

func (*ChampionshipManager) ImportRaceWeekendSetup

func (cm *ChampionshipManager) ImportRaceWeekendSetup(championshipID string, eventID string) error

func (*ChampionshipManager) InitScheduledChampionships

func (cm *ChampionshipManager) InitScheduledChampionships() error

func (*ChampionshipManager) ListAvailableResultsFilesForEvent

func (cm *ChampionshipManager) ListAvailableResultsFilesForEvent(championshipID string, eventID string) (*ChampionshipEvent, []SessionResults, error)

func (*ChampionshipManager) ListChampionships

func (cm *ChampionshipManager) ListChampionships() ([]*Championship, error)

func (*ChampionshipManager) LoadACSRRanges added in v1.7.6

func (cm *ChampionshipManager) LoadACSRRanges() ([]*ACSRRatingRanges, error)

func (*ChampionshipManager) LoadACSRRating added in v1.7.6

func (cm *ChampionshipManager) LoadACSRRating(guid string) (*ACSRDriverRating, error)

func (*ChampionshipManager) LoadACSRRatings added in v1.7.3

func (cm *ChampionshipManager) LoadACSRRatings(championship *Championship) (map[string]*ACSRDriverRating, error)

func (*ChampionshipManager) LoadChampionship

func (cm *ChampionshipManager) LoadChampionship(id string) (*Championship, error)

func (*ChampionshipManager) ModifyDriverPenalty

func (cm *ChampionshipManager) ModifyDriverPenalty(championshipID, classID, driverGUID string, action PenaltyAction, penalty int) error

func (*ChampionshipManager) ModifyTeamPenalty

func (cm *ChampionshipManager) ModifyTeamPenalty(championshipID, classID, team string, action PenaltyAction, penalty int) error

func (*ChampionshipManager) ReorderChampionshipEvents

func (cm *ChampionshipManager) ReorderChampionshipEvents(championshipID string, championshipEventIDsInOrder []string) error

func (*ChampionshipManager) RestartActiveEvent

func (cm *ChampionshipManager) RestartActiveEvent() error

func (*ChampionshipManager) RestartEvent

func (cm *ChampionshipManager) RestartEvent(championshipID string, eventID string) error

func (*ChampionshipManager) SaveChampionshipEvent

func (cm *ChampionshipManager) SaveChampionshipEvent(r *http.Request) (championship *Championship, event *ChampionshipEvent, edited bool, err error)

func (*ChampionshipManager) ScheduleEvent

func (cm *ChampionshipManager) ScheduleEvent(championshipID string, eventID string, date time.Time, action string, recurrence string) error

func (*ChampionshipManager) ScheduleNextEventFromRecurrence

func (cm *ChampionshipManager) ScheduleNextEventFromRecurrence(championship *Championship, event *ChampionshipEvent) error

func (*ChampionshipManager) StartEvent

func (cm *ChampionshipManager) StartEvent(championshipID string, eventID string, isPreChampionshipPracticeEvent bool) error

func (*ChampionshipManager) StartPracticeEvent

func (cm *ChampionshipManager) StartPracticeEvent(championshipID string, eventID string) error

Start a 2hr long Practice Event based off the existing championship event with eventID

func (*ChampionshipManager) StartScheduledEvent

func (cm *ChampionshipManager) StartScheduledEvent(championship *Championship, event *ChampionshipEvent) error

func (*ChampionshipManager) StopActiveEvent

func (cm *ChampionshipManager) StopActiveEvent() error

func (*ChampionshipManager) UpsertChampionship

func (cm *ChampionshipManager) UpsertChampionship(c *Championship) error

type ChampionshipPoints

type ChampionshipPoints struct {
	Places       []int
	BestLap      int
	PolePosition int

	CollisionWithDriver int
	CollisionWithEnv    int
	CutTrack            int

	SecondRaceMultiplier float64
}

ChampionshipPoints represent the potential points for positions as well as other awards in a Championship.

func (*ChampionshipPoints) ForPos

func (pts *ChampionshipPoints) ForPos(i int) float64

PointForPos uses the Championship's Points to determine what number should be awarded to a given position

type ChampionshipSession

type ChampionshipSession struct {
	StartedTime   time.Time
	CompletedTime time.Time

	Results *SessionResults

	RaceWeekendSession *RaceWeekendSession
}

A ChampionshipSession contains information found from the live portion of the Championship tool

func (*ChampionshipSession) Completed

func (ce *ChampionshipSession) Completed() bool

Completed ChampionshipSessions have a non-zero CompletedTime

func (*ChampionshipSession) InProgress

func (ce *ChampionshipSession) InProgress() bool

InProgress indicates whether a ChampionshipSession has been started but not stopped

func (*ChampionshipSession) IsRaceWeekend

func (ce *ChampionshipSession) IsRaceWeekend() bool

type ChampionshipSignUpForm

type ChampionshipSignUpForm struct {
	Enabled          bool
	AskForEmail      bool
	AskForTeam       bool
	HideCarChoice    bool
	ExtraFields      []string
	RequiresApproval bool

	Responses []*ChampionshipSignUpResponse
}

func (ChampionshipSignUpForm) EmailList

func (c ChampionshipSignUpForm) EmailList(group string) string

type ChampionshipSignUpResponse

type ChampionshipSignUpResponse struct {
	Created time.Time

	Name      string
	GUID      string
	Team      string
	Email     string
	Car       string
	Skin      string
	Questions map[string]string

	Status ChampionshipEntrantStatus
}

func (ChampionshipSignUpResponse) GetCar

func (csr ChampionshipSignUpResponse) GetCar() string

func (ChampionshipSignUpResponse) GetGUID

func (csr ChampionshipSignUpResponse) GetGUID() string

func (ChampionshipSignUpResponse) GetName

func (csr ChampionshipSignUpResponse) GetName() string

func (ChampionshipSignUpResponse) GetSkin

func (csr ChampionshipSignUpResponse) GetSkin() string

func (ChampionshipSignUpResponse) GetTeam

func (csr ChampionshipSignUpResponse) GetTeam() string

type ChampionshipStanding

type ChampionshipStanding struct {
	Car *SessionCar

	// Teams is a map of Team Name to how many Events per team were completed.
	Teams  map[string]int
	Points float64
}

ChampionshipStanding is the current number of Points an Entrant in the Championship has.

func NewChampionshipStanding

func NewChampionshipStanding(car *SessionCar) *ChampionshipStanding

func (*ChampionshipStanding) AddEventForTeam

func (cs *ChampionshipStanding) AddEventForTeam(team string)

func (*ChampionshipStanding) TeamSummary

func (cs *ChampionshipStanding) TeamSummary() string

type ChampionshipStandingWithTableInfo added in v1.7.5

type ChampionshipStandingWithTableInfo struct {
	*ChampionshipStanding

	BackgroundColour template.CSS
	NoFinishReason   string
}

type ChampionshipStandingsOrderEntryListSort

type ChampionshipStandingsOrderEntryListSort struct{}

func (ChampionshipStandingsOrderEntryListSort) Sort

type ChampionshipTab added in v1.7.8

type ChampionshipTab string
const (
	ChampionshipTabDriverStandings ChampionshipTab = "Driver Standings"
	ChampionshipTabTeamStandings   ChampionshipTab = "Team Standings"
	ChampionshipTabOverview        ChampionshipTab = "Overview"
	ChampionshipTabEntrants        ChampionshipTab = "Entrants"
	ChampionshipTabPointsReference ChampionshipTab = "Points Reference"
)

type ChampionshipTemplateVars

type ChampionshipTemplateVars struct {
	*RaceTemplateVars

	DefaultPoints             ChampionshipPoints
	DefaultClass              *ChampionshipClass
	ACSREnabled               bool
	ACSRRanges                *ACSRRanges
	AvailableChampionshipTabs []ChampionshipTab
}

type ChampionshipsConfig

type ChampionshipsConfig struct {
	RecaptchaConfig struct {
		SiteKey   string `yaml:"site_key"`
		SecretKey string `yaml:"secret_key"`
	} `yaml:"recaptcha"`
}

type ChampionshipsHandler

type ChampionshipsHandler struct {
	*BaseHandler
	SteamLoginHandler
	// contains filtered or unexported fields
}

func NewChampionshipsHandler

func NewChampionshipsHandler(baseHandler *BaseHandler, championshipManager *ChampionshipManager) *ChampionshipsHandler

type Collision

type Collision struct {
	ID              string         `json:"ID"`
	Type            CollisionType  `json:"Type"`
	Time            time.Time      `json:"Time" ts:"date"`
	OtherDriverGUID udp.DriverGUID `json:"OtherDriverGUID"`
	OtherDriverName string         `json:"OtherDriverName"`
	Speed           float64        `json:"Speed"`
}

type CollisionType

type CollisionType string
const (
	CollisionWithCar         CollisionType = "with other car"
	CollisionWithEnvironment CollisionType = "with environment"
)

type CommandPlugin

type CommandPlugin struct {
	Executable string   `yaml:"executable"`
	Arguments  []string `yaml:"arguments"`
}

func (*CommandPlugin) String

func (c *CommandPlugin) String() string

type Configuration

type Configuration struct {
	HTTP          HTTPConfig          `yaml:"http"`
	Steam         SteamConfig         `yaml:"steam"`
	Store         StoreConfig         `yaml:"store"`
	LiveMap       LiveMapConfig       `yaml:"live_map"`
	Server        ServerExtraConfig   `yaml:"server"`
	Accounts      AccountsConfig      `yaml:"accounts"`
	Monitoring    MonitoringConfig    `yaml:"monitoring"`
	Championships ChampionshipsConfig `yaml:"championships"`
	Lua           LuaConfig           `yaml:"lua"`
}

func ReadConfig

func ReadConfig(location string) (conf *Configuration, err error)

type ContentFile

type ContentFile struct {
	Name     string `json:"name"`
	FileType string `json:"type"`
	FilePath string `json:"filepath"`
	Data     string `json:"dataBase64"`
	Size     int    `json:"size"`
}

type ContentManagerWrapper

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

func NewContentManagerWrapper

func NewContentManagerWrapper(store Store, carManager *CarManager, trackManager *TrackManager) *ContentManagerWrapper

func (*ContentManagerWrapper) NewCMContent

func (cmw *ContentManagerWrapper) NewCMContent(cars []string, trackName string, requirePassword bool) (*CMContent, error)

func (*ContentManagerWrapper) ServeHTTP

func (cmw *ContentManagerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*ContentManagerWrapper) Start

func (cmw *ContentManagerWrapper) Start(servePort int, event RaceEvent, logger cmwSessionLogger) error

func (*ContentManagerWrapper) Stop

func (cmw *ContentManagerWrapper) Stop()

func (*ContentManagerWrapper) UDPCallback

func (cmw *ContentManagerWrapper) UDPCallback(message udp.Message)

type ContentManagerWrapperData

type ContentManagerWrapperData struct {
	ACHTTPSessionInfo
	Players ACHTTPPlayers `json:"players"`

	Description string `json:"description"`

	AmbientTemperature uint8  `json:"ambientTemperature"`
	RoadTemperature    uint8  `json:"roadTemperature"`
	WindDirection      int    `json:"windDirection"`
	WindSpeed          int    `json:"windSpeed"`
	CurrentWeatherID   string `json:"currentWeatherId"`
	Grip               int    `json:"grip"`
	GripTransfer       int    `json:"gripTransfer"`

	Assists          CMAssists `json:"assists"`
	MaxContactsPerKM int       `json:"maxContactsPerKm"`

	City             string    `json:"city"`
	PasswordChecksum [2]string `json:"passwordChecksum"`
	WrappedPort      int       `json:"wrappedPort"`

	Content   *CMContent `json:"content"`
	Frequency int        `json:"frequency"`
	Until     int64      `json:"until"`
}

type ContentType

type ContentType string

type ContentURL

type ContentURL struct {
	URL string `json:"url"`
}

type ContentUploadHandler

type ContentUploadHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewContentUploadHandler

func NewContentUploadHandler(baseHandler *BaseHandler, carManager *CarManager, trackManager *TrackManager) *ContentUploadHandler

type CurrentRaceConfig

type CurrentRaceConfig struct {
	Cars                      string        `ini:"CARS" show:"quick" input:"multiSelect" formopts:"CarOpts" help:"Models of cars allowed in the server"`
	Track                     string        `ini:"TRACK" show:"quick" input:"dropdown" formopts:"TrackOpts" help:"Track name"`
	TrackLayout               string        `` /* 128-byte string literal not displayed */
	SunAngle                  int           `ini:"SUN_ANGLE" help:"Angle of the position of the sun"`
	LegalTyres                string        `ini:"LEGAL_TYRES" help:"List of tyres short names that are allowed"`
	FuelRate                  int           `ini:"FUEL_RATE" min:"0" help:"Fuel usage from 0 (no fuel usage) to XXX (100 is the realistic one)"`
	DamageMultiplier          int           `ini:"DAMAGE_MULTIPLIER" min:"0" max:"100" help:"Damage from 0 (no damage) to 100 (full damage)"`
	TyreWearRate              int           `ini:"TYRE_WEAR_RATE" min:"0" help:"Tyre wear from 0 (no tyre wear) to XXX (100 is the realistic one)"`
	AllowedTyresOut           int           `ini:"ALLOWED_TYRES_OUT" help:"TODO: I have no idea"`
	ABSAllowed                FactoryAssist `` /* 133-byte string literal not displayed */
	TractionControlAllowed    FactoryAssist `` /* 129-byte string literal not displayed */
	StabilityControlAllowed   int           `ini:"STABILITY_ALLOWED" input:"checkbox" help:"Stability assist 0 -> OFF; 1 -> ON"`
	AutoClutchAllowed         int           `ini:"AUTOCLUTCH_ALLOWED" input:"checkbox" help:"Autoclutch assist 0 -> OFF; 1 -> ON"`
	TyreBlanketsAllowed       int           `` /* 147-byte string literal not displayed */
	ForceVirtualMirror        int           `` /* 126-byte string literal not displayed */
	RacePitWindowStart        int           `ini:"RACE_PIT_WINDOW_START" help:"pit window opens at lap/minute specified"`
	RacePitWindowEnd          int           `ini:"RACE_PIT_WINDOW_END" help:"pit window closes at lap/minute specified"`
	ReversedGridRacePositions int           `` /* 216-byte string literal not displayed */
	TimeOfDayMultiplier       int           `ini:"TIME_OF_DAY_MULT" help:"multiplier for the time of day"`
	QualifyMaxWaitPercentage  int           `` /* 205-byte string literal not displayed */
	RaceGasPenaltyDisabled    int           `` /* 195-byte string literal not displayed */
	MaxBallastKilograms       int           `` /* 131-byte string literal not displayed */
	RaceExtraLap              int           `ini:"RACE_EXTRA_LAP" input:"checkbox" help:"If the race is timed, force an extra lap after the leader has crossed the line"`
	MaxContactsPerKilometer   int           `ini:"MAX_CONTACTS_PER_KM" help:"Maximum number times you can make contact with another car in 1 kilometer."`
	ResultScreenTime          int           `ini:"RESULT_SCREEN_TIME" help:"Seconds of result screen between racing sessions"`

	PickupModeEnabled int `` /* 227-byte string literal not displayed */
	LockedEntryList   int `ini:"LOCKED_ENTRY_LIST" input:"checkbox" help:"Only players already included in the entry list can join the server"`
	LoopMode          int `ini:"LOOP_MODE" input:"checkbox" help:"the server restarts from the first track, to disable this set it to 0"`

	DriverSwapEnabled               int `ini:"-" help:"Enable Driver Swaps, in order to carry out a Driver Swap give an entrant two or more GUIDs separated by ;'s'"`
	DriverSwapMinTime               int `` /* 221-byte string literal not displayed */
	DriverSwapDisqualifyTime        int `` /* 131-byte string literal not displayed */
	DriverSwapPenaltyTime           int `` /* 155-byte string literal not displayed */
	DriverSwapMinimumNumberOfSwaps  int `ini:"-" help:"Minimum number of swaps required."`
	DriverSwapNotEnoughSwapsPenalty int `` /* 127-byte string literal not displayed */

	MaxClients   int       `ini:"MAX_CLIENTS" help:"max number of clients (must be <= track's number of pits)"`
	RaceOverTime int       `` /* 128-byte string literal not displayed */
	StartRule    StartRule `` /* 173-byte string literal not displayed */

	IsSol int `` /* 138-byte string literal not displayed */

	DisableDRSZones bool `ini:"-"`

	TimeAttack bool `ini:"-"` // time attack races will force loop ON and merge all results files (practice only)

	ExportSecondRaceToACSR bool `ini:"-"`

	DynamicTrack DynamicTrackConfig `ini:"-"`

	Sessions Sessions                  `ini:"-"`
	Weather  map[string]*WeatherConfig `ini:"-"`
}

func (*CurrentRaceConfig) AddSession

func (c *CurrentRaceConfig) AddSession(sessionType SessionType, config *SessionConfig)

func (*CurrentRaceConfig) AddWeather

func (c *CurrentRaceConfig) AddWeather(weather *WeatherConfig)

func (CurrentRaceConfig) GetSession

func (c CurrentRaceConfig) GetSession(sessionType SessionType) *SessionConfig

func (CurrentRaceConfig) HasMultipleRaces

func (c CurrentRaceConfig) HasMultipleRaces() bool

func (CurrentRaceConfig) HasSession

func (c CurrentRaceConfig) HasSession(sess SessionType) bool

func (*CurrentRaceConfig) RemoveSession

func (c *CurrentRaceConfig) RemoveSession(sessionType SessionType)

func (*CurrentRaceConfig) RemoveWeather

func (c *CurrentRaceConfig) RemoveWeather(weather *WeatherConfig)

func (CurrentRaceConfig) Tyres

func (c CurrentRaceConfig) Tyres() map[string]bool

type CustomRace

type CustomRace struct {
	ScheduledEventBase

	Name                            string
	HasCustomName, OverridePassword bool
	ReplacementPassword             string

	Created time.Time
	Updated time.Time
	Deleted time.Time
	UUID    uuid.UUID
	Starred bool
	// Deprecated: Replaced by LoopServer
	Loop       bool
	LoopServer map[ServerID]bool

	TimeAttackCombinedResultFile string

	ForceStopTime        int
	ForceStopWithDrivers bool

	RaceConfig CurrentRaceConfig
	EntryList  EntryList

	ScheduledEvents map[ServerID]*ScheduledEventBase
}

func (*CustomRace) EventDescription

func (cr *CustomRace) EventDescription() string

func (*CustomRace) EventName

func (cr *CustomRace) EventName() string

func (*CustomRace) GetEntryList

func (cr *CustomRace) GetEntryList() EntryList

func (*CustomRace) GetForceStopTime added in v1.7.2

func (cr *CustomRace) GetForceStopTime() time.Duration

func (*CustomRace) GetForceStopWithDrivers added in v1.7.2

func (cr *CustomRace) GetForceStopWithDrivers() bool

func (*CustomRace) GetID

func (cr *CustomRace) GetID() uuid.UUID

func (*CustomRace) GetRaceConfig

func (cr *CustomRace) GetRaceConfig() CurrentRaceConfig

func (*CustomRace) GetRaceSetup

func (cr *CustomRace) GetRaceSetup() CurrentRaceConfig

func (*CustomRace) GetScheduledServerID added in v1.7.8

func (cr *CustomRace) GetScheduledServerID() ServerID

func (*CustomRace) GetSummary

func (cr *CustomRace) GetSummary() string

func (*CustomRace) GetURL

func (cr *CustomRace) GetURL() string

func (*CustomRace) HasSignUpForm

func (cr *CustomRace) HasSignUpForm() bool

func (*CustomRace) IsChampionship

func (cr *CustomRace) IsChampionship() bool

func (*CustomRace) IsLooping

func (cr *CustomRace) IsLooping() bool

func (*CustomRace) IsPractice

func (cr *CustomRace) IsPractice() bool

func (*CustomRace) IsRaceWeekend

func (cr *CustomRace) IsRaceWeekend() bool

func (*CustomRace) IsTimeAttack added in v1.7.4

func (cr *CustomRace) IsTimeAttack() bool

func (*CustomRace) OverrideServerPassword

func (cr *CustomRace) OverrideServerPassword() bool

func (*CustomRace) ReadOnlyEntryList

func (cr *CustomRace) ReadOnlyEntryList() EntryList

func (*CustomRace) ReplacementServerPassword

func (cr *CustomRace) ReplacementServerPassword() string

type CustomRaceHandler

type CustomRaceHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewCustomRaceHandler

func NewCustomRaceHandler(base *BaseHandler, raceManager *RaceManager, store Store, championshipManager *ChampionshipManager, raceWeekendManager *RaceWeekendManager) *CustomRaceHandler

type DiscordManager

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

func NewDiscordManager

func NewDiscordManager(store Store, scheduledRacesManager *ScheduledRacesManager) (*DiscordManager, error)

NewDiscordManager instantiates the DiscordManager type. On error, it will log the error and return the type flagged as disabled

func (*DiscordManager) CommandHandler

func (dm *DiscordManager) CommandHandler(s *discordgo.Session, m *discordgo.MessageCreate)

func (*DiscordManager) CommandNotify

func (dm *DiscordManager) CommandNotify(s *discordgo.Session, m *discordgo.MessageCreate) (string, error)

CommandNotify attempts to add a role ID (if configured) to the user issuing the !notify command The role will be added as a mention on all Discord notifications

func (*DiscordManager) CommandSchedule

func (dm *DiscordManager) CommandSchedule() (string, error)

CommandSchedule outputs an abbreviated list of all scheduled events

func (*DiscordManager) CommandSessions

func (dm *DiscordManager) CommandSessions() (string, error)

CommandSessions outputs a full list of all scheduled sessions (P, Q & R), using buildCalendar as a base

func (*DiscordManager) SaveServerOptions

func (dm *DiscordManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error

func (*DiscordManager) SendMessage

func (dm *DiscordManager) SendMessage(title string, msg string) error

SendMessage sends a message to the configured channel and logs any errors

func (dm *DiscordManager) SendMessageWithLink(title string, msg string, linkText string, link *url.URL) error

SendMessage sends a message to the configured channel and logs any errors

func (*DiscordManager) Stop

func (dm *DiscordManager) Stop() error

type DriverMap

type DriverMap struct {
	Drivers                map[udp.DriverGUID]*RaceControlDriver `json:"Drivers"`
	GUIDsInPositionalOrder []udp.DriverGUID                      `json:"GUIDsInPositionalOrder"`
	// contains filtered or unexported fields
}

func NewDriverMap

func NewDriverMap(driverGroup RaceControlDriverGroup, driverSortLessFunc driverSortLessFunc) *DriverMap

func (*DriverMap) Add

func (d *DriverMap) Add(driverGUID udp.DriverGUID, driver *RaceControlDriver)

func (*DriverMap) Del

func (d *DriverMap) Del(driverGUID udp.DriverGUID)

func (*DriverMap) Each

func (d *DriverMap) Each(fn func(driverGUID udp.DriverGUID, driver *RaceControlDriver) error) error

func (*DriverMap) Get

func (d *DriverMap) Get(driverGUID udp.DriverGUID) (*RaceControlDriver, bool)

func (*DriverMap) Len

func (d *DriverMap) Len() int

type DynamicTrackConfig

type DynamicTrackConfig struct {
	SessionStart    int `ini:"SESSION_START" help:"% level of grip at session start"`
	Randomness      int `ini:"RANDOMNESS" help:"level of randomness added to the start grip"`
	SessionTransfer int `` /* 281-byte string literal not displayed */
	LapGain         int `ini:"LAP_GAIN" help:"how many laps are needed to add 1% grip"`
}

type Entrant

type Entrant struct {
	InternalUUID uuid.UUID `ini:"-"`
	PitBox       int       `ini:"-"`

	Name string `ini:"DRIVERNAME"`
	Team string `ini:"TEAM"`
	GUID string `ini:"GUID"`

	Model string `ini:"MODEL"`
	Skin  string `ini:"SKIN"`

	Ballast       int    `ini:"BALLAST"`
	SpectatorMode int    `ini:"SPECTATOR_MODE"`
	Restrictor    int    `ini:"RESTRICTOR"`
	FixedSetup    string `ini:"FIXED_SETUP"`

	TransferTeamPoints bool `ini:"-" json:"-"`
	OverwriteAllEvents bool `ini:"-" json:"-"`
	IsPlaceHolder      bool `ini:"-"`
}

func NewEntrant

func NewEntrant() *Entrant

func (*Entrant) AsSessionCar

func (e *Entrant) AsSessionCar() *SessionCar

func (*Entrant) AsSessionResult

func (e *Entrant) AsSessionResult() *SessionResult

func (*Entrant) AssignFromResult

func (e *Entrant) AssignFromResult(result *SessionResult, car *SessionCar)

func (Entrant) ID

func (e Entrant) ID() string

func (*Entrant) OverwriteProperties

func (e *Entrant) OverwriteProperties(other *Entrant)

func (*Entrant) SwapProperties

func (e *Entrant) SwapProperties(other *Entrant, entrantRemainedInClass bool)

type EntryList

type EntryList map[string]*Entrant

func (EntryList) AddInPitBox

func (e EntryList) AddInPitBox(entrant *Entrant, pitBox int)

AddInPitBox adds an Entrant in a specific pitbox - overwriting any entrant that was in that pitbox previously.

func (EntryList) AddToBackOfGrid added in v1.7.4

func (e EntryList) AddToBackOfGrid(entrant *Entrant)

Add an Entrant to the EntryList

func (EntryList) AlphaSlice

func (e EntryList) AlphaSlice() []*Entrant

func (EntryList) AsSlice

func (e EntryList) AsSlice() []*Entrant

func (EntryList) CarIDs

func (e EntryList) CarIDs() []string

CarIDs returns a unique list of car IDs used in the EntryList

func (EntryList) Delete

func (e EntryList) Delete(entrant *Entrant)

Remove an Entrant from the EntryList

func (EntryList) Entrants

func (e EntryList) Entrants() string

func (EntryList) FindEntrantByInternalUUID

func (e EntryList) FindEntrantByInternalUUID(internalUUID uuid.UUID) *Entrant

func (EntryList) FindGreatestBallast

func (e EntryList) FindGreatestBallast() int

returns the greatest ballast set on any entrant

func (EntryList) PrettyList

func (e EntryList) PrettyList() []*Entrant

func (EntryList) ReadString added in v1.7.8

func (e EntryList) ReadString() (string, error)

func (EntryList) Write

func (e EntryList) Write() error

Write the EntryList to the server location

type FactoryAssist added in v1.7.5

type FactoryAssist int

func (FactoryAssist) String added in v1.7.5

func (a FactoryAssist) String() string

type FilterError

type FilterError string

func (FilterError) Error

func (f FilterError) Error() string

type FormHeading

type FormHeading string

func (FormHeading) BuildFormElement added in v1.7.6

func (f FormHeading) BuildFormElement(_ string, parent *html.Node, field formulate.StructField, _ formulate.Decorator) error

type GeoIP

type GeoIP struct {
	CountryCode string `json:"country_code"`
	CountryName string `json:"country_name"`
	IP          string `json:"ip"`
}

type GlobalServerConfig

type GlobalServerConfig struct {
	AssettoCorsaServer FormHeading `ini:"-" json:"-" input:"heading"`

	Name                      string               `ini:"NAME" help:"Server Name"`
	Password                  string               `ini:"PASSWORD" type:"password" help:"Server password"`
	AdminPassword             string               `` /* 296-byte string literal not displayed */
	UDPPort                   int                  `ini:"UDP_PORT" show:"open" min:"0" max:"65535" help:"UDP port number: open this port on your server's firewall"`
	TCPPort                   int                  `ini:"TCP_PORT" show:"open" min:"0" max:"65535" help:"TCP port number: open this port on your server's firewall"`
	HTTPPort                  int                  `` /* 135-byte string literal not displayed */
	UDPPluginLocalPort        int                  `` /* 487-byte string literal not displayed */
	UDPPluginAddress          string               `` /* 463-byte string literal not displayed */
	AuthPluginAddress         string               `ini:"AUTH_PLUGIN_ADDRESS" show:"open" help:"The address of the auth plugin"`
	RegisterToLobby           formulate.BoolNumber `ini:"REGISTER_TO_LOBBY" show:"open" help:"Register the AC Server to the main lobby"`
	ClientSendIntervalInHertz int                  `` /* 228-byte string literal not displayed */
	SendBufferSize            int                  `ini:"SEND_BUFFER_SIZE" show:"open" help:""`
	ReceiveBufferSize         int                  `ini:"RECV_BUFFER_SIZE" show:"open" help:""`
	KickQuorum                int                  `ini:"KICK_QUORUM" help:"Percentage that is required for the kick vote to pass"`
	VotingQuorum              int                  `ini:"VOTING_QUORUM" min:"0" help:"Percentage that is required for the session vote to pass"`
	VoteDuration              int                  `ini:"VOTE_DURATION" min:"0" help:"Vote length in seconds"`
	BlacklistMode             BlockListMode        `ini:"BLACKLIST_MODE" name:"BlockList mode" help:"How to handle blocklisting of players."`
	NumberOfThreads           int                  `ini:"NUM_THREADS" show:"open" min:"1" help:"Number of threads to run on"`
	WelcomeMessage            string               `ini:"WELCOME_MESSAGE" show:"-" help:"Path to the file that contains the server welcome message"`

	SleepTime int `` /* 178-byte string literal not displayed */

	FreeUDPPluginLocalPort int    `ini:"-" show:"-"`
	FreeUDPPluginAddress   string `ini:"-" show:"-"`

	// ACSR
	AssettoCorsaSkillRating FormHeading `ini:"-" json:"-" show:"premium"`
	EnableACSR              bool        `` /* 140-byte string literal not displayed */
	ACSRAccountID           string      `` /* 144-byte string literal not displayed */
	ACSRAPIKey              string      `` /* 161-byte string literal not displayed */

	ServerName                FormHeading          `ini:"-" json:"-"`
	ShowRaceNameInServerLobby formulate.BoolNumber `` /* 137-byte string literal not displayed */
	ServerNameTemplate        string               `` /* 449-byte string literal not displayed */

	Theme     FormHeading          `ini:"-" json:"-"`
	DarkTheme formulate.BoolNumber `ini:"-" help:"Enable Server Manager's Dark Theme by default"`
	CustomCSS string               `` /* 218-byte string literal not displayed */
	OGImage   string               `` /* 126-byte string literal not displayed */

	ContentManagerIntegration   FormHeading          `ini:"-" json:"-"`
	EnableContentManagerWrapper formulate.BoolNumber `` /* 475-byte string literal not displayed */
	ContentManagerWrapperPort   int                  `` /* 170-byte string literal not displayed */
	ShowContentManagerJoinLink  formulate.BoolNumber `` /* 173-byte string literal not displayed */
	ContentManagerIPOverride    string               `` /* 166-byte string literal not displayed */

	Miscellaneous                     FormHeading          `ini:"-" json:"-"`
	UseShortenedDriverNames           formulate.BoolNumber `` /* 129-byte string literal not displayed */
	FallBackResultsSorting            formulate.BoolNumber `` /* 164-byte string literal not displayed */
	UseMPH                            formulate.BoolNumber `ini:"-" help:"When on, this option will make Server Manager use MPH instead of Km/h for all speed values."`
	PreventWebCrawlers                formulate.BoolNumber `` /* 178-byte string literal not displayed */
	RestartEventOnServerManagerLaunch formulate.BoolNumber `` /* 168-byte string literal not displayed */
	LogACServerOutputToFile           bool                 `ini:"-" show:"open" help:"When on, Server Manager will output each Assetto Corsa session into a log file in the logs folder."`
	NumberOfACServerLogsToKeep        int                  `` /* 140-byte string literal not displayed */
	ShowEventDetailsPopup             bool                 `` /* 146-byte string literal not displayed */

	// Discord Integration
	DiscordIntegration FormHeading `ini:"-" json:"-"`
	DiscordAPIToken    string      `` /* 169-byte string literal not displayed */
	DiscordChannelID   string      `` /* 246-byte string literal not displayed */
	DiscordRoleID      string      `` /* 272-byte string literal not displayed */
	DiscordRoleCommand string      `` /* 431-byte string literal not displayed */

	NotificationReminderTimer   int                  `` /* 160-byte string literal not displayed */
	NotificationReminderTimers  string               `` /* 237-byte string literal not displayed */
	ShowPasswordInNotifications formulate.BoolNumber `ini:"-" help:"Show the server password in race start notifications."`
	NotifyWhenScheduled         formulate.BoolNumber `ini:"-" help:"Send a notification when a race is scheduled (or cancelled)."`

	// Messages
	ContentManagerWelcomeMessage string `ini:"-" show:"-"`
	ServerJoinMessage            string `ini:"-" show:"-"`
}

func (GlobalServerConfig) GetName

func (gsc GlobalServerConfig) GetName() string

type Group

type Group string
const (
	GroupNoAccess Group = "no_access"
	GroupRead     Group = "read"
	GroupWrite    Group = "write"
	GroupDelete   Group = "delete"
	GroupAdmin    Group = "admin"
)

type HTTPConfig

type HTTPConfig struct {
	Hostname         string `yaml:"hostname"`
	SessionKey       string `yaml:"session_key"`
	SessionStoreType string `yaml:"session_store_type"`
	SessionStorePath string `yaml:"session_store_path"`
	BaseURL          string `yaml:"server_manager_base_URL"`

	TLS TLSConfig `yaml:"tls"`
}

type HealthCheck

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

func NewHealthCheck

func NewHealthCheck(raceControl *RaceControl, store Store, process ServerProcess) *HealthCheck

func (*HealthCheck) ServeHTTP

func (h *HealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)

type HealthCheckResponse

type HealthCheckResponse struct {
	OK        bool
	Version   string
	IsPremium bool
	IsHosted  bool

	OS            string
	NumCPU        int
	NumGoroutines int
	Uptime        string
	GoVersion     string

	AssettoIsInstalled  bool
	StrackerIsInstalled bool

	CarDirectoryIsWritable     bool
	TrackDirectoryIsWritable   bool
	WeatherDirectoryIsWritable bool
	SetupsDirectoryIsWritable  bool
	ConfigDirectoryIsWritable  bool
	ResultsDirectoryIsWritable bool

	ServerName          string
	ServerID            ServerID
	EventInProgress     bool
	EventIsCritical     bool
	EventIsChampionship bool
	EventIsRaceWeekend  bool
	EventIsPractice     bool
	NumConnectedDrivers int
	MaxClientsOverride  int
}

type JSONStore

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

func (*JSONStore) AddAuditEntry

func (rs *JSONStore) AddAuditEntry(entry *AuditEntry) error

func (*JSONStore) ClearLastRaceEvent

func (rs *JSONStore) ClearLastRaceEvent() error

func (*JSONStore) DeleteAccount

func (rs *JSONStore) DeleteAccount(id string) error

func (*JSONStore) DeleteChampionship

func (rs *JSONStore) DeleteChampionship(id string) error

func (*JSONStore) DeleteCustomRace

func (rs *JSONStore) DeleteCustomRace(race *CustomRace) error

func (*JSONStore) DeleteEntrant

func (rs *JSONStore) DeleteEntrant(id string) error

func (*JSONStore) DeleteRaceWeekend

func (rs *JSONStore) DeleteRaceWeekend(id string) error

func (*JSONStore) FindAccountByID

func (rs *JSONStore) FindAccountByID(id string) (*Account, error)

func (*JSONStore) FindAccountByName

func (rs *JSONStore) FindAccountByName(name string) (*Account, error)

func (*JSONStore) FindCustomRaceByID

func (rs *JSONStore) FindCustomRaceByID(uuid string) (*CustomRace, error)

func (*JSONStore) GetAuditEntries

func (rs *JSONStore) GetAuditEntries() ([]*AuditEntry, error)

func (*JSONStore) GetMeta

func (rs *JSONStore) GetMeta(key string, out interface{}) error

func (*JSONStore) ListAccounts

func (rs *JSONStore) ListAccounts() ([]*Account, error)

func (*JSONStore) ListChampionships

func (rs *JSONStore) ListChampionships() ([]*Championship, error)

func (*JSONStore) ListCustomRaces

func (rs *JSONStore) ListCustomRaces() ([]*CustomRace, error)

func (*JSONStore) ListEntrants

func (rs *JSONStore) ListEntrants() ([]*Entrant, error)

func (*JSONStore) ListPrevFrames

func (rs *JSONStore) ListPrevFrames() ([]string, error)

func (*JSONStore) ListRaceWeekends

func (rs *JSONStore) ListRaceWeekends() ([]*RaceWeekend, error)

func (*JSONStore) LoadChampionship

func (rs *JSONStore) LoadChampionship(id string) (*Championship, error)

func (*JSONStore) LoadKissMyRankOptions added in v1.7.2

func (rs *JSONStore) LoadKissMyRankOptions() (*KissMyRankConfig, error)

func (*JSONStore) LoadLastRaceEvent

func (rs *JSONStore) LoadLastRaceEvent() (RaceEvent, error)

func (*JSONStore) LoadLiveTimingsData

func (rs *JSONStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)

func (*JSONStore) LoadRaceWeekend

func (rs *JSONStore) LoadRaceWeekend(id string) (*RaceWeekend, error)

func (*JSONStore) LoadRealPenaltyOptions added in v1.7.5

func (rs *JSONStore) LoadRealPenaltyOptions() (*RealPenaltyConfig, error)

func (*JSONStore) LoadServerOptions

func (rs *JSONStore) LoadServerOptions() (*GlobalServerConfig, error)

func (*JSONStore) LoadStrackerOptions

func (rs *JSONStore) LoadStrackerOptions() (*StrackerConfiguration, error)

func (*JSONStore) SetMeta

func (rs *JSONStore) SetMeta(key string, value interface{}) error

func (*JSONStore) UpsertAccount

func (rs *JSONStore) UpsertAccount(a *Account) error

func (*JSONStore) UpsertChampionship

func (rs *JSONStore) UpsertChampionship(c *Championship) error

func (*JSONStore) UpsertCustomRace

func (rs *JSONStore) UpsertCustomRace(race *CustomRace) error

func (*JSONStore) UpsertEntrant

func (rs *JSONStore) UpsertEntrant(entrant Entrant) error

func (*JSONStore) UpsertKissMyRankOptions added in v1.7.2

func (rs *JSONStore) UpsertKissMyRankOptions(kmr *KissMyRankConfig) error

func (*JSONStore) UpsertLastRaceEvent

func (rs *JSONStore) UpsertLastRaceEvent(r RaceEvent) error

func (*JSONStore) UpsertLiveFrames

func (rs *JSONStore) UpsertLiveFrames(frameLinks []string) error

func (*JSONStore) UpsertLiveTimingsData

func (rs *JSONStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error

func (*JSONStore) UpsertRaceWeekend

func (rs *JSONStore) UpsertRaceWeekend(rw *RaceWeekend) error

func (*JSONStore) UpsertRealPenaltyOptions added in v1.7.5

func (rs *JSONStore) UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error

func (*JSONStore) UpsertServerOptions

func (rs *JSONStore) UpsertServerOptions(so *GlobalServerConfig) error

func (*JSONStore) UpsertStrackerOptions

func (rs *JSONStore) UpsertStrackerOptions(sto *StrackerConfiguration) error

type KissMyRankConfig added in v1.7.2

type KissMyRankConfig struct {
	EnableKissMyRank bool

	// Pings n stuff
	ConnectionOptions FormHeading `ini:"-" json:"-"`
	UpdateInterval    int         `` /* 160-byte string literal not displayed */
	MaxPing           int         `` /* 335-byte string literal not displayed */
	MaxPingDeviation  int         `` /* 357-byte string literal not displayed */
	PingCheckInterval int         `` /* 200-byte string literal not displayed */

	// WebStats
	WebInterface                  FormHeading          `ini:"-" json:"-"`
	WebStatsInterface             formulate.BoolNumber `` /* 143-byte string literal not displayed */
	WebStatsServerAddress         string               `` /* 157-byte string literal not displayed */
	WebStatsServerPort            int                  `` /* 142-byte string literal not displayed */
	WebStatsPublicURL             string               `` /* 360-byte string literal not displayed */
	WebStatsDriversPerPage        int                  `` /* 140-byte string literal not displayed */
	WebStatsCacheTime             int                  `json:"web_stats_cache_time" help:"Time to cache the stats in seconds (decreasing might increase CPU usage)"`
	WebStatsOverridePublicAddress string               `` /* 173-byte string literal not displayed */
	WebStatsOverridePublicPort    int                  `` /* 197-byte string literal not displayed */
	WebStatsResultsShowLapLog     formulate.BoolNumber `` /* 222-byte string literal not displayed */
	WebAdminConsolePassword       string               `` /* 487-byte string literal not displayed */
	WebAdminConsoleGuestPassword  string               `` /* 389-byte string literal not displayed */
	LiveTrackView                 formulate.BoolNumber `` /* 139-byte string literal not displayed */

	// WebAuth
	WebAuth              FormHeading          `ini:"-" json:"-" show:"open"`
	WebAuthServerAddress string               `` /* 154-byte string literal not displayed */
	WebAuthServerPort    int                  `json:"web_auth_server_port" show:"open" help:"Stats Web Auth Port For linux don't use ports below 1024."`
	WebAuthCacheTime     int                  `json:"web_auth_cache_time" show:"open" help:"Time to cache the web auth result in seconds"`
	WebAuthRelayTo       NewLineSeparatedList `` /* 644-byte string literal not displayed */

	UDPRelay    FormHeading          `ini:"-" json:"-" show:"open"`
	UDPReplayTo NewLineSeparatedList `` /* 841-byte string literal not displayed */

	// Money
	Money                                FormHeading          `ini:"-" json:"-"`
	CurrencySymbol                       string               `json:"currency_symbol" help:"The symbol of the currency used for all drivers fines and payments (e.g. €,$,RUB)."`
	ThousandSeparator                    string               `json:"thousand_separator" help:"The symbol to be used to separate thousands (e.g. 19,000 or 19.000)."`
	StartMoney                           float64              `` /* 218-byte string literal not displayed */
	MinMoney                             int                  `` /* 267-byte string literal not displayed */
	NoMoney                              formulate.BoolNumber `json:"no_money" help:"Set this to ON if you wish to use points instead of money (no money, no party :D)."`
	RaceMinimumPlayers                   int                  `` /* 192-byte string literal not displayed */
	RaceDriverEntryFee                   float64              `` /* 200-byte string literal not displayed */
	RaceSponsorEntryFee                  float64              `` /* 249-byte string literal not displayed */
	RaceSponsorRewardBaseLength          int                  `` /* 359-byte string literal not displayed */
	RaceSponsorRewardBaseTime            int                  `` /* 344-byte string literal not displayed */
	RaceSponsorCleanGainReward           int                  `` /* 278-byte string literal not displayed */
	RaceSponsorCleanGainOvertakes        int                  `` /* 263-byte string literal not displayed */
	RaceFastestLapPrize                  float64              `` /* 130-byte string literal not displayed */
	LaptimeChallengeBasePrize            float64              `` /* 192-byte string literal not displayed */
	LaptimeChallengeBaseAverageSpeed     int                  `` /* 205-byte string literal not displayed */
	LaptimeChallengeLevelAverageSpeedGap int                  `` /* 189-byte string literal not displayed */
	AlltimeFastestLapPrize               float64              `` /* 135-byte string literal not displayed */
	DamageCostBetweenCars                int                  `` /* 326-byte string literal not displayed */
	DamageCostWithEnvironment            int                  `` /* 350-byte string literal not displayed */
	DamageCostBetweenCarsBaseSpeed       int                  `json:"damage_cost_between_cars_base_speed" help:"The base speed (in km/h) for damage_cost_between_cars."`
	DamageCostWithEnvironmentBaseSpeed   int                  `json:"damage_cost_with_environment_base_speed" help:"The base speed (in km/h) for damage_cost_with_environment."`
	CarTowingCost                        float64              `` /* 271-byte string literal not displayed */
	JLPMoneyKillSwitch                   formulate.BoolNumber `` /* 360-byte string literal not displayed */
	QualifyTopThreeBasePrize             float64              `` /* 258-byte string literal not displayed */
	QualifyTopThreePrizeMinPlayers       int                  `json:"qualify_top_three_prize_min_players" help:"How many players need to post a time before the pole prizes are assigned."`

	Protections                                         FormHeading          `ini:"-" json:"-"`
	HotlapProtection                                    int                  `` /* 157-byte string literal not displayed */
	LappingProtection                                   int                  `` /* 149-byte string literal not displayed */
	RelativeHotlapProtection                            float64              `` /* 299-byte string literal not displayed */
	RelativeLappingProtection                           float64              `` /* 294-byte string literal not displayed */
	WarnedCarGrace                                      int                  `` /* 180-byte string literal not displayed */
	MinimumDrivingStandard                              float64              `` /* 304-byte string literal not displayed */
	MinimumDrivingStandardLaps                          int                  `` /* 252-byte string literal not displayed */
	MinimumDrivingStandardRechargePeriod                int                  `` /* 316-byte string literal not displayed */
	MinimumDrivingStandardMinPlayers                    int                  `` /* 280-byte string literal not displayed */
	CutLinesEnabled                                     formulate.BoolNumber `` /* 302-byte string literal not displayed */
	MaxCollisionsPer100km                               int                  `` /* 207-byte string literal not displayed */
	MaxCollisionsPer100kmMinDistance                    int                  `` /* 140-byte string literal not displayed */
	MacCollisionsPer100kmRechargeHours                  int                  `` /* 375-byte string literal not displayed */
	ReverseGearMaxDistance                              int                  `` /* 145-byte string literal not displayed */
	CollisionMinimumDamageWithEnvironment               float64              `` /* 258-byte string literal not displayed */
	CollisionMinimumDamageBetweenCars                   float64              `` /* 246-byte string literal not displayed */
	TrackBoundaryCutMaxSpeed                            int                  `` /* 128-byte string literal not displayed */
	TrackBoundarySameLapCutMaxSpeed                     int                  `` /* 221-byte string literal not displayed */
	TrackBoundarySampleLength                           int                  `` /* 263-byte string literal not displayed */
	CleanLapReward                                      float64              `` /* 199-byte string literal not displayed */
	AnticheatLaptimeInvalidateMaxClockDelta             int                  `` /* 681-byte string literal not displayed */
	AnticheatPenalizeDriverMaxClockDeltaConsecutiveHits int                  `` /* 245-byte string literal not displayed */
	MaxInfractions                                      int                  `` /* 233-byte string literal not displayed */
	ParkedCarMaxGrace                                   int                  `` /* 176-byte string literal not displayed */
	ParkedCarSeconds                                    int                  `` /* 220-byte string literal not displayed */
	ParkedCarDistance                                   int                  `` /* 253-byte string literal not displayed */
	RightToBeForgottenChatCommand                       formulate.BoolNumber `` /* 224-byte string literal not displayed */
	DriveThroughNoKick                                  formulate.BoolNumber `` /* 152-byte string literal not displayed */

	Rules                                               FormHeading          `ini:"-" json:"-"`
	TimeBasedRaceExtraLap                               formulate.BoolNumber `` /* 248-byte string literal not displayed */
	RacePodiumAnnouncement                              formulate.BoolNumber `json:"race_podium_announcement" help:"Whether to announce the first three drivers at the end of the race."`
	MaxCollisions                                       int                  `` /* 165-byte string literal not displayed */
	TrackRejoinMaxSpeed                                 int                  `` /* 184-byte string literal not displayed */
	TrackBoundaryCutMaxTime                             int                  `` /* 177-byte string literal not displayed */
	TrackBoundaryCutGainFilter                          formulate.BoolNumber `` /* 235-byte string literal not displayed */
	TrackBoundaryCutGainFilterMinLossPercent            int                  `` /* 283-byte string literal not displayed */
	TrackBoundaryCutGainFilterMinAverageSpeed           int                  `` /* 388-byte string literal not displayed */
	DrivingLinePenaltyRepeatGrace                       int                  `` /* 282-byte string literal not displayed */
	PitSpeedLimit                                       int                  `` /* 234-byte string literal not displayed */
	RollingStart                                        formulate.BoolNumber `json:"rolling_start" help:"If you wish to use Kissmyrank Rolling Start at the beginning of a race."`
	ImprovingQualifyLaptimeWithInfractionsCutoffPercent int                  `` /* 362-byte string literal not displayed */

	VirtualSafetyCar                          FormHeading              `ini:"-" json:"-" `
	VSCSpeedingMaxGrace                       int                      `` /* 172-byte string literal not displayed */
	VSCSlowingMaxGrace                        int                      `` /* 154-byte string literal not displayed */
	VSCDefaultSpeedLimit                      int                      `json:"vsc_default_speed_limit" help:"The maximum speed (in km/h) a player is allowed to drive during a Virtual Safety Car."`
	VSCOvertakingMaxGrace                     int                      `` /* 191-byte string literal not displayed */
	VSCFormationLapSpeedLimit                 int                      `` /* 140-byte string literal not displayed */
	VSCFormationLapMinSpeed                   int                      `` /* 157-byte string literal not displayed */
	VSCDefaultLeaderSlowAllowOvertakeSpeed    int                      `` /* 239-byte string literal not displayed */
	VSCDefaultSlowAndFarAllowOvertakeSpeed    int                      `` /* 261-byte string literal not displayed */
	VSCDefaultSlowAndFarAllowOvertakeDistance int                      `` /* 276-byte string literal not displayed */
	VSCFormationLapFarAllowOvertakeDistance   int                      `` /* 246-byte string literal not displayed */
	RaceMassAccidentCrashedPlayersPercentage  int                      `` /* 283-byte string literal not displayed */
	RaceMassAccidentCrashTime                 int                      `` /* 143-byte string literal not displayed */
	RaceMassAccidentMinCrashedPlayers         int                      `` /* 223-byte string literal not displayed */
	RaceMassAccidentResponse                  RaceMassAccidentResponse `` /* 226-byte string literal not displayed */

	RaceControl                         FormHeading          `ini:"-" json:"-" `
	RaceControlPassword                 string               `` /* 197-byte string literal not displayed */
	RaceControlMaxEvents                int                  `json:"race_control_max_events" help:"The maximum number of events that race control should display."`
	RaceControlCollisionSpace           float64              `` /* 265-byte string literal not displayed */
	RaceControlCollisionTime            int                  `` /* 197-byte string literal not displayed */
	RaceControlLogOvertakes             formulate.BoolNumber `` /* 248-byte string literal not displayed */
	RaceControlCollisionReplayTime      int                  `` /* 156-byte string literal not displayed */
	RaceControlCutReplayTime            int                  `` /* 145-byte string literal not displayed */
	RaceControlOvertakeReplayTime       int                  `` /* 155-byte string literal not displayed */
	RaceControlIncludePlayersNearerThan int                  `` /* 288-byte string literal not displayed */

	Database                                FormHeading          `ini:"-" json:"-" show:"open"`
	DatabaseSharingUniqueName               string               `` /* 200-byte string literal not displayed */
	DatabaseSharingLocalGroupPort           int                  `` /* 723-byte string literal not displayed */
	DatabaseSharingRemoteListenPort         int                  `` /* 367-byte string literal not displayed */
	DatabaseSharingRemoteSecretKey          string               `` /* 206-byte string literal not displayed */
	DatabaseSharingRemoteListenAddress      string               `` /* 183-byte string literal not displayed */
	DatabaseSharingRemoteConnectToAddresses NewLineSeparatedList `` /* 693-byte string literal not displayed */
	DatabaseSharingRelayForNames            NewLineSeparatedList `` /* 1143-byte string literal not displayed */

	Miscellaneous                               FormHeading          `ini:"-" json:"-"`
	SessionHistoryLength                        int                  `` /* 161-byte string literal not displayed */
	MemoryMonitorEnabled                        formulate.BoolNumber `` /* 272-byte string literal not displayed */
	SpeedUnitFormat                             string               `` /* 248-byte string literal not displayed */
	ReservedSlotsGUIDList                       NewLineSeparatedList `` /* 297-byte string literal not displayed */
	ReservedSlotsAccessKey                      string               `` /* 455-byte string literal not displayed */
	ReservedSlotsBootPlayersAtRace              int                  `` /* 479-byte string literal not displayed */
	RankSortByWinStats                          formulate.BoolNumber `` /* 132-byte string literal not displayed */
	ACAppLinkUDPPort                            int                  `` /* 300-byte string literal not displayed */
	CustomChatDriverWelcomeMessages             NewLineSeparatedList `` /* 153-byte string literal not displayed */
	ChatDriverWelcomeMessageShowRaceControlLink formulate.BoolNumber `json:"chat_driver_welcome_message_show_race_control_link" help:"Whether to show the Race Control link when a driver joins."`
	ACChatAdminPassword                         string               `` /* 159-byte string literal not displayed */
	ACChatAdminGUIDList                         NewLineSeparatedList `` /* 285-byte string literal not displayed */

	PenaltyInfractionMap PenaltyInfractionMap `json:"penalty_infraction_map"`
	PenaltyCosts         PenaltyCostMap       `json:"penalty_cost_map"`
	PenaltyActions       PenaltyActionMap     `json:"penalty_action_map"`

	// Hidden values below here...
	// ACServer
	ACServerIP                          string `` /* 172-byte string literal not displayed */
	ACServerHTTPPort                    int    `` /* 183-byte string literal not displayed */
	ACServerPluginLocalPort             int    `` /* 134-byte string literal not displayed */
	ACServerPluginAddressPort           int    `` /* 224-byte string literal not displayed */
	AfterACServerStartRunPath           string `` /* 392-byte string literal not displayed */
	BeforeACServerStartRunPath          string `` /* 626-byte string literal not displayed */
	ACServerRestartIfInactiveForMinutes int    `` /* 358-byte string literal not displayed */
	ACServerResultsBasePath             string `` /* 482-byte string literal not displayed */
	ACServerConfigIniPath               string `` /* 258-byte string literal not displayed */
	ACServerBinaryPath                  string `` /* 274-byte string literal not displayed */
	ACServerBinaryArguments             string `` /* 334-byte string literal not displayed */
	ACServerLogPath                     string `json:"ac_server_log_path" show:"-" help:"The path where you wish to save the Assetto Corsa Server logs."`

	MaxPlayers int `json:"max_players" show:"-" help:"Number of server slots."`

	// Track Rotation is not supported with Server Manager.
	TrackList               []interface{} `json:"track_list" help:"" show:"-"`
	TrackRotationMaxPlayers int           `json:"track_rotation_max_players" help:"" show:"-"`

	TrackRotationVoteMinPercent int `` /* 280-byte string literal not displayed */
	TrackRotationVoteMinVotes   int `` /* 268-byte string literal not displayed */
}

func DefaultKissMyRankConfig added in v1.7.2

func DefaultKissMyRankConfig() *KissMyRankConfig

func (*KissMyRankConfig) Write added in v1.7.2

func (kmr *KissMyRankConfig) Write() error

type KissMyRankHandler added in v1.7.2

type KissMyRankHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewKissMyRankHandler added in v1.7.2

func NewKissMyRankHandler(baseHandler *BaseHandler, store Store) *KissMyRankHandler

type LiveMapConfig

type LiveMapConfig struct {
	IntervalMs int `yaml:"refresh_interval_ms"`
}

func (*LiveMapConfig) IsEnabled

func (l *LiveMapConfig) IsEnabled() bool

type LiveTimingsPersistedData

type LiveTimingsPersistedData struct {
	SessionType udp.SessionType
	Track       string
	TrackLayout string
	SessionName string

	Drivers map[udp.DriverGUID]*RaceControlDriver
}

type LoadResultOpts added in v1.7.1

type LoadResultOpts int
const LoadResultWithoutPluginFire LoadResultOpts = 0

type LuaConfig

type LuaConfig struct {
	Enabled bool `yaml:"enabled"`
}

type LuaPlugin

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

func NewLuaPlugin added in v1.7.6

func NewLuaPlugin() *LuaPlugin

func (*LuaPlugin) Call

func (l *LuaPlugin) Call(fileName, functionName string) error

func (*LuaPlugin) Inputs

func (l *LuaPlugin) Inputs(i ...interface{}) *LuaPlugin

func (*LuaPlugin) Outputs

func (l *LuaPlugin) Outputs(o ...interface{}) *LuaPlugin

remember outputs need to be reversed from whatever the plugin returns

type MonitoringConfig

type MonitoringConfig struct {
	Enabled bool `yaml:"enabled"`
}

type NewLineSeparatedList added in v1.7.2

type NewLineSeparatedList string

func (NewLineSeparatedList) MarshalJSON added in v1.7.2

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

func (*NewLineSeparatedList) UnmarshalJSON added in v1.7.2

func (c *NewLineSeparatedList) UnmarshalJSON(data []byte) error

type NilBroadcaster

type NilBroadcaster struct{}

func (NilBroadcaster) Send

func (NilBroadcaster) Send(message udp.Message) ([]byte, error)

type NotificationDispatcher

type NotificationDispatcher interface {
	HasNotificationReminders() bool
	GetNotificationReminders() []int
	SendMessage(title string, msg string) error
	SendMessageWithLink(title string, msg string, linkText string, link *url.URL) error
	SendRaceStartMessage(config ServerConfig, event RaceEvent) error
	SendRaceScheduledMessage(event *CustomRace, date time.Time) error
	SendRaceCancelledMessage(event *CustomRace, date time.Time) error
	SendRaceReminderMessage(event *CustomRace, timer int) error
	SendChampionshipReminderMessage(championship *Championship, event *ChampionshipEvent, timer int) error
	SendRaceWeekendReminderMessage(raceWeekend *RaceWeekend, session *RaceWeekendSession, timer int) error
	SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
}

type NotificationManager

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

NotificationManager is the generic notification handler, which calls the individual notification managers. Initially, only a Discord manager is implemented.

func NewNotificationManager

func NewNotificationManager(discord *DiscordManager, cars *CarManager, store Store) *NotificationManager

func (*NotificationManager) GetCarList

func (nm *NotificationManager) GetCarList(cars string) string

GetCarList takes a ; sep string of cars from a race config, returns , sep of UI names with download links added

func (*NotificationManager) GetNotificationReminders

func (nm *NotificationManager) GetNotificationReminders() []int

GetNotificationReminders returns an array of int timers Doesn't return errors, just omits anything it doesn't like and logs errors

func (*NotificationManager) GetTrackInfo

func (nm *NotificationManager) GetTrackInfo(track string, layout string, download bool) string

GetTrackInfo returns the track summary with any download link appended

func (*NotificationManager) HasNotificationReminders

func (nm *NotificationManager) HasNotificationReminders() bool

HasNotificationReminders just tells us if we need to do any reminder scheduling

func (*NotificationManager) SaveServerOptions

func (nm *NotificationManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error

check to see if any notification handlers need to process option changes

func (*NotificationManager) SendChampionshipReminderMessage

func (nm *NotificationManager) SendChampionshipReminderMessage(championship *Championship, event *ChampionshipEvent, timer int) error

SendChampionshipReminderMessage sends a reminder a configurable number of minutes prior to a championship race starting

func (*NotificationManager) SendMessage

func (nm *NotificationManager) SendMessage(title string, msg string) error

SendMessage sends a message (surprise surprise)

func (nm *NotificationManager) SendMessageWithLink(title string, msg string, linkText string, link *url.URL) error

SendMessageWithLink sends a message with an embedded CM join link

func (*NotificationManager) SendRaceCancelledMessage

func (nm *NotificationManager) SendRaceCancelledMessage(event *CustomRace, date time.Time) error

SendRaceCancelledMessage sends a notification when a race is cancelled

func (*NotificationManager) SendRaceReminderMessage

func (nm *NotificationManager) SendRaceReminderMessage(event *CustomRace, timer int) error

SendRaceReminderMessage sends a reminder a configurable number of minutes prior to a race starting

func (*NotificationManager) SendRaceScheduledMessage

func (nm *NotificationManager) SendRaceScheduledMessage(event *CustomRace, date time.Time) error

SendRaceScheduledMessage sends a notification when a race is scheduled

func (*NotificationManager) SendRaceStartMessage

func (nm *NotificationManager) SendRaceStartMessage(config ServerConfig, event RaceEvent) error

SendRaceStartMessage sends a message as a race session is started

func (*NotificationManager) SendRaceWeekendReminderMessage

func (nm *NotificationManager) SendRaceWeekendReminderMessage(raceWeekend *RaceWeekend, session *RaceWeekendSession, timer int) error

SendRaceWeekendReminderMessage sends a reminder a configurable number of minutes prior to a RaceWeekendSession starting

func (*NotificationManager) Stop

func (nm *NotificationManager) Stop() error

type PenaltiesHandler

type PenaltiesHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewPenaltiesHandler

func NewPenaltiesHandler(baseHandler *BaseHandler, penaltiesManager *PenaltiesManager) *PenaltiesHandler

type PenaltiesManager added in v1.7.5

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

func NewPenaltiesManager added in v1.7.5

func NewPenaltiesManager(store Store) *PenaltiesManager

type PenaltyAction

type PenaltyAction string
const (
	SetPenalty    PenaltyAction = "set"
	RemovePenalty PenaltyAction = "remove"
)

type PenaltyActionMap added in v1.7.2

type PenaltyActionMap struct {
	HotLapProtection                       PenaltyActionSessions `json:"hotlap_protection"`
	HotLappingCarCollision                 PenaltyActionSessions `json:"hotlapping_car_collision"`
	LappingProtection                      PenaltyActionSessions `json:"lapping_protection"`
	LappingCarCollision                    PenaltyActionSessions `json:"lapping_car_collision"`
	ReverseGear                            PenaltyActionSessions `json:"reverse_gear"`
	TrackBoundaryCut                       PenaltyActionSessions `json:"track_boundary_cut"`
	TrackRejoinMaxSpeed                    PenaltyActionSessions `json:"track_rejoin_max_speed"`
	MaxInfractions                         PenaltyActionSessions `json:"max_infractions"`
	MaxCollisions                          PenaltyActionSessions `json:"max_collisions"`
	FirstBlood                             PenaltyActionSessions `json:"first_blood"`
	PitLaneSpeeding                        PenaltyActionSessions `json:"pit_lane_speeding"`
	PitExitLineCrossing                    PenaltyActionSessions `json:"pit_exit_line_crossing"`
	CutLineYourCustomCutLine               PenaltyActionSessions `json:"cut_line_your_custom_cut_line"`
	AntiCheatMaxClockDeltaConsecutiveHits  PenaltyActionSessions `json:"anticheat_max_clock_delta_consecutive_hits"`
	SpeedingUnderVirtualSafetyCar          PenaltyActionSessions `json:"speeding_under_vsc"`
	SlowingUnderVirtualSafetyCar           PenaltyActionSessions `json:"slowing_under_vsc"`
	OvertakingUnderVirtualSafety           PenaltyActionSessions `json:"overtaking_under_vsc"`
	ImprovingQualifyLapTimeWithInfractions PenaltyActionSessions `json:"improving_qualify_laptime_with_infractions"`
	ParkingNearTrack                       PenaltyActionSessions `json:"parking_near_track"`
}

type PenaltyActionSessions added in v1.7.2

type PenaltyActionSessions struct {
	Practice string `` /* 347-byte string literal not displayed */
	Qualify  string `` /* 346-byte string literal not displayed */
	Race     string `` /* 343-byte string literal not displayed */
}

type PenaltyCostMap added in v1.7.2

type PenaltyCostMap struct {
	HotLapProtection                       PenaltyCostSessions `json:"hotlap_protection"`
	HotLappingCarCollision                 PenaltyCostSessions `json:"hotlapping_car_collision"`
	LappingProtection                      PenaltyCostSessions `json:"lapping_protection"`
	LappingCarCollision                    PenaltyCostSessions `json:"lapping_car_collision"`
	ReverseGear                            PenaltyCostSessions `json:"reverse_gear"`
	TrackBoundaryCut                       PenaltyCostSessions `json:"track_boundary_cut"`
	TrackRejoinMaxSpeed                    PenaltyCostSessions `json:"track_rejoin_max_speed"`
	MaxInfractions                         PenaltyCostSessions `json:"max_infractions"`
	MaxCollisions                          PenaltyCostSessions `json:"max_collisions"`
	FirstBlood                             PenaltyCostSessions `json:"first_blood"`
	PitLaneSpeeding                        PenaltyCostSessions `json:"pit_lane_speeding"`
	PitExitLineCrossing                    PenaltyCostSessions `json:"pit_exit_line_crossing"`
	CutLineYourCustomCutLine               PenaltyCostSessions `json:"cut_line_your_custom_cut_line"`
	AntiCheatMaxClockDeltaConsecutiveHits  PenaltyCostSessions `json:"anticheat_max_clock_delta_consecutive_hits"`
	SpeedingUnderVirtualSafetyCar          PenaltyCostSessions `json:"speeding_under_vsc"`
	SlowingUnderVirtualSafetyCar           PenaltyCostSessions `json:"slowing_under_vsc"`
	OvertakingUnderVirtualSafety           PenaltyCostSessions `json:"overtaking_under_vsc"`
	ImprovingQualifyLapTimeWithInfractions PenaltyCostSessions `json:"improving_qualify_laptime_with_infractions"`
	ParkingNearTrack                       PenaltyCostSessions `json:"parking_near_track"`
}

type PenaltyCostSessions added in v1.7.2

type PenaltyCostSessions struct {
	Practice float64 `json:"practice" help:"The money penalties (in thousands) that you would like to give for any given situation."`
	Qualify  float64 `json:"qualify" help:"The money penalties (in thousands) that you would like to give for any given situation."`
	Race     float64 `json:"race" help:"The money penalties (in thousands) that you would like to give for any given situation."`
	Other    float64 `json:"other" help:"The money penalties (in thousands) that you would like to give for any given situation."`
}

type PenaltyInfractionMap added in v1.7.2

type PenaltyInfractionMap struct {
	HotLapProtection                       PenaltyInfractionSessions `json:"hotlap_protection"`
	HotLappingCarCollision                 PenaltyInfractionSessions `json:"hotlapping_car_collision"`
	LappingProtection                      PenaltyInfractionSessions `json:"lapping_protection"`
	LappingCarCollision                    PenaltyInfractionSessions `json:"lapping_car_collision"`
	ReverseGear                            PenaltyInfractionSessions `json:"reverse_gear"`
	TrackBoundaryCut                       PenaltyInfractionSessions `json:"track_boundary_cut"`
	TrackRejoinMaxSpeed                    PenaltyInfractionSessions `json:"track_rejoin_max_speed"`
	MaxInfractions                         PenaltyInfractionSessions `json:"max_infractions"`
	MaxCollisions                          PenaltyInfractionSessions `json:"max_collisions"`
	FirstBlood                             PenaltyInfractionSessions `json:"first_blood"`
	PitLaneSpeeding                        PenaltyInfractionSessions `json:"pit_lane_speeding"`
	PitExitLineCrossing                    PenaltyInfractionSessions `json:"pit_exit_line_crossing"`
	CutLineYourCustomCutLine               PenaltyInfractionSessions `json:"cut_line_your_custom_cut_line"`
	AntiCheatMaxClockDeltaConsecutiveHits  PenaltyInfractionSessions `json:"anticheat_max_clock_delta_consecutive_hits"`
	SpeedingUnderVirtualSafetyCar          PenaltyInfractionSessions `json:"speeding_under_vsc"`
	SlowingUnderVirtualSafetyCar           PenaltyInfractionSessions `json:"slowing_under_vsc"`
	OvertakingUnderVirtualSafety           PenaltyInfractionSessions `json:"overtaking_under_vsc"`
	ImprovingQualifyLapTimeWithInfractions PenaltyInfractionSessions `json:"improving_qualify_laptime_with_infractions"`
	ParkingNearTrack                       PenaltyInfractionSessions `json:"parking_near_track"`
}

type PenaltyInfractionSessions added in v1.7.2

type PenaltyInfractionSessions struct {
	Practice float64 `` /* 129-byte string literal not displayed */
	Qualify  float64 `` /* 128-byte string literal not displayed */
	Race     float64 `json:"race" help:"How many infractions you would like to add to the infraction counter for each penalty during each session."`
}

type PointsReason

type PointsReason int
const (
	PointsEventFinish PointsReason = iota
	PointsPolePosition
	PointsFastestLap
	PointsCollisionWithCar
	PointsCollisionWithEnvironment
	PointsCutTrack
)

type PotentialChampionshipEntrant

type PotentialChampionshipEntrant interface {
	GetName() string
	GetTeam() string
	GetCar() string
	GetSkin() string
	GetGUID() string
}

type QuickRace

type QuickRace struct {
	OverridePassword    bool
	ReplacementPassword string
	RaceConfig          CurrentRaceConfig
	EntryList           EntryList
}

func (QuickRace) EventDescription

func (q QuickRace) EventDescription() string

func (QuickRace) EventName

func (q QuickRace) EventName() string

func (QuickRace) GetEntryList

func (q QuickRace) GetEntryList() EntryList

func (QuickRace) GetForceStopTime added in v1.7.2

func (q QuickRace) GetForceStopTime() time.Duration

func (QuickRace) GetForceStopWithDrivers added in v1.7.2

func (q QuickRace) GetForceStopWithDrivers() bool

func (QuickRace) GetRaceConfig

func (q QuickRace) GetRaceConfig() CurrentRaceConfig

func (QuickRace) GetURL

func (q QuickRace) GetURL() string

func (QuickRace) IsChampionship

func (q QuickRace) IsChampionship() bool

func (QuickRace) IsLooping

func (q QuickRace) IsLooping() bool

func (QuickRace) IsPractice

func (q QuickRace) IsPractice() bool

func (QuickRace) IsRaceWeekend

func (q QuickRace) IsRaceWeekend() bool

func (QuickRace) IsTimeAttack added in v1.7.4

func (q QuickRace) IsTimeAttack() bool

func (QuickRace) OverrideServerPassword

func (q QuickRace) OverrideServerPassword() bool

func (QuickRace) ReplacementServerPassword

func (q QuickRace) ReplacementServerPassword() string

type QuickRaceHandler

type QuickRaceHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewQuickRaceHandler

func NewQuickRaceHandler(baseHandler *BaseHandler, raceManager *RaceManager) *QuickRaceHandler

type RaceControl

type RaceControl struct {
	SessionInfo                udp.SessionInfo `json:"SessionInfo"`
	TrackMapData               TrackMapData    `json:"TrackMapData"`
	TrackInfo                  TrackInfo       `json:"TrackInfo"`
	SessionStartTime           time.Time       `json:"SessionStartTime"`
	CurrentRealtimePosInterval int             `json:"CurrentRealtimePosInterval"`

	ChatMessages      []udp.Chat
	ChatMessagesMutex sync.Mutex

	ConnectedDrivers    *DriverMap `json:"ConnectedDrivers"`
	DisconnectedDrivers *DriverMap `json:"DisconnectedDrivers"`

	CarIDToGUID map[udp.CarID]udp.DriverGUID `json:"CarIDToGUID"`
	// contains filtered or unexported fields
}

func NewRaceControl

func NewRaceControl(broadcaster Broadcaster, trackDataGateway TrackDataGateway, process ServerProcess, store Store, penaltiesManager *PenaltiesManager) *RaceControl

func (*RaceControl) AllLapTimes

func (rc *RaceControl) AllLapTimes() map[udp.DriverGUID]*RaceControlDriver

func (*RaceControl) Event

func (rc *RaceControl) Event() udp.Event

RaceControl piggyback's on the udp.Message interface so that the entire data can be sent to newly connected clients.

func (*RaceControl) LuaBroadcastChat added in v1.7.2

func (rc *RaceControl) LuaBroadcastChat(L *lua.LState) int

func (*RaceControl) LuaSendChat added in v1.7.2

func (rc *RaceControl) LuaSendChat(L *lua.LState) int

func (*RaceControl) OnCarUpdate

func (rc *RaceControl) OnCarUpdate(update udp.CarUpdate) error

OnCarUpdate occurs every udp.RealTimePosInterval and returns car position, speed, etc. drivers top speeds are recorded per lap, as well as their last seen updated.

func (*RaceControl) OnChatMessage added in v1.7.6

func (rc *RaceControl) OnChatMessage(chat udp.Chat) error

func (*RaceControl) OnClientConnect

func (rc *RaceControl) OnClientConnect(client udp.SessionCarInfo) error

OnClientConnect stores CarID -> DriverGUID mappings. if a driver is known to have previously been in this event, they will be moved from DisconnectedDrivers to ConnectedDrivers.

func (*RaceControl) OnClientDisconnect

func (rc *RaceControl) OnClientDisconnect(client udp.SessionCarInfo) error

OnClientDisconnect moves a client from ConnectedDrivers to DisconnectedDrivers.

func (*RaceControl) OnClientLoaded

func (rc *RaceControl) OnClientLoaded(loadedCar udp.ClientLoaded) error

OnClientLoaded marks a connected client as having loaded in.

func (*RaceControl) OnCollisionWithCar

func (rc *RaceControl) OnCollisionWithCar(collision udp.CollisionWithCar) error

OnCollisionWithCar registers a driver's collision with another car.

func (*RaceControl) OnCollisionWithEnvironment

func (rc *RaceControl) OnCollisionWithEnvironment(collision udp.CollisionWithEnvironment) error

OnCollisionWithEnvironment registers a driver's collision with the environment.

func (*RaceControl) OnEndSession

func (rc *RaceControl) OnEndSession(sessionFile udp.EndSession) error

OnEndSession is called at the end of every session.

func (*RaceControl) OnLapCompleted

func (rc *RaceControl) OnLapCompleted(lap udp.LapCompleted) error

OnLapCompleted occurs every time a driver crosses the line. Lap information is collected for the driver and best lap time and top speed are calculated. OnLapCompleted also remembers the car the lap was completed in a PreviousCars map on the driver. This is so that lap times between different cars can be compared.

func (*RaceControl) OnNewSession

func (rc *RaceControl) OnNewSession(sessionInfo udp.SessionInfo) error

OnNewSession occurs every new session. If the session is the first in an event and it is not a looped practice, then all driver information is cleared.

func (*RaceControl) OnSessionUpdate

func (rc *RaceControl) OnSessionUpdate(sessionInfo udp.SessionInfo) (bool, error)

OnSessionUpdate is called every sessionRequestInterval.

func (*RaceControl) OnVersion

func (rc *RaceControl) OnVersion(version udp.Version) error

OnVersion occurs when the Assetto Corsa Server starts up for the first time.

func (*RaceControl) SortDrivers

func (rc *RaceControl) SortDrivers(driverGroup RaceControlDriverGroup, driverA, driverB *RaceControlDriver) bool

func (*RaceControl) UDPCallback

func (rc *RaceControl) UDPCallback(message udp.Message)

type RaceControlCarLapInfo

type RaceControlCarLapInfo struct {
	TopSpeedThisLap      float64       `json:"TopSpeedThisLap"`
	TopSpeedBestLap      float64       `json:"TopSpeedBestLap"`
	BestLap              time.Duration `json:"BestLap"`
	NumLaps              int           `json:"NumLaps"`
	LastLap              time.Duration `json:"LastLap"`
	LastLapCompletedTime time.Time     `json:"LastLapCompletedTime" ts:"date"`
	TotalLapTime         time.Duration `json:"TotalLapTime"`
	CarName              string        `json:"CarName"`
}

func NewRaceControlCarLapInfo added in v1.7.6

func NewRaceControlCarLapInfo(carModel string) *RaceControlCarLapInfo

type RaceControlDriver

type RaceControlDriver struct {
	CarInfo      udp.SessionCarInfo `json:"CarInfo"`
	TotalNumLaps int                `json:"TotalNumLaps"`

	ConnectedTime time.Time `json:"ConnectedTime" ts:"date"`
	LoadedTime    time.Time `json:"LoadedTime" ts:"date"`

	Position int       `json:"Position"`
	Split    string    `json:"Split"`
	LastSeen time.Time `json:"LastSeen" ts:"date"`
	LastPos  udp.Vec   `json:"LastPos"`

	Collisions []Collision `json:"Collisions"`

	// Cars is a map of CarModel to the information for that car.
	Cars map[string]*RaceControlCarLapInfo `json:"Cars"`
	// contains filtered or unexported fields
}

func NewRaceControlDriver

func NewRaceControlDriver(carInfo udp.SessionCarInfo) *RaceControlDriver

func (*RaceControlDriver) CurrentCar

func (rcd *RaceControlDriver) CurrentCar() *RaceControlCarLapInfo

type RaceControlDriverGroup

type RaceControlDriverGroup int
const (
	ConnectedDrivers    RaceControlDriverGroup = 0
	DisconnectedDrivers RaceControlDriverGroup = 1
)

type RaceControlHandler

type RaceControlHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewRaceControlHandler

func NewRaceControlHandler(baseHandler *BaseHandler, store Store, raceManager *RaceManager, raceControl *RaceControl, raceControlHub *RaceControlHub, serverProcess ServerProcess) *RaceControlHandler

type RaceControlHub

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

func (*RaceControlHub) Send

func (h *RaceControlHub) Send(message udp.Message) ([]byte, error)

type RaceEvent

type RaceEvent interface {
	GetRaceConfig() CurrentRaceConfig
	GetEntryList() EntryList

	IsLooping() bool
	IsChampionship() bool
	IsRaceWeekend() bool
	IsPractice() bool
	IsTimeAttack() bool

	OverrideServerPassword() bool
	ReplacementServerPassword() string

	GetForceStopTime() time.Duration
	GetForceStopWithDrivers() bool

	EventName() string
	EventDescription() string
	GetURL() string
}

type RaceManager

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

func NewRaceManager

func NewRaceManager(
	store Store,
	process ServerProcess,
	carManager *CarManager,
	trackManager *TrackManager,
	notificationManager NotificationDispatcher,
	raceControl *RaceControl,
) *RaceManager

func (*RaceManager) BuildCustomRaceFromForm

func (rm *RaceManager) BuildCustomRaceFromForm(r *http.Request) (*CurrentRaceConfig, error)

func (*RaceManager) BuildEntryList

func (rm *RaceManager) BuildEntryList(r *http.Request, start, length int) (EntryList, error)

func (*RaceManager) BuildRaceOpts

func (rm *RaceManager) BuildRaceOpts(r *http.Request) (*RaceTemplateVars, error)

BuildRaceOpts builds a quick race form

func (*RaceManager) CurrentRace

func (rm *RaceManager) CurrentRace() (*ServerConfig, EntryList)

func (*RaceManager) DeleteCustomRace

func (rm *RaceManager) DeleteCustomRace(uuid string) error

func (*RaceManager) FindNextRecurrence

func (rm *RaceManager) FindNextRecurrence(race *CustomRace, start time.Time) time.Time

func (*RaceManager) InitScheduledRaces

func (rm *RaceManager) InitScheduledRaces() error

func (*RaceManager) ListAutoFillEntrants

func (rm *RaceManager) ListAutoFillEntrants() ([]*Entrant, error)

func (*RaceManager) ListCustomRaces

func (rm *RaceManager) ListCustomRaces() (recent, starred, looped, scheduled []*CustomRace, err error)

func (*RaceManager) LoadServerOptions

func (rm *RaceManager) LoadServerOptions() (*GlobalServerConfig, error)

func (*RaceManager) LoopCallback

func (rm *RaceManager) LoopCallback(message udp.Message)

callback check for udp end session, load result file, check session type against sessionTypes if session matches last session in sessionTypes then stop server and clear sessionTypes

func (*RaceManager) LoopRaces

func (rm *RaceManager) LoopRaces()

func (*RaceManager) RescheduleNotifications

func (rm *RaceManager) RescheduleNotifications(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error

reschedule notifications if notification timer changed

func (*RaceManager) SaveCustomRace

func (rm *RaceManager) SaveCustomRace(
	name string,
	overridePassword bool,
	replacementPassword string,
	config CurrentRaceConfig,
	entryList EntryList,
	starred bool,
	forceStopTime int,
	forceStopWithDrivers bool,
) (*CustomRace, error)

func (*RaceManager) SaveEntrantsForAutoFill

func (rm *RaceManager) SaveEntrantsForAutoFill(entryList EntryList) error

func (*RaceManager) SaveServerOptions

func (rm *RaceManager) SaveServerOptions(newServerOpts *GlobalServerConfig) error

func (*RaceManager) ScheduleNextFromRecurrence

func (rm *RaceManager) ScheduleNextFromRecurrence(race *CustomRace) error

func (*RaceManager) ScheduleRace

func (rm *RaceManager) ScheduleRace(uuid string, date time.Time, action string, recurrence string) error

func (*RaceManager) SetupCustomRace

func (rm *RaceManager) SetupCustomRace(r *http.Request) error

func (*RaceManager) SetupQuickRace

func (rm *RaceManager) SetupQuickRace(r *http.Request) error

func (*RaceManager) StartCustomRace

func (rm *RaceManager) StartCustomRace(uuid string, forceRestart bool) (*CustomRace, error)

func (*RaceManager) StartScheduledRace

func (rm *RaceManager) StartScheduledRace(race *CustomRace) error

func (*RaceManager) ToggleLoopCustomRace

func (rm *RaceManager) ToggleLoopCustomRace(uuid string) (bool, error)

func (*RaceManager) ToggleStarCustomRace

func (rm *RaceManager) ToggleStarCustomRace(uuid string) error

type RaceMassAccidentResponse added in v1.7.2

type RaceMassAccidentResponse struct {
	FirstLap  string
	OtherLaps string
}

type RaceTemplateVars

type RaceTemplateVars struct {
	BaseTemplateVars

	CarOpts             Cars
	TrackOpts           TrackOptsGrouped
	AvailableSessions   []SessionType
	Weather             Weather
	SolIsInstalled      bool
	Current             CurrentRaceConfig
	CurrentEntrants     EntryList
	PossibleEntrants    []*Entrant
	FixedSetups         CarSetups
	IsEditing           bool
	EditingID           string
	CustomRaceName      string
	SurfacePresets      []TrackSurfacePreset
	OverridePassword    bool
	ReplacementPassword string
	Tyres               Tyres
	DeselectedTyres     map[string]bool

	ForceStopTime        int
	ForceStopWithDrivers bool

	IsChampionship                 bool
	Championship                   *Championship
	ChampionshipHasAtLeastOnceRace bool
	ChampionshipEventIndex         int

	IsRaceWeekend                   bool
	RaceWeekend                     *RaceWeekend
	RaceWeekendSession              *RaceWeekendSession
	RaceWeekendHasAtLeastOneSession bool

	ShowOverridePasswordCard bool
}

type RaceWeekend

type RaceWeekend struct {
	ID      uuid.UUID
	Name    string
	Created time.Time
	Updated time.Time
	Deleted time.Time

	// Filters is a map of Parent ID -> Child ID -> Filter
	Filters map[string]map[string]*RaceWeekendSessionToSessionFilter

	// Deprecated: use GetEntryList() instead
	EntryList EntryList

	Sessions []*RaceWeekendSession

	// ChampionshipID links a RaceWeekend to a Championship. It can be uuid.Nil
	ChampionshipID uuid.UUID
	// Championship is the Championship that is linked to the RaceWeekend.
	// If ChampionshipID is uuid.Nil, Championship will also be nil
	Championship *Championship `json:"-"`

	SpectatorCar        Entrant
	SpectatorCarEnabled bool
}

RaceWeekends are a collection of sessions, where one session influences the EntryList of the next.

func NewRaceWeekend

func NewRaceWeekend() *RaceWeekend

NewRaceWeekend creates a RaceWeekend

func (*RaceWeekend) AddFilter

func (rw *RaceWeekend) AddFilter(parentID, childID string, filter *RaceWeekendSessionToSessionFilter)

AddFilter creates a link between parentID and childID with a filter that specifies how to take the EntrantResult of parent and modify them to make an EntryList for child

func (*RaceWeekend) AddSession

func (rw *RaceWeekend) AddSession(s *RaceWeekendSession, parent *RaceWeekendSession)

AddSession adds a RaceWeekendSession to a RaceWeekend, with an optional parent session (can be nil).

func (*RaceWeekend) Completed

func (rw *RaceWeekend) Completed() bool

func (*RaceWeekend) CompletedTime added in v1.7.5

func (rw *RaceWeekend) CompletedTime() time.Time

func (*RaceWeekend) DelSession

func (rw *RaceWeekend) DelSession(sessionID string)

DelSession removes a RaceWeekendSession from a RaceWeekend. This also removes any parent links from the removed session to any other sessions.

func (*RaceWeekend) Duplicate added in v1.7.2

func (rw *RaceWeekend) Duplicate() (*RaceWeekend, error)

func (*RaceWeekend) EnhanceResults

func (rw *RaceWeekend) EnhanceResults(results *SessionResults)

EnhanceResults takes a set of SessionResults and attaches Championship information to them.

func (*RaceWeekend) FindChildren

func (rw *RaceWeekend) FindChildren(parentID string) []*RaceWeekendSession

func (*RaceWeekend) FindSessionByID

func (rw *RaceWeekend) FindSessionByID(id string) (*RaceWeekendSession, error)

FindSessionByID finds a RaceWeekendSession by its unique identifier

func (*RaceWeekend) FindTotalNumParents

func (rw *RaceWeekend) FindTotalNumParents(session *RaceWeekendSession) int

FindTotalNumParents recursively finds all parents for a given session, including their parents etc...

func (*RaceWeekend) GetAvailableSplitTypes added in v1.7.8

func (rw *RaceWeekend) GetAvailableSplitTypes() []RaceWeekendFilterSplitType

func (*RaceWeekend) GetEntryList

func (rw *RaceWeekend) GetEntryList() EntryList

func (*RaceWeekend) GetFilter

func (rw *RaceWeekend) GetFilter(parentID, childID string) (*RaceWeekendSessionToSessionFilter, error)

GetFilter returns the Filter between parentID and childID, erroring if no Filter is found.

func (*RaceWeekend) GetFilterOrUseDefault

func (rw *RaceWeekend) GetFilterOrUseDefault(parentID, childID string) (*RaceWeekendSessionToSessionFilter, error)

GetFilterOrUseDefault attempts to find a filter between parentID and childID. If a filter is not found, a 'default' filter is created. The default filter takes all entrants from the parent results and applies them directly to the child entrylist, in their finishing order.

func (*RaceWeekend) GetSpectatorCar added in v1.7.5

func (rw *RaceWeekend) GetSpectatorCar() Entrant

func (*RaceWeekend) HasLinkedChampionship

func (rw *RaceWeekend) HasLinkedChampionship() bool

func (*RaceWeekend) HasParentRecursive

func (rw *RaceWeekend) HasParentRecursive(session *RaceWeekendSession, otherSessionID string) bool

HasParentRecursive looks for otherSessionID in session's parents, grandparents, etc...

func (*RaceWeekend) HasSpectatorCar added in v1.7.5

func (rw *RaceWeekend) HasSpectatorCar() bool

func (*RaceWeekend) HasTeamNames

func (rw *RaceWeekend) HasTeamNames() bool

HasTeamNames indicates whether a RaceWeekend entrylist has team names in it

func (*RaceWeekend) InProgress

func (rw *RaceWeekend) InProgress() bool

func (*RaceWeekend) MostRecentScheduledDateFormat added in v1.7.5

func (rw *RaceWeekend) MostRecentScheduledDateFormat(format string) string

func (*RaceWeekend) Progress

func (rw *RaceWeekend) Progress() float64

Progress indicates how far (0 -> 1) a RaceWeekend has progressed.

func (*RaceWeekend) RemoveFilter

func (rw *RaceWeekend) RemoveFilter(parentID, childID string)

RemoveFilter removes the link between parent and child

func (*RaceWeekend) SessionCanBeRun

func (rw *RaceWeekend) SessionCanBeRun(s *RaceWeekendSession) bool

SessionCanBeRun determines whether a RaceWeekendSession has all of its parent dependencies met to be allowed to run (i.e. all parent RaceWeekendSessions must be complete to allow it to run)

func (*RaceWeekend) SortedSessions

func (rw *RaceWeekend) SortedSessions() []*RaceWeekendSession

SortedSessions returns the RaceWeekendSessions in order by the number of parents the sessions have.

func (*RaceWeekend) TrackOverview

func (rw *RaceWeekend) TrackOverview() string

type RaceWeekendEntryList

type RaceWeekendEntryList []*RaceWeekendSessionEntrant

A RaceWeekendEntryList is a collection of RaceWeekendSessionEntrants

func EntryListToRaceWeekendEntryList

func EntryListToRaceWeekendEntryList(e EntryList, sessionID uuid.UUID) RaceWeekendEntryList

EntryListToRaceWeekendEntryList converts an EntryList to a RaceWeekendEntryList for a given RaceWeekendSession

func (*RaceWeekendEntryList) Add

Add an Entrant to the EntryList

func (*RaceWeekendEntryList) AddInPitBox

func (e *RaceWeekendEntryList) AddInPitBox(entrant *RaceWeekendSessionEntrant, pitBox int)

AddInPitBox adds an Entrant in a specific pitbox - overwriting any entrant that was in that pitbox previously.

func (RaceWeekendEntryList) AsEntryList

func (e RaceWeekendEntryList) AsEntryList() EntryList

AsEntryList returns a RaceWeekendEntryList as an EntryList

func (*RaceWeekendEntryList) Delete

func (e *RaceWeekendEntryList) Delete(entrant *RaceWeekendSessionEntrant)

Remove an Entrant from the EntryList

func (*RaceWeekendEntryList) Sorted

Sorted returns the RaceWeekendEntryList ordered by Entrant PitBoxes

type RaceWeekendEntryListSorter

type RaceWeekendEntryListSorter interface {
	Sort(*RaceWeekend, *RaceWeekendSession, []*RaceWeekendSessionEntrant, *RaceWeekendSessionToSessionFilter) error
}

RaceWeekendEntryListSorter is a function which takes a race weekend, session and entrylist and sorts the entrylist based on some criteria.

func GetRaceWeekendEntryListSort

func GetRaceWeekendEntryListSort(key string) RaceWeekendEntryListSorter

type RaceWeekendEntryListSorterDescription

type RaceWeekendEntryListSorterDescription struct {
	Name                  string
	Key                   string
	Sorter                RaceWeekendEntryListSorter
	NeedsParentSession    bool
	NeedsChampionship     bool
	ShowInManageEntryList bool
}

type RaceWeekendFilterSplitType added in v1.7.8

type RaceWeekendFilterSplitType string
const (
	SplitTypeNumeric               RaceWeekendFilterSplitType = "Numeric"
	SplitTypeManualDriverSelection RaceWeekendFilterSplitType = "Manual Driver Selection"
	SplitTypeChampionshipClass     RaceWeekendFilterSplitType = "Championship Class"
)

func (RaceWeekendFilterSplitType) String added in v1.7.8

func (fst RaceWeekendFilterSplitType) String() string

type RaceWeekendGridPreview

type RaceWeekendGridPreview struct {
	Results map[int]SessionPreviewEntrant
	Grid    map[int]SessionPreviewEntrant
	Classes map[string]string
}

func NewRaceWeekendGridPreview

func NewRaceWeekendGridPreview() *RaceWeekendGridPreview

type RaceWeekendHandler

type RaceWeekendHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewRaceWeekendHandler

func NewRaceWeekendHandler(baseHandler *BaseHandler, raceWeekendManager *RaceWeekendManager) *RaceWeekendHandler

type RaceWeekendManager

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

func NewRaceWeekendManager

func NewRaceWeekendManager(
	raceManager *RaceManager,
	championshipManager *ChampionshipManager,
	store Store,
	process ServerProcess,
	notificationManager NotificationDispatcher,
	acsrClient *ACSRClient,
	carManager *CarManager,
) *RaceWeekendManager

func (*RaceWeekendManager) BuildRaceWeekendSessionOpts

func (rwm *RaceWeekendManager) BuildRaceWeekendSessionOpts(r *http.Request) (*RaceTemplateVars, error)

func (*RaceWeekendManager) BuildRaceWeekendTemplateOpts

func (rwm *RaceWeekendManager) BuildRaceWeekendTemplateOpts(r *http.Request) (*RaceTemplateVars, error)

func (*RaceWeekendManager) CancelSession

func (rwm *RaceWeekendManager) CancelSession(raceWeekendID string, raceWeekendSessionID string) error

func (*RaceWeekendManager) ClearLockedTyreSetups

func (rwm *RaceWeekendManager) ClearLockedTyreSetups(raceWeekend *RaceWeekend, session *RaceWeekendSession) error

func (*RaceWeekendManager) DeScheduleSession

func (rwm *RaceWeekendManager) DeScheduleSession(raceWeekendID, sessionID string) error

func (*RaceWeekendManager) DeleteRaceWeekend

func (rwm *RaceWeekendManager) DeleteRaceWeekend(id string) error

func (*RaceWeekendManager) DeleteSession

func (rwm *RaceWeekendManager) DeleteSession(raceWeekendID string, raceWeekendSessionID string) error

func (*RaceWeekendManager) FindConnectedSessions

func (rwm *RaceWeekendManager) FindConnectedSessions(raceWeekendID, parentSessionID, childSessionID string) (*RaceWeekend, *RaceWeekendSession, *RaceWeekendSession, error)

func (*RaceWeekendManager) FindSession

func (rwm *RaceWeekendManager) FindSession(raceWeekendID, sessionID string) (*RaceWeekend, *RaceWeekendSession, error)

func (*RaceWeekendManager) ImportRaceWeekend

func (rwm *RaceWeekendManager) ImportRaceWeekend(data string) (string, error)

func (*RaceWeekendManager) ImportSession

func (rwm *RaceWeekendManager) ImportSession(raceWeekendID string, raceWeekendSessionID string, r *http.Request) error

func (*RaceWeekendManager) ListAvailableResultsFilesForSession

func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSession(raceWeekendID string, raceWeekendSessionID string) (*RaceWeekendSession, []SessionResults, error)

func (*RaceWeekendManager) ListAvailableResultsFilesForSorting

func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSorting(raceWeekend *RaceWeekend, session *RaceWeekendSession) ([]SessionResults, error)

func (*RaceWeekendManager) ListRaceWeekends

func (rwm *RaceWeekendManager) ListRaceWeekends() ([]*RaceWeekend, error)

func (*RaceWeekendManager) LoadRaceWeekend

func (rwm *RaceWeekendManager) LoadRaceWeekend(id string) (*RaceWeekend, error)

func (*RaceWeekendManager) PreviewGrid

func (rwm *RaceWeekendManager) PreviewGrid(raceWeekendID, parentSessionID, childSessionID string, filter *RaceWeekendSessionToSessionFilter) (*RaceWeekendGridPreview, error)

func (*RaceWeekendManager) PreviewSessionEntryList

func (rwm *RaceWeekendManager) PreviewSessionEntryList(raceWeekendID, sessionID, sortType string, reverseGrid int) (*RaceWeekendGridPreview, error)

func (*RaceWeekendManager) RaceWeekendSessionIsRunning

func (rwm *RaceWeekendManager) RaceWeekendSessionIsRunning() bool

func (*RaceWeekendManager) RestartActiveSession

func (rwm *RaceWeekendManager) RestartActiveSession() error

func (*RaceWeekendManager) RestartSession

func (rwm *RaceWeekendManager) RestartSession(raceWeekendID string, raceWeekendSessionID string) error

func (*RaceWeekendManager) SaveRaceWeekend

func (rwm *RaceWeekendManager) SaveRaceWeekend(r *http.Request) (raceWeekend *RaceWeekend, edited bool, err error)

func (*RaceWeekendManager) SaveRaceWeekendSession

func (rwm *RaceWeekendManager) SaveRaceWeekendSession(r *http.Request) (raceWeekend *RaceWeekend, session *RaceWeekendSession, edited bool, err error)

func (*RaceWeekendManager) ScheduleSession

func (rwm *RaceWeekendManager) ScheduleSession(raceWeekendID, sessionID string, date time.Time, startWhenParentFinishes bool) error

func (*RaceWeekendManager) StartPracticeSession

func (rwm *RaceWeekendManager) StartPracticeSession(raceWeekendID string, raceWeekendSessionID string) error

func (*RaceWeekendManager) StartSession

func (rwm *RaceWeekendManager) StartSession(raceWeekendID string, raceWeekendSessionID string, isPracticeSession bool) error

func (*RaceWeekendManager) StopActiveSession

func (rwm *RaceWeekendManager) StopActiveSession() error

func (*RaceWeekendManager) UDPCallback

func (rwm *RaceWeekendManager) UDPCallback(message udp.Message)

func (*RaceWeekendManager) UpdateGrid

func (rwm *RaceWeekendManager) UpdateGrid(raceWeekendID, parentSessionID, childSessionID string, filter *RaceWeekendSessionToSessionFilter) error

func (*RaceWeekendManager) UpdateSessionSorting

func (rwm *RaceWeekendManager) UpdateSessionSorting(raceWeekendID, sessionID string, sortType string, numEntrantsToReverse int) error

func (*RaceWeekendManager) UpsertRaceWeekend

func (rwm *RaceWeekendManager) UpsertRaceWeekend(raceWeekend *RaceWeekend) error

func (*RaceWeekendManager) WatchForScheduledSessions

func (rwm *RaceWeekendManager) WatchForScheduledSessions() error

type RaceWeekendSession

type RaceWeekendSession struct {
	ID      uuid.UUID
	Created time.Time
	Updated time.Time
	Deleted time.Time

	ParentIDs            []uuid.UUID
	SortType             string
	NumEntrantsToReverse int

	RaceConfig          CurrentRaceConfig
	OverridePassword    bool
	ReplacementPassword string

	StartedTime                time.Time
	CompletedTime              time.Time
	ScheduledTime              time.Time
	ScheduledServerID          ServerID
	Results                    *SessionResults
	StartWhenParentHasFinished bool

	Points map[uuid.UUID]*ChampionshipPoints
	// contains filtered or unexported fields
}

A RaceWeekendSession is a single session within a RaceWeekend. It can have parent sessions. It must have a RaceConfig. Once completed, a RaceWeekendSession will contain EntrantResult from that session.

func NewRaceWeekendSession

func NewRaceWeekendSession() *RaceWeekendSession

NewRaceWeekendSession creates an empty RaceWeekendSession

func (*RaceWeekendSession) ClearRecurrenceRule

func (rws *RaceWeekendSession) ClearRecurrenceRule()

func (*RaceWeekendSession) Completed

func (rws *RaceWeekendSession) Completed() bool

Completed RaceWeekendSessions have a non-zero CompletedTime

func (*RaceWeekendSession) FinishingGrid

func (rws *RaceWeekendSession) FinishingGrid(raceWeekend *RaceWeekend) ([]*RaceWeekendSessionEntrant, error)

FinishingGrid returns the finishing grid of the session, if complete. Otherwise, it returns the EntryList of that session

func (*RaceWeekendSession) GetID

func (rws *RaceWeekendSession) GetID() uuid.UUID

func (*RaceWeekendSession) GetRaceSetup

func (rws *RaceWeekendSession) GetRaceSetup() CurrentRaceConfig

func (*RaceWeekendSession) GetRaceWeekendEntryList

func (rws *RaceWeekendSession) GetRaceWeekendEntryList(rw *RaceWeekend, overrideFilter *RaceWeekendSessionToSessionFilter, overrideFilterSessionID string) (RaceWeekendEntryList, error)

GetRaceWeekendEntryList returns the RaceWeekendEntryList for the given session, built from the parent session(s) results and applied filters.

func (*RaceWeekendSession) GetRecurrenceRule

func (rws *RaceWeekendSession) GetRecurrenceRule() (*rrule.RRule, error)

func (*RaceWeekendSession) GetScheduledServerID added in v1.7.8

func (rws *RaceWeekendSession) GetScheduledServerID() ServerID

func (*RaceWeekendSession) GetScheduledTime

func (rws *RaceWeekendSession) GetScheduledTime() time.Time

func (*RaceWeekendSession) GetSummary

func (rws *RaceWeekendSession) GetSummary() string

func (*RaceWeekendSession) GetURL

func (rws *RaceWeekendSession) GetURL() string

func (*RaceWeekendSession) HasParent

func (rws *RaceWeekendSession) HasParent(id string) bool

HasParent determines if a RaceWeekendSession has a parent with id

func (*RaceWeekendSession) HasRecurrenceRule

func (rws *RaceWeekendSession) HasRecurrenceRule() bool

func (*RaceWeekendSession) HasSignUpForm

func (rws *RaceWeekendSession) HasSignUpForm() bool

func (*RaceWeekendSession) InProgress

func (rws *RaceWeekendSession) InProgress() bool

InProgress indicates whether a RaceWeekendSession has been started but not stopped

func (*RaceWeekendSession) IsBase

func (rws *RaceWeekendSession) IsBase() bool

IsBase indicates that a RaceWeekendSession has no parent

func (*RaceWeekendSession) Name

func (rws *RaceWeekendSession) Name() string

Name of the RaceWeekendSession

func (*RaceWeekendSession) ParentsDataAttr

func (rws *RaceWeekendSession) ParentsDataAttr(raceWeekend *RaceWeekend) template.HTMLAttr

ParentsDataAttr returns a html-safe data attribute for identifying parent sessions of a given RaceWeekendSession in the frontend

func (*RaceWeekendSession) ReadOnlyEntryList

func (rws *RaceWeekendSession) ReadOnlyEntryList() EntryList

func (*RaceWeekendSession) RemoveParent

func (rws *RaceWeekendSession) RemoveParent(parentID string)

RemoveParent removes a parent RaceWeekendSession from this session

func (*RaceWeekendSession) SessionInfo

func (rws *RaceWeekendSession) SessionInfo() *SessionConfig

SessionInfo returns the information about the Assetto Corsa Session (i.e. practice, qualifying, race)

func (*RaceWeekendSession) SessionType

func (rws *RaceWeekendSession) SessionType() SessionType

SessionType returns the type of the RaceWeekendSession (practice, qualifying, race)

func (*RaceWeekendSession) SetRecurrenceRule

func (rws *RaceWeekendSession) SetRecurrenceRule(input string) error

type RaceWeekendSessionEntrant

type RaceWeekendSessionEntrant struct {
	// SessionID is the last session the Entrant participated in
	SessionID uuid.UUID
	// EntrantResult is the result of the last session the Entrant participated in
	EntrantResult *SessionResult
	// Car is the car from the EntryList that matches the results of the last session the Entrant participated in
	Car *SessionCar
	// PitBox is used to determine the starting pitbox of the Entrant.
	PitBox int
	// SessionResults are the whole results for the session the entrant took part in
	SessionResults *SessionResults `json:"-"`

	IsPlaceholder bool `json:"-"`

	// OverrideSetupFile is a path to an overridden setup for a Race Weekend
	OverrideSetupFile string
}

A RaceWeekendSessionEntrant is someone who has entered at least one RaceWeekend event.

func NewRaceWeekendSessionEntrant

func NewRaceWeekendSessionEntrant(previousSessionID uuid.UUID, car *SessionCar, entrantResult *SessionResult, sessionResults *SessionResults) *RaceWeekendSessionEntrant

NewRaceWeekendSessionEntrant creates a RaceWeekendSessionEntrant

func (*RaceWeekendSessionEntrant) ChampionshipClass

func (se *RaceWeekendSessionEntrant) ChampionshipClass(raceWeekend *RaceWeekend) *ChampionshipClass

func (*RaceWeekendSessionEntrant) GetEntrant

func (se *RaceWeekendSessionEntrant) GetEntrant() *Entrant

GetEntrant returns the RaceWeekendSessionEntrant as an EntryList Entrant (used for building the final entry_list.ini)

type RaceWeekendSessionToSessionFilter

type RaceWeekendSessionToSessionFilter struct {
	// IsPreview indicates that the Filter is for preview only, and will not actually affect a starting grid.
	IsPreview bool

	// ResultStart is the beginning of the split from the previous session's result
	ResultStart int
	// ResultEnd is the end of the split from the previous session's result
	ResultEnd int

	// NumEntrantsToReverse defines how many entrants to reverse. -1 indicates all, 0 indicates none, or N entrants.
	NumEntrantsToReverse int

	// EntryListStart is where to place the entrants in the starting grid of the next session
	EntryListStart int

	// SortType defines how the entrants are sorted
	SortType string

	// ForceUseTyreFromFastestLap forces drivers to start on the same tyre compound as the tyre compound that
	// they achieved their fastest lap on in the previous session
	ForceUseTyreFromFastestLap bool

	// AvailableResultsForSorting are the results files to be used for sorting the entrants.
	AvailableResultsForSorting []string

	// SplitType defines the kind of splitting that we want to do.
	SplitType RaceWeekendFilterSplitType

	// SelectedDriverGUIDs is a list of the currently selected driver GUIDs. This is only populated if SplitType == SplitTypeManualDriverSelection
	SelectedDriverGUIDs []string

	// SelectedChampionshipClassIDs is a list of the currently selected ChampionshipClass IDs. This is only populated if SplitType == SplitTypeChampionshipClass
	SelectedChampionshipClassIDs map[uuid.UUID]bool

	// Deprecated: ManualDriverSelection indicates that drivers are picked manually from the above results file.
	ManualDriverSelection bool
}

func (RaceWeekendSessionToSessionFilter) Filter

func (f RaceWeekendSessionToSessionFilter) Filter(raceWeekend *RaceWeekend, parentSession, childSession *RaceWeekendSession, parentSessionResults []*RaceWeekendSessionEntrant, childSessionEntryList *RaceWeekendEntryList) error

Filter takes a set of RaceWeekendSessionEntrants formed by the results of the parent session and filters them into a child session entry list.

type RealPenaltyACSettings added in v1.7.5

type RealPenaltyACSettings struct {
	General            RealPenaltyACSettingsGeneral            `ini:"General" help:""`
	App                RealPenaltyACSettingsApp                `ini:"App" help:""`
	Sol                RealPenaltyACSettingsSol                `ini:"Sol" help:""`
	CustomShadersPatch RealPenaltyACSettingsCustomShadersPatch `ini:"Custom_Shaders_Patch"`
	SafetyCar          RealPenaltyACSettingsSafetyCar          `ini:"Safety_Car" help:""`
	NoPenalty          RealPenaltyACSettingsNoPenalty          `ini:"No_Penalty" help:""`
	Admin              RealPenaltyACSettingsAdmin              `ini:"Admin" help:""`
	Helicorsa          RealPenaltyACSettingsHelicorsa          `ini:"Helicorsa" help:""`
}

func DefaultRealPenaltyACSettings added in v1.7.5

func DefaultRealPenaltyACSettings() RealPenaltyACSettings

type RealPenaltyACSettingsAdmin added in v1.7.5

type RealPenaltyACSettingsAdmin struct {
	GUIDs string `ini:"GUIDs" name:"GUIDs" help:"List of Steam GUIDs (separated by a semicolon) that can send commands to the server via chat"`
}

type RealPenaltyACSettingsApp added in v1.7.5

type RealPenaltyACSettingsApp struct {
	Mandatory      boolString `ini:"MANDATORY" help:"on = Real Penalty app is mandatory, off = Real Penalty app is not mandatory"`
	CheckFrequency int        `ini:"CHECK_FREQUENCY" help:"Frequency (seconds) for app check"`
}

type RealPenaltyACSettingsCustomShadersPatch added in v1.7.8

type RealPenaltyACSettingsCustomShadersPatch struct {
	Mandatory      bool `` /* 219-byte string literal not displayed */
	CheckFrequency int  `ini:"CHECK_FREQUENCY" help:"Frequency (seconds) for Custom Shaders Patch check"`
}

type RealPenaltyACSettingsGeneral added in v1.7.5

type RealPenaltyACSettingsGeneral struct {
	FirstCheckTime int `ini:"FIRST_CHECK_TIME" help:"Delay (seconds) after connection of new driver for the first check (app + sol)"`

	CockpitCamera bool `` /* 169-byte string literal not displayed */

	TrackChecksum   bool `` /* 135-byte string literal not displayed */
	WeatherChecksum bool `ini:"WEATHER_CHECKSUM" help:"Set to true if you want the weather checksum (if the weather exists on the server)"`
	CarChecksum     bool `` /* 143-byte string literal not displayed */
}

type RealPenaltyACSettingsHelicorsa added in v1.7.5

type RealPenaltyACSettingsHelicorsa struct {
	Mandatory         bool    `ini:"MANDATORY" help:"Set to true if the Helicorsa app is mandatory for the race"`
	DistanceThreshold float64 `ini:"DISTANCE_THRESHOLD" help:"How far away are the cars we paint?"`
	WorldZoom         float64 `ini:"WORLD_ZOOM" help:"World coordinates zoom or how big the bars are"`
	OpacityThreshold  float64 `ini:"OPACITY_THRESHOLD" help:"Opacity threshold: At which distance (in meters) should the cars start to fade?"`
	FrontFadeOutArc   float64 `ini:"FRONT_FADE_OUT_ARC" help:"Fade out cars in front of the player in an arc of X degrees (0 to disable)"`
	FrontFadeAngle    float64 `` /* 128-byte string literal not displayed */

	CarLength float64 `ini:"CAR_LENGHT" help:"How long are the cars (in meters). Sorry, no data from AC available"` // this is misspelt in the example ac_settings.ini
	CarWidth  float64 `ini:"CAR_WIDTH" help:"How wide are the cars (in meters). Sorry, no data from AC available"`
}

type RealPenaltyACSettingsNoPenalty added in v1.7.5

type RealPenaltyACSettingsNoPenalty struct {
	GUIDs string `` /* 178-byte string literal not displayed */
}

type RealPenaltyACSettingsSafetyCar added in v1.7.5

type RealPenaltyACSettingsSafetyCar struct {
	CarModel                   string  `ini:"CAR_MODEL" help:"Car model of safety car"`
	RaceStartBehindSC          bool    `` /* 157-byte string literal not displayed */
	NormalizedLightOffPosition float64 `` /* 179-byte string literal not displayed */
	NormalizedStartPosition    float64 `` /* 253-byte string literal not displayed */
	GreenLightDelay            float64 `ini:"GREEN_LIGHT_DELAY" help:"Rolling start: delay of the green light after red signal (seconds)"`
}

type RealPenaltyACSettingsSol added in v1.7.5

type RealPenaltyACSettingsSol struct {
	Mandatory              bool `ini:"MANDATORY" help:"Set to true if the event is with mod Sol day to night transition"`
	PerformanceModeAllowed bool `ini:"PERFORMACE_MODE_ALLOWED" help:"Set to true if Sol performance mode is allowed"` // misspelt in real penalty INI
	CheckFrequency         int  `ini:"CHECK_FREQUENCY" help:"Frequency (seconds) for Sol check"`
}

type RealPenaltyAppConfig added in v1.7.5

type RealPenaltyAppConfig struct {
	General      RealPenaltyConfigGeneral `ini:"General"`
	PluginsRelay RealPenaltyPluginsRelay  `ini:"Plugins_Relay" show:"open"`
}

func DefaultRealPenaltyAppConfig added in v1.7.5

func DefaultRealPenaltyAppConfig() RealPenaltyAppConfig

type RealPenaltyConfig added in v1.7.5

type RealPenaltyConfig struct {
	RealPenaltyAppConfig  RealPenaltyAppConfig  `show:"contents"`
	RealPenaltySettings   RealPenaltySettings   `show:"contents"`
	RealPenaltyACSettings RealPenaltyACSettings `show:"contents"`
}

each of these is a separate ini file

func DefaultRealPenaltyConfig added in v1.7.5

func DefaultRealPenaltyConfig() *RealPenaltyConfig

func (*RealPenaltyConfig) Write added in v1.7.5

func (rpc *RealPenaltyConfig) Write() error

type RealPenaltyConfigGeneral added in v1.7.5

type RealPenaltyConfigGeneral struct {
	EnableRealPenalty bool `ini:"-" help:"Turn Real Penalty on or off"`

	ACServerPath    string `ini:"AC_SERVER_PATH" show:"-" help:"Path to the AC Server folder"`
	ACCFGFile       string `` /* 143-byte string literal not displayed */
	ACTracksFolder  string `` /* 137-byte string literal not displayed */
	ACWeatherFolder string `` /* 139-byte string literal not displayed */

	UDPPort     int    `ini:"UDP_PORT" show:"-" help:"Listening UDP port - Set the same port (without IP) of cfg of the server, UDP_PLUGIN_ADDRESS "`
	UDPResponse string `` /* 146-byte string literal not displayed */
	AppTCPPort  int    `` /* 290-byte string literal not displayed */
	AppUDPPort  int    `ini:"APP_UDP_PORT" show:"open" help:"Listening UDP port from AC app (to open in firewall/router). Any free UDP port is OK"`

	AppFile      string `ini:"APP_FILE" show:"-" help:"Path and file names of the app from the plugin package"`
	ImagesFile   string `ini:"IMAGES_FILE" show:"-" help:"Path and file names of the images from the plugin package"`
	SoundsFile   string `ini:"SOUNDS_FILE" show:"-" help:"Path and file names of the sounds from the plugin package"`
	TracksFolder string `ini:"TRACKS_FOLDER" show:"-" help:"Folder of the additional .ini track files"`
}

type RealPenaltyHandler added in v1.7.5

type RealPenaltyHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewRealPenaltyHandler added in v1.7.5

func NewRealPenaltyHandler(baseHandler *BaseHandler, store Store) *RealPenaltyHandler

type RealPenaltyPluginsRelay added in v1.7.5

type RealPenaltyPluginsRelay struct {
	OtherUDPPlugin string `` /* 140-byte string literal not displayed */
	UDPPort        string `ini:"UDP_PORT" show:"open" help:"List of listening UDP ports for all other plugins connected (separated by a semicolon)"`
}

type RealPenaltySettings added in v1.7.5

type RealPenaltySettings struct {
	General   RealPenaltySettingsGeneral   `ini:"General"`
	Cutting   RealPenaltySettingsCutting   `ini:"Cutting"`
	Speeding  RealPenaltySettingsSpeeding  `ini:"Speeding"`
	Crossing  RealPenaltySettingsCrossing  `ini:"Crossing"`
	JumpStart RealPenaltySettingsJumpStart `ini:"Jump_Start"`
	DRS       RealPenaltySettingsDRS       `ini:"Drs"`
	BlueFlag  RealPenaltySettingsBlueFlag  `ini:"Blue_Flag"`
}

func DefaultRealPenaltySettings added in v1.7.5

func DefaultRealPenaltySettings() RealPenaltySettings

type RealPenaltySettingsBlueFlag added in v1.7.5

type RealPenaltySettingsBlueFlag struct {
	QualifyTimeThreshold float64 `ini:"QUALIFY_TIME_THRESHOLD" help:"Time distance (seconds) to show the blue flag in qualifying"`
	RaceTimeThreshold    float64 `ini:"RACE_TIME_THRESHOLD" help:"Time distance (seconds) to show the blue flag in the race"`
}

type RealPenaltySettingsCrossing added in v1.7.5

type RealPenaltySettingsCrossing struct {
	PenaltyType string `` /* 145-byte string literal not displayed */
}

type RealPenaltySettingsCutting added in v1.7.5

type RealPenaltySettingsCutting struct {
	EnabledDuringSafetyCar bool    `ini:"ENABLED_DURING_SAFETY_CAR" help:"Cutting penalty enable during Safety Car or Virtual Safety Car"`
	TotalCutWarnings       int     `ini:"TOTAL_CUT_WARNINGS" help:"How many warnings are allowed before a penalty is given"`
	EnableTyresDirtLevel   bool    `ini:"ENABLE_TYRES_DIRT_LEVEL" help:"Tyres dirt for cutting"`
	WheelsOut              int     `ini:"WHEELS_OUT" help:"The maximum number of wheels that are allowed to go off track"`
	MinSpeed               int     `ini:"MIN_SPEED" help:"The minimum speed, in kph, that will trigger a cut"`
	SecondsBetweenCuts     int     `ini:"SECONDS_BETWEEN_CUTS" help:"You won't get a cut until this many seconds after the last one"`
	MaxCutTime             int     `` /* 153-byte string literal not displayed */
	MinSlowDownRatio       float64 `` /* 442-byte string literal not displayed */

	QualifySlowDownSpeed      int     `` /* 133-byte string literal not displayed */
	QualifyMaxSectorOutSpeed  int     `` /* 196-byte string literal not displayed */
	QualifySlowDownSpeedRatio float64 `` /* 234-byte string literal not displayed */

	PostCuttingTime int    `` /* 206-byte string literal not displayed */
	PenaltyType     string `` /* 144-byte string literal not displayed */
}

type RealPenaltySettingsDRS added in v1.7.5

type RealPenaltySettingsDRS struct {
	PenaltyType            string  `` /* 152-byte string literal not displayed */
	Gap                    float64 `ini:"GAP" help:"Max gap in seconds from front car"`
	EnabledAfterLaps       int     `ini:"ENABLED_AFTER_LAPS" help:"DRS enabled after N lap from start (+1 if rolling start with SC - file ac_settings.ini)"`
	MinSpeed               int     `ini:"MIN_SPEED" help:"If the car speed < MIN SPEED no penalty for illegal DRS use"`
	BonusTime              float64 `ini:"BONUS_TIME" help:"How many seconds the DRS can remain open during each illegal use before the penalty"`
	MaxIllegalUses         int     `ini:"MAX_ILLEGAL_USES" help:"How many time the driver can open the illegal DRS in each sector before the penalty"`
	EnabledDuringSafetyCar bool    `ini:"ENABLED_DURING_SAFETY_CAR" help:"DRS penalty enabled during Safety Car or Virtual Safety Car"`
	OmitCars               string  `ini:"OMIT_CARS" help:"List of cars without DRS, semicolon separated."`
}

type RealPenaltySettingsGeneral added in v1.7.5

type RealPenaltySettingsGeneral struct {
	EnableCuttingPenalties  bool `ini:"ENABLE_CUTTING_PENALTIES" help:"Set to true to enable cuttings penalties; false to issue warnings only"`
	EnableSpeedingPenalties bool `ini:"ENABLE_SPEEDING_PENALTIES" help:"Set to true to enable pit lane speeding penalties"`
	EnableCrossingPenalties bool `ini:"ENABLE_CROSSING_PENALTIES" help:"Set to true to enable exit pit lane crossing line penalty"`
	EnableDRSPenalties      bool `ini:"ENABLE_DRS_PENALTIES" help:"Set to true to enable DRS penalty (only for car with DRS)"`

	LapsToTakePenalty      int `` /* 151-byte string literal not displayed */
	PenaltySeconds         int `` /* 131-byte string literal not displayed */
	LastTimeWithoutPenalty int `` /* 430-byte string literal not displayed */
	LastLapsWithoutPenalty int `` /* 296-byte string literal not displayed */
}

type RealPenaltySettingsJumpStart added in v1.7.5

type RealPenaltySettingsJumpStart struct {
	PenaltyType0       string `` /* 164-byte string literal not displayed */
	SpeedLimitPenalty0 int    `ini:"SPEED_LIMIT_PENALTY_0" help:""`

	PenaltyType1       string `ini:"PENALTY_TYPE_1" help:""`
	SpeedLimitPenalty1 int    `` /* 171-byte string literal not displayed */

	PenaltyType2       string `ini:"PENALTY_TYPE_2" help:""`
	SpeedLimitPenalty2 int    `` /* 171-byte string literal not displayed */
}

type RealPenaltySettingsSpeeding added in v1.7.5

type RealPenaltySettingsSpeeding struct {
	PitLaneSpeed int `` /* 158-byte string literal not displayed */

	PenaltyType0       string `` /* 180-byte string literal not displayed */
	SpeedLimitPenalty0 int    `ini:"SPEED_LIMIT_PENALTY_0" help:""`

	PenaltyType1       string `` /* 180-byte string literal not displayed */
	SpeedLimitPenalty1 int    `ini:"SPEED_LIMIT_PENALTY_1" help:""`

	PenaltyType2       string `` /* 180-byte string literal not displayed */
	SpeedLimitPenalty2 int    `ini:"SPEED_LIMIT_PENALTY_2" help:""`
}

type Renderer

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

Renderer is the template engine.

func NewRenderer

func NewRenderer(loader TemplateLoader, store Store, process ServerProcess, reload bool) (*Renderer, error)

func (*Renderer) LoadPartial

func (tr *Renderer) LoadPartial(w http.ResponseWriter, r *http.Request, partial string, vars TemplateVars) error

func (*Renderer) LoadTemplate

func (tr *Renderer) LoadTemplate(w http.ResponseWriter, r *http.Request, view string, vars TemplateVars) error

LoadTemplate reads a template from templates and renders it with data to the given io.Writer

func (*Renderer) MustLoadPartial

func (tr *Renderer) MustLoadPartial(w http.ResponseWriter, r *http.Request, partial string, vars TemplateVars)

func (*Renderer) MustLoadTemplate

func (tr *Renderer) MustLoadTemplate(w http.ResponseWriter, r *http.Request, view string, vars TemplateVars)

MustLoadTemplate asserts that a LoadTemplate call must succeed or be dealt with via the http.ResponseWriter

type Resolver

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

func NewResolver

func NewResolver(templateLoader TemplateLoader, reloadTemplates bool, store Store) (*Resolver, error)

func (*Resolver) ResolveRaceControl added in v1.7.2

func (r *Resolver) ResolveRaceControl() *RaceControl

func (*Resolver) ResolveRouter

func (r *Resolver) ResolveRouter(fs http.FileSystem) http.Handler

func (*Resolver) ResolveStore

func (r *Resolver) ResolveStore() Store

func (*Resolver) UDPCallback

func (r *Resolver) UDPCallback(message udp.Message)

type ResultsHandler

type ResultsHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewResultsHandler

func NewResultsHandler(baseHandler *BaseHandler, store Store) *ResultsHandler

type ScheduledEvent

type ScheduledEvent interface {
	GetID() uuid.UUID
	GetScheduledServerID() ServerID
	GetRaceSetup() CurrentRaceConfig
	GetScheduledTime() time.Time
	GetSummary() string
	GetURL() string
	HasSignUpForm() bool
	ReadOnlyEntryList() EntryList
	HasRecurrenceRule() bool
	GetRecurrenceRule() (*rrule.RRule, error)
	SetRecurrenceRule(input string) error
	ClearRecurrenceRule()
}

type ScheduledEventBase

type ScheduledEventBase struct {
	Scheduled         time.Time
	ScheduledInitial  time.Time
	Recurrence        string
	ScheduledServerID ServerID
}

func (*ScheduledEventBase) ClearRecurrenceRule

func (seb *ScheduledEventBase) ClearRecurrenceRule()

func (*ScheduledEventBase) GetRecurrenceRule

func (seb *ScheduledEventBase) GetRecurrenceRule() (*rrule.RRule, error)

func (*ScheduledEventBase) GetScheduledTime

func (seb *ScheduledEventBase) GetScheduledTime() time.Time

func (*ScheduledEventBase) HasRecurrenceRule

func (seb *ScheduledEventBase) HasRecurrenceRule() bool

func (*ScheduledEventBase) SetRecurrenceRule

func (seb *ScheduledEventBase) SetRecurrenceRule(input string) error

type ScheduledRacesHandler

type ScheduledRacesHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewScheduledRacesHandler

func NewScheduledRacesHandler(baseHandler *BaseHandler, scheduledRacesManager *ScheduledRacesManager) *ScheduledRacesHandler

type ScheduledRacesManager

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

func NewScheduledRacesManager

func NewScheduledRacesManager(store Store) *ScheduledRacesManager

type ServerAccountOptions

type ServerAccountOptions struct {
	IsOpen bool
}

type ServerAdministrationHandler

type ServerAdministrationHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewServerAdministrationHandler

func NewServerAdministrationHandler(
	baseHandler *BaseHandler,
	store Store,
	raceManager *RaceManager,
	championshipManager *ChampionshipManager,
	raceWeekendManager *RaceWeekendManager,
	process ServerProcess,
	acsrClient *ACSRClient,
) *ServerAdministrationHandler

type ServerConfig

type ServerConfig struct {
	GlobalServerConfig GlobalServerConfig `ini:"SERVER"`
	CurrentRaceConfig  CurrentRaceConfig  `ini:"SERVER"`
}

func ConfigIniDefault

func ConfigIniDefault() ServerConfig

ConfigIniDefault is the default server config (ish) as supplied via the assetto corsa server.

func (ServerConfig) ReadString added in v1.7.8

func (sc ServerConfig) ReadString() (string, error)

func (ServerConfig) Write

func (sc ServerConfig) Write() error

type ServerExtraConfig

type ServerExtraConfig struct {
	Plugins                     []*CommandPlugin `yaml:"plugins"`
	AuditLogging                bool             `yaml:"audit_logging"`
	PerformanceMode             bool             `yaml:"performance_mode"`
	DisableWindowsBrowserOpen   bool             `yaml:"dont_open_browser"`
	ScanContentFolderForChanges bool             `yaml:"scan_content_folder_for_changes"`
	UseCarNameCache             bool             `yaml:"use_car_name_cache"`
	PersistMidSessionResults    bool             `yaml:"persist_mid_session_results"`

	// Deprecated: use Plugins instead
	RunOnStart []string `yaml:"run_on_start"`
}

type ServerID added in v1.7.3

type ServerID string

type ServerProcess

type ServerProcess interface {
	Start(event RaceEvent, udpPluginAddress string, udpPluginLocalPort int, forwardingAddress string, forwardListenPort int) error
	Stop() error
	Restart() error
	IsRunning() bool
	Event() RaceEvent
	UDPCallback(message udp.Message)
	SendUDPMessage(message udp.Message) error
	NotifyDone(chan struct{})
	Logs() string
}

type SessionCar

type SessionCar struct {
	BallastKG  int           `json:"BallastKG"`
	CarID      int           `json:"CarId"`
	Driver     SessionDriver `json:"Driver"`
	Model      string        `json:"Model"`
	Restrictor int           `json:"Restrictor"`
	Skin       string        `json:"Skin"`
}

func (*SessionCar) GetCar

func (c *SessionCar) GetCar() string

func (*SessionCar) GetGUID

func (c *SessionCar) GetGUID() string

func (*SessionCar) GetName

func (c *SessionCar) GetName() string

func (*SessionCar) GetSkin

func (c *SessionCar) GetSkin() string

func (*SessionCar) GetTeam

func (c *SessionCar) GetTeam() string

func (*SessionCar) HasMultipleDrivers added in v1.7.5

func (c *SessionCar) HasMultipleDrivers() bool

type SessionConfig

type SessionConfig struct {
	Name     string          `ini:"NAME" show:"quick"`
	Time     int             `ini:"TIME" show:"quick" help:"session length in minutes"`
	Laps     int             `ini:"LAPS" show:"quick" help:"number of laps in the race"`
	IsOpen   SessionOpenness `ini:"IS_OPEN" input:"checkbox" help:"0 = no join, 1 = free join, 2 = free join until 20 seconds to the green light"`
	WaitTime int             `ini:"WAIT_TIME" help:"seconds before the start of the session"`
}

type SessionDriver

type SessionDriver struct {
	GUID      string    `json:"Guid"`
	GuidsList []string  `json:"GuidsList"`
	Name      string    `json:"Name"`
	Nation    string    `json:"Nation"`
	Team      string    `json:"Team"`
	ClassID   uuid.UUID `json:"ClassID"`
}

func (*SessionDriver) AssignEntrant

func (sd *SessionDriver) AssignEntrant(entrant *Entrant, classID uuid.UUID)

type SessionEvent

type SessionEvent struct {
	CarID         int            `json:"CarId"`
	Driver        *SessionDriver `json:"Driver"`
	ImpactSpeed   float64        `json:"ImpactSpeed"`
	OtherCarID    int            `json:"OtherCarId"`
	OtherDriver   *SessionDriver `json:"OtherDriver"`
	RelPosition   *SessionPos    `json:"RelPosition"`
	Type          string         `json:"Type"`
	WorldPosition *SessionPos    `json:"WorldPosition"`
}

func (*SessionEvent) GetRelPosition

func (se *SessionEvent) GetRelPosition() string

func (*SessionEvent) GetWorldPosition

func (se *SessionEvent) GetWorldPosition() string

type SessionLap

type SessionLap struct {
	BallastKG  int       `json:"BallastKG"`
	CarID      int       `json:"CarId"`
	CarModel   string    `json:"CarModel"`
	Cuts       int       `json:"Cuts"`
	DriverGUID string    `json:"DriverGuid"`
	DriverName string    `json:"DriverName"`
	LapTime    int       `json:"LapTime"`
	Restrictor int       `json:"Restrictor"`
	Sectors    []int     `json:"Sectors"`
	Timestamp  int       `json:"Timestamp"`
	Tyre       string    `json:"Tyre"`
	ClassID    uuid.UUID `json:"ClassID"`
}

func (*SessionLap) DidCheat

func (sl *SessionLap) DidCheat(averageTime time.Duration) bool

func (*SessionLap) GetLapTime

func (sl *SessionLap) GetLapTime() time.Duration

func (*SessionLap) GetSector

func (sl *SessionLap) GetSector(x int) time.Duration

type SessionOpenness added in v1.7.5

type SessionOpenness int

func (SessionOpenness) String added in v1.7.5

func (s SessionOpenness) String() string

type SessionPos

type SessionPos struct {
	X float64 `json:"X"`
	Y float64 `json:"Y"`
	Z float64 `json:"Z"`
}

type SessionPreviewEntrant

type SessionPreviewEntrant struct {
	Name       string
	Session    string
	Class      string
	ClassColor string
}

type SessionResult

type SessionResult struct {
	BallastKG    int           `json:"BallastKG"`
	BestLap      int           `json:"BestLap"`
	CarID        int           `json:"CarId"`
	CarModel     string        `json:"CarModel"`
	DriverGUID   string        `json:"DriverGuid"`
	DriverName   string        `json:"DriverName"`
	Restrictor   int           `json:"Restrictor"`
	TotalTime    int           `json:"TotalTime"`
	HasPenalty   bool          `json:"HasPenalty"`
	PenaltyTime  time.Duration `json:"PenaltyTime"`
	LapPenalty   int           `json:"LapPenalty"`
	Disqualified bool          `json:"Disqualified"`
	ClassID      uuid.UUID     `json:"ClassID"`
}

func (*SessionResult) BestLapTyre

func (s *SessionResult) BestLapTyre(results *SessionResults) string

type SessionResults

type SessionResults struct {
	Cars           []*SessionCar    `json:"Cars"`
	Events         []*SessionEvent  `json:"Events"`
	Laps           []*SessionLap    `json:"Laps"`
	Result         []*SessionResult `json:"Result"`
	TrackConfig    string           `json:"TrackConfig"`
	TrackName      string           `json:"TrackName"`
	Type           SessionType      `json:"Type"`
	Date           time.Time        `json:"Date"`
	SessionFile    string           `json:"SessionFile"`
	ChampionshipID string           `json:"ChampionshipID"`
	RaceWeekendID  string           `json:"RaceWeekendID"`
}

func ListAllResults

func ListAllResults() ([]SessionResults, error)

func LoadResult

func LoadResult(fileName string, opts ...LoadResultOpts) (*SessionResults, error)

func (*SessionResults) Anonymize

func (s *SessionResults) Anonymize()

func (*SessionResults) ClearKickedGUIDs added in v1.7.6

func (s *SessionResults) ClearKickedGUIDs()

Clear Kicked GUIDs removes any instances of the kicked guid from the results

func (*SessionResults) DriversHaveTeams

func (s *SessionResults) DriversHaveTeams() bool

func (*SessionResults) FallBackSort

func (s *SessionResults) FallBackSort()

func (*SessionResults) FastestLap

func (s *SessionResults) FastestLap() *SessionLap

func (*SessionResults) FastestLapInClass

func (s *SessionResults) FastestLapInClass(classID uuid.UUID) *SessionLap

func (*SessionResults) FindCarByGUIDAndModel

func (s *SessionResults) FindCarByGUIDAndModel(guid, model string) (*SessionCar, error)

func (*SessionResults) FindCarIDForGUIDAndModel added in v1.7.5

func (s *SessionResults) FindCarIDForGUIDAndModel(guid, model string) int

func (*SessionResults) GetAverageLapTime

func (s *SessionResults) GetAverageLapTime(guid, model string) time.Duration

func (*SessionResults) GetConsistency

func (s *SessionResults) GetConsistency(guid, model string) float64

func (*SessionResults) GetCrashes

func (s *SessionResults) GetCrashes(guid, model string) int

func (*SessionResults) GetCrashesOfType

func (s *SessionResults) GetCrashesOfType(guid, model, collisionType string) int

func (*SessionResults) GetCuts

func (s *SessionResults) GetCuts(driverGUID, model string) int

func (*SessionResults) GetDate

func (s *SessionResults) GetDate() string

func (*SessionResults) GetDriverDescriptionForLap added in v1.7.5

func (s *SessionResults) GetDriverDescriptionForLap(lap *SessionLap, autoFillEntrantList []*Entrant) string

func (*SessionResults) GetDriverPosition

func (s *SessionResults) GetDriverPosition(driverGUID, model string) int

func (*SessionResults) GetDrivers

func (s *SessionResults) GetDrivers() string

func (*SessionResults) GetDriversFastestLap

func (s *SessionResults) GetDriversFastestLap(guid, model string) *SessionLap

func (*SessionResults) GetLastLapPos

func (s *SessionResults) GetLastLapPos(driverGUID, model string) int

func (*SessionResults) GetLastLapTime

func (s *SessionResults) GetLastLapTime(driverGUID, model string) time.Duration

func (*SessionResults) GetNumLaps

func (s *SessionResults) GetNumLaps(driverGUID, model string) int

func (*SessionResults) GetNumSectors

func (s *SessionResults) GetNumSectors() []int

func (*SessionResults) GetOverallAverageLapTime

func (s *SessionResults) GetOverallAverageLapTime() time.Duration

func (*SessionResults) GetPosForLap

func (s *SessionResults) GetPosForLap(guid, model string, lapNum int64) int

lapNum is the drivers current lap

func (*SessionResults) GetPotentialLap

func (s *SessionResults) GetPotentialLap(driverGUID, model string) time.Duration

func (*SessionResults) GetTeamName

func (s *SessionResults) GetTeamName(driverGUID string) string

func (*SessionResults) GetTime

func (s *SessionResults) GetTime(timeINT int, driverGUID, model string, penalty bool) time.Duration

func (*SessionResults) GetURL

func (s *SessionResults) GetURL() string

func (*SessionResults) HasHandicaps

func (s *SessionResults) HasHandicaps() bool

func (*SessionResults) IsDriversFastestLap

func (s *SessionResults) IsDriversFastestLap(guid, model string, time, cuts int) bool

func (*SessionResults) IsDriversFastestSector

func (s *SessionResults) IsDriversFastestSector(guid, model string, sector, time, cuts int) bool

func (*SessionResults) IsFastestLap

func (s *SessionResults) IsFastestLap(time, cuts int) bool

func (*SessionResults) IsFastestSector

func (s *SessionResults) IsFastestSector(sector, time, cuts int) bool

func (*SessionResults) IsTimeAttack added in v1.7.4

func (s *SessionResults) IsTimeAttack() bool

func (*SessionResults) LapAssociatedWithGUIDAndModel added in v1.7.5

func (s *SessionResults) LapAssociatedWithGUIDAndModel(lap *SessionLap, driverGUID, model string) bool

func (*SessionResults) MaskDriverNames

func (s *SessionResults) MaskDriverNames()

func (*SessionResults) NormaliseCarIDs added in v1.7.6

func (s *SessionResults) NormaliseCarIDs()

NormaliseCarIDs fixes any instances where CarID may have changed in some laps

func (*SessionResults) NormaliseDriverSwapGUIDs added in v1.7.5

func (s *SessionResults) NormaliseDriverSwapGUIDs()

func (*SessionResults) NumberOfDriverSwaps added in v1.7.5

func (s *SessionResults) NumberOfDriverSwaps(carID int) int

func (*SessionResults) RenameDriver

func (s *SessionResults) RenameDriver(guid, newName string)

func (*SessionResults) ResultHasMultipleDrivers added in v1.7.5

func (s *SessionResults) ResultHasMultipleDrivers(result *SessionResult) bool

func (*SessionResults) UpdateDate added in v1.7.6

func (s *SessionResults) UpdateDate(date time.Time)

type SessionType

type SessionType string
const (
	SessionTypeBooking    SessionType = "BOOK"
	SessionTypePractice   SessionType = "PRACTICE"
	SessionTypeQualifying SessionType = "QUALIFY"
	SessionTypeRace       SessionType = "RACE"

	// SessionTypeSecondRace is a convenience const to allow for checking of
	// reversed grid positions signifying a second race.
	SessionTypeSecondRace SessionType = "RACEx2"
)

func (SessionType) OriginalString

func (s SessionType) OriginalString() string

func (SessionType) String

func (s SessionType) String() string

type Sessions

type Sessions map[SessionType]*SessionConfig

func (Sessions) AsSlice

func (s Sessions) AsSlice() []*SessionConfig

func (Sessions) AsSliceWithSessionTypes added in v1.7.8

func (s Sessions) AsSliceWithSessionTypes() ([]*SessionConfig, []SessionType)

type ShouldBeAnInt

type ShouldBeAnInt int

ShouldBeAnInt can be used in JSON struct definitions in places where the value provided should be an int, but isn't.

func (*ShouldBeAnInt) UnmarshalJSON

func (i *ShouldBeAnInt) UnmarshalJSON(b []byte) error

type StandingsOption added in v1.7.4

type StandingsOption int
const (
	StandingsNoPointsPenalties StandingsOption = iota
)

type StartRule added in v1.7.5

type StartRule int

func (StartRule) String added in v1.7.5

func (s StartRule) String() string

type SteamConfig

type SteamConfig struct {
	Username       string `yaml:"username"`
	Password       string `yaml:"password"`
	InstallPath    string `yaml:"install_path"`
	ForceUpdate    bool   `yaml:"force_update"`
	ExecutablePath string `yaml:"executable_path"`
}

type SteamLoginHandler

type SteamLoginHandler struct{}

type Store

type Store interface {
	// Custom Races
	UpsertCustomRace(race *CustomRace) error
	FindCustomRaceByID(uuid string) (*CustomRace, error)
	ListCustomRaces() ([]*CustomRace, error)
	DeleteCustomRace(race *CustomRace) error

	// Entrants
	UpsertEntrant(entrant Entrant) error
	ListEntrants() ([]*Entrant, error)
	DeleteEntrant(id string) error

	// Server Options
	UpsertServerOptions(so *GlobalServerConfig) error
	LoadServerOptions() (*GlobalServerConfig, error)

	// Championships
	UpsertChampionship(c *Championship) error
	ListChampionships() ([]*Championship, error)
	LoadChampionship(id string) (*Championship, error)
	DeleteChampionship(id string) error

	// Live Timings
	UpsertLiveTimingsData(*LiveTimingsPersistedData) error
	LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
	UpsertLastRaceEvent(r RaceEvent) error
	LoadLastRaceEvent() (RaceEvent, error)
	ClearLastRaceEvent() error

	UpsertLiveFrames([]string) error
	ListPrevFrames() ([]string, error)

	// Meta
	SetMeta(key string, value interface{}) error
	GetMeta(key string, out interface{}) error

	// Accounts
	ListAccounts() ([]*Account, error)
	UpsertAccount(a *Account) error
	FindAccountByName(name string) (*Account, error)
	FindAccountByID(id string) (*Account, error)
	DeleteAccount(id string) error

	// Audit Log
	GetAuditEntries() ([]*AuditEntry, error)
	AddAuditEntry(entry *AuditEntry) error

	// Race Weekend
	ListRaceWeekends() ([]*RaceWeekend, error)
	UpsertRaceWeekend(rw *RaceWeekend) error
	LoadRaceWeekend(id string) (*RaceWeekend, error)
	DeleteRaceWeekend(id string) error

	// Stracker Options
	UpsertStrackerOptions(sto *StrackerConfiguration) error
	LoadStrackerOptions() (*StrackerConfiguration, error)

	// KissMyRank Options
	UpsertKissMyRankOptions(kmr *KissMyRankConfig) error
	LoadKissMyRankOptions() (*KissMyRankConfig, error)

	// RealPenalty options
	UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error
	LoadRealPenaltyOptions() (*RealPenaltyConfig, error)
}

func NewBoltStore

func NewBoltStore(db *bbolt.DB) Store

func NewJSONStore

func NewJSONStore(dir string, sharedDir string) Store

type StoreConfig

type StoreConfig struct {
	Type                    string        `yaml:"type"`
	Path                    string        `yaml:"path"`
	SharedPath              string        `yaml:"shared_data_path"`
	ScheduledEventCheckLoop time.Duration `yaml:"scheduled_event_check_loop"`
}

func (*StoreConfig) BuildStore

func (s *StoreConfig) BuildStore() (Store, error)

type StrackerACPlugin

type StrackerACPlugin struct {
	ReceivePort int `` /* 126-byte string literal not displayed */
	SendPort    int `ini:"sendPort" show:"open" help:"UDP port the plugins sends to. -1 means to use the AC servers setting UDP_PLUGIN_LOCAL_PORT"`

	ProxyPluginLocalPort int `` /* 189-byte string literal not displayed */
	ProxyPluginPort      int `` /* 181-byte string literal not displayed */
}

type StrackerConfiguration

type StrackerConfiguration struct {
	EnableStracker bool `ini:"-" help:"Turn Stracker on or off"`

	InstanceConfiguration StrackerInstanceConfiguration `ini:"STRACKER_CONFIG" show:"open"`
	SwearFilter           StrackerSwearFilter           `ini:"SWEAR_FILTER"`
	SessionManagement     StrackerSessionManagement     `ini:"SESSION_MANAGEMENT"`
	Messages              StrackerMessages              `ini:"MESSAGES"`
	Database              StrackerDatabase              `ini:"DATABASE" show:"open"`
	DatabaseCompression   StrackerDatabaseCompression   `ini:"DB_COMPRESSION" show:"open"`
	HTTPConfiguration     StrackerHTTPConfiguration     `ini:"HTTP_CONFIG"`
	WelcomeMessage        StrackerWelcomeMessage        `ini:"WELCOME_MSG"`
	ACPlugin              StrackerACPlugin              `ini:"ACPLUGIN" show:"open"`
	LapValidChecks        StrackerLapValidChecks        `ini:"LAP_VALID_CHECKS"`
}

func DefaultStrackerIni

func DefaultStrackerIni() *StrackerConfiguration

func (*StrackerConfiguration) Write

func (stc *StrackerConfiguration) Write() error

type StrackerDatabase

type StrackerDatabase struct {
	DatabaseFile         string `` /* 182-byte string literal not displayed */
	DatabaseType         string `ini:"database_type" show:"open" help:"Valid values are 'sqlite3' and 'postgres'. Selects the database to be used."`
	PerformBackups       bool   `` /* 222-byte string literal not displayed */
	PostgresDatabaseName string `ini:"postgres_db" show:"open" help:"The name of the postgres database"`
	PostgresHostname     string `ini:"postgres_host" show:"open" help:"Name of the host running the postgresql server."`
	PostgresUsername     string `ini:"postgres_user" show:"open" help:"Name of the postgresql user"`
	PostgresPassword     string `ini:"postgres_pwd" show:"open" help:"Postgresql user password"`
}

type StrackerDatabaseCompression

type StrackerDatabaseCompression struct {
	Interval         int    `ini:"interval" show:"open" help:"Interval of database compression in minutes"`
	Mode             string `` /* 246-byte string literal not displayed */
	NeedsEmptyServer int    `` /* 138-byte string literal not displayed */
}

type StrackerHTTPConfiguration

type StrackerHTTPConfiguration struct {
	Enabled       bool   `ini:"enabled" show:"open"`
	ListenAddress string `` /* 199-byte string literal not displayed */
	ListenPort    int    `ini:"listen_port" show:"open" help:"TCP listening port of the http server"`
	PublicURL     string `` /* 371-byte string literal not displayed */

	AdminUsername string `ini:"admin_username" help:"Username for the stracker admin pages. Leaving empty results in disabled admin pages"`
	AdminPassword string `` /* 128-byte string literal not displayed */

	TemperatureUnit string `ini:"temperature_unit" help:"Valid values are 'degc' or 'degf'"`
	VelocityUnit    string `ini:"velocity_unit" help:"Valid values are 'kmh' or 'mph'"`

	AuthBanAnonymisedPlayers bool   `ini:"auth_ban_anonymized_players" help:"Add anonymized players to blacklist."`
	AuthLogFile              string `` /* 171-byte string literal not displayed */
	Banner                   string `ini:"banner" help:"Icon to be used in webpages (leave empty for default Assetto Corsa icon)"`
	EnableSVGGeneration      bool   `` /* 129-byte string literal not displayed */
	InverseNavbar            bool   `ini:"inverse_navbar" help:"Set to true to get the navbar inverted (i.e., dark instead of bright)"`
	ItemsPerPage             int    `ini:"items_per_page" help:"Number of items displayed per page"`

	LapTimesAddColumns      string `` /* 306-byte string literal not displayed */
	LogRequests             bool   `` /* 128-byte string literal not displayed */
	MaximumStreamingClients int    `` /* 241-byte string literal not displayed */

	SSL            bool   `` /* 209-byte string literal not displayed */
	SSLCertificate string `` /* 221-byte string literal not displayed */
	SSLPrivateKey  string `` /* 181-byte string literal not displayed */
}

type StrackerHandler

type StrackerHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewStrackerHandler

func NewStrackerHandler(baseHandler *BaseHandler, store Store) *StrackerHandler

type StrackerInstanceConfiguration

type StrackerInstanceConfiguration struct {
	ACServerAddress              string `` /* 145-byte string literal not displayed */
	ACServerConfigIni            string `` /* 163-byte string literal not displayed */
	ACServerWorkingDir           string `` /* 230-byte string literal not displayed */
	AppendLogFile                bool   `` /* 175-byte string literal not displayed */
	IDBasedOnDriverNames         bool   `` /* 201-byte string literal not displayed */
	KeepAlivePtrackerConnections bool   `` /* 146-byte string literal not displayed */
	ListeningPort                int    `` /* 310-byte string literal not displayed */
	LogFile                      string `ini:"log_file" show:"open" help:"Name of the stracker log file (utf-8 encoded), all messages go into there"`
	LogLevel                     string `` /* 145-byte string literal not displayed */
	LogTimestamps                bool   `ini:"log_timestamps" show:"open" help:"Set to ON if you want the log messages to be prefixed with a timestamp"`
	LowerPriority                bool   `` /* 149-byte string literal not displayed */
	PerformChecksumComparisons   bool   `ini:"perform_checksum_comparisons" show:"open" help:"Set to ON if you want stracker to compare the players checksums."`
	PtrackerConnectionMode       string `` /* 156-byte string literal not displayed */
	ServerName                   string `` /* 190-byte string literal not displayed */
	TeeToStdout                  bool   `ini:"tee_to_stdout" show:"open" help:"Set to ON if you want the messages appear on stdout (in Server Manager's plugin logs)"`
}

type StrackerLapValidChecks

type StrackerLapValidChecks struct {
	InvalidateOnCarCollisions         bool `ini:"invalidateOnCarCollisions" help:"If ON, collisions with other cars will invalidate laps"`
	InvalidateOnEnvironmentCollisions bool `ini:"invalidateOnEnvCollisions" help:"If ON, collisions with environment objects will invalidate laps"`
	PtrackerAllowedTyresOut           int  `` /* 143-byte string literal not displayed */
}

type StrackerMessages

type StrackerMessages struct {
	BestLapTimeBroadcastThreshold int    `` /* 208-byte string literal not displayed */
	CarToCarCollisionMessage      bool   `ini:"car_to_car_collision_msg" help:"Set to ON to enable car to car private messages."`
	MessageTypesToSendOverChat    string `` /* 202-byte string literal not displayed */
}

type StrackerSessionManagement

type StrackerSessionManagement struct {
	RaceOverStrategy      string `` /* 134-byte string literal not displayed */
	WaitSecondsBeforeSkip int    `` /* 137-byte string literal not displayed */
}

type StrackerSwearFilter

type StrackerSwearFilter struct {
	Action           string `ini:"action" help:"Valid values are 'none', 'kick' and 'ban'"`
	BanDuration      int    `ini:"ban_duration" help:"The number of days to ban a player for (if the Action is 'ban')"`
	NumberOfWarnings int    `ini:"num_warnings" help:"The number of warnings issued before the player is kicked"`
	SwearFile        string `ini:"swear_file" help:"A file with bad words to be used for filtering" show:"open"`
	Warning          string `ini:"warning" help:"The message sent to a player after swear detection"`
}

type StrackerWelcomeMessage

type StrackerWelcomeMessage struct {
	Line1 string `ini:"line1"`
	Line2 string `ini:"line2"`
	Line3 string `ini:"line3"`
	Line4 string `ini:"line4"`
	Line5 string `ini:"line5"`
	Line6 string `ini:"line6"`
}

type TLSConfig added in v1.7.4

type TLSConfig struct {
	Enabled  bool   `yaml:"enabled"`
	CertPath string `yaml:"cert_path"`
	KeyPath  string `yaml:"key_path"`
}

type TeamStanding

type TeamStanding struct {
	Team   string
	Points float64
}

TeamStanding is the current number of Points a Team has.

type TemplateLoader

type TemplateLoader interface {
	Init() error
	Templates(funcs template.FuncMap) (map[string]*template.Template, error)
}

func NewFilesystemTemplateLoader

func NewFilesystemTemplateLoader(dir string) TemplateLoader

type TemplateVars

type TemplateVars interface {
	Get() *BaseTemplateVars
}

type Theme

type Theme string

type ThemeDetails

type ThemeDetails struct {
	Theme Theme
	Name  string
}

type Track

type Track struct {
	Name    string
	Layouts []string

	CalculatedPrettyName string

	MetaData TrackMetaData
}

func (Track) GetImagePath

func (t Track) GetImagePath() string

func (Track) IsMod

func (t Track) IsMod() bool

func (Track) IsPaidDLC

func (t Track) IsPaidDLC() bool

func (*Track) LayoutsCSV

func (t *Track) LayoutsCSV() string

func (*Track) LoadMetaData

func (t *Track) LoadMetaData() error

func (Track) PrettyName

func (t Track) PrettyName() string

type TrackDataGateway

type TrackDataGateway interface {
	TrackInfo(name, layout string) (*TrackInfo, error)
	TrackMap(name, layout string) (*TrackMapData, error)
}

type TrackInfo

type TrackInfo struct {
	Name        string      `json:"name"`
	City        string      `json:"city"`
	Country     string      `json:"country"`
	Description string      `json:"description"`
	Geotags     []string    `json:"geotags"`
	Length      string      `json:"length"`
	Pitboxes    json.Number `json:"pitboxes"`
	Run         string      `json:"run"`
	Tags        []string    `json:"tags"`
	Width       string      `json:"width"`
}

func GetTrackInfo

func GetTrackInfo(name, layout string) (*TrackInfo, error)

type TrackManager

type TrackManager struct {
}

func NewTrackManager

func NewTrackManager() *TrackManager

func (*TrackManager) GetTrackFromName

func (tm *TrackManager) GetTrackFromName(name string) (*Track, error)

func (*TrackManager) GetTrackImage added in v1.7.8

func (tm *TrackManager) GetTrackImage(w io.Writer, track, layout string) (int64, error)

func (*TrackManager) ListTracks

func (tm *TrackManager) ListTracks() ([]Track, error)

func (*TrackManager) ResultsForLayout

func (tm *TrackManager) ResultsForLayout(trackName, layout string) ([]SessionResults, error)

func (*TrackManager) UpdateTrackMetadata

func (tm *TrackManager) UpdateTrackMetadata(name string, r *http.Request) error

type TrackMapData

type TrackMapData struct {
	Width       float64 `ini:"WIDTH" json:"width"`
	Height      float64 `ini:"HEIGHT" json:"height"`
	Margin      float64 `ini:"MARGIN" json:"margin"`
	ScaleFactor float64 `ini:"SCALE_FACTOR" json:"scale_factor"`
	OffsetX     float64 `ini:"X_OFFSET" json:"offset_x"`
	OffsetZ     float64 `ini:"Z_OFFSET" json:"offset_y"`
	DrawingSize float64 `ini:"DRAWING_SIZE" json:"drawing_size"`
}

func LoadTrackMapData

func LoadTrackMapData(track, trackLayout string) (*TrackMapData, error)

type TrackMetaData

type TrackMetaData struct {
	DownloadURL string `json:"downloadURL"`
	Notes       string `json:"notes"`
}

func LoadTrackMetaDataFromName

func LoadTrackMetaDataFromName(name string) (*TrackMetaData, error)

func (*TrackMetaData) Save

func (tmd *TrackMetaData) Save(name string) error

type TrackOptsGrouped added in v1.7.9

type TrackOptsGrouped []Track

func (TrackOptsGrouped) Split added in v1.7.9

func (tog TrackOptsGrouped) Split() TracksSplit

type TrackSurfacePreset

type TrackSurfacePreset struct {
	Name            string
	Description     string
	SessionStart    int
	SessionTransfer int
	Randomness      int
	LapGain         int
}

type TracksHandler

type TracksHandler struct {
	*BaseHandler
	// contains filtered or unexported fields
}

func NewTracksHandler

func NewTracksHandler(baseHandler *BaseHandler, trackManager *TrackManager) *TracksHandler

type TracksSplit added in v1.7.9

type TracksSplit struct {
	Stock, DLC, Mod []Track
}

type Tyres

type Tyres map[string]map[string]string

func ListTyres

func ListTyres() (Tyres, error)

ListTyres reads tyres from the TyreFiles and returns them as a map of car => tyre short name => tyre long name

func (Tyres) Name

func (t Tyres) Name(search string, cars []string) string

type ValidationError

type ValidationError string

func (ValidationError) Error

func (e ValidationError) Error() string

type Weather

type Weather map[string]string

func ListWeather

func ListWeather() (Weather, error)

type WeatherConfig

type WeatherConfig struct {
	Graphics               string `ini:"GRAPHICS" help:"exactly one of the folder names that you find in the 'content\\weather'' directory"`
	BaseTemperatureAmbient int    `ini:"BASE_TEMPERATURE_AMBIENT" help:"ambient temperature"` // 0-36
	BaseTemperatureRoad    int    ``                                                          // 0-36
	/* 215-byte string literal not displayed */
	VariationAmbient int `` /* 130-byte string literal not displayed */
	VariationRoad    int `ini:"VARIATION_ROAD" help:"variation of the road's temperature. Like the ambient one"`

	WindBaseSpeedMin       int `ini:"WIND_BASE_SPEED_MIN" help:"Min speed of the session possible"`
	WindBaseSpeedMax       int `ini:"WIND_BASE_SPEED_MAX" help:"Max speed of session possible (max 40)"`
	WindBaseDirection      int `ini:"WIND_BASE_DIRECTION" help:"base direction of the wind (wind is pointing at); 0 = North, 90 = East etc"`
	WindVariationDirection int `ini:"WIND_VARIATION_DIRECTION" help:"variation (+ or -) of the base direction"`

	ChampionshipPracticeWeather string `ini:"-"`

	CMGraphics          string `ini:"__CM_GRAPHICS" help:"Graphics folder name"`
	CMWFXType           int    `ini:"__CM_WFX_TYPE" help:"Weather ini file number, inside weather.ini"`
	CMWFXUseCustomTime  int    `ini:"__CM_WFX_USE_CUSTOM_TIME" help:"If Sol is active then this should be too"`
	CMWFXTime           int    `ini:"__CM_WFX_TIME" help:"Seconds after 12 noon, usually leave at 0 and use unix timestamp instead"`
	CMWFXTimeMulti      int    `ini:"__CM_WFX_TIME_MULT" help:"Time speed multiplier, default to 1x"`
	CMWFXUseCustomDate  int    `ini:"__CM_WFX_USE_CUSTOM_DATE" help:"If Sol is active then this should be too"`
	CMWFXDate           int    `ini:"__CM_WFX_DATE" help:"Unix timestamp (UTC + 10)"`
	CMWFXDateUnModified int    `ini:"__CM_WFX_DATE_UNMODIFIED" help:"Unix timestamp (UTC + 10), without multiplier correction"`
}

func (WeatherConfig) TrimName

func (w WeatherConfig) TrimName(name string) string

func (WeatherConfig) UnixToTime

func (w WeatherConfig) UnixToTime(unix int) time.Time

type WeatherHandler

type WeatherHandler struct {
	*BaseHandler
}

func NewWeatherHandler

func NewWeatherHandler(baseHandler *BaseHandler) *WeatherHandler

Notes

Bugs

  • splitting commands on spaces breaks child processes that have a space in their path name

Directories

Path Synopsis
cmd
fixtures
internal
pkg
acd
This code would not have been possible without the two following projects: * AcTools (and Content Manager) - https://github.com/gro-ove/actools - Licensed under the Microsoft Public License (Ms-PL) * Luigi Auriemma's QuickBMS, specifically the "Assetto Corsa ACD" script.
This code would not have been possible without the two following projects: * AcTools (and Content Manager) - https://github.com/gro-ove/actools - Licensed under the Microsoft Public License (Ms-PL) * Luigi Auriemma's QuickBMS, specifically the "Assetto Corsa ACD" script.
udp

Jump to

Keyboard shortcuts

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