Documentation ¶
Index ¶
- Constants
- Variables
- func ACSRSendResult(championship Championship)
- func AddErrorFlash(w http.ResponseWriter, r *http.Request, message string)
- func AddFlash(w http.ResponseWriter, r *http.Request, message string)
- func AdminAccess(r *http.Request) func() bool
- func AlphabeticalRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, ...) error
- func AssetCacheHeaders(next http.HandlerFunc, useRevalidation bool) http.HandlerFunc
- func BuildICalEvent(event ScheduledEvent) *components.Event
- func CarDataFile(carModel, dataFile string) (io.ReadCloser, error)
- func CarNameFromFilepath(path string) (string, error)
- func ChampionshipClassColor(i int) string
- func DeleteAccess(r *http.Request) func() bool
- func FastestLapRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, ...) error
- func FastestResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, ...) error
- func FewestCollisionsRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, ...) error
- func FewestCutsRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, ...) error
- func FileServer(r chi.Router, path string, root http.FileSystem, useRevalidation bool)
- func FreeUDPPort() (int, error)
- func GenerateSummary(raceSetup CurrentRaceConfig, eventType string) string
- func GetMD5Hash(guid string) string
- func GetResultDate(name string) (time.Time, error)
- func InitLogging()
- func InitLua()
- func InitMonitoring()
- func InitWithResolver(resolver *Resolver) error
- func InstallAssettoCorsaServer(login, password string, force bool) error
- func IsAssettoInstalled() bool
- func IsDirWriteable(dir string) error
- func IsStrackerInstalled() bool
- func ListSetupsForCar(model string) (map[string][]string, error)
- func LoadTrackMapImage(track, trackLayout string) (image.Image, error)
- func LoadTyresFromACDINI(data []byte) (map[string]string, error)
- func LoggedIn(r *http.Request) func() bool
- func LuaHTTPRequest(L *lua.LState) int
- func Migrate(store Store) error
- func NumberResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, ...) error
- func RandomRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, ...) error
- func ReadAccess(r *http.Request) func() bool
- func RoundTripper(t http.RoundTripper) http.RoundTripper
- func Router(fs http.FileSystem, quickRaceHandler *QuickRaceHandler, ...) http.Handler
- func SafetyRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, ...) error
- func SetAssettoInstallPath(installPath string)
- func StrackerExecutablePath() string
- func StrackerFolderPath() string
- func ToggleDRSForTrack(track, layout string, drsEnabled bool) error
- func TotalRaceTimeRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, ...) error
- func UnchangedRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, _ []*RaceWeekendSessionEntrant, ...) error
- func WriteAccess(r *http.Request) func() bool
- type ACHTTPPlayers
- type ACHTTPSessionInfo
- type ACSRConfig
- type Account
- type AccountHandler
- func (ah *AccountHandler) AdminAccessMiddleware(next http.Handler) http.Handler
- func (ah *AccountHandler) DeleteAccessMiddleware(next http.Handler) http.Handler
- func (ah *AccountHandler) MustLoginMiddleware(requiredGroup Group, next http.Handler) http.Handler
- func (ah *AccountHandler) ReadAccessMiddleware(next http.Handler) http.Handler
- func (ah *AccountHandler) WriteAccessMiddleware(next http.Handler) http.Handler
- type AccountManager
- type AccountsConfig
- type ActiveChampionship
- func (a *ActiveChampionship) EventDescription() string
- func (a *ActiveChampionship) EventName() string
- func (a *ActiveChampionship) GetEntryList() EntryList
- func (a *ActiveChampionship) GetRaceConfig() CurrentRaceConfig
- func (a *ActiveChampionship) GetURL() string
- func (a *ActiveChampionship) IsChampionship() bool
- func (a *ActiveChampionship) IsLooping() bool
- func (a *ActiveChampionship) IsPractice() bool
- func (a *ActiveChampionship) IsRaceWeekend() bool
- func (a *ActiveChampionship) OverrideServerPassword() bool
- func (a *ActiveChampionship) ReplacementServerPassword() string
- type ActiveRaceWeekend
- func (a ActiveRaceWeekend) EventDescription() string
- func (a ActiveRaceWeekend) EventName() string
- func (a ActiveRaceWeekend) GetEntryList() EntryList
- func (a ActiveRaceWeekend) GetRaceConfig() CurrentRaceConfig
- func (a ActiveRaceWeekend) GetURL() string
- func (a ActiveRaceWeekend) IsChampionship() bool
- func (a ActiveRaceWeekend) IsLooping() bool
- func (a ActiveRaceWeekend) IsPractice() bool
- func (a ActiveRaceWeekend) IsRaceWeekend() bool
- func (a ActiveRaceWeekend) OverrideServerPassword() bool
- func (a ActiveRaceWeekend) ReplacementServerPassword() string
- type AssetHelper
- type AssettoServerProcess
- func (as *AssettoServerProcess) Done() <-chan struct{}
- func (as *AssettoServerProcess) Event() RaceEvent
- func (as *AssettoServerProcess) GetServerConfig() ServerConfig
- func (as *AssettoServerProcess) IsRunning() bool
- func (as *AssettoServerProcess) Logs() string
- func (as *AssettoServerProcess) Restart() error
- func (as *AssettoServerProcess) SendUDPMessage(message udp.Message) error
- func (as *AssettoServerProcess) Start(cfg ServerConfig, entryList EntryList, forwardingAddress string, ...) error
- func (as *AssettoServerProcess) Stop() error
- func (as *AssettoServerProcess) UDPCallback(message udp.Message)
- type AuditEntry
- type AuditLogHandler
- type BaseHandler
- type BaseTemplateVars
- type BoltStore
- func (rs *BoltStore) AddAuditEntry(entry *AuditEntry) error
- func (rs *BoltStore) ClearLastRaceEvent() error
- func (rs *BoltStore) DeleteAccount(id string) error
- func (rs *BoltStore) DeleteChampionship(id string) error
- func (rs *BoltStore) DeleteCustomRace(race *CustomRace) error
- func (rs *BoltStore) DeleteEntrant(id string) error
- func (rs *BoltStore) DeleteRaceWeekend(id string) error
- func (rs *BoltStore) FindAccountByID(id string) (*Account, error)
- func (rs *BoltStore) FindAccountByName(name string) (*Account, error)
- func (rs *BoltStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
- func (rs *BoltStore) GetAuditEntries() ([]*AuditEntry, error)
- func (rs *BoltStore) GetMeta(key string, out interface{}) error
- func (rs *BoltStore) ListAccounts() ([]*Account, error)
- func (rs *BoltStore) ListChampionships() ([]*Championship, error)
- func (rs *BoltStore) ListCustomRaces() ([]*CustomRace, error)
- func (rs *BoltStore) ListEntrants() ([]*Entrant, error)
- func (rs *BoltStore) ListPrevFrames() ([]string, error)
- func (rs *BoltStore) ListRaceWeekends() ([]*RaceWeekend, error)
- func (rs *BoltStore) LoadChampionship(id string) (*Championship, error)
- func (rs *BoltStore) LoadLastRaceEvent() (RaceEvent, error)
- func (rs *BoltStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
- func (rs *BoltStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
- func (rs *BoltStore) LoadServerOptions() (*GlobalServerConfig, error)
- func (rs *BoltStore) LoadStrackerOptions() (*StrackerConfiguration, error)
- func (rs *BoltStore) SetMeta(key string, value interface{}) error
- func (rs *BoltStore) UpsertAccount(a *Account) error
- func (rs *BoltStore) UpsertChampionship(c *Championship) error
- func (rs *BoltStore) UpsertCustomRace(race *CustomRace) error
- func (rs *BoltStore) UpsertEntrant(entrant Entrant) error
- func (rs *BoltStore) UpsertLastRaceEvent(r RaceEvent) error
- func (rs *BoltStore) UpsertLiveFrames(frameLinks []string) error
- func (rs *BoltStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error
- func (rs *BoltStore) UpsertRaceWeekend(rw *RaceWeekend) error
- func (rs *BoltStore) UpsertServerOptions(so *GlobalServerConfig) error
- func (rs *BoltStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
- type Broadcaster
- type ByteReaderCloser
- type CMAssists
- type CMCar
- type CMContent
- type CalendarObject
- type Car
- type CarDetails
- type CarManager
- func (cm *CarManager) AddTag(carName, tag string) error
- func (cm *CarManager) CreateOrOpenSearchIndex() error
- func (cm *CarManager) DeIndexCar(name string) error
- func (cm *CarManager) DelTag(carName, tag string) error
- func (cm *CarManager) DeleteCar(carName string) error
- func (cm *CarManager) DeleteSkin(car, skin string) error
- func (cm *CarManager) IndexAllCars() error
- func (cm *CarManager) IndexCar(car *Car) error
- func (cm *CarManager) ListCars() (Cars, error)
- func (cm *CarManager) LoadCar(name string, tyres Tyres) (*Car, error)
- func (cm *CarManager) LoadCarDetailsForTemplate(carName string) (*carDetailsTemplateVars, error)
- func (cm *CarManager) RandomSkin(model string) string
- func (cm *CarManager) ResultsForCar(car string) ([]SessionResults, error)
- func (cm *CarManager) SaveCarDetails(carName string, car *Car) error
- func (cm *CarManager) Search(ctx context.Context, term string, from, size int) (*bleve.SearchResult, Cars, error)
- func (cm *CarManager) UpdateCarMetadata(carName string, r *http.Request) error
- func (cm *CarManager) UploadSkin(carName string, files map[string][]*multipart.FileHeader) error
- type CarSetups
- type CarSpecs
- type CarSpecsNumeric
- type Cars
- type CarsHandler
- type Championship
- func (c *Championship) AddClass(class *ChampionshipClass)
- func (c *Championship) AddEntrantFromSession(potentialEntrant PotentialChampionshipEntrant) (foundFreeEntrantSlot bool, entrant *Entrant, entrantClass *ChampionshipClass, ...)
- func (c *Championship) AddEntrantInFirstFreeSlot(potentialEntrant PotentialChampionshipEntrant) (foundFreeEntrantSlot bool, entrant *Entrant, entrantClass *ChampionshipClass, ...)
- func (c *Championship) AllEntrants() EntryList
- func (c *Championship) AttachClassIDToResults(results *SessionResults)
- func (c *Championship) ClassByID(id string) (*ChampionshipClass, error)
- func (c *Championship) ClearEntrant(entrantGUID string)
- func (c *Championship) EnhanceResults(results *SessionResults)
- func (c *Championship) EntrantAttendance(guid string) int
- func (c *Championship) EventByID(id string) (*ChampionshipEvent, error)
- func (c *Championship) FindClassForCarModel(model string) (*ChampionshipClass, error)
- func (c *Championship) FindLastResultForDriver(guid string) (out *SessionResult, teamName string)
- func (c *Championship) GetPlayerSummary(guid string) string
- func (c *Championship) GetURL() string
- func (c *Championship) HasScheduledEvents() bool
- func (c *Championship) HasTeamNames() bool
- func (c *Championship) ImportEvent(eventToImport interface{}) error
- func (c *Championship) IsMultiClass() bool
- func (c *Championship) NumCompletedEvents() int
- func (c *Championship) NumEntrants() int
- func (c *Championship) NumPendingSignUps() int
- func (c *Championship) Progress() float64
- func (c *Championship) SignUpAvailable() bool
- func (c *Championship) ValidCarIDs() []string
- type ChampionshipClass
- func (c *ChampionshipClass) AssignToFreeEntrantSlot(entrant *Entrant, potentialEntrant PotentialChampionshipEntrant)
- func (c *ChampionshipClass) AttachEntrantToResult(entrant *Entrant, results *SessionResults)
- func (c *ChampionshipClass) DriverInClass(result *SessionResult) bool
- func (c *ChampionshipClass) PenaltyForGUID(guid string) int
- func (c *ChampionshipClass) PenaltyForTeam(name string) int
- func (c *ChampionshipClass) ResultsForClass(results []*SessionResult) (filtered []*SessionResult)
- func (c *ChampionshipClass) Standings(inEvents []*ChampionshipEvent) []*ChampionshipStanding
- func (c *ChampionshipClass) StandingsForEvent(event *ChampionshipEvent) []*ChampionshipStanding
- func (c *ChampionshipClass) TeamStandings(inEvents []*ChampionshipEvent) []*TeamStanding
- func (c *ChampionshipClass) ValidCarIDs() []string
- type ChampionshipEntrantStatus
- type ChampionshipEvent
- func (cr *ChampionshipEvent) Cars(c *Championship) []string
- func (cr *ChampionshipEvent) CombineEntryLists(championship *Championship) EntryList
- func (cr *ChampionshipEvent) Completed() bool
- func (cr *ChampionshipEvent) GetID() uuid.UUID
- func (cr *ChampionshipEvent) GetRaceSetup() CurrentRaceConfig
- func (cr *ChampionshipEvent) GetSummary() string
- func (cr *ChampionshipEvent) GetURL() string
- func (cr *ChampionshipEvent) HasSignUpForm() bool
- func (cr *ChampionshipEvent) InProgress() bool
- func (cr *ChampionshipEvent) IsRaceWeekend() bool
- func (cr *ChampionshipEvent) LastSession() SessionType
- func (cr *ChampionshipEvent) ReadOnlyEntryList() EntryList
- type ChampionshipManager
- func (cm *ChampionshipManager) AddEntrantFromSessionData(championship *Championship, potentialEntrant PotentialChampionshipEntrant, ...) (foundFreeEntrantSlot bool, entrantClass *ChampionshipClass, err error)
- func (cm *ChampionshipManager) BuildChampionshipEventOpts(r *http.Request) (*RaceTemplateVars, error)
- func (cm *ChampionshipManager) BuildChampionshipOpts(r *http.Request) (championship *Championship, opts *ChampionshipTemplateVars, err error)
- func (cm *ChampionshipManager) BuildICalFeed(championshipID string, w io.Writer) error
- func (cm *ChampionshipManager) CancelEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) ChampionshipEventCallback(message udp.Message)
- func (cm *ChampionshipManager) ChampionshipEventIsRunning() bool
- func (cm *ChampionshipManager) DeleteChampionship(id string) error
- func (cm *ChampionshipManager) DeleteEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) FindNextEventRecurrence(event *ChampionshipEvent, start time.Time) time.Time
- func (cm *ChampionshipManager) GetChampionshipAndEvent(championshipID string, eventID string) (*Championship, *ChampionshipEvent, error)
- func (cm *ChampionshipManager) HandleChampionshipSignUp(r *http.Request) (response *ChampionshipSignUpResponse, foundSlot bool, err error)
- func (cm *ChampionshipManager) HandleCreateChampionship(r *http.Request) (championship *Championship, edited bool, err error)
- func (cm *ChampionshipManager) ImportChampionship(jsonData string) (string, error)
- func (cm *ChampionshipManager) ImportEvent(championshipID string, eventID string, r *http.Request) error
- func (cm *ChampionshipManager) ImportEventSetup(championshipID string, eventID string) error
- func (cm *ChampionshipManager) ImportRaceWeekendSetup(championshipID string, eventID string) error
- func (cm *ChampionshipManager) InitScheduledChampionships() error
- func (cm *ChampionshipManager) ListAvailableResultsFilesForEvent(championshipID string, eventID string) (*ChampionshipEvent, []SessionResults, error)
- func (cm *ChampionshipManager) ListChampionships() ([]*Championship, error)
- func (cm *ChampionshipManager) LoadChampionship(id string) (*Championship, error)
- func (cm *ChampionshipManager) ModifyDriverPenalty(championshipID, classID, driverGUID string, action PenaltyAction, penalty int) error
- func (cm *ChampionshipManager) ModifyTeamPenalty(championshipID, classID, team string, action PenaltyAction, penalty int) error
- func (cm *ChampionshipManager) ReorderChampionshipEvents(championshipID string, championshipEventIDsInOrder []string) error
- func (cm *ChampionshipManager) RestartActiveEvent() error
- func (cm *ChampionshipManager) RestartEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) SaveChampionshipEvent(r *http.Request) (championship *Championship, event *ChampionshipEvent, edited bool, err error)
- func (cm *ChampionshipManager) ScheduleEvent(championshipID string, eventID string, date time.Time, action string, ...) error
- func (cm *ChampionshipManager) ScheduleNextEventFromRecurrence(championship *Championship, event *ChampionshipEvent) error
- func (cm *ChampionshipManager) StartEvent(championshipID string, eventID string, isPreChampionshipPracticeEvent bool) error
- func (cm *ChampionshipManager) StartPracticeEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) StartScheduledEvent(championship *Championship, event *ChampionshipEvent) error
- func (cm *ChampionshipManager) StopActiveEvent() error
- func (cm *ChampionshipManager) UpsertChampionship(c *Championship) error
- type ChampionshipPoints
- type ChampionshipSession
- type ChampionshipSignUpForm
- type ChampionshipSignUpResponse
- type ChampionshipStanding
- type ChampionshipStandingsOrderEntryListSort
- type ChampionshipTemplateVars
- type ChampionshipsConfig
- type ChampionshipsHandler
- type Collision
- type CollisionType
- type CommandPlugin
- type Configuration
- type ContentFile
- type ContentManagerWrapper
- func (cmw *ContentManagerWrapper) NewCMContent(cars []string, trackName string) (*CMContent, error)
- func (cmw *ContentManagerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (cmw *ContentManagerWrapper) Start(process ServerProcess, servePort int, serverConfig ServerConfig, ...) error
- func (cmw *ContentManagerWrapper) Stop()
- func (cmw *ContentManagerWrapper) UDPCallback(message udp.Message)
- type ContentManagerWrapperData
- type ContentType
- type ContentURL
- type ContentUploadHandler
- type CurrentRaceConfig
- func (c *CurrentRaceConfig) AddSession(sessionType SessionType, config *SessionConfig)
- func (c *CurrentRaceConfig) AddWeather(weather *WeatherConfig)
- func (c CurrentRaceConfig) GetSession(sessionType SessionType) *SessionConfig
- func (c CurrentRaceConfig) HasMultipleRaces() bool
- func (c CurrentRaceConfig) HasSession(sess SessionType) bool
- func (c *CurrentRaceConfig) RemoveSession(sessionType SessionType)
- func (c *CurrentRaceConfig) RemoveWeather(weather *WeatherConfig)
- func (c CurrentRaceConfig) Tyres() map[string]bool
- type CustomRace
- func (cr *CustomRace) EventDescription() string
- func (cr *CustomRace) EventName() string
- func (cr *CustomRace) GetEntryList() EntryList
- func (cr *CustomRace) GetID() uuid.UUID
- func (cr *CustomRace) GetRaceConfig() CurrentRaceConfig
- func (cr *CustomRace) GetRaceSetup() CurrentRaceConfig
- func (cr *CustomRace) GetSummary() string
- func (cr *CustomRace) GetURL() string
- func (cr *CustomRace) HasSignUpForm() bool
- func (cr *CustomRace) IsChampionship() bool
- func (cr *CustomRace) IsLooping() bool
- func (cr *CustomRace) IsPractice() bool
- func (cr *CustomRace) IsRaceWeekend() bool
- func (cr *CustomRace) OverrideServerPassword() bool
- func (cr *CustomRace) ReadOnlyEntryList() EntryList
- func (cr *CustomRace) ReplacementServerPassword() string
- type CustomRaceHandler
- type DiscordManager
- func (dm *DiscordManager) CommandHandler(s *discordgo.Session, m *discordgo.MessageCreate)
- func (dm *DiscordManager) CommandNotify(s *discordgo.Session, m *discordgo.MessageCreate) (string, error)
- func (dm *DiscordManager) CommandSchedule() (string, error)
- func (dm *DiscordManager) CommandSessions() (string, error)
- func (dm *DiscordManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
- func (dm *DiscordManager) SendMessage(msg string) error
- func (dm *DiscordManager) SendMessageWithLink(msg string, linkText string, link *url.URL) error
- func (dm *DiscordManager) Stop() error
- type DriverMap
- func (d *DriverMap) Add(driverGUID udp.DriverGUID, driver *RaceControlDriver)
- func (d *DriverMap) Del(driverGUID udp.DriverGUID)
- func (d *DriverMap) Each(fn func(driverGUID udp.DriverGUID, driver *RaceControlDriver) error) error
- func (d *DriverMap) Get(driverGUID udp.DriverGUID) (*RaceControlDriver, bool)
- func (d *DriverMap) Len() int
- type DynamicTrackConfig
- type Entrant
- func (e *Entrant) AsSessionCar() *SessionCar
- func (e *Entrant) AsSessionResult() *SessionResult
- func (e *Entrant) AssignFromResult(result *SessionResult, car *SessionCar)
- func (e Entrant) ID() string
- func (e *Entrant) OverwriteProperties(other *Entrant)
- func (e *Entrant) SwapProperties(other *Entrant, entrantRemainedInClass bool)
- type EntryList
- func (e EntryList) Add(entrant *Entrant)
- func (e EntryList) AddInPitBox(entrant *Entrant, pitBox int)
- func (e EntryList) AlphaSlice() []*Entrant
- func (e EntryList) AsSlice() []*Entrant
- func (e EntryList) CarIDs() []string
- func (e EntryList) Delete(entrant *Entrant)
- func (e EntryList) Entrants() string
- func (e EntryList) FindEntrantByInternalUUID(internalUUID uuid.UUID) *Entrant
- func (e EntryList) FindGreatestBallast() int
- func (e EntryList) PrettyList() []*Entrant
- func (e EntryList) Write() error
- type FilterError
- type Form
- type FormElement
- type FormHeader
- type FormHeading
- type FormOption
- type GeoIP
- type GlobalServerConfig
- type Group
- type HTTPConfig
- type HealthCheck
- type HealthCheckResponse
- type JSONStore
- func (rs *JSONStore) AddAuditEntry(entry *AuditEntry) error
- func (rs *JSONStore) ClearLastRaceEvent() error
- func (rs *JSONStore) DeleteAccount(id string) error
- func (rs *JSONStore) DeleteChampionship(id string) error
- func (rs *JSONStore) DeleteCustomRace(race *CustomRace) error
- func (rs *JSONStore) DeleteEntrant(id string) error
- func (rs *JSONStore) DeleteRaceWeekend(id string) error
- func (rs *JSONStore) FindAccountByID(id string) (*Account, error)
- func (rs *JSONStore) FindAccountByName(name string) (*Account, error)
- func (rs *JSONStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
- func (rs *JSONStore) GetAuditEntries() ([]*AuditEntry, error)
- func (rs *JSONStore) GetMeta(key string, out interface{}) error
- func (rs *JSONStore) ListAccounts() ([]*Account, error)
- func (rs *JSONStore) ListChampionships() ([]*Championship, error)
- func (rs *JSONStore) ListCustomRaces() ([]*CustomRace, error)
- func (rs *JSONStore) ListEntrants() ([]*Entrant, error)
- func (rs *JSONStore) ListPrevFrames() ([]string, error)
- func (rs *JSONStore) ListRaceWeekends() ([]*RaceWeekend, error)
- func (rs *JSONStore) LoadChampionship(id string) (*Championship, error)
- func (rs *JSONStore) LoadLastRaceEvent() (RaceEvent, error)
- func (rs *JSONStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
- func (rs *JSONStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
- func (rs *JSONStore) LoadServerOptions() (*GlobalServerConfig, error)
- func (rs *JSONStore) LoadStrackerOptions() (*StrackerConfiguration, error)
- func (rs *JSONStore) SetMeta(key string, value interface{}) error
- func (rs *JSONStore) UpsertAccount(a *Account) error
- func (rs *JSONStore) UpsertChampionship(c *Championship) error
- func (rs *JSONStore) UpsertCustomRace(race *CustomRace) error
- func (rs *JSONStore) UpsertEntrant(entrant Entrant) error
- func (rs *JSONStore) UpsertLastRaceEvent(r RaceEvent) error
- func (rs *JSONStore) UpsertLiveFrames(frameLinks []string) error
- func (rs *JSONStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error
- func (rs *JSONStore) UpsertRaceWeekend(rw *RaceWeekend) error
- func (rs *JSONStore) UpsertServerOptions(so *GlobalServerConfig) error
- func (rs *JSONStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
- type LiveMapConfig
- type LiveTimingsPersistedData
- type LuaConfig
- type LuaPlugin
- type MonitoringConfig
- type NilBroadcaster
- type NotificationDispatcher
- type NotificationManager
- func (nm *NotificationManager) GetCarList(cars string) string
- func (nm *NotificationManager) GetNotificationReminders() []int
- func (nm *NotificationManager) GetTrackInfo(track string, layout string) string
- func (nm *NotificationManager) HasNotificationReminders() bool
- func (nm *NotificationManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
- func (nm *NotificationManager) SendChampionshipReminderMessage(championship *Championship, event *ChampionshipEvent, timer int) error
- func (nm *NotificationManager) SendMessage(msg string) error
- func (nm *NotificationManager) SendMessageWithLink(msg string, linkText string, link *url.URL) error
- func (nm *NotificationManager) SendRaceCancelledMessage(event *CustomRace, date time.Time) error
- func (nm *NotificationManager) SendRaceReminderMessage(event *CustomRace, timer int) error
- func (nm *NotificationManager) SendRaceScheduledMessage(event *CustomRace, date time.Time) error
- func (nm *NotificationManager) SendRaceStartMessage(config ServerConfig, event RaceEvent) error
- func (nm *NotificationManager) SendRaceWeekendReminderMessage(raceWeekend *RaceWeekend, session *RaceWeekendSession, timer int) error
- func (nm *NotificationManager) Stop() error
- type PenaltiesHandler
- type PenaltyAction
- type PointsReason
- type PotentialChampionshipEntrant
- type QuickRace
- func (q QuickRace) EventDescription() string
- func (q QuickRace) EventName() string
- func (q QuickRace) GetEntryList() EntryList
- func (q QuickRace) GetRaceConfig() CurrentRaceConfig
- func (q QuickRace) GetURL() string
- func (q QuickRace) IsChampionship() bool
- func (q QuickRace) IsLooping() bool
- func (q QuickRace) IsPractice() bool
- func (q QuickRace) IsRaceWeekend() bool
- func (q QuickRace) OverrideServerPassword() bool
- func (q QuickRace) ReplacementServerPassword() string
- type QuickRaceHandler
- type RaceControl
- func (rc *RaceControl) AllLapTimes() map[udp.DriverGUID]*RaceControlDriver
- func (rc *RaceControl) Event() udp.Event
- func (rc *RaceControl) OnCarUpdate(update udp.CarUpdate) error
- func (rc *RaceControl) OnClientConnect(client udp.SessionCarInfo) error
- func (rc *RaceControl) OnClientDisconnect(client udp.SessionCarInfo) error
- func (rc *RaceControl) OnClientLoaded(loadedCar udp.ClientLoaded) error
- func (rc *RaceControl) OnCollisionWithCar(collision udp.CollisionWithCar) error
- func (rc *RaceControl) OnCollisionWithEnvironment(collision udp.CollisionWithEnvironment) error
- func (rc *RaceControl) OnEndSession(sessionFile udp.EndSession) error
- func (rc *RaceControl) OnLapCompleted(lap udp.LapCompleted) error
- func (rc *RaceControl) OnNewSession(sessionInfo udp.SessionInfo) error
- func (rc *RaceControl) OnSessionUpdate(sessionInfo udp.SessionInfo) (bool, error)
- func (rc *RaceControl) OnVersion(version udp.Version) error
- func (rc *RaceControl) SortDrivers(driverGroup RaceControlDriverGroup, driverA, driverB *RaceControlDriver) bool
- func (rc *RaceControl) UDPCallback(message udp.Message)
- type RaceControlCarLapInfo
- type RaceControlDriver
- type RaceControlDriverGroup
- type RaceControlHandler
- type RaceControlHub
- type RaceEvent
- type RaceManager
- func (rm *RaceManager) BuildCustomRaceFromForm(r *http.Request) (*CurrentRaceConfig, error)
- func (rm *RaceManager) BuildEntryList(r *http.Request, start, length int) (EntryList, error)
- func (rm *RaceManager) BuildRaceOpts(r *http.Request) (*RaceTemplateVars, error)
- func (rm *RaceManager) CurrentRace() (*ServerConfig, EntryList)
- func (rm *RaceManager) DeleteCustomRace(uuid string) error
- func (rm *RaceManager) FindNextRecurrence(race *CustomRace, start time.Time) time.Time
- func (rm *RaceManager) InitScheduledRaces() error
- func (rm *RaceManager) ListAutoFillEntrants() ([]*Entrant, error)
- func (rm *RaceManager) ListCustomRaces() (recent, starred, looped, scheduled []*CustomRace, err error)
- func (rm *RaceManager) LoadServerOptions() (*GlobalServerConfig, error)
- func (rm *RaceManager) LoopCallback(message udp.Message)
- func (rm *RaceManager) LoopRaces()
- func (rm *RaceManager) RescheduleNotifications(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
- func (rm *RaceManager) SaveCustomRace(name string, overridePassword bool, replacementPassword string, ...) (*CustomRace, error)
- func (rm *RaceManager) SaveEntrantsForAutoFill(entryList EntryList) error
- func (rm *RaceManager) SaveServerOptions(newServerOpts *GlobalServerConfig) error
- func (rm *RaceManager) ScheduleNextFromRecurrence(race *CustomRace) error
- func (rm *RaceManager) ScheduleRace(uuid string, date time.Time, action string, recurrence string) error
- func (rm *RaceManager) SetupCustomRace(r *http.Request) error
- func (rm *RaceManager) SetupQuickRace(r *http.Request) error
- func (rm *RaceManager) StartCustomRace(uuid string, forceRestart bool) error
- func (rm *RaceManager) StartScheduledRace(race *CustomRace) error
- func (rm *RaceManager) ToggleLoopCustomRace(uuid string) error
- func (rm *RaceManager) ToggleStarCustomRace(uuid string) error
- type RaceTemplateVars
- type RaceWeekend
- func (rw *RaceWeekend) AddFilter(parentID, childID string, filter *RaceWeekendSessionToSessionFilter)
- func (rw *RaceWeekend) AddSession(s *RaceWeekendSession, parent *RaceWeekendSession)
- func (rw *RaceWeekend) Completed() bool
- func (rw *RaceWeekend) DelSession(sessionID string)
- func (rw *RaceWeekend) EnhanceResults(results *SessionResults)
- func (rw *RaceWeekend) FindChildren(parentID string) []*RaceWeekendSession
- func (rw *RaceWeekend) FindSessionByID(id string) (*RaceWeekendSession, error)
- func (rw *RaceWeekend) FindTotalNumParents(session *RaceWeekendSession) int
- func (rw *RaceWeekend) GetEntryList() EntryList
- func (rw *RaceWeekend) GetFilter(parentID, childID string) (*RaceWeekendSessionToSessionFilter, error)
- func (rw *RaceWeekend) GetFilterOrUseDefault(parentID, childID string) (*RaceWeekendSessionToSessionFilter, error)
- func (rw *RaceWeekend) HasLinkedChampionship() bool
- func (rw *RaceWeekend) HasParentRecursive(session *RaceWeekendSession, otherSessionID string) bool
- func (rw *RaceWeekend) HasTeamNames() bool
- func (rw *RaceWeekend) InProgress() bool
- func (rw *RaceWeekend) Progress() float64
- func (rw *RaceWeekend) RemoveFilter(parentID, childID string)
- func (rw *RaceWeekend) SessionCanBeRun(s *RaceWeekendSession) bool
- func (rw *RaceWeekend) SortedSessions() []*RaceWeekendSession
- func (rw *RaceWeekend) TrackOverview() string
- type RaceWeekendEntryList
- func (e *RaceWeekendEntryList) Add(entrant *RaceWeekendSessionEntrant)
- func (e *RaceWeekendEntryList) AddInPitBox(entrant *RaceWeekendSessionEntrant, pitBox int)
- func (e RaceWeekendEntryList) AsEntryList() EntryList
- func (e *RaceWeekendEntryList) Delete(entrant *RaceWeekendSessionEntrant)
- func (e *RaceWeekendEntryList) Sorted() []*RaceWeekendSessionEntrant
- type RaceWeekendEntryListSortFunc
- type RaceWeekendEntryListSorter
- type RaceWeekendEntryListSorterDescription
- type RaceWeekendGridPreview
- type RaceWeekendHandler
- type RaceWeekendManager
- func (rwm *RaceWeekendManager) BuildRaceWeekendSessionOpts(r *http.Request) (*RaceTemplateVars, error)
- func (rwm *RaceWeekendManager) BuildRaceWeekendTemplateOpts(r *http.Request) (*RaceTemplateVars, error)
- func (rwm *RaceWeekendManager) CancelSession(raceWeekendID string, raceWeekendSessionID string) error
- func (rwm *RaceWeekendManager) ClearLockedTyreSetups(raceWeekend *RaceWeekend, session *RaceWeekendSession) error
- func (rwm *RaceWeekendManager) DeScheduleSession(raceWeekendID, sessionID string) error
- func (rwm *RaceWeekendManager) DeleteRaceWeekend(id string) error
- func (rwm *RaceWeekendManager) DeleteSession(raceWeekendID string, raceWeekendSessionID string) error
- func (rwm *RaceWeekendManager) FindConnectedSessions(raceWeekendID, parentSessionID, childSessionID string) (*RaceWeekend, *RaceWeekendSession, *RaceWeekendSession, error)
- func (rwm *RaceWeekendManager) FindSession(raceWeekendID, sessionID string) (*RaceWeekend, *RaceWeekendSession, error)
- func (rwm *RaceWeekendManager) ImportRaceWeekend(data string) (string, error)
- func (rwm *RaceWeekendManager) ImportSession(raceWeekendID string, raceWeekendSessionID string, r *http.Request) error
- func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSession(raceWeekendID string, raceWeekendSessionID string) (*RaceWeekendSession, []SessionResults, error)
- func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSorting(raceWeekend *RaceWeekend, session *RaceWeekendSession) ([]SessionResults, error)
- func (rwm *RaceWeekendManager) ListRaceWeekends() ([]*RaceWeekend, error)
- func (rwm *RaceWeekendManager) LoadRaceWeekend(id string) (*RaceWeekend, error)
- func (rwm *RaceWeekendManager) PreviewGrid(raceWeekendID, parentSessionID, childSessionID string, ...) (*RaceWeekendGridPreview, error)
- func (rwm *RaceWeekendManager) PreviewSessionEntryList(raceWeekendID, sessionID, sortType string, reverseGrid int) (*RaceWeekendGridPreview, error)
- func (rwm *RaceWeekendManager) RaceWeekendSessionIsRunning() bool
- func (rwm *RaceWeekendManager) RestartActiveSession() error
- func (rwm *RaceWeekendManager) RestartSession(raceWeekendID string, raceWeekendSessionID string) error
- func (rwm *RaceWeekendManager) SaveRaceWeekend(r *http.Request) (raceWeekend *RaceWeekend, edited bool, err error)
- func (rwm *RaceWeekendManager) SaveRaceWeekendSession(r *http.Request) (raceWeekend *RaceWeekend, session *RaceWeekendSession, edited bool, err error)
- func (rwm *RaceWeekendManager) ScheduleSession(raceWeekendID, sessionID string, date time.Time, startWhenParentFinishes bool) error
- func (rwm *RaceWeekendManager) StartPracticeSession(raceWeekendID string, raceWeekendSessionID string) error
- func (rwm *RaceWeekendManager) StartSession(raceWeekendID string, raceWeekendSessionID string, isPracticeSession bool) error
- func (rwm *RaceWeekendManager) StopActiveSession() error
- func (rwm *RaceWeekendManager) UDPCallback(message udp.Message)
- func (rwm *RaceWeekendManager) UpdateGrid(raceWeekendID, parentSessionID, childSessionID string, ...) error
- func (rwm *RaceWeekendManager) UpdateSessionSorting(raceWeekendID, sessionID string, sortType string, numEntrantsToReverse int) error
- func (rwm *RaceWeekendManager) UpsertRaceWeekend(raceWeekend *RaceWeekend) error
- func (rwm *RaceWeekendManager) WatchForScheduledSessions() error
- type RaceWeekendSession
- func (rws *RaceWeekendSession) ClearRecurrenceRule()
- func (rws *RaceWeekendSession) Completed() bool
- func (rws *RaceWeekendSession) FinishingGrid(raceWeekend *RaceWeekend) ([]*RaceWeekendSessionEntrant, error)
- func (rws *RaceWeekendSession) GetID() uuid.UUID
- func (rws *RaceWeekendSession) GetRaceSetup() CurrentRaceConfig
- func (rws *RaceWeekendSession) GetRaceWeekendEntryList(rw *RaceWeekend, overrideFilter *RaceWeekendSessionToSessionFilter, ...) (RaceWeekendEntryList, error)
- func (rws *RaceWeekendSession) GetRecurrenceRule() (*rrule.RRule, error)
- func (rws *RaceWeekendSession) GetScheduledTime() time.Time
- func (rws *RaceWeekendSession) GetSummary() string
- func (rws *RaceWeekendSession) GetURL() string
- func (rws *RaceWeekendSession) HasParent(id string) bool
- func (rws *RaceWeekendSession) HasRecurrenceRule() bool
- func (rws *RaceWeekendSession) HasSignUpForm() bool
- func (rws *RaceWeekendSession) InProgress() bool
- func (rws *RaceWeekendSession) IsBase() bool
- func (rws *RaceWeekendSession) Name() string
- func (rws *RaceWeekendSession) ParentsDataAttr(raceWeekend *RaceWeekend) template.HTMLAttr
- func (rws *RaceWeekendSession) ReadOnlyEntryList() EntryList
- func (rws *RaceWeekendSession) RemoveParent(parentID string)
- func (rws *RaceWeekendSession) SessionInfo() *SessionConfig
- func (rws *RaceWeekendSession) SessionType() SessionType
- func (rws *RaceWeekendSession) SetRecurrenceRule(input string) error
- type RaceWeekendSessionEntrant
- type RaceWeekendSessionToSessionFilter
- type Renderer
- func (tr *Renderer) LoadPartial(w http.ResponseWriter, r *http.Request, partial string, vars TemplateVars) error
- func (tr *Renderer) LoadTemplate(w http.ResponseWriter, r *http.Request, view string, vars TemplateVars) error
- func (tr *Renderer) MustLoadPartial(w http.ResponseWriter, r *http.Request, partial string, vars TemplateVars)
- func (tr *Renderer) MustLoadTemplate(w http.ResponseWriter, r *http.Request, view string, vars TemplateVars)
- type Resolver
- type ResultsHandler
- type ScheduledEvent
- type ScheduledEventBase
- func (seb *ScheduledEventBase) ClearRecurrenceRule()
- func (seb *ScheduledEventBase) GetRecurrenceRule() (*rrule.RRule, error)
- func (seb *ScheduledEventBase) GetScheduledTime() time.Time
- func (seb *ScheduledEventBase) HasRecurrenceRule() bool
- func (seb *ScheduledEventBase) SetRecurrenceRule(input string) error
- type ScheduledRacesHandler
- type ScheduledRacesManager
- type ServerAccountOptions
- type ServerAdministrationHandler
- type ServerConfig
- type ServerExtraConfig
- type ServerProcess
- type SessionCar
- type SessionConfig
- type SessionDriver
- type SessionEvent
- type SessionLap
- type SessionPos
- type SessionPreviewEntrant
- type SessionResult
- type SessionResults
- func (s *SessionResults) Anonymize()
- func (s *SessionResults) DriversHaveTeams() bool
- func (s *SessionResults) FallBackSort()
- func (s *SessionResults) FastestLap() *SessionLap
- func (s *SessionResults) FastestLapInClass(classID uuid.UUID) *SessionLap
- func (s *SessionResults) FindCarByGUIDAndModel(guid, model string) (*SessionCar, error)
- func (s *SessionResults) GetAverageLapTime(guid, model string) time.Duration
- func (s *SessionResults) GetConsistency(guid, model string) float64
- func (s *SessionResults) GetCrashes(guid string) int
- func (s *SessionResults) GetCrashesOfType(guid, collisionType string) int
- func (s *SessionResults) GetCuts(driverGuid, model string) int
- func (s *SessionResults) GetDate() string
- func (s *SessionResults) GetDriverPosition(driverGuid, model string) int
- func (s *SessionResults) GetDrivers() string
- func (s *SessionResults) GetDriversFastestLap(guid, model string) *SessionLap
- func (s *SessionResults) GetLastLapPos(driverGuid, model string) int
- func (s *SessionResults) GetLastLapTime(driverGuid, model string) time.Duration
- func (s *SessionResults) GetNumLaps(driverGUID, model string) int
- func (s *SessionResults) GetNumSectors() []int
- func (s *SessionResults) GetOverallAverageLapTime() time.Duration
- func (s *SessionResults) GetPosForLap(guid, model string, lapNum int64) int
- func (s *SessionResults) GetPotentialLap(driverGUID, model string) time.Duration
- func (s *SessionResults) GetTeamName(driverGUID string) string
- func (s *SessionResults) GetTime(timeINT int, driverGUID, model string, penalty bool) time.Duration
- func (s *SessionResults) GetURL() string
- func (s *SessionResults) HasHandicaps() bool
- func (s *SessionResults) IsDriversFastestLap(guid, model string, time, cuts int) bool
- func (s *SessionResults) IsDriversFastestSector(guid, model string, sector, time, cuts int) bool
- func (s *SessionResults) IsFastestLap(time, cuts int) bool
- func (s *SessionResults) IsFastestSector(sector, time, cuts int) bool
- func (s *SessionResults) MaskDriverNames()
- func (s *SessionResults) RenameDriver(guid, newName string)
- type SessionType
- type Sessions
- type ShouldBeAnInt
- type SteamConfig
- type SteamLoginHandler
- type Store
- type StoreConfig
- type StrackerACPlugin
- type StrackerConfiguration
- type StrackerDatabase
- type StrackerDatabaseCompression
- type StrackerHTTPConfiguration
- type StrackerHandler
- type StrackerInstanceConfiguration
- type StrackerLapValidChecks
- type StrackerMessages
- type StrackerSessionManagement
- type StrackerSwearFilter
- type StrackerWelcomeMessage
- type TeamStanding
- type TemplateLoader
- type TemplateVars
- type Theme
- type ThemeDetails
- type Track
- type TrackDataGateway
- type TrackInfo
- type TrackManager
- func (tm *TrackManager) GetTrackFromName(name string) (*Track, error)
- func (tm *TrackManager) ListTracks() ([]Track, error)
- func (tm *TrackManager) LoadTrackDetailsForTemplate(trackName string) (*trackDetailsTemplateVars, error)
- func (tm *TrackManager) ResultsForLayout(trackName, layout string) ([]SessionResults, error)
- func (tm *TrackManager) UpdateTrackMetadata(name string, r *http.Request) error
- type TrackMapData
- type TrackMetaData
- type TrackSurfacePreset
- type TracksHandler
- type Tyres
- type ValidationError
- type Weather
- type WeatherConfig
- type WeatherHandler
- Bugs
Constants ¶
const ( ChampionshipEntrantAll = "All" ChampionshipEntrantAccepted = "Accepted" ChampionshipEntrantRejected = "Rejected" ChampionshipEntrantPending = "Pending Approval" )
const ( ContentTypeCar = "Car" ContentTypeTrack = "Track" ContentTypeWeather = "Weather" )
const ( ThemeDefault = "default" ThemeLight = "light" ThemeDark = "dark" )
const (
AnyCarModel = "any_car_model"
)
const (
ContentManagerJoinLinkBase string = "https://acstuff.ru/s/q:race/online/join"
)
const IERP13c = "ier_p13c"
const MOTDFilename = "motd.txt"
const MaxLogSizeBytes = 1e6
const ServerExecutablePath = "acServer"
Variables ¶
var ( ErrInvalidChampionshipEvent = errors.New("servermanager: invalid championship event") ErrInvalidChampionshipClass = errors.New("servermanager: invalid championship class") )
var ( ErrSessionNotFound = errors.New("servermanager: session not found") ErrResultFileNotFound = errors.New("servermanager: results files not found") )
var ( IsHosted = os.Getenv("HOSTED") == "true" MaxClientsOverride = formValueAsInt(os.Getenv("MAX_CLIENTS_OVERRIDE")) IsPremium = "false" )
var ( ErrRaceWeekendNotFound = errors.New("servermanager: race weekend not found") RaceWeekendSessionNotFound = errors.New("servermanager: race weekend session not found") )
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" )
var AvailableSessions = []SessionType{ SessionTypeRace, SessionTypeQualifying, SessionTypePractice, SessionTypeBooking, }
var AvailableSessionsNoBooking = []SessionType{ SessionTypeRace, SessionTypeQualifying, SessionTypePractice, }
var BuildVersion string
BuildVersion is the time Server Manager was built at
var ChampionshipClassColors = []string{
"#9ec6f5",
"#91d8af",
"#dba8ed",
"#e3a488",
"#e3819a",
"#908ba1",
"#a2b5b9",
"#a681b4",
"#c1929d",
"#999ecf",
}
ChampionshipClassColors are sequentially selected to indicate different classes within a Championship
var Changelog template.HTML
var (
CurrentMigrationVersion = len(migrations)
)
var (
Debug = os.Getenv("DEBUG") == "true"
)
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.
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.",
},
}
var ErrAccountNeedsPassword = errors.New("servermanager: account needs to set a password")
var ErrAccountNotFound = errors.New("servermanager: account not found")
var ErrChampionshipNotFound = errors.New("servermanager: championship not found")
var ErrClassNotFound = errors.New("servermanager: championship class not found")
var ErrCouldNotFindTyreForCar = errors.New("servermanager: could not find tyres for car")
var ErrCustomRaceNotFound = errors.New("servermanager: custom race not found")
var ErrEntryListFull = errors.New("servermanager: entry list is full")
var ErrEntryListTooBig = errors.New("servermanager: EntryList exceeds MaxClients setting")
var ErrInvalidUsernameOrPassword = errors.New("servermanager: invalid username or password")
var ErrMustSubmitCar = errors.New("servermanager: you must set a car")
var ErrNoActiveChampionshipEvent = errors.New("servermanager: no active championship event")
var ErrNoActiveRaceWeekendSession = errors.New("servermanager: no active race weekend session")
var ErrNoOpenUDPConnection = errors.New("servermanager: no open UDP connection found")
var ErrRaceWeekendFilterNotFound = errors.New("servermanager: race weekend filter not found")
var ErrRaceWeekendSessionDependencyIncomplete = errors.New("servermanager: race weekend session dependency incomplete")
var ErrResultsPageNotFound = errors.New("servermanager: results page not found")
var ErrScheduledTimeIsZero = errors.New("servermanager: can't schedule race for zero time")
var ErrServerAlreadyRunning = errors.New("servermanager: assetto corsa server is already running")
var ErrSessionCarNotFound = errors.New("servermanager: session car not found")
var (
ErrStrackerConfigurationRequiresUDPPluginConfiguration = errors.New("servermanager: stracker configuration requires UDP plugin configuration in Server Options")
)
var ErrValueNotSet = errors.New("servermanager: value not set")
var HTTPCounter = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "web_requests_total", Help: "A counter for requests to the wrapped handler.", }, []string{"code", "method"}, )
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.
var HTTPInFlightGauge = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "in_flight_requests",
Help: "A gauge of requests currently being served by the wrapped handler.",
})
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.
var IERP13cTyres = []string{"S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8"}
var LaunchTime = time.Now()
var Lua *lua.LState
var OpenAccount = &Account{ Name: "Free Access", Group: GroupRead, LastSeenVersion: BuildVersion, Theme: ThemeDefault, }
var RaceWeekendEntryListSorters = []RaceWeekendEntryListSorterDescription{ { Name: "No Sort (Use Finishing Grid)", Key: "", Sorter: RaceWeekendEntryListSortFunc(UnchangedRaceWeekendEntryListSort), NeedsParentSession: false, ShowInManageEntryList: true, }, { Name: "Fastest Lap", Key: "fastest_lap", Sorter: RaceWeekendEntryListSortFunc(FastestLapRaceWeekendEntryListSort), NeedsParentSession: true, ShowInManageEntryList: true, }, { Name: "Total Race Time", Key: "total_race_time", Sorter: RaceWeekendEntryListSortFunc(TotalRaceTimeRaceWeekendEntryListSort), NeedsParentSession: true, ShowInManageEntryList: true, }, { Name: "Fastest Lap Across Multiple Results Files", Key: "fastest_multi_results_lap", Sorter: RaceWeekendEntryListSortFunc(FastestResultsFileRaceWeekendEntryListSort), NeedsParentSession: false, ShowInManageEntryList: false, }, { Name: "Number of Laps Across Multiple Results Files", Key: "number_multi_results_lap", Sorter: RaceWeekendEntryListSortFunc(NumberResultsFileRaceWeekendEntryListSort), NeedsParentSession: false, ShowInManageEntryList: false, }, { Name: "Fewest Collisions", Key: "fewest_collisions", Sorter: RaceWeekendEntryListSortFunc(FewestCollisionsRaceWeekendEntryListSort), NeedsParentSession: true, ShowInManageEntryList: true, }, { Name: "Fewest Cuts", Key: "fewest_cuts", Sorter: RaceWeekendEntryListSortFunc(FewestCutsRaceWeekendEntryListSort), NeedsParentSession: true, ShowInManageEntryList: true, }, { Name: "Safety (Collisions then Cuts)", Key: "safety", Sorter: RaceWeekendEntryListSortFunc(SafetyRaceWeekendEntryListSort), NeedsParentSession: true, ShowInManageEntryList: true, }, { Name: "Championship Standings Order", Key: "championship_standings_order", Sorter: &ChampionshipStandingsOrderEntryListSort{}, NeedsParentSession: false, ShowInManageEntryList: true, }, { Name: "Random", Key: "random", Sorter: RaceWeekendEntryListSortFunc(RandomRaceWeekendEntryListSort), NeedsParentSession: false, ShowInManageEntryList: true, }, { Name: "Alphabetical (Using Driver Name)", Key: "alphabetical", Sorter: RaceWeekendEntryListSortFunc(AlphabeticalRaceWeekendEntryListSort), NeedsParentSession: false, ShowInManageEntryList: true, }, }
var ThemeOptions = []ThemeDetails{ { Theme: ThemeDefault, Name: "Use Default", }, { Theme: ThemeLight, Name: "Light", }, { Theme: ThemeDark, Name: "Dark", }, }
var UseFallBackSorting = false
var UseShortenedDriverNames = true
Functions ¶
func ACSRSendResult ¶ added in v1.5.0
func ACSRSendResult(championship Championship)
Sends a championship to ACSR, called OnEndSession and when a championship is created
func AddErrorFlash ¶ added in v1.3.1
func AddErrorFlash(w http.ResponseWriter, r *http.Request, message string)
func AddFlash ¶ added in v1.3.1
func AddFlash(w http.ResponseWriter, r *http.Request, message string)
Helper function to get message session and add a flash
func AdminAccess ¶
func AlphabeticalRaceWeekendEntryListSort ¶ added in v1.5.0
func AlphabeticalRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func AssetCacheHeaders ¶ added in v1.4.0
func AssetCacheHeaders(next http.HandlerFunc, useRevalidation bool) http.HandlerFunc
func BuildICalEvent ¶ added in v1.2.1
func BuildICalEvent(event ScheduledEvent) *components.Event
func CarDataFile ¶ added in v1.5.1
func CarDataFile(carModel, dataFile string) (io.ReadCloser, error)
func CarNameFromFilepath ¶
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 ¶ added in v1.5.0
func DeleteAccess ¶ added in v1.2.0
func FastestLapRaceWeekendEntryListSort ¶ added in v1.5.0
func FastestLapRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func FastestResultsFileRaceWeekendEntryListSort ¶ added in v1.6.0
func FastestResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, filter *RaceWeekendSessionToSessionFilter) error
func FewestCollisionsRaceWeekendEntryListSort ¶ added in v1.5.0
func FewestCollisionsRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func FewestCutsRaceWeekendEntryListSort ¶ added in v1.5.0
func FewestCutsRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func FileServer ¶
func FreeUDPPort ¶
func GenerateSummary ¶ added in v1.5.0
func GenerateSummary(raceSetup CurrentRaceConfig, eventType string) string
func GetMD5Hash ¶ added in v1.5.0
func InitLogging ¶ added in v1.3.3
func InitLogging()
func InitMonitoring ¶ added in v1.3.0
func InitMonitoring()
func InitWithResolver ¶ added in v1.4.0
func InstallAssettoCorsaServer ¶
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 ¶ added in v1.5.3
func IsAssettoInstalled() bool
func IsDirWriteable ¶ added in v1.5.3
func IsStrackerInstalled ¶ added in v1.5.1
func IsStrackerInstalled() bool
IsStrackerInstalled looks in the ServerInstallPath for an "stracker" directory with the correct stracker executable for the given platform
func ListSetupsForCar ¶ added in v1.4.0
func LoadTrackMapImage ¶ added in v1.5.1
func LoadTyresFromACDINI ¶
LoadTyresFromACDINI reads the tyres.ini file from within the data.acd of a car and finds all available tyre compounds.
func LuaHTTPRequest ¶ added in v1.6.0
func NumberResultsFileRaceWeekendEntryListSort ¶ added in v1.6.0
func NumberResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, filter *RaceWeekendSessionToSessionFilter) error
func RandomRaceWeekendEntryListSort ¶ added in v1.5.0
func RandomRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func ReadAccess ¶
func RoundTripper ¶ added in v1.3.0
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, ) http.Handler
func SafetyRaceWeekendEntryListSort ¶ added in v1.5.0
func SafetyRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func SetAssettoInstallPath ¶
func SetAssettoInstallPath(installPath string)
func StrackerExecutablePath ¶ added in v1.5.1
func StrackerExecutablePath() string
func StrackerFolderPath ¶ added in v1.5.1
func StrackerFolderPath() string
func ToggleDRSForTrack ¶ added in v1.3.3
func TotalRaceTimeRaceWeekendEntryListSort ¶ added in v1.5.0
func TotalRaceTimeRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func UnchangedRaceWeekendEntryListSort ¶ added in v1.5.0
func UnchangedRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, _ []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func WriteAccess ¶
Types ¶
type ACHTTPPlayers ¶ added in v1.4.0
type ACHTTPPlayers struct {
Cars []*CMCar `json:"Cars"`
}
type ACHTTPSessionInfo ¶ added in v1.4.0
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 ACSRConfig ¶ added in v1.5.0
type Account ¶
type Account struct { ID uuid.UUID Created time.Time Updated time.Time Deleted time.Time Name string Group Group DriverName, GUID, Team string PasswordHash string PasswordSalt string DefaultPassword string LastSeenVersion string Theme Theme }
func AccountFromRequest ¶ added in v1.2.0
func NewAccount ¶ added in v1.2.0
func NewAccount() *Account
func (Account) HasGroupPrivilege ¶
func (Account) HasSeenCurrentVersion ¶ added in v1.4.0
func (Account) HasSeenVersion ¶ added in v1.4.0
func (Account) NeedsPasswordReset ¶ added in v1.2.0
func (Account) ShowDarkTheme ¶ added in v1.5.0
type AccountHandler ¶ added in v1.4.0
type AccountHandler struct { *BaseHandler SteamLoginHandler // contains filtered or unexported fields }
func NewAccountHandler ¶ added in v1.4.0
func NewAccountHandler(baseHandler *BaseHandler, store Store, accountManager *AccountManager) *AccountHandler
func (*AccountHandler) AdminAccessMiddleware ¶ added in v1.4.0
func (ah *AccountHandler) AdminAccessMiddleware(next http.Handler) http.Handler
func (*AccountHandler) DeleteAccessMiddleware ¶ added in v1.4.0
func (ah *AccountHandler) DeleteAccessMiddleware(next http.Handler) http.Handler
func (*AccountHandler) MustLoginMiddleware ¶ added in v1.4.0
MustLoginMiddleware determines whether an account needs to log in to access a given Group page
func (*AccountHandler) ReadAccessMiddleware ¶ added in v1.4.0
func (ah *AccountHandler) ReadAccessMiddleware(next http.Handler) http.Handler
func (*AccountHandler) WriteAccessMiddleware ¶ added in v1.4.0
func (ah *AccountHandler) WriteAccessMiddleware(next http.Handler) http.Handler
type AccountManager ¶ added in v1.2.0
type AccountManager struct {
// contains filtered or unexported fields
}
func NewAccountManager ¶ added in v1.2.0
func NewAccountManager(store Store) *AccountManager
func (*AccountManager) ChangePassword ¶ added in v1.5.0
func (am *AccountManager) ChangePassword(account *Account, password string) error
func (*AccountManager) SetCurrentVersion ¶ added in v1.4.0
func (am *AccountManager) SetCurrentVersion(account *Account) error
type AccountsConfig ¶ added in v1.2.0
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:"-"` // contains filtered or unexported fields }
func (*ActiveChampionship) EventDescription ¶ added in v1.4.0
func (a *ActiveChampionship) EventDescription() string
func (*ActiveChampionship) EventName ¶ added in v1.3.0
func (a *ActiveChampionship) EventName() string
func (*ActiveChampionship) GetEntryList ¶ added in v1.5.3
func (a *ActiveChampionship) GetEntryList() EntryList
func (*ActiveChampionship) GetRaceConfig ¶ added in v1.5.3
func (a *ActiveChampionship) GetRaceConfig() CurrentRaceConfig
func (*ActiveChampionship) GetURL ¶ added in v1.4.0
func (a *ActiveChampionship) GetURL() string
func (*ActiveChampionship) IsChampionship ¶ added in v1.3.0
func (a *ActiveChampionship) IsChampionship() bool
func (*ActiveChampionship) IsLooping ¶ added in v1.5.3
func (a *ActiveChampionship) IsLooping() bool
func (*ActiveChampionship) IsPractice ¶ added in v1.5.3
func (a *ActiveChampionship) IsPractice() bool
func (*ActiveChampionship) IsRaceWeekend ¶ added in v1.5.0
func (a *ActiveChampionship) IsRaceWeekend() bool
func (*ActiveChampionship) OverrideServerPassword ¶ added in v1.3.0
func (a *ActiveChampionship) OverrideServerPassword() bool
func (*ActiveChampionship) ReplacementServerPassword ¶ added in v1.3.0
func (a *ActiveChampionship) ReplacementServerPassword() string
type ActiveRaceWeekend ¶ added in v1.5.0
type ActiveRaceWeekend struct { Name string RaceWeekendID, SessionID 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 ¶ added in v1.5.0
func (a ActiveRaceWeekend) EventDescription() string
func (ActiveRaceWeekend) EventName ¶ added in v1.5.0
func (a ActiveRaceWeekend) EventName() string
func (ActiveRaceWeekend) GetEntryList ¶ added in v1.5.3
func (a ActiveRaceWeekend) GetEntryList() EntryList
func (ActiveRaceWeekend) GetRaceConfig ¶ added in v1.5.3
func (a ActiveRaceWeekend) GetRaceConfig() CurrentRaceConfig
func (ActiveRaceWeekend) GetURL ¶ added in v1.5.0
func (a ActiveRaceWeekend) GetURL() string
func (ActiveRaceWeekend) IsChampionship ¶ added in v1.5.0
func (a ActiveRaceWeekend) IsChampionship() bool
func (ActiveRaceWeekend) IsLooping ¶ added in v1.5.3
func (a ActiveRaceWeekend) IsLooping() bool
func (ActiveRaceWeekend) IsPractice ¶ added in v1.5.3
func (a ActiveRaceWeekend) IsPractice() bool
func (ActiveRaceWeekend) IsRaceWeekend ¶ added in v1.5.0
func (a ActiveRaceWeekend) IsRaceWeekend() bool
func (ActiveRaceWeekend) OverrideServerPassword ¶ added in v1.5.0
func (a ActiveRaceWeekend) OverrideServerPassword() bool
func (ActiveRaceWeekend) ReplacementServerPassword ¶ added in v1.5.0
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 ¶ added in v1.2.0
func NewAssettoServerProcess(callbackFunc udp.CallbackFunc, store Store, contentManagerWrapper *ContentManagerWrapper) *AssettoServerProcess
func (*AssettoServerProcess) Done ¶ added in v1.2.0
func (as *AssettoServerProcess) Done() <-chan struct{}
func (*AssettoServerProcess) Event ¶ added in v1.4.0
func (as *AssettoServerProcess) Event() RaceEvent
func (*AssettoServerProcess) GetServerConfig ¶ added in v1.4.0
func (as *AssettoServerProcess) GetServerConfig() ServerConfig
func (*AssettoServerProcess) IsRunning ¶
func (as *AssettoServerProcess) IsRunning() bool
IsRunning of the server. returns true if running
func (*AssettoServerProcess) Logs ¶
func (as *AssettoServerProcess) Logs() string
Logs outputs the server logs
func (*AssettoServerProcess) Restart ¶
func (as *AssettoServerProcess) Restart() error
Restart the assetto server.
func (*AssettoServerProcess) SendUDPMessage ¶ added in v1.2.1
func (as *AssettoServerProcess) SendUDPMessage(message udp.Message) error
func (*AssettoServerProcess) Start ¶
func (as *AssettoServerProcess) Start(cfg ServerConfig, entryList EntryList, forwardingAddress string, forwardListenPort int, event RaceEvent) error
Start the assetto server. If it's already running, an ErrServerAlreadyRunning is returned.
func (*AssettoServerProcess) Stop ¶
func (as *AssettoServerProcess) Stop() error
Stop the assetto server.
func (*AssettoServerProcess) UDPCallback ¶ added in v1.2.1
func (as *AssettoServerProcess) UDPCallback(message udp.Message)
type AuditEntry ¶ added in v1.3.3
type AuditLogHandler ¶ added in v1.4.0
type AuditLogHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewAuditLogHandler ¶ added in v1.4.0
func NewAuditLogHandler(baseHandler *BaseHandler, store Store) *AuditLogHandler
func (*AuditLogHandler) Middleware ¶ added in v1.4.0
func (alh *AuditLogHandler) Middleware(next http.Handler) http.Handler
type BaseHandler ¶ added in v1.4.0
type BaseHandler struct {
// contains filtered or unexported fields
}
func NewBaseHandler ¶ added in v1.4.0
func NewBaseHandler(viewRenderer *Renderer) *BaseHandler
type BaseTemplateVars ¶ added in v1.5.0
type BaseTemplateVars struct { Messages []interface{} Errors []interface{} ServerStatus bool ServerEvent RaceEvent ServerName string CustomCSS template.CSS User *Account IsHosted bool IsPremium string MaxClientsOverride int IsDarkTheme bool Request *http.Request Debug bool MonitoringEnabled bool SentryDSN template.JSStr RecaptchaSiteKey string WideContainer bool OGImage string }
func (*BaseTemplateVars) Get ¶ added in v1.5.0
func (b *BaseTemplateVars) Get() *BaseTemplateVars
type BoltStore ¶ added in v1.2.0
type BoltStore struct {
// contains filtered or unexported fields
}
func (*BoltStore) AddAuditEntry ¶ added in v1.3.3
func (rs *BoltStore) AddAuditEntry(entry *AuditEntry) error
func (*BoltStore) ClearLastRaceEvent ¶ added in v1.5.3
func (*BoltStore) DeleteAccount ¶ added in v1.2.0
func (*BoltStore) DeleteChampionship ¶ added in v1.2.0
func (*BoltStore) DeleteCustomRace ¶ added in v1.2.0
func (rs *BoltStore) DeleteCustomRace(race *CustomRace) error
func (*BoltStore) DeleteEntrant ¶ added in v1.3.1
func (*BoltStore) DeleteRaceWeekend ¶ added in v1.5.0
func (*BoltStore) FindAccountByID ¶ added in v1.2.0
func (*BoltStore) FindAccountByName ¶ added in v1.2.0
func (*BoltStore) FindCustomRaceByID ¶ added in v1.2.0
func (rs *BoltStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
func (*BoltStore) GetAuditEntries ¶ added in v1.3.3
func (rs *BoltStore) GetAuditEntries() ([]*AuditEntry, error)
func (*BoltStore) ListAccounts ¶ added in v1.2.0
func (*BoltStore) ListChampionships ¶ added in v1.2.0
func (rs *BoltStore) ListChampionships() ([]*Championship, error)
func (*BoltStore) ListCustomRaces ¶ added in v1.2.0
func (rs *BoltStore) ListCustomRaces() ([]*CustomRace, error)
func (*BoltStore) ListEntrants ¶ added in v1.2.0
func (*BoltStore) ListPrevFrames ¶ added in v1.2.0
func (*BoltStore) ListRaceWeekends ¶ added in v1.5.0
func (rs *BoltStore) ListRaceWeekends() ([]*RaceWeekend, error)
func (*BoltStore) LoadChampionship ¶ added in v1.2.0
func (rs *BoltStore) LoadChampionship(id string) (*Championship, error)
func (*BoltStore) LoadLastRaceEvent ¶ added in v1.5.3
func (*BoltStore) LoadLiveTimingsData ¶ added in v1.5.3
func (rs *BoltStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
func (*BoltStore) LoadRaceWeekend ¶ added in v1.5.0
func (rs *BoltStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
func (*BoltStore) LoadServerOptions ¶ added in v1.2.0
func (rs *BoltStore) LoadServerOptions() (*GlobalServerConfig, error)
func (*BoltStore) LoadStrackerOptions ¶ added in v1.5.1
func (rs *BoltStore) LoadStrackerOptions() (*StrackerConfiguration, error)
func (*BoltStore) UpsertAccount ¶ added in v1.2.0
func (*BoltStore) UpsertChampionship ¶ added in v1.2.0
func (rs *BoltStore) UpsertChampionship(c *Championship) error
func (*BoltStore) UpsertCustomRace ¶ added in v1.2.0
func (rs *BoltStore) UpsertCustomRace(race *CustomRace) error
func (*BoltStore) UpsertEntrant ¶ added in v1.2.0
func (*BoltStore) UpsertLastRaceEvent ¶ added in v1.5.3
func (*BoltStore) UpsertLiveFrames ¶ added in v1.2.0
func (*BoltStore) UpsertLiveTimingsData ¶ added in v1.5.3
func (rs *BoltStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error
func (*BoltStore) UpsertRaceWeekend ¶ added in v1.5.0
func (rs *BoltStore) UpsertRaceWeekend(rw *RaceWeekend) error
func (*BoltStore) UpsertServerOptions ¶ added in v1.2.0
func (rs *BoltStore) UpsertServerOptions(so *GlobalServerConfig) error
func (*BoltStore) UpsertStrackerOptions ¶ added in v1.5.1
func (rs *BoltStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
type Broadcaster ¶ added in v1.3.3
type ByteReaderCloser ¶ added in v1.5.1
func (ByteReaderCloser) Close ¶ added in v1.5.1
func (ByteReaderCloser) Close() error
type CMAssists ¶ added in v1.4.0
type CMAssists struct { ABSState int `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 int `json:"tcState"` TyreBlanketsAllowed bool `json:"tyreBlanketsAllowed"` TyreWearRate int `json:"tyreWearRate"` }
type CMCar ¶ added in v1.4.0
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 ¶ added in v1.4.0
type CMContent struct { Cars map[string]ContentURL `json:"cars"` Track ContentURL `json:"track"` }
type CalendarObject ¶ added in v1.5.0
type CalendarObject struct { ID string `json:"id"` 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 ¶ added in v1.5.0
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) PrettyName ¶
type CarDetails ¶ added in v1.4.0
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"` DownloadURL string `json:"downloadURL"` Notes string `json:"notes"` }
func (*CarDetails) AddTag ¶ added in v1.4.0
func (cd *CarDetails) AddTag(name string)
func (*CarDetails) DelTag ¶ added in v1.4.0
func (cd *CarDetails) DelTag(name string)
func (*CarDetails) Load ¶ added in v1.4.0
func (cd *CarDetails) Load(carName string) error
func (*CarDetails) Save ¶ added in v1.4.0
func (cd *CarDetails) Save(carName string) error
type CarManager ¶ added in v1.4.0
type CarManager struct {
// contains filtered or unexported fields
}
func NewCarManager ¶ added in v1.4.0
func NewCarManager(trackManager *TrackManager, watchForCarChanges bool) *CarManager
func (*CarManager) AddTag ¶ added in v1.4.0
func (cm *CarManager) AddTag(carName, tag string) error
func (*CarManager) CreateOrOpenSearchIndex ¶ added in v1.4.0
func (cm *CarManager) CreateOrOpenSearchIndex() error
CreateSearchIndex builds a search index for the cars
func (*CarManager) DeIndexCar ¶ added in v1.4.0
func (cm *CarManager) DeIndexCar(name string) error
DeIndexCar removes a car from the index.
func (*CarManager) DelTag ¶ added in v1.4.0
func (cm *CarManager) DelTag(carName, tag string) error
func (*CarManager) DeleteCar ¶ added in v1.4.0
func (cm *CarManager) DeleteCar(carName string) error
DeleteCar removes a car from the file system and search index.
func (*CarManager) DeleteSkin ¶ added in v1.4.0
func (cm *CarManager) DeleteSkin(car, skin string) error
func (*CarManager) IndexAllCars ¶ added in v1.4.0
func (cm *CarManager) IndexAllCars() error
IndexAllCars loads all current cars and adds them to the search index
func (*CarManager) IndexCar ¶ added in v1.4.0
func (cm *CarManager) IndexCar(car *Car) error
IndexCar indexes an individual car.
func (*CarManager) ListCars ¶ added in v1.4.0
func (cm *CarManager) ListCars() (Cars, error)
func (*CarManager) LoadCar ¶ added in v1.4.0
func (cm *CarManager) LoadCar(name string, tyres Tyres) (*Car, error)
LoadCar reads a car from the content folder on the filesystem
func (*CarManager) LoadCarDetailsForTemplate ¶ added in v1.4.0
func (cm *CarManager) LoadCarDetailsForTemplate(carName string) (*carDetailsTemplateVars, error)
LoadCarDetailsForTemplate loads all necessary items to generate the car details template.
func (*CarManager) RandomSkin ¶ added in v1.6.1
func (cm *CarManager) RandomSkin(model string) string
func (*CarManager) ResultsForCar ¶ added in v1.4.0
func (cm *CarManager) ResultsForCar(car string) ([]SessionResults, error)
ResultsForCar finds results for a given car.
func (*CarManager) SaveCarDetails ¶ added in v1.4.0
func (cm *CarManager) SaveCarDetails(carName string, car *Car) error
SaveCarDetails saves a car's details, and indexes that car.
func (*CarManager) Search ¶ added in v1.4.0
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 ¶ added in v1.4.0
func (cm *CarManager) UpdateCarMetadata(carName string, r *http.Request) error
func (*CarManager) UploadSkin ¶ added in v1.4.0
func (cm *CarManager) UploadSkin(carName string, files map[string][]*multipart.FileHeader) error
type CarSetups ¶ added in v1.2.0
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 ¶ added in v1.4.0
type CarSpecs ¶ added in v1.4.0
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 ¶ added in v1.4.0
func (cs CarSpecs) Numeric() CarSpecsNumeric
type CarSpecsNumeric ¶ added in v1.4.0
type CarsHandler ¶ added in v1.4.0
type CarsHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewCarsHandler ¶ added in v1.4.0
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 // 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 // contains filtered or unexported fields }
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 ¶ added in v1.3.0
func (c *Championship) AddEntrantFromSession(potentialEntrant PotentialChampionshipEntrant) (foundFreeEntrantSlot bool, entrant *Entrant, entrantClass *ChampionshipClass, err error)
func (*Championship) AddEntrantInFirstFreeSlot ¶ added in v1.4.2
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 ¶ added in v1.4.2
func (c *Championship) AttachClassIDToResults(results *SessionResults)
func (*Championship) ClassByID ¶ added in v1.3.0
func (c *Championship) ClassByID(id string) (*ChampionshipClass, error)
ClassByID finds a ChampionshipClass by its ID string.
func (*Championship) ClearEntrant ¶ added in v1.3.1
func (c *Championship) ClearEntrant(entrantGUID string)
func (*Championship) EnhanceResults ¶ added in v1.2.0
func (c *Championship) EnhanceResults(results *SessionResults)
EnhanceResults takes a set of SessionResults and attaches Championship information to them.
func (*Championship) EntrantAttendance ¶ added in v1.5.1
func (c *Championship) EntrantAttendance(guid string) int
func (*Championship) EventByID ¶
func (c *Championship) EventByID(id string) (*ChampionshipEvent, error)
EventByID finds a ChampionshipEvent by its ID string.
func (*Championship) FindClassForCarModel ¶
func (c *Championship) FindClassForCarModel(model string) (*ChampionshipClass, error)
func (*Championship) FindLastResultForDriver ¶ added in v1.4.2
func (c *Championship) FindLastResultForDriver(guid string) (out *SessionResult, teamName string)
func (*Championship) GetPlayerSummary ¶ added in v1.1.0
func (c *Championship) GetPlayerSummary(guid string) string
func (*Championship) GetURL ¶ added in v1.5.0
func (c *Championship) GetURL() string
func (*Championship) HasScheduledEvents ¶ added in v1.2.1
func (c *Championship) HasScheduledEvents() bool
func (*Championship) HasTeamNames ¶ added in v1.3.1
func (c *Championship) HasTeamNames() bool
func (*Championship) ImportEvent ¶ added in v1.6.0
func (c *Championship) ImportEvent(eventToImport interface{}) error
func (*Championship) IsMultiClass ¶
func (c *Championship) IsMultiClass() bool
IsMultiClass is true if the Championship has more than one Class
func (*Championship) NumCompletedEvents ¶ added in v1.5.1
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 ¶ added in v1.4.2
func (c *Championship) NumPendingSignUps() int
func (*Championship) Progress ¶
func (c *Championship) Progress() float64
Progress of the Championship as a percentage
func (*Championship) SignUpAvailable ¶ added in v1.5.0
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 ¶ added in v1.5.1
func (c *ChampionshipClass) AssignToFreeEntrantSlot(entrant *Entrant, potentialEntrant PotentialChampionshipEntrant)
func (*ChampionshipClass) AttachEntrantToResult ¶ added in v1.2.0
func (c *ChampionshipClass) AttachEntrantToResult(entrant *Entrant, results *SessionResults)
func (*ChampionshipClass) DriverInClass ¶ added in v1.2.0
func (c *ChampionshipClass) DriverInClass(result *SessionResult) bool
func (*ChampionshipClass) PenaltyForGUID ¶ added in v1.3.0
func (c *ChampionshipClass) PenaltyForGUID(guid string) int
func (*ChampionshipClass) PenaltyForTeam ¶ added in v1.3.0
func (c *ChampionshipClass) PenaltyForTeam(name string) int
func (*ChampionshipClass) ResultsForClass ¶
func (c *ChampionshipClass) ResultsForClass(results []*SessionResult) (filtered []*SessionResult)
func (*ChampionshipClass) Standings ¶
func (c *ChampionshipClass) Standings(inEvents []*ChampionshipEvent) []*ChampionshipStanding
Standings returns the current Driver Standings for the Championship.
func (*ChampionshipClass) StandingsForEvent ¶ added in v1.3.2
func (c *ChampionshipClass) StandingsForEvent(event *ChampionshipEvent) []*ChampionshipStanding
func (*ChampionshipClass) TeamStandings ¶
func (c *ChampionshipClass) TeamStandings(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 ChampionshipEntrantStatus ¶ added in v1.3.0
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 ¶ added in v1.5.1
func DuplicateChampionshipEvent(event *ChampionshipEvent) *ChampionshipEvent
copied an existing ChampionshipEvent but assigns a new ID
func ExtractRaceWeekendSessionsIntoIndividualEvents ¶ added in v1.5.0
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 ¶ added in v1.2.0
func (cr *ChampionshipEvent) Cars(c *Championship) []string
func (*ChampionshipEvent) CombineEntryLists ¶ added in v1.2.0
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 ¶ added in v1.2.1
func (cr *ChampionshipEvent) GetID() uuid.UUID
func (*ChampionshipEvent) GetRaceSetup ¶ added in v1.2.1
func (cr *ChampionshipEvent) GetRaceSetup() CurrentRaceConfig
func (*ChampionshipEvent) GetSummary ¶ added in v1.2.1
func (cr *ChampionshipEvent) GetSummary() string
func (*ChampionshipEvent) GetURL ¶ added in v1.2.1
func (cr *ChampionshipEvent) GetURL() string
func (*ChampionshipEvent) HasSignUpForm ¶ added in v1.4.0
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 ¶ added in v1.5.0
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 ¶ added in v1.3.3
func (cr *ChampionshipEvent) ReadOnlyEntryList() EntryList
type ChampionshipManager ¶
type ChampionshipManager struct { *RaceManager // contains filtered or unexported fields }
func NewChampionshipManager ¶
func NewChampionshipManager(raceManager *RaceManager) *ChampionshipManager
func (*ChampionshipManager) AddEntrantFromSessionData ¶ added in v1.4.0
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 ¶ added in v1.2.1
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 ¶ added in v1.5.3
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) FindNextEventRecurrence ¶ added in v1.5.1
func (cm *ChampionshipManager) FindNextEventRecurrence(event *ChampionshipEvent, start time.Time) time.Time
func (*ChampionshipManager) GetChampionshipAndEvent ¶ added in v1.1.0
func (cm *ChampionshipManager) GetChampionshipAndEvent(championshipID string, eventID string) (*Championship, *ChampionshipEvent, error)
func (*ChampionshipManager) HandleChampionshipSignUp ¶ added in v1.3.0
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 ¶ added in v1.3.0
func (cm *ChampionshipManager) ImportChampionship(jsonData string) (string, error)
func (*ChampionshipManager) ImportEvent ¶ added in v1.2.0
func (*ChampionshipManager) ImportEventSetup ¶ added in v1.6.0
func (cm *ChampionshipManager) ImportEventSetup(championshipID string, eventID string) error
func (*ChampionshipManager) ImportRaceWeekendSetup ¶ added in v1.6.0
func (cm *ChampionshipManager) ImportRaceWeekendSetup(championshipID string, eventID string) error
func (*ChampionshipManager) InitScheduledChampionships ¶ added in v1.4.0
func (cm *ChampionshipManager) InitScheduledChampionships() error
func (*ChampionshipManager) ListAvailableResultsFilesForEvent ¶ added in v1.2.0
func (cm *ChampionshipManager) ListAvailableResultsFilesForEvent(championshipID string, eventID string) (*ChampionshipEvent, []SessionResults, error)
func (*ChampionshipManager) ListChampionships ¶
func (cm *ChampionshipManager) ListChampionships() ([]*Championship, error)
func (*ChampionshipManager) LoadChampionship ¶
func (cm *ChampionshipManager) LoadChampionship(id string) (*Championship, error)
func (*ChampionshipManager) ModifyDriverPenalty ¶ added in v1.3.0
func (cm *ChampionshipManager) ModifyDriverPenalty(championshipID, classID, driverGUID string, action PenaltyAction, penalty int) error
func (*ChampionshipManager) ModifyTeamPenalty ¶ added in v1.3.0
func (cm *ChampionshipManager) ModifyTeamPenalty(championshipID, classID, team string, action PenaltyAction, penalty int) error
func (*ChampionshipManager) ReorderChampionshipEvents ¶ added in v1.5.0
func (cm *ChampionshipManager) ReorderChampionshipEvents(championshipID string, championshipEventIDsInOrder []string) error
func (*ChampionshipManager) RestartActiveEvent ¶ added in v1.2.0
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 ¶ added in v1.1.0
func (*ChampionshipManager) ScheduleNextEventFromRecurrence ¶ added in v1.5.1
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 ¶ added in v1.5.1
func (cm *ChampionshipManager) StartScheduledEvent(championship *Championship, event *ChampionshipEvent) error
func (*ChampionshipManager) StopActiveEvent ¶ added in v1.2.0
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 ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (ce *ChampionshipSession) IsRaceWeekend() bool
type ChampionshipSignUpForm ¶ added in v1.3.0
type ChampionshipSignUpForm struct { Enabled bool AskForEmail bool AskForTeam bool HideCarChoice bool ExtraFields []string RequiresApproval bool Responses []*ChampionshipSignUpResponse }
func (ChampionshipSignUpForm) EmailList ¶ added in v1.3.0
func (c ChampionshipSignUpForm) EmailList(group string) string
type ChampionshipSignUpResponse ¶ added in v1.3.0
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 ¶ added in v1.3.0
func (csr ChampionshipSignUpResponse) GetCar() string
func (ChampionshipSignUpResponse) GetGUID ¶ added in v1.3.0
func (csr ChampionshipSignUpResponse) GetGUID() string
func (ChampionshipSignUpResponse) GetName ¶ added in v1.3.0
func (csr ChampionshipSignUpResponse) GetName() string
func (ChampionshipSignUpResponse) GetSkin ¶ added in v1.3.0
func (csr ChampionshipSignUpResponse) GetSkin() string
func (ChampionshipSignUpResponse) GetTeam ¶ added in v1.3.0
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 ¶ added in v1.2.0
func NewChampionshipStanding(car *SessionCar) *ChampionshipStanding
func (*ChampionshipStanding) AddEventForTeam ¶ added in v1.2.0
func (cs *ChampionshipStanding) AddEventForTeam(team string)
func (*ChampionshipStanding) TeamSummary ¶ added in v1.2.0
func (cs *ChampionshipStanding) TeamSummary() string
type ChampionshipStandingsOrderEntryListSort ¶ added in v1.5.3
type ChampionshipStandingsOrderEntryListSort struct{}
func (ChampionshipStandingsOrderEntryListSort) Sort ¶ added in v1.5.3
func (ChampionshipStandingsOrderEntryListSort) Sort(rw *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
type ChampionshipTemplateVars ¶ added in v1.5.0
type ChampionshipTemplateVars struct { *RaceTemplateVars DefaultPoints ChampionshipPoints DefaultClass *ChampionshipClass ACSREnabled bool }
type ChampionshipsConfig ¶ added in v1.3.0
type ChampionshipsHandler ¶ added in v1.4.0
type ChampionshipsHandler struct { *BaseHandler SteamLoginHandler // contains filtered or unexported fields }
func NewChampionshipsHandler ¶ added in v1.4.0
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 ¶ added in v1.3.3
type CollisionType string
const ( CollisionWithCar CollisionType = "with other car" CollisionWithEnvironment CollisionType = "with environment" )
type CommandPlugin ¶ added in v1.6.1
type CommandPlugin struct { Executable string `yaml:"executable"` Arguments []string `yaml:"arguments"` }
func (*CommandPlugin) String ¶ added in v1.6.1
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"` ACSR ACSRConfig `yaml:"acsr"` Lua LuaConfig `yaml:"lua"` }
func ReadConfig ¶
func ReadConfig(location string) (conf *Configuration, err error)
type ContentFile ¶
type ContentManagerWrapper ¶ added in v1.4.0
type ContentManagerWrapper struct {
// contains filtered or unexported fields
}
func NewContentManagerWrapper ¶ added in v1.4.0
func NewContentManagerWrapper(store Store, carManager *CarManager, trackManager *TrackManager) *ContentManagerWrapper
func (*ContentManagerWrapper) NewCMContent ¶ added in v1.5.3
func (cmw *ContentManagerWrapper) NewCMContent(cars []string, trackName string) (*CMContent, error)
func (*ContentManagerWrapper) ServeHTTP ¶ added in v1.4.0
func (cmw *ContentManagerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ContentManagerWrapper) Start ¶ added in v1.4.0
func (cmw *ContentManagerWrapper) Start(process ServerProcess, servePort int, serverConfig ServerConfig, entryList EntryList, event RaceEvent) error
func (*ContentManagerWrapper) Stop ¶ added in v1.4.0
func (cmw *ContentManagerWrapper) Stop()
func (*ContentManagerWrapper) UDPCallback ¶ added in v1.4.0
func (cmw *ContentManagerWrapper) UDPCallback(message udp.Message)
type ContentManagerWrapperData ¶ added in v1.4.0
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 ¶ added in v1.4.0
type ContentType string
type ContentURL ¶ added in v1.5.3
type ContentURL struct {
URL string `json:"url"`
}
type ContentUploadHandler ¶ added in v1.4.0
type ContentUploadHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewContentUploadHandler ¶ added in v1.4.0
func NewContentUploadHandler(baseHandler *BaseHandler, carManager *CarManager) *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 int `` /* 133-byte string literal not displayed */ TractionControlAllowed int `` /* 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"` 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 int `` /* 173-byte string literal not displayed */ IsSol int `` /* 138-byte string literal not displayed */ 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"` DisableDRSZones 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 ¶ added in v1.5.0
func (c CurrentRaceConfig) GetSession(sessionType SessionType) *SessionConfig
func (CurrentRaceConfig) HasMultipleRaces ¶ added in v1.1.0
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 ¶ added in v1.5.1
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, Loop bool RaceConfig CurrentRaceConfig EntryList EntryList }
func (*CustomRace) EventDescription ¶ added in v1.4.0
func (cr *CustomRace) EventDescription() string
func (*CustomRace) EventName ¶ added in v1.3.0
func (cr *CustomRace) EventName() string
func (*CustomRace) GetEntryList ¶ added in v1.2.1
func (cr *CustomRace) GetEntryList() EntryList
func (*CustomRace) GetID ¶ added in v1.2.1
func (cr *CustomRace) GetID() uuid.UUID
func (*CustomRace) GetRaceConfig ¶ added in v1.5.3
func (cr *CustomRace) GetRaceConfig() CurrentRaceConfig
func (*CustomRace) GetRaceSetup ¶ added in v1.2.1
func (cr *CustomRace) GetRaceSetup() CurrentRaceConfig
func (*CustomRace) GetSummary ¶ added in v1.2.1
func (cr *CustomRace) GetSummary() string
func (*CustomRace) GetURL ¶ added in v1.2.1
func (cr *CustomRace) GetURL() string
func (*CustomRace) HasSignUpForm ¶ added in v1.4.0
func (cr *CustomRace) HasSignUpForm() bool
func (*CustomRace) IsChampionship ¶ added in v1.3.0
func (cr *CustomRace) IsChampionship() bool
func (*CustomRace) IsLooping ¶ added in v1.5.3
func (cr *CustomRace) IsLooping() bool
func (*CustomRace) IsPractice ¶ added in v1.5.3
func (cr *CustomRace) IsPractice() bool
func (*CustomRace) IsRaceWeekend ¶ added in v1.5.0
func (cr *CustomRace) IsRaceWeekend() bool
func (*CustomRace) OverrideServerPassword ¶ added in v1.3.0
func (cr *CustomRace) OverrideServerPassword() bool
func (*CustomRace) ReadOnlyEntryList ¶ added in v1.3.3
func (cr *CustomRace) ReadOnlyEntryList() EntryList
func (*CustomRace) ReplacementServerPassword ¶ added in v1.3.0
func (cr *CustomRace) ReplacementServerPassword() string
type CustomRaceHandler ¶ added in v1.4.0
type CustomRaceHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewCustomRaceHandler ¶ added in v1.4.0
func NewCustomRaceHandler(base *BaseHandler, raceManager *RaceManager) *CustomRaceHandler
type DiscordManager ¶ added in v1.5.0
type DiscordManager struct {
// contains filtered or unexported fields
}
func NewDiscordManager ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (dm *DiscordManager) CommandHandler(s *discordgo.Session, m *discordgo.MessageCreate)
func (*DiscordManager) CommandNotify ¶ added in v1.5.2
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 ¶ added in v1.5.2
func (dm *DiscordManager) CommandSchedule() (string, error)
CommandSchedule outputs an abbreviated list of all scheduled events
func (*DiscordManager) CommandSessions ¶ added in v1.5.2
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 ¶ added in v1.5.0
func (dm *DiscordManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
func (*DiscordManager) SendMessage ¶ added in v1.5.0
func (dm *DiscordManager) SendMessage(msg string) error
SendMessage sends a message to the configured channel and logs any errors
func (*DiscordManager) SendMessageWithLink ¶ added in v1.5.2
SendMessage sends a message to the configured channel and logs any errors
func (*DiscordManager) Stop ¶ added in v1.5.0
func (dm *DiscordManager) Stop() error
type DriverMap ¶ added in v1.3.3
type DriverMap struct { Drivers map[udp.DriverGUID]*RaceControlDriver `json:"Drivers"` GUIDsInPositionalOrder []udp.DriverGUID `json:"GUIDsInPositionalOrder"` // contains filtered or unexported fields }
func NewDriverMap ¶ added in v1.3.3
func NewDriverMap(driverGroup RaceControlDriverGroup, driverSortLessFunc driverSortLessFunc) *DriverMap
func (*DriverMap) Add ¶ added in v1.3.3
func (d *DriverMap) Add(driverGUID udp.DriverGUID, driver *RaceControlDriver)
func (*DriverMap) Del ¶ added in v1.3.3
func (d *DriverMap) Del(driverGUID udp.DriverGUID)
func (*DriverMap) Each ¶ added in v1.3.3
func (d *DriverMap) Each(fn func(driverGUID udp.DriverGUID, driver *RaceControlDriver) error) error
func (*DriverMap) Get ¶ added in v1.3.3
func (d *DriverMap) Get(driverGUID udp.DriverGUID) (*RaceControlDriver, bool)
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 ¶ added in v1.2.0
func NewEntrant() *Entrant
func (*Entrant) AsSessionCar ¶ added in v1.5.0
func (e *Entrant) AsSessionCar() *SessionCar
func (*Entrant) AsSessionResult ¶ added in v1.5.0
func (e *Entrant) AsSessionResult() *SessionResult
func (*Entrant) AssignFromResult ¶ added in v1.5.0
func (e *Entrant) AssignFromResult(result *SessionResult, car *SessionCar)
func (*Entrant) OverwriteProperties ¶ added in v1.2.0
func (*Entrant) SwapProperties ¶ added in v1.4.0
type EntryList ¶
func (EntryList) AddInPitBox ¶ added in v1.5.0
AddInPitBox adds an Entrant in a specific pitbox - overwriting any entrant that was in that pitbox previously.
func (EntryList) AlphaSlice ¶ added in v1.5.0
func (EntryList) CarIDs ¶ added in v1.5.0
CarIDs returns a unique list of car IDs used in the EntryList
func (EntryList) FindEntrantByInternalUUID ¶ added in v1.2.0
func (EntryList) FindGreatestBallast ¶ added in v1.6.0
returns the greatest ballast set on any entrant
func (EntryList) PrettyList ¶ added in v1.2.0
type FilterError ¶ added in v1.5.0
type FilterError string
func (FilterError) Error ¶ added in v1.5.0
func (f FilterError) Error() string
type Form ¶
type Form struct {
// contains filtered or unexported fields
}
func (Form) Fields ¶
func (f Form) Fields() []FormElement
type FormElement ¶
type FormHeader ¶
type FormHeader struct {
Name string
}
func (FormHeader) HTML ¶
func (fh FormHeader) HTML() template.HTML
type FormHeading ¶ added in v1.5.0
type FormHeading string
type FormOption ¶
type FormOption struct { Name string Key string Type string HelpText template.HTML Value interface{} Min, Max string Hidden bool Opts map[string]bool }
func (FormOption) HTML ¶
func (f FormOption) HTML() template.HTML
type GlobalServerConfig ¶
type GlobalServerConfig struct { AssettoCorsaServer FormHeading `ini:"-" json:"-" input:"heading"` Name string `ini:"NAME" help:"Server Name"` Password string `ini:"PASSWORD" input:"password" help:"Server password"` AdminPassword string `` /* 225-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 int `ini:"REGISTER_TO_LOBBY" show:"open" input:"checkbox" 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" max:"100" help:"Percentage that is required for the session vote to pass"` VoteDuration int `ini:"VOTE_DURATION" min:"0" help:"Vote length in seconds"` BlacklistMode int `` /* 294-byte string literal not displayed */ 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:"-"` ServerName FormHeading `ini:"-" json:"-" input:"heading"` ShowRaceNameInServerLobby int `` /* 154-byte string literal not displayed */ ServerNameTemplate string `` /* 442-byte string literal not displayed */ Theme FormHeading `ini:"-" json:"-" input:"heading"` DarkTheme int `ini:"-" input:"checkbox" help:"Enable Server Manager's Dark Theme by default"` CustomCSS string `` /* 212-byte string literal not displayed */ OGImage string `` /* 126-byte string literal not displayed */ ContentManagerIntegration FormHeading `ini:"-" json:"-" input:"heading"` EnableContentManagerWrapper int `` /* 492-byte string literal not displayed */ ContentManagerWrapperPort int `` /* 158-byte string literal not displayed */ ShowContentManagerJoinLink int `` /* 190-byte string literal not displayed */ Miscellaneous FormHeading `ini:"-" json:"-" input:"heading"` UseShortenedDriverNames int `` /* 146-byte string literal not displayed */ FallBackResultsSorting int `` /* 181-byte string literal not displayed */ UseMPH int `ini:"-" input:"checkbox" help:"When on, this option will make Server Manager use MPH instead of Km/h for all speed values."` PreventWebCrawlers int `` /* 195-byte string literal not displayed */ RestartEventOnServerManagerLaunch int `` /* 185-byte string literal not displayed */ // Discord Integration DiscordIntegration FormHeading `ini:"-" json:"-" input:"heading"` 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 `` /* 161-byte string literal not displayed */ NotificationReminderTimers string `` /* 237-byte string literal not displayed */ ShowPasswordInNotifications int `ini:"-" input:"checkbox" help:"Show the server password in race start notifications."` NotifyWhenScheduled int `ini:"-" input:"checkbox" help:"Send a notification when a race is scheduled (or cancelled)."` // Messages ContentManagerWelcomeMessage string `ini:"-" show:"-"` ServerJoinMessage string `ini:"-" show:"-"` }
func (GlobalServerConfig) GetName ¶ added in v1.4.0
func (gsc GlobalServerConfig) GetName() string
type HTTPConfig ¶
type HealthCheck ¶ added in v1.5.3
type HealthCheck struct {
// contains filtered or unexported fields
}
func NewHealthCheck ¶ added in v1.5.3
func NewHealthCheck(raceControl *RaceControl, store Store) *HealthCheck
func (*HealthCheck) ServeHTTP ¶ added in v1.5.3
func (h *HealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HealthCheckResponse ¶ added in v1.5.3
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 EventInProgress bool EventIsCritical bool EventIsChampionship bool EventIsRaceWeekend bool EventIsPractice bool NumConnectedDrivers int MaxClientsOverride int }
type JSONStore ¶ added in v1.2.0
type JSONStore struct {
// contains filtered or unexported fields
}
func (*JSONStore) AddAuditEntry ¶ added in v1.3.3
func (rs *JSONStore) AddAuditEntry(entry *AuditEntry) error
func (*JSONStore) ClearLastRaceEvent ¶ added in v1.5.3
func (*JSONStore) DeleteAccount ¶ added in v1.2.0
func (*JSONStore) DeleteChampionship ¶ added in v1.2.0
func (*JSONStore) DeleteCustomRace ¶ added in v1.2.0
func (rs *JSONStore) DeleteCustomRace(race *CustomRace) error
func (*JSONStore) DeleteEntrant ¶ added in v1.3.1
func (*JSONStore) DeleteRaceWeekend ¶ added in v1.5.0
func (*JSONStore) FindAccountByID ¶ added in v1.2.0
func (*JSONStore) FindAccountByName ¶ added in v1.2.0
func (*JSONStore) FindCustomRaceByID ¶ added in v1.2.0
func (rs *JSONStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
func (*JSONStore) GetAuditEntries ¶ added in v1.3.3
func (rs *JSONStore) GetAuditEntries() ([]*AuditEntry, error)
func (*JSONStore) ListAccounts ¶ added in v1.2.0
func (*JSONStore) ListChampionships ¶ added in v1.2.0
func (rs *JSONStore) ListChampionships() ([]*Championship, error)
func (*JSONStore) ListCustomRaces ¶ added in v1.2.0
func (rs *JSONStore) ListCustomRaces() ([]*CustomRace, error)
func (*JSONStore) ListEntrants ¶ added in v1.2.0
func (*JSONStore) ListPrevFrames ¶ added in v1.2.0
func (*JSONStore) ListRaceWeekends ¶ added in v1.5.0
func (rs *JSONStore) ListRaceWeekends() ([]*RaceWeekend, error)
func (*JSONStore) LoadChampionship ¶ added in v1.2.0
func (rs *JSONStore) LoadChampionship(id string) (*Championship, error)
func (*JSONStore) LoadLastRaceEvent ¶ added in v1.5.3
func (*JSONStore) LoadLiveTimingsData ¶ added in v1.5.3
func (rs *JSONStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
func (*JSONStore) LoadRaceWeekend ¶ added in v1.5.0
func (rs *JSONStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
func (*JSONStore) LoadServerOptions ¶ added in v1.2.0
func (rs *JSONStore) LoadServerOptions() (*GlobalServerConfig, error)
func (*JSONStore) LoadStrackerOptions ¶ added in v1.5.1
func (rs *JSONStore) LoadStrackerOptions() (*StrackerConfiguration, error)
func (*JSONStore) UpsertAccount ¶ added in v1.2.0
func (*JSONStore) UpsertChampionship ¶ added in v1.2.0
func (rs *JSONStore) UpsertChampionship(c *Championship) error
func (*JSONStore) UpsertCustomRace ¶ added in v1.2.0
func (rs *JSONStore) UpsertCustomRace(race *CustomRace) error
func (*JSONStore) UpsertEntrant ¶ added in v1.2.0
func (*JSONStore) UpsertLastRaceEvent ¶ added in v1.5.3
func (*JSONStore) UpsertLiveFrames ¶ added in v1.2.0
func (*JSONStore) UpsertLiveTimingsData ¶ added in v1.5.3
func (rs *JSONStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error
func (*JSONStore) UpsertRaceWeekend ¶ added in v1.5.0
func (rs *JSONStore) UpsertRaceWeekend(rw *RaceWeekend) error
func (*JSONStore) UpsertServerOptions ¶ added in v1.2.0
func (rs *JSONStore) UpsertServerOptions(so *GlobalServerConfig) error
func (*JSONStore) UpsertStrackerOptions ¶ added in v1.5.1
func (rs *JSONStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
type LiveMapConfig ¶ added in v1.1.0
type LiveMapConfig struct {
IntervalMs int `yaml:"refresh_interval_ms"`
}
func (*LiveMapConfig) IsEnabled ¶ added in v1.1.0
func (l *LiveMapConfig) IsEnabled() bool
type LiveTimingsPersistedData ¶ added in v1.5.3
type LiveTimingsPersistedData struct { SessionType udp.SessionType Track string TrackLayout string SessionName string Drivers map[udp.DriverGUID]*RaceControlDriver }
type LuaPlugin ¶ added in v1.6.0
type LuaPlugin struct {
// contains filtered or unexported fields
}
type MonitoringConfig ¶ added in v1.3.0
type MonitoringConfig struct {
Enabled bool `yaml:"enabled"`
}
type NilBroadcaster ¶ added in v1.3.3
type NilBroadcaster struct{}
type NotificationDispatcher ¶ added in v1.5.0
type NotificationDispatcher interface { HasNotificationReminders() bool GetNotificationReminders() []int SendMessage(msg string) error SendMessageWithLink(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 ¶ added in v1.5.0
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 ¶ added in v1.5.0
func NewNotificationManager(discord *DiscordManager, cars *CarManager, store Store) *NotificationManager
func (*NotificationManager) GetCarList ¶ added in v1.5.3
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 ¶ added in v1.5.2
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 ¶ added in v1.5.3
func (nm *NotificationManager) GetTrackInfo(track string, layout string) string
GetTrackInfo returns the track summary with any download link appended
func (*NotificationManager) HasNotificationReminders ¶ added in v1.5.2
func (nm *NotificationManager) HasNotificationReminders() bool
HasNotificationReminders just tells us if we need to do any reminder scheduling
func (*NotificationManager) SaveServerOptions ¶ added in v1.5.0
func (nm *NotificationManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
check to see if any notification handlers need to process option changes
func (*NotificationManager) SendChampionshipReminderMessage ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (nm *NotificationManager) SendMessage(msg string) error
SendMessage sends a message (surprise surprise)
func (*NotificationManager) SendMessageWithLink ¶ added in v1.5.0
func (nm *NotificationManager) SendMessageWithLink(msg string, linkText string, link *url.URL) error
SendMessageWithLink sends a message with an embedded CM join link
func (*NotificationManager) SendRaceCancelledMessage ¶ added in v1.5.2
func (nm *NotificationManager) SendRaceCancelledMessage(event *CustomRace, date time.Time) error
SendRaceCancelledMessage sends a notification when a race is cancelled
func (*NotificationManager) SendRaceReminderMessage ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (nm *NotificationManager) SendRaceScheduledMessage(event *CustomRace, date time.Time) error
SendRaceScheduledMessage sends a notification when a race is scheduled
func (*NotificationManager) SendRaceStartMessage ¶ added in v1.5.0
func (nm *NotificationManager) SendRaceStartMessage(config ServerConfig, event RaceEvent) error
SendRaceStartMessage sends a message as a race session is started
func (*NotificationManager) SendRaceWeekendReminderMessage ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (nm *NotificationManager) Stop() error
type PenaltiesHandler ¶ added in v1.4.0
type PenaltiesHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewPenaltiesHandler ¶ added in v1.4.0
func NewPenaltiesHandler(baseHandler *BaseHandler, championshipManager *ChampionshipManager, raceWeekendManager *RaceWeekendManager) *PenaltiesHandler
type PenaltyAction ¶ added in v1.3.0
type PenaltyAction string
const ( SetPenalty PenaltyAction = "set" RemovePenalty PenaltyAction = "remove" )
type PointsReason ¶ added in v1.5.3
type PointsReason int
const ( PointsEventFinish PointsReason = iota PointsPolePosition PointsFastestLap PointsCollisionWithCar PointsCollisionWithEnvironment PointsCutTrack )
type PotentialChampionshipEntrant ¶ added in v1.3.0
type QuickRace ¶ added in v1.5.0
type QuickRace struct { OverridePassword bool ReplacementPassword string RaceConfig CurrentRaceConfig EntryList EntryList }
func (QuickRace) EventDescription ¶ added in v1.5.0
func (QuickRace) GetEntryList ¶ added in v1.5.3
func (QuickRace) GetRaceConfig ¶ added in v1.5.3
func (q QuickRace) GetRaceConfig() CurrentRaceConfig
func (QuickRace) IsChampionship ¶ added in v1.5.0
func (QuickRace) IsPractice ¶ added in v1.5.3
func (QuickRace) IsRaceWeekend ¶ added in v1.5.0
func (QuickRace) OverrideServerPassword ¶ added in v1.5.0
func (QuickRace) ReplacementServerPassword ¶ added in v1.5.0
type QuickRaceHandler ¶ added in v1.4.0
type QuickRaceHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewQuickRaceHandler ¶ added in v1.4.0
func NewQuickRaceHandler(baseHandler *BaseHandler, raceManager *RaceManager) *QuickRaceHandler
type RaceControl ¶ added in v1.3.3
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"` ConnectedDrivers *DriverMap `json:"ConnectedDrivers"` DisconnectedDrivers *DriverMap `json:"DisconnectedDrivers"` CarIDToGUID map[udp.CarID]udp.DriverGUID `json:"CarIDToGUID"` // contains filtered or unexported fields }
func NewRaceControl ¶ added in v1.3.3
func NewRaceControl(broadcaster Broadcaster, trackDataGateway TrackDataGateway, process ServerProcess, store Store) *RaceControl
func (*RaceControl) AllLapTimes ¶ added in v1.5.3
func (rc *RaceControl) AllLapTimes() map[udp.DriverGUID]*RaceControlDriver
func (*RaceControl) Event ¶ added in v1.3.3
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) OnCarUpdate ¶ added in v1.3.3
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) OnClientConnect ¶ added in v1.3.3
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 ¶ added in v1.3.3
func (rc *RaceControl) OnClientDisconnect(client udp.SessionCarInfo) error
OnClientDisconnect moves a client from ConnectedDrivers to DisconnectedDrivers.
func (*RaceControl) OnClientLoaded ¶ added in v1.3.3
func (rc *RaceControl) OnClientLoaded(loadedCar udp.ClientLoaded) error
OnClientLoaded marks a connected client as having loaded in.
func (*RaceControl) OnCollisionWithCar ¶ added in v1.3.3
func (rc *RaceControl) OnCollisionWithCar(collision udp.CollisionWithCar) error
OnCollisionWithCar registers a driver's collision with another car.
func (*RaceControl) OnCollisionWithEnvironment ¶ added in v1.3.3
func (rc *RaceControl) OnCollisionWithEnvironment(collision udp.CollisionWithEnvironment) error
OnCollisionWithEnvironment registers a driver's collision with the environment.
func (*RaceControl) OnEndSession ¶ added in v1.3.3
func (rc *RaceControl) OnEndSession(sessionFile udp.EndSession) error
OnEndSession is called at the end of every session.
func (*RaceControl) OnLapCompleted ¶ added in v1.3.3
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 ¶ added in v1.3.3
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 ¶ added in v1.3.3
func (rc *RaceControl) OnSessionUpdate(sessionInfo udp.SessionInfo) (bool, error)
OnSessionUpdate is called every sessionRequestInterval.
func (*RaceControl) OnVersion ¶ added in v1.3.3
func (rc *RaceControl) OnVersion(version udp.Version) error
OnVersion occurs when the Assetto Corsa Server starts up for the first time.
func (*RaceControl) SortDrivers ¶ added in v1.3.3
func (rc *RaceControl) SortDrivers(driverGroup RaceControlDriverGroup, driverA, driverB *RaceControlDriver) bool
func (*RaceControl) UDPCallback ¶ added in v1.3.3
func (rc *RaceControl) UDPCallback(message udp.Message)
type RaceControlCarLapInfo ¶ added in v1.3.3
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"` }
type RaceControlDriver ¶ added in v1.3.3
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"` }
func NewRaceControlDriver ¶ added in v1.3.3
func NewRaceControlDriver(carInfo udp.SessionCarInfo) *RaceControlDriver
func (*RaceControlDriver) CurrentCar ¶ added in v1.3.3
func (rcd *RaceControlDriver) CurrentCar() *RaceControlCarLapInfo
type RaceControlDriverGroup ¶ added in v1.3.3
type RaceControlDriverGroup int
const ( ConnectedDrivers RaceControlDriverGroup = 0 DisconnectedDrivers RaceControlDriverGroup = 1 )
type RaceControlHandler ¶ added in v1.4.0
type RaceControlHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewRaceControlHandler ¶ added in v1.4.0
func NewRaceControlHandler(baseHandler *BaseHandler, store Store, raceManager *RaceManager, raceControl *RaceControl, raceControlHub *RaceControlHub, serverProcess ServerProcess) *RaceControlHandler
type RaceControlHub ¶ added in v1.4.0
type RaceControlHub struct {
// contains filtered or unexported fields
}
type RaceManager ¶
type RaceManager struct {
// contains filtered or unexported fields
}
func NewRaceManager ¶
func NewRaceManager( store Store, process ServerProcess, carManager *CarManager, trackManager *TrackManager, notificationManager NotificationDispatcher, ) *RaceManager
func (*RaceManager) BuildCustomRaceFromForm ¶
func (rm *RaceManager) BuildCustomRaceFromForm(r *http.Request) (*CurrentRaceConfig, error)
func (*RaceManager) BuildEntryList ¶
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 ¶ added in v1.4.0
func (rm *RaceManager) FindNextRecurrence(race *CustomRace, start time.Time) time.Time
func (*RaceManager) InitScheduledRaces ¶ added in v1.4.0
func (rm *RaceManager) InitScheduledRaces() error
func (*RaceManager) ListAutoFillEntrants ¶ added in v1.3.2
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
func (rm *RaceManager) LoopRaces()
func (*RaceManager) RescheduleNotifications ¶ added in v1.5.0
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, ) (*CustomRace, error)
func (*RaceManager) SaveEntrantsForAutoFill ¶ added in v1.2.0
func (rm *RaceManager) SaveEntrantsForAutoFill(entryList EntryList) error
func (*RaceManager) SaveServerOptions ¶
func (rm *RaceManager) SaveServerOptions(newServerOpts *GlobalServerConfig) error
func (*RaceManager) ScheduleNextFromRecurrence ¶ added in v1.4.0
func (rm *RaceManager) ScheduleNextFromRecurrence(race *CustomRace) error
func (*RaceManager) ScheduleRace ¶ added in v1.1.0
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) error
func (*RaceManager) StartScheduledRace ¶ added in v1.4.0
func (rm *RaceManager) StartScheduledRace(race *CustomRace) error
func (*RaceManager) ToggleLoopCustomRace ¶
func (rm *RaceManager) ToggleLoopCustomRace(uuid string) error
func (*RaceManager) ToggleStarCustomRace ¶
func (rm *RaceManager) ToggleStarCustomRace(uuid string) error
type RaceTemplateVars ¶ added in v1.5.0
type RaceTemplateVars struct { BaseTemplateVars CarOpts Cars TrackOpts []Track 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 IsChampionship bool Championship *Championship ChampionshipHasAtLeastOnceRace bool IsRaceWeekend bool RaceWeekend *RaceWeekend RaceWeekendSession *RaceWeekendSession RaceWeekendHasAtLeastOneSession bool ShowOverridePasswordCard bool }
type RaceWeekend ¶ added in v1.5.0
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:"-"` }
RaceWeekends are a collection of sessions, where one session influences the EntryList of the next.
func NewRaceWeekend ¶ added in v1.5.0
func NewRaceWeekend() *RaceWeekend
NewRaceWeekend creates a RaceWeekend
func (*RaceWeekend) AddFilter ¶ added in v1.5.0
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 ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (rw *RaceWeekend) Completed() bool
func (*RaceWeekend) DelSession ¶ added in v1.5.0
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) EnhanceResults ¶ added in v1.5.0
func (rw *RaceWeekend) EnhanceResults(results *SessionResults)
EnhanceResults takes a set of SessionResults and attaches Championship information to them.
func (*RaceWeekend) FindChildren ¶ added in v1.5.0
func (rw *RaceWeekend) FindChildren(parentID string) []*RaceWeekendSession
func (*RaceWeekend) FindSessionByID ¶ added in v1.5.0
func (rw *RaceWeekend) FindSessionByID(id string) (*RaceWeekendSession, error)
FindSessionByID finds a RaceWeekendSession by its unique identifier
func (*RaceWeekend) FindTotalNumParents ¶ added in v1.5.0
func (rw *RaceWeekend) FindTotalNumParents(session *RaceWeekendSession) int
FindTotalNumParents recursively finds all parents for a given session, including their parents etc...
func (*RaceWeekend) GetEntryList ¶ added in v1.5.0
func (rw *RaceWeekend) GetEntryList() EntryList
func (*RaceWeekend) GetFilter ¶ added in v1.5.0
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 ¶ added in v1.5.0
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) HasLinkedChampionship ¶ added in v1.5.0
func (rw *RaceWeekend) HasLinkedChampionship() bool
func (*RaceWeekend) HasParentRecursive ¶ added in v1.5.0
func (rw *RaceWeekend) HasParentRecursive(session *RaceWeekendSession, otherSessionID string) bool
HasParentRecursive looks for otherSessionID in session's parents, grandparents, etc...
func (*RaceWeekend) HasTeamNames ¶ added in v1.5.0
func (rw *RaceWeekend) HasTeamNames() bool
HasTeamNames indicates whether a RaceWeekend entrylist has team names in it
func (*RaceWeekend) InProgress ¶ added in v1.5.0
func (rw *RaceWeekend) InProgress() bool
func (*RaceWeekend) Progress ¶ added in v1.5.0
func (rw *RaceWeekend) Progress() float64
Progress indicates how far (0 -> 1) a RaceWeekend has progressed.
func (*RaceWeekend) RemoveFilter ¶ added in v1.5.0
func (rw *RaceWeekend) RemoveFilter(parentID, childID string)
RemoveFilter removes the link between parent and child
func (*RaceWeekend) SessionCanBeRun ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (rw *RaceWeekend) SortedSessions() []*RaceWeekendSession
SortedSessions returns the RaceWeekendSessions in order by the number of parents the sessions have.
func (*RaceWeekend) TrackOverview ¶ added in v1.5.0
func (rw *RaceWeekend) TrackOverview() string
type RaceWeekendEntryList ¶ added in v1.5.0
type RaceWeekendEntryList []*RaceWeekendSessionEntrant
A RaceWeekendEntryList is a collection of RaceWeekendSessionEntrants
func EntryListToRaceWeekendEntryList ¶ added in v1.5.0
func EntryListToRaceWeekendEntryList(e EntryList, sessionID uuid.UUID) RaceWeekendEntryList
EntryListToRaceWeekendEntryList converts an EntryList to a RaceWeekendEntryList for a given RaceWeekendSession
func (*RaceWeekendEntryList) Add ¶ added in v1.5.0
func (e *RaceWeekendEntryList) Add(entrant *RaceWeekendSessionEntrant)
Add an Entrant to the EntryList
func (*RaceWeekendEntryList) AddInPitBox ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (e RaceWeekendEntryList) AsEntryList() EntryList
AsEntryList returns a RaceWeekendEntryList as an EntryList
func (*RaceWeekendEntryList) Delete ¶ added in v1.5.0
func (e *RaceWeekendEntryList) Delete(entrant *RaceWeekendSessionEntrant)
Remove an Entrant from the EntryList
func (*RaceWeekendEntryList) Sorted ¶ added in v1.5.0
func (e *RaceWeekendEntryList) Sorted() []*RaceWeekendSessionEntrant
Sorted returns the RaceWeekendEntryList ordered by Entrant PitBoxes
type RaceWeekendEntryListSortFunc ¶ added in v1.5.3
type RaceWeekendEntryListSortFunc func(*RaceWeekend, *RaceWeekendSession, []*RaceWeekendSessionEntrant, *RaceWeekendSessionToSessionFilter) error
func (RaceWeekendEntryListSortFunc) Sort ¶ added in v1.5.3
func (rwelsf RaceWeekendEntryListSortFunc) Sort(rw *RaceWeekend, rws *RaceWeekendSession, rwes []*RaceWeekendSessionEntrant, rwsf *RaceWeekendSessionToSessionFilter) error
type RaceWeekendEntryListSorter ¶ added in v1.5.0
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 ¶ added in v1.5.0
func GetRaceWeekendEntryListSort(key string) RaceWeekendEntryListSorter
func PerClassSort ¶ added in v1.5.0
func PerClassSort(sorter RaceWeekendEntryListSorter) RaceWeekendEntryListSorter
type RaceWeekendEntryListSorterDescription ¶ added in v1.5.0
type RaceWeekendEntryListSorterDescription struct { Name string Key string Sorter RaceWeekendEntryListSorter NeedsParentSession bool ShowInManageEntryList bool }
type RaceWeekendGridPreview ¶ added in v1.5.0
type RaceWeekendGridPreview struct { Results map[int]SessionPreviewEntrant Grid map[int]SessionPreviewEntrant Classes map[string]string }
func NewRaceWeekendGridPreview ¶ added in v1.5.0
func NewRaceWeekendGridPreview() *RaceWeekendGridPreview
type RaceWeekendHandler ¶ added in v1.5.0
type RaceWeekendHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewRaceWeekendHandler ¶ added in v1.5.0
func NewRaceWeekendHandler(baseHandler *BaseHandler, raceWeekendManager *RaceWeekendManager) *RaceWeekendHandler
type RaceWeekendManager ¶ added in v1.5.0
type RaceWeekendManager struct {
// contains filtered or unexported fields
}
func NewRaceWeekendManager ¶ added in v1.5.0
func NewRaceWeekendManager(raceManager *RaceManager, championshipManager *ChampionshipManager, store Store, process ServerProcess, notificationManager NotificationDispatcher) *RaceWeekendManager
func (*RaceWeekendManager) BuildRaceWeekendSessionOpts ¶ added in v1.5.0
func (rwm *RaceWeekendManager) BuildRaceWeekendSessionOpts(r *http.Request) (*RaceTemplateVars, error)
func (*RaceWeekendManager) BuildRaceWeekendTemplateOpts ¶ added in v1.5.0
func (rwm *RaceWeekendManager) BuildRaceWeekendTemplateOpts(r *http.Request) (*RaceTemplateVars, error)
func (*RaceWeekendManager) CancelSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) CancelSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) ClearLockedTyreSetups ¶ added in v1.5.1
func (rwm *RaceWeekendManager) ClearLockedTyreSetups(raceWeekend *RaceWeekend, session *RaceWeekendSession) error
func (*RaceWeekendManager) DeScheduleSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) DeScheduleSession(raceWeekendID, sessionID string) error
func (*RaceWeekendManager) DeleteRaceWeekend ¶ added in v1.5.0
func (rwm *RaceWeekendManager) DeleteRaceWeekend(id string) error
func (*RaceWeekendManager) DeleteSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) DeleteSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) FindConnectedSessions ¶ added in v1.5.0
func (rwm *RaceWeekendManager) FindConnectedSessions(raceWeekendID, parentSessionID, childSessionID string) (*RaceWeekend, *RaceWeekendSession, *RaceWeekendSession, error)
func (*RaceWeekendManager) FindSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) FindSession(raceWeekendID, sessionID string) (*RaceWeekend, *RaceWeekendSession, error)
func (*RaceWeekendManager) ImportRaceWeekend ¶ added in v1.5.0
func (rwm *RaceWeekendManager) ImportRaceWeekend(data string) (string, error)
func (*RaceWeekendManager) ImportSession ¶ added in v1.5.0
func (*RaceWeekendManager) ListAvailableResultsFilesForSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSession(raceWeekendID string, raceWeekendSessionID string) (*RaceWeekendSession, []SessionResults, error)
func (*RaceWeekendManager) ListAvailableResultsFilesForSorting ¶ added in v1.6.0
func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSorting(raceWeekend *RaceWeekend, session *RaceWeekendSession) ([]SessionResults, error)
func (*RaceWeekendManager) ListRaceWeekends ¶ added in v1.5.0
func (rwm *RaceWeekendManager) ListRaceWeekends() ([]*RaceWeekend, error)
func (*RaceWeekendManager) LoadRaceWeekend ¶ added in v1.5.0
func (rwm *RaceWeekendManager) LoadRaceWeekend(id string) (*RaceWeekend, error)
func (*RaceWeekendManager) PreviewGrid ¶ added in v1.5.0
func (rwm *RaceWeekendManager) PreviewGrid(raceWeekendID, parentSessionID, childSessionID string, filter *RaceWeekendSessionToSessionFilter) (*RaceWeekendGridPreview, error)
func (*RaceWeekendManager) PreviewSessionEntryList ¶ added in v1.5.0
func (rwm *RaceWeekendManager) PreviewSessionEntryList(raceWeekendID, sessionID, sortType string, reverseGrid int) (*RaceWeekendGridPreview, error)
func (*RaceWeekendManager) RaceWeekendSessionIsRunning ¶ added in v1.5.3
func (rwm *RaceWeekendManager) RaceWeekendSessionIsRunning() bool
func (*RaceWeekendManager) RestartActiveSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) RestartActiveSession() error
func (*RaceWeekendManager) RestartSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) RestartSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) SaveRaceWeekend ¶ added in v1.5.0
func (rwm *RaceWeekendManager) SaveRaceWeekend(r *http.Request) (raceWeekend *RaceWeekend, edited bool, err error)
func (*RaceWeekendManager) SaveRaceWeekendSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) SaveRaceWeekendSession(r *http.Request) (raceWeekend *RaceWeekend, session *RaceWeekendSession, edited bool, err error)
func (*RaceWeekendManager) ScheduleSession ¶ added in v1.5.0
func (*RaceWeekendManager) StartPracticeSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) StartPracticeSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) StartSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) StartSession(raceWeekendID string, raceWeekendSessionID string, isPracticeSession bool) error
func (*RaceWeekendManager) StopActiveSession ¶ added in v1.5.0
func (rwm *RaceWeekendManager) StopActiveSession() error
func (*RaceWeekendManager) UDPCallback ¶ added in v1.5.0
func (rwm *RaceWeekendManager) UDPCallback(message udp.Message)
func (*RaceWeekendManager) UpdateGrid ¶ added in v1.5.0
func (rwm *RaceWeekendManager) UpdateGrid(raceWeekendID, parentSessionID, childSessionID string, filter *RaceWeekendSessionToSessionFilter) error
func (*RaceWeekendManager) UpdateSessionSorting ¶ added in v1.5.0
func (rwm *RaceWeekendManager) UpdateSessionSorting(raceWeekendID, sessionID string, sortType string, numEntrantsToReverse int) error
func (*RaceWeekendManager) UpsertRaceWeekend ¶ added in v1.5.0
func (rwm *RaceWeekendManager) UpsertRaceWeekend(raceWeekend *RaceWeekend) error
func (*RaceWeekendManager) WatchForScheduledSessions ¶ added in v1.5.0
func (rwm *RaceWeekendManager) WatchForScheduledSessions() error
type RaceWeekendSession ¶ added in v1.5.0
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 string 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 ¶ added in v1.5.0
func NewRaceWeekendSession() *RaceWeekendSession
NewRaceWeekendSession creates an empty RaceWeekendSession
func (*RaceWeekendSession) ClearRecurrenceRule ¶ added in v1.5.0
func (rws *RaceWeekendSession) ClearRecurrenceRule()
func (*RaceWeekendSession) Completed ¶ added in v1.5.0
func (rws *RaceWeekendSession) Completed() bool
Completed RaceWeekendSessions have a non-zero CompletedTime
func (*RaceWeekendSession) FinishingGrid ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (rws *RaceWeekendSession) GetID() uuid.UUID
func (*RaceWeekendSession) GetRaceSetup ¶ added in v1.5.0
func (rws *RaceWeekendSession) GetRaceSetup() CurrentRaceConfig
func (*RaceWeekendSession) GetRaceWeekendEntryList ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (rws *RaceWeekendSession) GetRecurrenceRule() (*rrule.RRule, error)
func (*RaceWeekendSession) GetScheduledTime ¶ added in v1.5.0
func (rws *RaceWeekendSession) GetScheduledTime() time.Time
func (*RaceWeekendSession) GetSummary ¶ added in v1.5.0
func (rws *RaceWeekendSession) GetSummary() string
func (*RaceWeekendSession) GetURL ¶ added in v1.5.0
func (rws *RaceWeekendSession) GetURL() string
func (*RaceWeekendSession) HasParent ¶ added in v1.5.0
func (rws *RaceWeekendSession) HasParent(id string) bool
HasParent determines if a RaceWeekendSession has a parent with id
func (*RaceWeekendSession) HasRecurrenceRule ¶ added in v1.5.0
func (rws *RaceWeekendSession) HasRecurrenceRule() bool
func (*RaceWeekendSession) HasSignUpForm ¶ added in v1.5.0
func (rws *RaceWeekendSession) HasSignUpForm() bool
func (*RaceWeekendSession) InProgress ¶ added in v1.5.0
func (rws *RaceWeekendSession) InProgress() bool
InProgress indicates whether a RaceWeekendSession has been started but not stopped
func (*RaceWeekendSession) IsBase ¶ added in v1.5.0
func (rws *RaceWeekendSession) IsBase() bool
IsBase indicates that a RaceWeekendSession has no parent
func (*RaceWeekendSession) Name ¶ added in v1.5.0
func (rws *RaceWeekendSession) Name() string
Name of the RaceWeekendSession
func (*RaceWeekendSession) ParentsDataAttr ¶ added in v1.5.0
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 ¶ added in v1.5.0
func (rws *RaceWeekendSession) ReadOnlyEntryList() EntryList
func (*RaceWeekendSession) RemoveParent ¶ added in v1.5.0
func (rws *RaceWeekendSession) RemoveParent(parentID string)
RemoveParent removes a parent RaceWeekendSession from this session
func (*RaceWeekendSession) SessionInfo ¶ added in v1.5.0
func (rws *RaceWeekendSession) SessionInfo() *SessionConfig
SessionInfo returns the information about the Assetto Corsa Session (i.e. practice, qualifying, race)
func (*RaceWeekendSession) SessionType ¶ added in v1.5.0
func (rws *RaceWeekendSession) SessionType() SessionType
SessionType returns the type of the RaceWeekendSession (practice, qualifying, race)
func (*RaceWeekendSession) SetRecurrenceRule ¶ added in v1.5.0
func (rws *RaceWeekendSession) SetRecurrenceRule(input string) error
type RaceWeekendSessionEntrant ¶ added in v1.5.0
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 overriden setup for a Race Weekend OverrideSetupFile string }
A RaceWeekendSessionEntrant is someone who has entered at least one RaceWeekend event.
func NewRaceWeekendSessionEntrant ¶ added in v1.5.0
func NewRaceWeekendSessionEntrant(previousSessionID uuid.UUID, car *SessionCar, entrantResult *SessionResult, sessionResults *SessionResults) *RaceWeekendSessionEntrant
NewRaceWeekendSessionEntrant creates a RaceWeekendSessionEntrant
func (*RaceWeekendSessionEntrant) ChampionshipClass ¶ added in v1.5.0
func (se *RaceWeekendSessionEntrant) ChampionshipClass(raceWeekend *RaceWeekend) *ChampionshipClass
func (*RaceWeekendSessionEntrant) GetEntrant ¶ added in v1.5.0
func (se *RaceWeekendSessionEntrant) GetEntrant() *Entrant
GetEntrant returns the RaceWeekendSessionEntrant as an EntryList Entrant (used for building the final entry_list.ini)
type RaceWeekendSessionToSessionFilter ¶ added in v1.5.0
type RaceWeekendSessionToSessionFilter struct { IsPreview bool ResultStart int ResultEnd int NumEntrantsToReverse int EntryListStart int SortType string ForceUseTyreFromFastestLap bool AvailableResultsForSorting []string }
func (RaceWeekendSessionToSessionFilter) Filter ¶ added in v1.5.0
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 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 ¶ added in v1.5.0
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 ¶ added in v1.5.0
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 ¶ added in v1.4.0
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶ added in v1.4.0
func NewResolver(templateLoader TemplateLoader, reloadTemplates bool, store Store) (*Resolver, error)
func (*Resolver) ResolveRouter ¶ added in v1.4.0
func (r *Resolver) ResolveRouter(fs http.FileSystem) http.Handler
func (*Resolver) ResolveStore ¶ added in v1.4.0
func (*Resolver) UDPCallback ¶ added in v1.4.0
type ResultsHandler ¶ added in v1.4.0
type ResultsHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewResultsHandler ¶ added in v1.4.0
func NewResultsHandler(baseHandler *BaseHandler, store Store) *ResultsHandler
type ScheduledEvent ¶ added in v1.2.1
type ScheduledEvent interface { GetID() uuid.UUID 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 ¶ added in v1.5.1
type ScheduledEventBase struct { Scheduled time.Time ScheduledInitial time.Time Recurrence string ScheduledServerID string }
func (*ScheduledEventBase) ClearRecurrenceRule ¶ added in v1.5.1
func (seb *ScheduledEventBase) ClearRecurrenceRule()
func (*ScheduledEventBase) GetRecurrenceRule ¶ added in v1.5.1
func (seb *ScheduledEventBase) GetRecurrenceRule() (*rrule.RRule, error)
func (*ScheduledEventBase) GetScheduledTime ¶ added in v1.5.1
func (seb *ScheduledEventBase) GetScheduledTime() time.Time
func (*ScheduledEventBase) HasRecurrenceRule ¶ added in v1.5.1
func (seb *ScheduledEventBase) HasRecurrenceRule() bool
func (*ScheduledEventBase) SetRecurrenceRule ¶ added in v1.5.1
func (seb *ScheduledEventBase) SetRecurrenceRule(input string) error
type ScheduledRacesHandler ¶ added in v1.4.0
type ScheduledRacesHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewScheduledRacesHandler ¶ added in v1.4.0
func NewScheduledRacesHandler(baseHandler *BaseHandler, scheduledRacesManager *ScheduledRacesManager) *ScheduledRacesHandler
type ScheduledRacesManager ¶ added in v1.5.0
type ScheduledRacesManager struct {
// contains filtered or unexported fields
}
func NewScheduledRacesManager ¶ added in v1.5.0
func NewScheduledRacesManager(store Store) *ScheduledRacesManager
type ServerAccountOptions ¶ added in v1.2.0
type ServerAccountOptions struct {
IsOpen bool
}
type ServerAdministrationHandler ¶ added in v1.4.0
type ServerAdministrationHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewServerAdministrationHandler ¶ added in v1.4.0
func NewServerAdministrationHandler( baseHandler *BaseHandler, store Store, raceManager *RaceManager, championshipManager *ChampionshipManager, raceWeekendManager *RaceWeekendManager, process ServerProcess, ) *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) Write ¶
func (sc ServerConfig) Write() error
type ServerExtraConfig ¶ added in v1.1.2
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"` // Deprecated; use Plugins instead RunOnStart []string `yaml:"run_on_start"` }
type ServerProcess ¶
type ServerProcess interface { Logs() string Start(cfg ServerConfig, entryList EntryList, forwardingAddress string, forwardListenPort int, event RaceEvent) error Stop() error Restart() error IsRunning() bool Event() RaceEvent UDPCallback(message udp.Message) SendUDPMessage(message udp.Message) error GetServerConfig() ServerConfig Done() <-chan struct{} }
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 ¶ added in v1.3.0
func (c *SessionCar) GetCar() string
func (*SessionCar) GetGUID ¶ added in v1.3.0
func (c *SessionCar) GetGUID() string
func (*SessionCar) GetName ¶ added in v1.3.0
func (c *SessionCar) GetName() string
func (*SessionCar) GetSkin ¶ added in v1.3.0
func (c *SessionCar) GetSkin() string
func (*SessionCar) GetTeam ¶ added in v1.3.0
func (c *SessionCar) GetTeam() string
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 int `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 ¶ added in v1.2.0
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) GetLapTime ¶
func (sl *SessionLap) GetLapTime() time.Duration
type SessionPos ¶
type SessionPreviewEntrant ¶ added in v1.5.0
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 ¶ added in v1.3.2
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 ¶ added in v1.2.0
func ListAllResults() ([]SessionResults, error)
func LoadResult ¶
func LoadResult(fileName string) (*SessionResults, error)
func (*SessionResults) Anonymize ¶ added in v1.5.0
func (s *SessionResults) Anonymize()
func (*SessionResults) DriversHaveTeams ¶ added in v1.3.3
func (s *SessionResults) DriversHaveTeams() bool
func (*SessionResults) FallBackSort ¶ added in v1.4.0
func (s *SessionResults) FallBackSort()
func (*SessionResults) FastestLap ¶
func (s *SessionResults) FastestLap() *SessionLap
func (*SessionResults) FastestLapInClass ¶ added in v1.4.2
func (s *SessionResults) FastestLapInClass(classID uuid.UUID) *SessionLap
func (*SessionResults) FindCarByGUIDAndModel ¶ added in v1.5.0
func (s *SessionResults) FindCarByGUIDAndModel(guid, model string) (*SessionCar, error)
func (*SessionResults) GetAverageLapTime ¶
func (s *SessionResults) GetAverageLapTime(guid, model string) time.Duration
func (*SessionResults) GetConsistency ¶ added in v1.5.0
func (s *SessionResults) GetConsistency(guid, model string) float64
func (*SessionResults) GetCrashes ¶
func (s *SessionResults) GetCrashes(guid string) int
func (*SessionResults) GetCrashesOfType ¶ added in v1.5.1
func (s *SessionResults) GetCrashesOfType(guid, collisionType string) int
func (*SessionResults) GetCuts ¶
func (s *SessionResults) GetCuts(driverGuid, model string) int
func (*SessionResults) GetDate ¶
func (s *SessionResults) GetDate() string
func (*SessionResults) GetDriverPosition ¶ added in v1.5.0
func (s *SessionResults) GetDriverPosition(driverGuid, model string) int
func (*SessionResults) GetDrivers ¶
func (s *SessionResults) GetDrivers() string
func (*SessionResults) GetDriversFastestLap ¶ added in v1.5.0
func (s *SessionResults) GetDriversFastestLap(guid, model string) *SessionLap
func (*SessionResults) GetLastLapPos ¶ added in v1.4.0
func (s *SessionResults) GetLastLapPos(driverGuid, model string) int
func (*SessionResults) GetLastLapTime ¶
func (s *SessionResults) GetLastLapTime(driverGuid, model string) time.Duration
func (*SessionResults) GetNumLaps ¶ added in v1.5.0
func (s *SessionResults) GetNumLaps(driverGUID, model string) int
func (*SessionResults) GetNumSectors ¶
func (s *SessionResults) GetNumSectors() []int
func (*SessionResults) GetOverallAverageLapTime ¶ added in v1.5.0
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 ¶ added in v1.6.0
func (s *SessionResults) GetPotentialLap(driverGUID, model string) time.Duration
func (*SessionResults) GetTeamName ¶
func (s *SessionResults) GetTeamName(driverGUID string) string
func (*SessionResults) GetURL ¶ added in v1.3.0
func (s *SessionResults) GetURL() string
func (*SessionResults) HasHandicaps ¶ added in v1.6.0
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) MaskDriverNames ¶ added in v1.3.0
func (s *SessionResults) MaskDriverNames()
func (*SessionResults) RenameDriver ¶ added in v1.4.2
func (s *SessionResults) RenameDriver(guid, newName string)
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 ¶ added in v1.5.0
func (s SessionType) OriginalString() string
func (SessionType) String ¶
func (s SessionType) String() string
type Sessions ¶ added in v1.2.1
type Sessions map[SessionType]*SessionConfig
func (Sessions) AsSlice ¶ added in v1.2.1
func (s Sessions) AsSlice() []*SessionConfig
type ShouldBeAnInt ¶ added in v1.4.0
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 ¶ added in v1.4.0
func (i *ShouldBeAnInt) UnmarshalJSON(b []byte) error
type SteamConfig ¶
type SteamLoginHandler ¶ added in v1.5.1
type SteamLoginHandler struct{}
type Store ¶ added in v1.2.0
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) }
func NewBoltStore ¶ added in v1.2.0
func NewJSONStore ¶ added in v1.2.0
type StoreConfig ¶
func (*StoreConfig) BuildStore ¶
func (s *StoreConfig) BuildStore() (Store, error)
type StrackerACPlugin ¶ added in v1.5.1
type StrackerACPlugin struct { AssettoCorsaPlugin FormHeading `ini:"-" show:"open" input:"heading"` 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 ¶ added in v1.5.1
type StrackerConfiguration struct { EnableStracker bool `ini:"-" help:"Turn Stracker on or off"` InstanceConfiguration StrackerInstanceConfiguration `ini:"STRACKER_CONFIG"` SwearFilter StrackerSwearFilter `ini:"SWEAR_FILTER"` SessionManagement StrackerSessionManagement `ini:"SESSION_MANAGEMENT"` Messages StrackerMessages `ini:"MESSAGES"` Database StrackerDatabase `ini:"DATABASE"` DatabaseCompression StrackerDatabaseCompression `ini:"DB_COMPRESSION"` HTTPConfiguration StrackerHTTPConfiguration `ini:"HTTP_CONFIG"` WelcomeMessage StrackerWelcomeMessage `ini:"WELCOME_MSG"` ACPlugin StrackerACPlugin `ini:"ACPLUGIN"` LapValidChecks StrackerLapValidChecks `ini:"LAP_VALID_CHECKS"` }
func DefaultStrackerIni ¶ added in v1.5.1
func DefaultStrackerIni() *StrackerConfiguration
func (*StrackerConfiguration) Write ¶ added in v1.5.1
func (stc *StrackerConfiguration) Write() error
type StrackerDatabase ¶ added in v1.5.1
type StrackerDatabase struct { Database FormHeading `ini:"-" show:"open" input:"heading"` 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 ¶ added in v1.5.1
type StrackerDatabaseCompression struct { DatabaseCompression FormHeading `ini:"-" show:"open" input:"heading"` Interval int `ini:"interval" show:"open" help:"Interval of database compression in minutes"` Mode string `` /* 246-byte string literal not displayed */ NeedsEmptyServer int `` /* 139-byte string literal not displayed */ }
type StrackerHTTPConfiguration ¶ added in v1.5.1
type StrackerHTTPConfiguration struct { HTTPConfiguration FormHeading `ini:"-" input:"heading"` 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"` AdminUsername string `ini:"admin_username" help:"Username for the stracker admin pages. Leaving empty results in disabled admin pages"` AdminPassword string `` /* 129-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 */ 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 ¶ added in v1.5.1
type StrackerHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewStrackerHandler ¶ added in v1.5.1
func NewStrackerHandler(baseHandler *BaseHandler, store Store) *StrackerHandler
type StrackerInstanceConfiguration ¶ added in v1.5.1
type StrackerInstanceConfiguration struct { InstanceConfiguration FormHeading `ini:"-" show:"open" input:"heading"` ACServerAddress string `` /* 145-byte string literal not displayed */ ACServerConfigIni string `` /* 166-byte string literal not displayed */ ACServerWorkingDir string `` /* 233-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 ¶ added in v1.5.1
type StrackerLapValidChecks struct { LapValidChecks FormHeading `ini:"-" input:"heading"` 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 ¶ added in v1.5.1
type StrackerMessages struct { Messages FormHeading `ini:"-" input:"heading"` 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 ¶ added in v1.5.1
type StrackerSessionManagement struct { SessionManagement FormHeading `ini:"-" input:"heading"` RaceOverStrategy string `` /* 134-byte string literal not displayed */ WaitSecondsBeforeSkip int `` /* 137-byte string literal not displayed */ }
type StrackerSwearFilter ¶ added in v1.5.1
type StrackerSwearFilter struct { SwearFilter FormHeading `ini:"-" input:"heading"` 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 ¶ added in v1.5.1
type TeamStanding ¶
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 ¶ added in v1.5.0
type TemplateVars interface {
Get() *BaseTemplateVars
}
type ThemeDetails ¶ added in v1.5.0
type Track ¶
type Track struct { Name string Layouts []string MetaData TrackMetaData }
func (Track) GetImagePath ¶ added in v1.5.1
func (*Track) LayoutsCSV ¶
func (*Track) LoadMetaData ¶ added in v1.5.1
func (Track) PrettyName ¶
type TrackDataGateway ¶ added in v1.3.3
type TrackInfo ¶
type TrackInfo struct { Name string `json:"name"` City string `json:"city"` Country string `json:"country"` Description string `json:"description"` Length string `json:"length"` Pitboxes json.Number `json:"pitboxes"` Run string `json:"run"` Tags []string `json:"tags"` Width string `json:"width"` }
func GetTrackInfo ¶
type TrackManager ¶ added in v1.5.1
type TrackManager struct { }
func NewTrackManager ¶ added in v1.5.1
func NewTrackManager() *TrackManager
func (*TrackManager) GetTrackFromName ¶ added in v1.5.1
func (tm *TrackManager) GetTrackFromName(name string) (*Track, error)
func (*TrackManager) ListTracks ¶ added in v1.5.1
func (tm *TrackManager) ListTracks() ([]Track, error)
func (*TrackManager) LoadTrackDetailsForTemplate ¶ added in v1.5.1
func (tm *TrackManager) LoadTrackDetailsForTemplate(trackName string) (*trackDetailsTemplateVars, error)
func (*TrackManager) ResultsForLayout ¶ added in v1.5.1
func (tm *TrackManager) ResultsForLayout(trackName, layout string) ([]SessionResults, error)
func (*TrackManager) UpdateTrackMetadata ¶ added in v1.5.1
func (tm *TrackManager) UpdateTrackMetadata(name string, r *http.Request) error
type TrackMapData ¶ added in v1.1.0
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 ¶ added in v1.1.0
func LoadTrackMapData(track, trackLayout string) (*TrackMapData, error)
type TrackMetaData ¶ added in v1.5.1
func LoadTrackMetaDataFromName ¶ added in v1.5.3
func LoadTrackMetaDataFromName(name string) (*TrackMetaData, error)
func (*TrackMetaData) Save ¶ added in v1.5.1
func (tmd *TrackMetaData) Save(name string) error
type TrackSurfacePreset ¶
type TracksHandler ¶ added in v1.4.0
type TracksHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewTracksHandler ¶ added in v1.4.0
func NewTracksHandler(baseHandler *BaseHandler, trackManager *TrackManager) *TracksHandler
type Tyres ¶
type ValidationError ¶ added in v1.3.0
type ValidationError string
func (ValidationError) Error ¶ added in v1.3.0
func (e ValidationError) Error() string
type Weather ¶
func ListWeather ¶
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"` 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 ¶ added in v1.4.0
type WeatherHandler struct {
*BaseHandler
}
func NewWeatherHandler ¶ added in v1.4.0
func NewWeatherHandler(baseHandler *BaseHandler) *WeatherHandler
Notes ¶
Bugs ¶
splitting commands on spaces breaks child processes that have a space in their path name
Source Files ¶
- accounts.go
- acsr.go
- audit_log.go
- championship_manager.go
- championships.go
- championships_handler.go
- config_ini.go
- config_ini_default.go
- content_cars.go
- content_cars_skins.go
- content_manager_wrapper.go
- content_setups.go
- content_tracks.go
- content_tyres.go
- content_upload.go
- content_weather.go
- discord.go
- entrylist_ini.go
- form.go
- healthcheck.go
- hosted.go
- init.go
- lua.go
- migrations.go
- monitoring.go
- notification_manager.go
- penalties.go
- race_control.go
- race_control_driver.go
- race_control_http.go
- race_custom.go
- race_event.go
- race_manager.go
- race_quick.go
- race_weekend.go
- race_weekend_filter.go
- race_weekend_handler.go
- race_weekend_manager.go
- race_weekend_sort.go
- resolver.go
- results.go
- router.go
- scheduled_races.go
- server_administration.go
- server_install.go
- server_process.go
- server_process_nonwindows.go
- servermanager_config.go
- steam.go
- store.go
- store_bolt.go
- store_json.go
- stracker.go
- templates.go
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. |