Documentation ¶
Index ¶
- Constants
- Variables
- 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 AnonymiseDriverGUID(guid string) string
- func AssetCacheHeaders(next http.Handler, 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 CleanGUIDs(guids []string) []string
- func DecodeFormData(out interface{}, r *http.Request) error
- func DeleteAccess(r *http.Request) func() bool
- func EncodeFormData(data interface{}, r *http.Request) (template.HTML, error)
- 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 GetResultDate(name string) (time.Time, error)
- func InitLogging()
- func InitLua(raceControl *RaceControl)
- func InitMonitoring()
- func InitWithResolver(resolver *Resolver) error
- func InstallAssettoCorsaServer(login, password string, force bool) error
- func IsAssettoInstalled() bool
- func IsDirWriteable(dir string) error
- func IsKissMyRankInstalled() bool
- func IsRealPenaltyInstalled() bool
- func IsStrackerInstalled() bool
- func KissMyRankConfigPath() string
- func KissMyRankExecutablePath() string
- func KissMyRankFolderPath() string
- 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 NormaliseEntrantGUID(guid string) string
- func NormaliseEntrantGUIDs(guids []string) string
- func NumberResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, ...) error
- func Premium() bool
- func RandomRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, ...) error
- func ReadAccess(r *http.Request) func() bool
- func RealPenaltyExecutablePath() string
- func RealPenaltyFolderPath() string
- 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 TrackMapImageURL(track, trackLayout string) string
- func UnchangedRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, _ []*RaceWeekendSessionEntrant, ...) error
- func WriteAccess(r *http.Request) func() bool
- type ACHTTPPlayers
- type ACHTTPSessionInfo
- type ACSRClient
- type ACSRDriverRating
- type ACSRDriverRatingRequest
- type ACSRRanges
- type ACSRRatingGateMet
- type ACSRRatingRanges
- type Account
- func (a Account) Group() Group
- func (a Account) HasGroupPrivilege(g Group) bool
- func (a Account) HasSeenCurrentVersion() bool
- func (a Account) HasSeenVersion(version string) bool
- func (a Account) IsDefaultHostedAccount() bool
- func (a Account) NeedsPasswordReset() bool
- func (a Account) ShouldSeeIntroPopup() bool
- func (a Account) ShouldSeeUpgradePopup() bool
- func (a Account) ShowDarkTheme(serverManagerDarkThemeEnabled bool) bool
- 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) GetForceStopTime() time.Duration
- func (a *ActiveChampionship) GetForceStopWithDrivers() bool
- 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) IsTimeAttack() 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) GetForceStopTime() time.Duration
- func (a ActiveRaceWeekend) GetForceStopWithDrivers() bool
- 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) IsTimeAttack() bool
- func (a ActiveRaceWeekend) OverrideServerPassword() bool
- func (a ActiveRaceWeekend) ReplacementServerPassword() string
- type AssetHelper
- type AssettoServerProcess
- func (sp *AssettoServerProcess) Event() RaceEvent
- func (sp *AssettoServerProcess) IsRunning() bool
- func (sp *AssettoServerProcess) Logs() string
- func (sp *AssettoServerProcess) NotifyDone(ch chan struct{})
- func (sp *AssettoServerProcess) Restart() error
- func (sp *AssettoServerProcess) SendUDPMessage(message udp.Message) error
- func (sp *AssettoServerProcess) Start(event RaceEvent, udpPluginAddress string, udpPluginLocalPort int, ...) error
- func (sp *AssettoServerProcess) Stop() error
- func (sp *AssettoServerProcess) UDPCallback(message udp.Message)
- type AuditEntry
- type AuditLogHandler
- type BaseHandler
- type BaseTemplateVars
- type BlockListMode
- 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) LoadKissMyRankOptions() (*KissMyRankConfig, error)
- func (rs *BoltStore) LoadLastRaceEvent() (RaceEvent, error)
- func (rs *BoltStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
- func (rs *BoltStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
- func (rs *BoltStore) LoadRealPenaltyOptions() (*RealPenaltyConfig, 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) UpsertKissMyRankOptions(kmr *KissMyRankConfig) 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) UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error
- func (rs *BoltStore) UpsertServerOptions(so *GlobalServerConfig) error
- func (rs *BoltStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
- type Broadcaster
- 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) 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) UpdateTyres(car *Car) 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) DriverMeetsACSRGates(rating *ACSRDriverRating) bool
- func (c *Championship) EnhanceResults(results *SessionResults)
- func (c *Championship) EntrantAttendance(guid string) int
- func (c *Championship) EventByID(id string) (*ChampionshipEvent, int, 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) HasSpectatorCar() bool
- func (c *Championship) HasTeamNames() bool
- func (c *Championship) ImportEvent(eventToImport interface{}) (*ChampionshipEvent, error)
- func (c *Championship) IsMultiClass() bool
- func (c *Championship) MostRecentScheduledDateFormat(format string) string
- 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) CountPositionsForDriver(i int, guid string, inEvents []*ChampionshipEvent) int
- func (c *ChampionshipClass) CountPositionsForTeam(i int, team string, inEvents []*ChampionshipEvent) int
- func (c *ChampionshipClass) DriverInClass(result *SessionResult) bool
- func (c *ChampionshipClass) HadBetterFinishingPositions(guidA, guidB string, inEvents []*ChampionshipEvent, numPositions int) bool
- func (c *ChampionshipClass) PenaltyForGUID(guid string) int
- func (c *ChampionshipClass) PenaltyForTeam(name string) int
- func (c *ChampionshipClass) ResultsForClass(results []*SessionResult, championship *Championship) (filtered []*SessionResult)
- func (c *ChampionshipClass) Standings(championship *Championship, inEvents []*ChampionshipEvent, ...) []*ChampionshipStanding
- func (c *ChampionshipClass) StandingsForEntrantAtEvent(championship *Championship, event *ChampionshipEvent, ...) *ChampionshipStandingWithTableInfo
- func (c *ChampionshipClass) StandingsForEvent(championship *Championship, event *ChampionshipEvent) []*ChampionshipStanding
- func (c *ChampionshipClass) TeamHadBetterFinishingPositions(teamA, teamB string, inEvents []*ChampionshipEvent, numPositions int) bool
- func (c *ChampionshipClass) TeamStandings(championship *Championship, inEvents []*ChampionshipEvent) []*TeamStanding
- func (c *ChampionshipClass) ValidCarIDs() []string
- type ChampionshipClassSort
- 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) GetScheduledServerID() ServerID
- 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) DuplicateChampionship(championshipID string) (*Championship, error)
- func (cm *ChampionshipManager) DuplicateEvent(event *ChampionshipEvent, championship *Championship) (*ChampionshipEvent, error)
- func (cm *ChampionshipManager) DuplicateEventInChampionship(championshipID, eventID string) (*ChampionshipEvent, error)
- func (cm *ChampionshipManager) FinalEventConfigurationFiles(championship *Championship, event *ChampionshipEvent, ...) (CurrentRaceConfig, EntryList)
- 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) LoadACSRRanges() ([]*ACSRRatingRanges, error)
- func (cm *ChampionshipManager) LoadACSRRating(guid string) (*ACSRDriverRating, error)
- func (cm *ChampionshipManager) LoadACSRRatings(championship *Championship) (map[string]*ACSRDriverRating, 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 ChampionshipStandingWithTableInfo
- type ChampionshipStandingsOrderEntryListSort
- type ChampionshipTab
- 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, requirePassword bool) (*CMContent, error)
- func (cmw *ContentManagerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (cmw *ContentManagerWrapper) Start(servePort int, event RaceEvent, logger cmwSessionLogger) 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) GetForceStopTime() time.Duration
- func (cr *CustomRace) GetForceStopWithDrivers() bool
- func (cr *CustomRace) GetID() uuid.UUID
- func (cr *CustomRace) GetRaceConfig() CurrentRaceConfig
- func (cr *CustomRace) GetRaceSetup() CurrentRaceConfig
- func (cr *CustomRace) GetScheduledServerID() ServerID
- 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) IsTimeAttack() 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(title string, msg string) error
- func (dm *DiscordManager) SendMessageWithLink(title string, 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) AddInPitBox(entrant *Entrant, pitBox int)
- func (e EntryList) AddToBackOfGrid(entrant *Entrant)
- 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) ReadString() (string, error)
- func (e EntryList) Write() error
- type FactoryAssist
- type FilterError
- type FormHeading
- 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) LoadKissMyRankOptions() (*KissMyRankConfig, error)
- func (rs *JSONStore) LoadLastRaceEvent() (RaceEvent, error)
- func (rs *JSONStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
- func (rs *JSONStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
- func (rs *JSONStore) LoadRealPenaltyOptions() (*RealPenaltyConfig, 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) UpsertKissMyRankOptions(kmr *KissMyRankConfig) 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) UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error
- func (rs *JSONStore) UpsertServerOptions(so *GlobalServerConfig) error
- func (rs *JSONStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
- type KissMyRankConfig
- type KissMyRankHandler
- type LiveMapConfig
- type LiveTimingsPersistedData
- type LoadResultOpts
- type LuaConfig
- type LuaPlugin
- type MonitoringConfig
- type NewLineSeparatedList
- 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, download bool) 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(title string, msg string) error
- func (nm *NotificationManager) SendMessageWithLink(title string, 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 PenaltiesManager
- type PenaltyAction
- type PenaltyActionMap
- type PenaltyActionSessions
- type PenaltyCostMap
- type PenaltyCostSessions
- type PenaltyInfractionMap
- type PenaltyInfractionSessions
- type PointsReason
- type PotentialChampionshipEntrant
- type QuickRace
- func (q QuickRace) EventDescription() string
- func (q QuickRace) EventName() string
- func (q QuickRace) GetEntryList() EntryList
- func (q QuickRace) GetForceStopTime() time.Duration
- func (q QuickRace) GetForceStopWithDrivers() bool
- 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) IsTimeAttack() 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) LuaBroadcastChat(L *lua.LState) int
- func (rc *RaceControl) LuaSendChat(L *lua.LState) int
- func (rc *RaceControl) OnCarUpdate(update udp.CarUpdate) error
- func (rc *RaceControl) OnChatMessage(chat udp.Chat) 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) (*CustomRace, error)
- func (rm *RaceManager) StartScheduledRace(race *CustomRace) error
- func (rm *RaceManager) ToggleLoopCustomRace(uuid string) (bool, error)
- func (rm *RaceManager) ToggleStarCustomRace(uuid string) error
- type RaceMassAccidentResponse
- 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) CompletedTime() time.Time
- func (rw *RaceWeekend) DelSession(sessionID string)
- func (rw *RaceWeekend) Duplicate() (*RaceWeekend, error)
- 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) GetAvailableSplitTypes() []RaceWeekendFilterSplitType
- 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) GetSpectatorCar() Entrant
- func (rw *RaceWeekend) HasLinkedChampionship() bool
- func (rw *RaceWeekend) HasParentRecursive(session *RaceWeekendSession, otherSessionID string) bool
- func (rw *RaceWeekend) HasSpectatorCar() bool
- func (rw *RaceWeekend) HasTeamNames() bool
- func (rw *RaceWeekend) InProgress() bool
- func (rw *RaceWeekend) MostRecentScheduledDateFormat(format string) string
- 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 RaceWeekendFilterSplitType
- 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) GetScheduledServerID() ServerID
- 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 RealPenaltyACSettings
- type RealPenaltyACSettingsAdmin
- type RealPenaltyACSettingsApp
- type RealPenaltyACSettingsCustomShadersPatch
- type RealPenaltyACSettingsGeneral
- type RealPenaltyACSettingsHelicorsa
- type RealPenaltyACSettingsNoPenalty
- type RealPenaltyACSettingsSafetyCar
- type RealPenaltyACSettingsSol
- type RealPenaltyAppConfig
- type RealPenaltyConfig
- type RealPenaltyConfigGeneral
- type RealPenaltyHandler
- type RealPenaltyPluginsRelay
- type RealPenaltySettings
- type RealPenaltySettingsBlueFlag
- type RealPenaltySettingsCrossing
- type RealPenaltySettingsCutting
- type RealPenaltySettingsDRS
- type RealPenaltySettingsGeneral
- type RealPenaltySettingsJumpStart
- type RealPenaltySettingsSpeeding
- 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 ServerID
- type ServerProcess
- type SessionCar
- type SessionConfig
- type SessionDriver
- type SessionEvent
- type SessionLap
- type SessionOpenness
- type SessionPos
- type SessionPreviewEntrant
- type SessionResult
- type SessionResults
- func (s *SessionResults) Anonymize()
- func (s *SessionResults) ClearKickedGUIDs()
- 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) FindCarIDForGUIDAndModel(guid, model string) int
- func (s *SessionResults) GetAverageLapTime(guid, model string) time.Duration
- func (s *SessionResults) GetConsistency(guid, model string) float64
- func (s *SessionResults) GetCrashes(guid, model string) int
- func (s *SessionResults) GetCrashesOfType(guid, model, collisionType string) int
- func (s *SessionResults) GetCuts(driverGUID, model string) int
- func (s *SessionResults) GetDate() string
- func (s *SessionResults) GetDriverDescriptionForLap(lap *SessionLap, autoFillEntrantList []*Entrant) 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) IsTimeAttack() bool
- func (s *SessionResults) LapAssociatedWithGUIDAndModel(lap *SessionLap, driverGUID, model string) bool
- func (s *SessionResults) MaskDriverNames()
- func (s *SessionResults) NormaliseCarIDs()
- func (s *SessionResults) NormaliseDriverSwapGUIDs()
- func (s *SessionResults) NumberOfDriverSwaps(carID int) int
- func (s *SessionResults) RenameDriver(guid, newName string)
- func (s *SessionResults) ResultHasMultipleDrivers(result *SessionResult) bool
- func (s *SessionResults) UpdateDate(date time.Time)
- type SessionType
- type Sessions
- type ShouldBeAnInt
- type StandingsOption
- type StartRule
- 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 TLSConfig
- 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) GetTrackImage(w io.Writer, track, layout string) (int64, error)
- func (tm *TrackManager) ListTracks() ([]Track, 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 TrackOptsGrouped
- type TrackSurfacePreset
- type TracksHandler
- type TracksSplit
- type Tyres
- type ValidationError
- type Weather
- type WeatherConfig
- type WeatherHandler
- Bugs
Constants ¶
const ( ChampionshipEntrantAll = "All" ChampionshipEntrantAccepted = "Accepted" ChampionshipEntrantRejected = "Rejected" ChampionshipEntrantPending = "Pending Approval" )
const ( SessionOpennessNoJoin = 0 SessionOpennessFreeJoin = 1 SessionOpennessFreeJoinUntil20SecondsToTheGreenLight = 2 )
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 (
RealPenaltySupportedVersion = "v3.02.01b"
)
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 = "true" )
var ( ErrRaceWeekendNotFound = errors.New("servermanager: race weekend not found") ErrRaceWeekendSessionNotFound = 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 AvailableChampionshipTabs = []ChampionshipTab{ ChampionshipTabDriverStandings, ChampionshipTabTeamStandings, ChampionshipTabOverview, ChampionshipTabEntrants, ChampionshipTabPointsReference, }
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 ErrCommandUnstoppable = errors.New("servermanager: command is unstoppable")
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 ErrPluginConfigurationRequiresUDPPortSetup = errors.New("servermanager: kissmyrank and stracker configuration requires UDP plugin configuration in Server Options")
var ErrRaceWeekendFilterNotFound = errors.New("servermanager: race weekend filter not found")
var ErrRaceWeekendSessionDependencyIncomplete = errors.New("servermanager: race weekend session dependency incomplete")
var ErrRaceWeekendUnknownSplitType = errors.New("servermanager: unknown split type")
var ErrResultsPageNotFound = errors.New("servermanager: results page not found")
var ErrScheduledTimeIsZero = errors.New("servermanager: can't schedule race for zero time")
var ErrServerProcessTimeout = errors.New("servermanager: server process did not stop even after manual kill. please check your server configuration")
var ErrSessionCarNotFound = errors.New("servermanager: session car not found")
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 RaceWeekendEntryListSorters = []RaceWeekendEntryListSorterDescription{ { Name: "No Sort (Use Finishing Grid)", Key: "", Sorter: RaceWeekendEntryListSortFunc(UnchangedRaceWeekendEntryListSort), NeedsParentSession: false, NeedsChampionship: false, ShowInManageEntryList: true, }, { Name: "Fastest Lap", Key: "fastest_lap", Sorter: RaceWeekendEntryListSortFunc(FastestLapRaceWeekendEntryListSort), NeedsParentSession: true, NeedsChampionship: false, ShowInManageEntryList: true, }, { Name: "Total Race Time", Key: "total_race_time", Sorter: RaceWeekendEntryListSortFunc(TotalRaceTimeRaceWeekendEntryListSort), NeedsParentSession: true, NeedsChampionship: false, ShowInManageEntryList: true, }, { Name: "Fastest Lap Across Multiple Results Files", Key: "fastest_multi_results_lap", Sorter: RaceWeekendEntryListSortFunc(FastestResultsFileRaceWeekendEntryListSort), NeedsParentSession: false, NeedsChampionship: false, ShowInManageEntryList: false, }, { Name: "Number of Laps Across Multiple Results Files", Key: "number_multi_results_lap", Sorter: RaceWeekendEntryListSortFunc(NumberResultsFileRaceWeekendEntryListSort), NeedsParentSession: false, NeedsChampionship: false, ShowInManageEntryList: false, }, { Name: "Fewest Collisions", Key: "fewest_collisions", Sorter: RaceWeekendEntryListSortFunc(FewestCollisionsRaceWeekendEntryListSort), NeedsParentSession: true, NeedsChampionship: false, ShowInManageEntryList: true, }, { Name: "Fewest Cuts", Key: "fewest_cuts", Sorter: RaceWeekendEntryListSortFunc(FewestCutsRaceWeekendEntryListSort), NeedsParentSession: true, NeedsChampionship: false, ShowInManageEntryList: true, }, { Name: "Safety (Collisions then Cuts)", Key: "safety", Sorter: RaceWeekendEntryListSortFunc(SafetyRaceWeekendEntryListSort), NeedsParentSession: true, NeedsChampionship: false, ShowInManageEntryList: true, }, { Name: "Championship Standings Order", Key: "championship_standings_order", Sorter: &ChampionshipStandingsOrderEntryListSort{}, NeedsParentSession: false, NeedsChampionship: true, ShowInManageEntryList: true, }, { Name: "Championship Class", Key: "championship_class", Sorter: &ChampionshipClassSort{}, NeedsParentSession: false, NeedsChampionship: true, ShowInManageEntryList: false, }, { Name: "Random", Key: "random", Sorter: RaceWeekendEntryListSortFunc(RandomRaceWeekendEntryListSort), NeedsParentSession: false, NeedsChampionship: false, ShowInManageEntryList: true, }, { Name: "Alphabetical (Using Driver Name)", Key: "alphabetical", Sorter: RaceWeekendEntryListSortFunc(AlphabeticalRaceWeekendEntryListSort), NeedsParentSession: false, NeedsChampionship: false, ShowInManageEntryList: true, }, }
var ThemeOptions = []ThemeDetails{ { Theme: ThemeDefault, Name: "Use Default", }, { Theme: ThemeLight, Name: "Light", }, { Theme: ThemeDark, Name: "Dark", }, }
var UseFallBackSorting = false
var UseShortenedDriverNames = true
Functions ¶
func AddErrorFlash ¶
func AddErrorFlash(w http.ResponseWriter, r *http.Request, message string)
func AddFlash ¶
func AddFlash(w http.ResponseWriter, r *http.Request, message string)
Helper function to get message session and add a flash
func AdminAccess ¶
func AlphabeticalRaceWeekendEntryListSort ¶
func AlphabeticalRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func AnonymiseDriverGUID ¶
func AssetCacheHeaders ¶
func AssetCacheHeaders(next http.Handler, useRevalidation bool) http.HandlerFunc
func BuildICalEvent ¶
func BuildICalEvent(event ScheduledEvent) *components.Event
func CarDataFile ¶
func CarDataFile(carModel, dataFile string) (io.ReadCloser, error)
func CarNameFromFilepath ¶
CarNameFromFilepath takes a filepath e.g. content/cars/rss_formula_rss_4/data.acd and returns the car name, e.g. in this case: rss_formula_rss_4.
func ChampionshipClassColor ¶
func CleanGUIDs ¶
func DecodeFormData ¶
func DeleteAccess ¶
func EncodeFormData ¶
EncodeFormData uses formulate to build template.HTML from a struct
func FastestLapRaceWeekendEntryListSort ¶
func FastestLapRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func FastestResultsFileRaceWeekendEntryListSort ¶
func FastestResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, filter *RaceWeekendSessionToSessionFilter) error
func FewestCollisionsRaceWeekendEntryListSort ¶
func FewestCollisionsRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func FewestCutsRaceWeekendEntryListSort ¶
func FewestCutsRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func FileServer ¶
func FreeUDPPort ¶
func GenerateSummary ¶
func GenerateSummary(raceSetup CurrentRaceConfig, eventType string) string
func InitLogging ¶
func InitLogging()
func InitLua ¶
func InitLua(raceControl *RaceControl)
func InitMonitoring ¶
func InitMonitoring()
func InitWithResolver ¶
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 ¶
func IsAssettoInstalled() bool
func IsDirWriteable ¶
func IsKissMyRankInstalled ¶
func IsKissMyRankInstalled() bool
IsKissMyRankInstalled looks in the ServerInstallPath for a "kissmyrank" directory with the correct kissmyrank executable for the given platform
func IsRealPenaltyInstalled ¶
func IsRealPenaltyInstalled() bool
func IsStrackerInstalled ¶
func IsStrackerInstalled() bool
IsStrackerInstalled looks in the ServerInstallPath for an "stracker" directory with the correct stracker executable for the given platform
func KissMyRankConfigPath ¶
func KissMyRankConfigPath() string
func KissMyRankExecutablePath ¶
func KissMyRankExecutablePath() string
func KissMyRankFolderPath ¶
func KissMyRankFolderPath() string
func LoadTyresFromACDINI ¶
LoadTyresFromACDINI reads the tyres.ini file from within the data.acd of a car and finds all available tyre compounds.
func LuaHTTPRequest ¶
func NormaliseEntrantGUID ¶
NormaliseEntrantGUID takes a guid which may have driverSwapEntrantSeparators in it, sorts all GUIDs in the string and then rejoins them by driverSwapEntrantSeparator
func NormaliseEntrantGUIDs ¶
NormaliseEntrantGUIDs takes a list of guids, sorts them and joins them by driverSwapEntrantSeparator
func NumberResultsFileRaceWeekendEntryListSort ¶
func NumberResultsFileRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, filter *RaceWeekendSessionToSessionFilter) error
func RandomRaceWeekendEntryListSort ¶
func RandomRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func ReadAccess ¶
func RealPenaltyExecutablePath ¶
func RealPenaltyExecutablePath() string
func RealPenaltyFolderPath ¶
func RealPenaltyFolderPath() string
func RoundTripper ¶
func RoundTripper(t http.RoundTripper) http.RoundTripper
func Router ¶
func Router( fs http.FileSystem, quickRaceHandler *QuickRaceHandler, customRaceHandler *CustomRaceHandler, championshipsHandler *ChampionshipsHandler, accountHandler *AccountHandler, auditLogHandler *AuditLogHandler, carsHandler *CarsHandler, tracksHandler *TracksHandler, weatherHandler *WeatherHandler, penaltiesHandler *PenaltiesHandler, resultsHandler *ResultsHandler, contentUploadHandler *ContentUploadHandler, serverAdministrationHandler *ServerAdministrationHandler, raceControlHandler *RaceControlHandler, scheduledRacesHandler *ScheduledRacesHandler, raceWeekendHandler *RaceWeekendHandler, strackerHandler *StrackerHandler, healthCheck *HealthCheck, kissMyRankHandler *KissMyRankHandler, realPenaltyHandler *RealPenaltyHandler, ) http.Handler
func SafetyRaceWeekendEntryListSort ¶
func SafetyRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func SetAssettoInstallPath ¶
func SetAssettoInstallPath(installPath string)
func StrackerExecutablePath ¶
func StrackerExecutablePath() string
func StrackerFolderPath ¶
func StrackerFolderPath() string
func ToggleDRSForTrack ¶
func TotalRaceTimeRaceWeekendEntryListSort ¶
func TotalRaceTimeRaceWeekendEntryListSort(rw *RaceWeekend, session *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func TrackMapImageURL ¶
func UnchangedRaceWeekendEntryListSort ¶
func UnchangedRaceWeekendEntryListSort(_ *RaceWeekend, _ *RaceWeekendSession, _ []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
func WriteAccess ¶
Types ¶
type ACHTTPPlayers ¶
type ACHTTPPlayers struct {
Cars []*CMCar `json:"Cars"`
}
type ACHTTPSessionInfo ¶
type ACHTTPSessionInfo struct { Cars []string `json:"cars"` Clients int64 `json:"clients"` Country []string `json:"country"` HTTPPort int64 `json:"cport"` Durations []int64 `json:"durations"` Extra bool `json:"extra"` Inverted int64 `json:"inverted"` IP string `json:"ip"` JSON interface{} `json:"json"` L bool `json:"l"` MaxClients int64 `json:"maxclients"` Name string `json:"name"` Pass bool `json:"pass"` Pickup bool `json:"pickup"` Pit bool `json:"pit"` Port int64 `json:"port"` Session int64 `json:"session"` Sessiontypes []int64 `json:"sessiontypes"` Timed bool `json:"timed"` Timeleft int64 `json:"timeleft"` Timeofday int64 `json:"timeofday"` Timestamp int64 `json:"timestamp"` TCPPort int64 `json:"tport"` Track string `json:"track"` }
type ACSRClient ¶
func NewACSRClient ¶
func NewACSRClient(accountID, apiKey string, enabled bool) *ACSRClient
func (*ACSRClient) GetRanges ¶
func (a *ACSRClient) GetRanges() ([]*ACSRRatingRanges, error)
func (*ACSRClient) GetRating ¶
func (a *ACSRClient) GetRating(guids ...string) (map[string]*ACSRDriverRating, error)
func (*ACSRClient) SendChampionship ¶
func (a *ACSRClient) SendChampionship(inChampionship Championship)
Sends a championship to ACSR, called OnEndSession and when a championship is created
type ACSRDriverRating ¶
type ACSRDriverRatingRequest ¶
type ACSRDriverRatingRequest struct {
GUIDs []string `json:"guids"`
}
type ACSRRanges ¶
type ACSRRanges struct { Ranges []*ACSRRatingRanges HighestSkillCount int HighestSafetyCount int }
type ACSRRatingGateMet ¶
type ACSRRatingGateMet struct { ACSRDriverRating *ACSRDriverRating `json:"acsr_driver_rating"` GateMet bool `json:"gate_met"` ACSREnabled bool `json:"acsr_enabled"` }
type ACSRRatingRanges ¶
type Account ¶
type Account struct { ID uuid.UUID Created time.Time Updated time.Time Deleted time.Time Name string Groups map[ServerID]Group DriverName, GUID, Team string PasswordHash string PasswordSalt string DefaultPassword string LastSeenVersion string HasSeenIntroPopup bool Theme Theme // Deprecated: Use Groups instead. DeprecatedGroup Group `json:"Group"` }
var OpenAccount *Account
func AccountFromRequest ¶
func NewAccount ¶
func NewAccount() *Account
func (Account) HasGroupPrivilege ¶
func (Account) HasSeenCurrentVersion ¶
func (Account) HasSeenVersion ¶
func (Account) IsDefaultHostedAccount ¶
func (Account) NeedsPasswordReset ¶
func (Account) ShouldSeeIntroPopup ¶
func (Account) ShouldSeeUpgradePopup ¶
func (Account) ShowDarkTheme ¶
type AccountHandler ¶
type AccountHandler struct { *BaseHandler SteamLoginHandler // contains filtered or unexported fields }
func NewAccountHandler ¶
func NewAccountHandler(baseHandler *BaseHandler, store Store, accountManager *AccountManager) *AccountHandler
func (*AccountHandler) AdminAccessMiddleware ¶
func (ah *AccountHandler) AdminAccessMiddleware(next http.Handler) http.Handler
func (*AccountHandler) DeleteAccessMiddleware ¶
func (ah *AccountHandler) DeleteAccessMiddleware(next http.Handler) http.Handler
func (*AccountHandler) MustLoginMiddleware ¶
MustLoginMiddleware determines whether an account needs to log in to access a given Group page
func (*AccountHandler) ReadAccessMiddleware ¶
func (ah *AccountHandler) ReadAccessMiddleware(next http.Handler) http.Handler
func (*AccountHandler) WriteAccessMiddleware ¶
func (ah *AccountHandler) WriteAccessMiddleware(next http.Handler) http.Handler
type AccountManager ¶
type AccountManager struct {
// contains filtered or unexported fields
}
func NewAccountManager ¶
func NewAccountManager(store Store) *AccountManager
func (*AccountManager) ChangePassword ¶
func (am *AccountManager) ChangePassword(account *Account, password string) error
func (*AccountManager) SetCurrentVersion ¶
func (am *AccountManager) SetCurrentVersion(account *Account) error
type AccountsConfig ¶
type AccountsConfig struct {
AdminPasswordOverride string `yaml:"admin_password_override"`
}
type ActiveChampionship ¶
type ActiveChampionship struct { Name string ChampionshipID, EventID uuid.UUID SessionType SessionType OverridePassword bool ReplacementPassword string Description string IsPracticeSession bool RaceConfig CurrentRaceConfig EntryList EntryList NumLapsCompleted int `json:"-"` NumRaceStartEvents int `json:"-"` }
func (*ActiveChampionship) EventDescription ¶
func (a *ActiveChampionship) EventDescription() string
func (*ActiveChampionship) EventName ¶
func (a *ActiveChampionship) EventName() string
func (*ActiveChampionship) GetEntryList ¶
func (a *ActiveChampionship) GetEntryList() EntryList
func (*ActiveChampionship) GetForceStopTime ¶
func (a *ActiveChampionship) GetForceStopTime() time.Duration
func (*ActiveChampionship) GetForceStopWithDrivers ¶
func (a *ActiveChampionship) GetForceStopWithDrivers() bool
func (*ActiveChampionship) GetRaceConfig ¶
func (a *ActiveChampionship) GetRaceConfig() CurrentRaceConfig
func (*ActiveChampionship) GetURL ¶
func (a *ActiveChampionship) GetURL() string
func (*ActiveChampionship) IsChampionship ¶
func (a *ActiveChampionship) IsChampionship() bool
func (*ActiveChampionship) IsLooping ¶
func (a *ActiveChampionship) IsLooping() bool
func (*ActiveChampionship) IsPractice ¶
func (a *ActiveChampionship) IsPractice() bool
func (*ActiveChampionship) IsRaceWeekend ¶
func (a *ActiveChampionship) IsRaceWeekend() bool
func (*ActiveChampionship) IsTimeAttack ¶
func (a *ActiveChampionship) IsTimeAttack() bool
func (*ActiveChampionship) OverrideServerPassword ¶
func (a *ActiveChampionship) OverrideServerPassword() bool
func (*ActiveChampionship) ReplacementServerPassword ¶
func (a *ActiveChampionship) ReplacementServerPassword() string
type ActiveRaceWeekend ¶
type ActiveRaceWeekend struct { Name string RaceWeekendID, SessionID, ChampionshipID uuid.UUID OverridePassword bool ReplacementPassword string Description string IsPracticeSession bool RaceConfig CurrentRaceConfig EntryList EntryList }
ActiveRaceWeekend indicates which RaceWeekend and RaceWeekendSession are currently running on the server.
func (ActiveRaceWeekend) EventDescription ¶
func (a ActiveRaceWeekend) EventDescription() string
func (ActiveRaceWeekend) EventName ¶
func (a ActiveRaceWeekend) EventName() string
func (ActiveRaceWeekend) GetEntryList ¶
func (a ActiveRaceWeekend) GetEntryList() EntryList
func (ActiveRaceWeekend) GetForceStopTime ¶
func (a ActiveRaceWeekend) GetForceStopTime() time.Duration
func (ActiveRaceWeekend) GetForceStopWithDrivers ¶
func (a ActiveRaceWeekend) GetForceStopWithDrivers() bool
func (ActiveRaceWeekend) GetRaceConfig ¶
func (a ActiveRaceWeekend) GetRaceConfig() CurrentRaceConfig
func (ActiveRaceWeekend) GetURL ¶
func (a ActiveRaceWeekend) GetURL() string
func (ActiveRaceWeekend) IsChampionship ¶
func (a ActiveRaceWeekend) IsChampionship() bool
func (ActiveRaceWeekend) IsLooping ¶
func (a ActiveRaceWeekend) IsLooping() bool
func (ActiveRaceWeekend) IsPractice ¶
func (a ActiveRaceWeekend) IsPractice() bool
func (ActiveRaceWeekend) IsRaceWeekend ¶
func (a ActiveRaceWeekend) IsRaceWeekend() bool
func (ActiveRaceWeekend) IsTimeAttack ¶
func (a ActiveRaceWeekend) IsTimeAttack() bool
func (ActiveRaceWeekend) OverrideServerPassword ¶
func (a ActiveRaceWeekend) OverrideServerPassword() bool
func (ActiveRaceWeekend) ReplacementServerPassword ¶
func (a ActiveRaceWeekend) ReplacementServerPassword() string
type AssetHelper ¶
type AssetHelper struct {
// contains filtered or unexported fields
}
func NewAssetHelper ¶
func NewAssetHelper(baseURL, prefix, suffix string, query map[string]string) *AssetHelper
func (*AssetHelper) GetURL ¶
func (a *AssetHelper) GetURL(location string) string
type AssettoServerProcess ¶
type AssettoServerProcess struct {
// contains filtered or unexported fields
}
AssettoServerProcess manages the Assetto Corsa Server process.
func NewAssettoServerProcess ¶
func NewAssettoServerProcess(callbackFunc udp.CallbackFunc, store Store, contentManagerWrapper *ContentManagerWrapper) *AssettoServerProcess
func (*AssettoServerProcess) Event ¶
func (sp *AssettoServerProcess) Event() RaceEvent
func (*AssettoServerProcess) IsRunning ¶
func (sp *AssettoServerProcess) IsRunning() bool
func (*AssettoServerProcess) Logs ¶
func (sp *AssettoServerProcess) Logs() string
func (*AssettoServerProcess) NotifyDone ¶
func (sp *AssettoServerProcess) NotifyDone(ch chan struct{})
func (*AssettoServerProcess) Restart ¶
func (sp *AssettoServerProcess) Restart() error
func (*AssettoServerProcess) SendUDPMessage ¶
func (sp *AssettoServerProcess) SendUDPMessage(message udp.Message) error
func (*AssettoServerProcess) Stop ¶
func (sp *AssettoServerProcess) Stop() error
func (*AssettoServerProcess) UDPCallback ¶
func (sp *AssettoServerProcess) UDPCallback(message udp.Message)
type AuditEntry ¶
type AuditLogHandler ¶
type AuditLogHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewAuditLogHandler ¶
func NewAuditLogHandler(baseHandler *BaseHandler, store Store) *AuditLogHandler
func (*AuditLogHandler) Middleware ¶
func (alh *AuditLogHandler) Middleware(next http.Handler) http.Handler
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
func NewBaseHandler ¶
func NewBaseHandler(viewRenderer *Renderer) *BaseHandler
type BaseTemplateVars ¶
type BaseTemplateVars struct { Messages []interface{} Errors []interface{} ServerStatus bool ServerEvent RaceEvent ServerName string CustomCSS template.CSS User *Account IsHosted bool IsPremium bool MaxClientsOverride int IsDarkTheme bool Request *http.Request Debug bool MonitoringEnabled bool SentryDSN template.JSStr RecaptchaSiteKey string WideContainer bool OGImage string ACSREnabled bool BaseURLIsSet bool BaseURLIsValid bool ServerID ServerID ShowEventDetailsPopup bool }
func (*BaseTemplateVars) Get ¶
func (b *BaseTemplateVars) Get() *BaseTemplateVars
type BlockListMode ¶
type BlockListMode uint8
const ( BlockListModeNormalKick BlockListMode = 0 BlockListModeNoRejoin BlockListMode = 1 BlockListModeAddToList BlockListMode = 2 )
func (BlockListMode) SelectMultiple ¶
func (b BlockListMode) SelectMultiple() bool
func (BlockListMode) SelectOptions ¶
func (b BlockListMode) SelectOptions() []formulate.Option
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
func (*BoltStore) AddAuditEntry ¶
func (rs *BoltStore) AddAuditEntry(entry *AuditEntry) error
func (*BoltStore) ClearLastRaceEvent ¶
func (*BoltStore) DeleteAccount ¶
func (*BoltStore) DeleteChampionship ¶
func (*BoltStore) DeleteCustomRace ¶
func (rs *BoltStore) DeleteCustomRace(race *CustomRace) error
func (*BoltStore) DeleteEntrant ¶
func (*BoltStore) DeleteRaceWeekend ¶
func (*BoltStore) FindAccountByID ¶
func (*BoltStore) FindAccountByName ¶
func (*BoltStore) FindCustomRaceByID ¶
func (rs *BoltStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
func (*BoltStore) GetAuditEntries ¶
func (rs *BoltStore) GetAuditEntries() ([]*AuditEntry, error)
func (*BoltStore) ListAccounts ¶
func (*BoltStore) ListChampionships ¶
func (rs *BoltStore) ListChampionships() ([]*Championship, error)
func (*BoltStore) ListCustomRaces ¶
func (rs *BoltStore) ListCustomRaces() ([]*CustomRace, error)
func (*BoltStore) ListEntrants ¶
func (*BoltStore) ListPrevFrames ¶
func (*BoltStore) ListRaceWeekends ¶
func (rs *BoltStore) ListRaceWeekends() ([]*RaceWeekend, error)
func (*BoltStore) LoadChampionship ¶
func (rs *BoltStore) LoadChampionship(id string) (*Championship, error)
func (*BoltStore) LoadKissMyRankOptions ¶
func (rs *BoltStore) LoadKissMyRankOptions() (*KissMyRankConfig, error)
func (*BoltStore) LoadLastRaceEvent ¶
func (*BoltStore) LoadLiveTimingsData ¶
func (rs *BoltStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
func (*BoltStore) LoadRaceWeekend ¶
func (rs *BoltStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
func (*BoltStore) LoadRealPenaltyOptions ¶
func (rs *BoltStore) LoadRealPenaltyOptions() (*RealPenaltyConfig, error)
func (*BoltStore) LoadServerOptions ¶
func (rs *BoltStore) LoadServerOptions() (*GlobalServerConfig, error)
func (*BoltStore) LoadStrackerOptions ¶
func (rs *BoltStore) LoadStrackerOptions() (*StrackerConfiguration, error)
func (*BoltStore) UpsertAccount ¶
func (*BoltStore) UpsertChampionship ¶
func (rs *BoltStore) UpsertChampionship(c *Championship) error
func (*BoltStore) UpsertCustomRace ¶
func (rs *BoltStore) UpsertCustomRace(race *CustomRace) error
func (*BoltStore) UpsertEntrant ¶
func (*BoltStore) UpsertKissMyRankOptions ¶
func (rs *BoltStore) UpsertKissMyRankOptions(kmr *KissMyRankConfig) error
func (*BoltStore) UpsertLastRaceEvent ¶
func (*BoltStore) UpsertLiveFrames ¶
func (*BoltStore) UpsertLiveTimingsData ¶
func (rs *BoltStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error
func (*BoltStore) UpsertRaceWeekend ¶
func (rs *BoltStore) UpsertRaceWeekend(rw *RaceWeekend) error
func (*BoltStore) UpsertRealPenaltyOptions ¶
func (rs *BoltStore) UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error
func (*BoltStore) UpsertServerOptions ¶
func (rs *BoltStore) UpsertServerOptions(so *GlobalServerConfig) error
func (*BoltStore) UpsertStrackerOptions ¶
func (rs *BoltStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
type CMAssists ¶
type CMAssists struct { ABSState FactoryAssist `json:"absState"` AllowedTyresOut int `json:"allowedTyresOut"` AutoClutchAllowed bool `json:"autoclutchAllowed"` DamageMultiplier int `json:"damageMultiplier"` ForceVirtualMirror bool `json:"forceVirtualMirror"` FuelRate int `json:"fuelRate"` StabilityAllowed bool `json:"stabilityAllowed"` TractionControlState FactoryAssist `json:"tcState"` TyreBlanketsAllowed bool `json:"tyreBlanketsAllowed"` TyreWearRate int `json:"tyreWearRate"` }
type CMCar ¶
type CMCar struct { DriverName string `json:"DriverName"` DriverNation string `json:"DriverNation"` DriverTeam string `json:"DriverTeam"` ID string `json:"ID"` IsConnected bool `json:"IsConnected"` IsEntryList bool `json:"IsEntryList"` IsRequestedGUID bool `json:"IsRequestedGUID"` Model string `json:"Model"` Skin string `json:"Skin"` }
type CMContent ¶
type CMContent struct { Cars map[string]ContentURL `json:"cars"` Track ContentURL `json:"track"` // @TODO not functional Password bool `json:"password"` }
type CalendarObject ¶
type CalendarObject struct { ID string `json:"id"` ScheduledServerID ServerID `json:"scheduledServerID"` GroupID string `json:"groupId"` AllDay bool `json:"allDay"` Start time.Time `json:"start"` End time.Time `json:"end"` Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` SignUpURL string `json:"signUpURL"` ClassNames []string `json:"classNames"` Editable bool `json:"editable"` StartEditable bool `json:"startEditable"` DurationEditable bool `json:"durationEditable"` ResourceEditable bool `json:"resourceEditable"` Rendering string `json:"rendering"` Overlap bool `json:"overlap"` Constraint string `json:"constraint"` BackgroundColor string `json:"backgroundColor"` BorderColor string `json:"borderColor"` TextColor string `json:"textColor"` }
func BuildCalObject ¶
func BuildCalObject(scheduled []ScheduledEvent, calendarObjects []CalendarObject) ([]CalendarObject, error)
type Car ¶
type Car struct { Name string Skins []string Tyres map[string]string Details CarDetails }
func (Car) PrettyName ¶
type CarDetails ¶
type CarDetails struct { Author string `json:"author"` Brand string `json:"brand"` Class string `json:"class"` Country string `json:"country"` Description string `json:"description"` Name string `json:"name"` PowerCurve [][]json.Number `json:"powerCurve"` Specs CarSpecs `json:"specs"` SpecsNumeric CarSpecsNumeric `json:"spec"` Tags []string `json:"tags"` TorqueCurve [][]json.Number `json:"torqueCurve"` URL string `json:"url"` Version string `json:"version"` Year ShouldBeAnInt `json:"year"` IsStock bool `json:"stock"` IsDLC bool `json:"dlc"` IsMod bool `json:"mod"` Key string `json:"key"` PrettifiedKey string `json:"prettified_key"` DownloadURL string `json:"downloadURL"` Notes string `json:"notes"` }
func (*CarDetails) AddTag ¶
func (cd *CarDetails) AddTag(name string)
func (*CarDetails) DelTag ¶
func (cd *CarDetails) DelTag(name string)
func (*CarDetails) Load ¶
func (cd *CarDetails) Load(carName string) error
func (*CarDetails) Save ¶
func (cd *CarDetails) Save(carName string) error
type CarManager ¶
type CarManager struct {
// contains filtered or unexported fields
}
func NewCarManager ¶
func NewCarManager(trackManager *TrackManager, watchForCarChanges, useCarNameCache bool) *CarManager
func (*CarManager) AddTag ¶
func (cm *CarManager) AddTag(carName, tag string) error
func (*CarManager) CreateOrOpenSearchIndex ¶
func (cm *CarManager) CreateOrOpenSearchIndex() error
CreateSearchIndex builds a search index for the cars
func (*CarManager) DeIndexCar ¶
func (cm *CarManager) DeIndexCar(name string) error
DeIndexCar removes a car from the index.
func (*CarManager) DelTag ¶
func (cm *CarManager) DelTag(carName, tag string) error
func (*CarManager) DeleteCar ¶
func (cm *CarManager) DeleteCar(carName string) error
DeleteCar removes a car from the file system and search index.
func (*CarManager) DeleteSkin ¶
func (cm *CarManager) DeleteSkin(car, skin string) error
func (*CarManager) IndexAllCars ¶
func (cm *CarManager) IndexAllCars() error
IndexAllCars loads all current cars and adds them to the search index
func (*CarManager) IndexCar ¶
func (cm *CarManager) IndexCar(car *Car) error
IndexCar indexes an individual car.
func (*CarManager) ListCars ¶
func (cm *CarManager) ListCars() (Cars, error)
func (*CarManager) LoadCar ¶
func (cm *CarManager) LoadCar(name string, tyres Tyres) (*Car, error)
LoadCar reads a car from the content folder on the filesystem
func (*CarManager) RandomSkin ¶
func (cm *CarManager) RandomSkin(model string) string
func (*CarManager) ResultsForCar ¶
func (cm *CarManager) ResultsForCar(car string) ([]SessionResults, error)
ResultsForCar finds results for a given car.
func (*CarManager) SaveCarDetails ¶
func (cm *CarManager) SaveCarDetails(carName string, car *Car) error
SaveCarDetails saves a car's details, and indexes that car.
func (*CarManager) Search ¶
func (cm *CarManager) Search(ctx context.Context, term string, from, size int) (*bleve.SearchResult, Cars, error)
Search looks for cars in the search index.
func (*CarManager) UpdateCarMetadata ¶
func (cm *CarManager) UpdateCarMetadata(carName string, r *http.Request) error
func (*CarManager) UpdateTyres ¶
func (cm *CarManager) UpdateTyres(car *Car) error
func (*CarManager) UploadSkin ¶
func (cm *CarManager) UploadSkin(carName string, files map[string][]*multipart.FileHeader) error
type CarSetups ¶
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 ¶
type CarSpecs ¶
type CarSpecs struct { Acceleration string `json:"acceleration"` BHP string `json:"bhp"` PWRatio string `json:"pwratio"` TopSpeed string `json:"topspeed"` Torque string `json:"torque"` Weight string `json:"weight"` }
func (CarSpecs) Numeric ¶
func (cs CarSpecs) Numeric() CarSpecsNumeric
type CarSpecsNumeric ¶
type CarsHandler ¶
type CarsHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewCarsHandler ¶
func NewCarsHandler(baseHandler *BaseHandler, carManager *CarManager) *CarsHandler
type Championship ¶
type Championship struct { ID uuid.UUID Name string Created time.Time Updated time.Time Deleted time.Time OverridePassword bool ReplacementPassword string // acsr integration - sends the championship to acsr on save and event complete ACSR bool ACSRSkillGate string ACSRSafetyGate int EnableACSRSafetyGate bool EnableACSRSkillGate bool // Raw html can be attached to championships, used to share tracks/cars etc. Info template.HTML // URL to a specific OG Image for the championship OGImage string // OpenEntrants indicates that entrant names do not need to be specified in the EntryList. // As Entrants join a championship, the available Entrant slots will be filled by the information // provided by a join message. The EntryList for each class will still need creating, but // can omit names/GUIDs/teams as necessary. These can then be edited after the fact. OpenEntrants bool // PersistOpenEntrants (used with OpenEntrants) indicates that drivers who join the Championship // should be added to the Championship EntryList. This is ON by default. PersistOpenEntrants bool // SignUpForm gives anyone on the web access to a Championship Sign Up Form so that they can // mark themselves for participation in this Championship. SignUpForm ChampionshipSignUpForm Classes []*ChampionshipClass Events []*ChampionshipEvent // SpectatorCar is a car defined in the Championship settings that if set up is added to the back of the grid // of every event in the Championship. SpectatorCar Entrant SpectatorCarEnabled bool DefaultTab ChampionshipTab }
A Championship is a collection of ChampionshipEvents for a group of Entrants. Each Entrant in a Championship is awarded Points for their position in a ChampionshipEvent.
func NewChampionship ¶
func NewChampionship(name string) *Championship
NewChampionship creates a Championship with a given name, creating a UUID for the championship as well.
func (*Championship) AddClass ¶
func (c *Championship) AddClass(class *ChampionshipClass)
AddClass to the championship
func (*Championship) AddEntrantFromSession ¶
func (c *Championship) AddEntrantFromSession(potentialEntrant PotentialChampionshipEntrant) (foundFreeEntrantSlot bool, entrant *Entrant, entrantClass *ChampionshipClass, err error)
func (*Championship) AddEntrantInFirstFreeSlot ¶
func (c *Championship) AddEntrantInFirstFreeSlot(potentialEntrant PotentialChampionshipEntrant) (foundFreeEntrantSlot bool, entrant *Entrant, entrantClass *ChampionshipClass, err error)
func (*Championship) AllEntrants ¶
func (c *Championship) AllEntrants() EntryList
AllEntrants returns the list of all entrants in the championship (across ALL classes)
func (*Championship) AttachClassIDToResults ¶
func (c *Championship) AttachClassIDToResults(results *SessionResults)
func (*Championship) ClassByID ¶
func (c *Championship) ClassByID(id string) (*ChampionshipClass, error)
ClassByID finds a ChampionshipClass by its ID string.
func (*Championship) ClearEntrant ¶
func (c *Championship) ClearEntrant(entrantGUID string)
func (*Championship) DriverMeetsACSRGates ¶
func (c *Championship) DriverMeetsACSRGates(rating *ACSRDriverRating) bool
func (*Championship) EnhanceResults ¶
func (c *Championship) EnhanceResults(results *SessionResults)
EnhanceResults takes a set of SessionResults and attaches Championship information to them.
func (*Championship) EntrantAttendance ¶
func (c *Championship) EntrantAttendance(guid string) int
func (*Championship) EventByID ¶
func (c *Championship) EventByID(id string) (*ChampionshipEvent, int, error)
EventByID finds a ChampionshipEvent by its ID string.
func (*Championship) FindClassForCarModel ¶
func (c *Championship) FindClassForCarModel(model string) (*ChampionshipClass, error)
func (*Championship) FindLastResultForDriver ¶
func (c *Championship) FindLastResultForDriver(guid string) (out *SessionResult, teamName string)
func (*Championship) GetPlayerSummary ¶
func (c *Championship) GetPlayerSummary(guid string) string
func (*Championship) GetURL ¶
func (c *Championship) GetURL() string
func (*Championship) HasScheduledEvents ¶
func (c *Championship) HasScheduledEvents() bool
func (*Championship) HasSpectatorCar ¶
func (c *Championship) HasSpectatorCar() bool
func (*Championship) HasTeamNames ¶
func (c *Championship) HasTeamNames() bool
func (*Championship) ImportEvent ¶
func (c *Championship) ImportEvent(eventToImport interface{}) (*ChampionshipEvent, error)
func (*Championship) IsMultiClass ¶
func (c *Championship) IsMultiClass() bool
IsMultiClass is true if the Championship has more than one Class
func (*Championship) MostRecentScheduledDateFormat ¶
func (c *Championship) MostRecentScheduledDateFormat(format string) string
func (*Championship) NumCompletedEvents ¶
func (c *Championship) NumCompletedEvents() int
func (*Championship) NumEntrants ¶
func (c *Championship) NumEntrants() int
NumEntrants is the number of entrants across all Classes in a Championship.
func (*Championship) NumPendingSignUps ¶
func (c *Championship) NumPendingSignUps() int
func (*Championship) Progress ¶
func (c *Championship) Progress() float64
Progress of the Championship as a percentage
func (*Championship) SignUpAvailable ¶
func (c *Championship) SignUpAvailable() bool
func (*Championship) ValidCarIDs ¶
func (c *Championship) ValidCarIDs() []string
ValidCarIDs returns a set of all of the valid cars in the Championship - that is, the smallest possible list of Cars driven by the Entrants.
type ChampionshipClass ¶
type ChampionshipClass struct { ID uuid.UUID Name string Entrants EntryList Points ChampionshipPoints AvailableCars []string DriverPenalties, TeamPenalties map[string]int }
ChampionshipClass contains a Name, Entrants (including Cars, Skins) and Points for those Entrants
func NewChampionshipClass ¶
func NewChampionshipClass(name string) *ChampionshipClass
NewChampionshipClass creates a championship class with the default points
func (*ChampionshipClass) AssignToFreeEntrantSlot ¶
func (c *ChampionshipClass) AssignToFreeEntrantSlot(entrant *Entrant, potentialEntrant PotentialChampionshipEntrant)
func (*ChampionshipClass) AttachEntrantToResult ¶
func (c *ChampionshipClass) AttachEntrantToResult(entrant *Entrant, results *SessionResults)
func (*ChampionshipClass) CountPositionsForDriver ¶
func (c *ChampionshipClass) CountPositionsForDriver(i int, guid string, inEvents []*ChampionshipEvent) int
func (*ChampionshipClass) CountPositionsForTeam ¶
func (c *ChampionshipClass) CountPositionsForTeam(i int, team string, inEvents []*ChampionshipEvent) int
func (*ChampionshipClass) DriverInClass ¶
func (c *ChampionshipClass) DriverInClass(result *SessionResult) bool
func (*ChampionshipClass) HadBetterFinishingPositions ¶
func (c *ChampionshipClass) HadBetterFinishingPositions(guidA, guidB string, inEvents []*ChampionshipEvent, numPositions int) bool
func (*ChampionshipClass) PenaltyForGUID ¶
func (c *ChampionshipClass) PenaltyForGUID(guid string) int
func (*ChampionshipClass) PenaltyForTeam ¶
func (c *ChampionshipClass) PenaltyForTeam(name string) int
func (*ChampionshipClass) ResultsForClass ¶
func (c *ChampionshipClass) ResultsForClass(results []*SessionResult, championship *Championship) (filtered []*SessionResult)
func (*ChampionshipClass) Standings ¶
func (c *ChampionshipClass) Standings(championship *Championship, inEvents []*ChampionshipEvent, standingOpts ...StandingsOption) []*ChampionshipStanding
Standings returns the current Driver Standings for the Championship.
func (*ChampionshipClass) StandingsForEntrantAtEvent ¶
func (c *ChampionshipClass) StandingsForEntrantAtEvent(championship *Championship, event *ChampionshipEvent, entrant *ChampionshipStanding) *ChampionshipStandingWithTableInfo
func (*ChampionshipClass) StandingsForEvent ¶
func (c *ChampionshipClass) StandingsForEvent(championship *Championship, event *ChampionshipEvent) []*ChampionshipStanding
StandingsForEvent reports the standings for a single event, not including any generic points penalties applied to the championship.
func (*ChampionshipClass) TeamHadBetterFinishingPositions ¶
func (c *ChampionshipClass) TeamHadBetterFinishingPositions(teamA, teamB string, inEvents []*ChampionshipEvent, numPositions int) bool
func (*ChampionshipClass) TeamStandings ¶
func (c *ChampionshipClass) TeamStandings(championship *Championship, inEvents []*ChampionshipEvent) []*TeamStanding
TeamStandings returns the current position of Teams in the Championship.
func (*ChampionshipClass) ValidCarIDs ¶
func (c *ChampionshipClass) ValidCarIDs() []string
ValidCarIDs returns a set of all cars chosen within the given class
type ChampionshipClassSort ¶
type ChampionshipClassSort struct{}
func (ChampionshipClassSort) Sort ¶
func (ChampionshipClassSort) Sort(rw *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
type ChampionshipEntrantStatus ¶
type ChampionshipEntrantStatus string
type ChampionshipEvent ¶
type ChampionshipEvent struct { ScheduledEventBase ID uuid.UUID RaceSetup CurrentRaceConfig EntryList EntryList Sessions map[SessionType]*ChampionshipSession `json:",omitempty"` // RaceWeekendID is the ID of the linked RaceWeekend for this ChampionshipEvent RaceWeekendID uuid.UUID // If RaceWeekendID is non-nil, RaceWeekend will be populated on loading the Championship. RaceWeekend *RaceWeekend StartedTime time.Time CompletedTime time.Time // contains filtered or unexported fields }
A ChampionshipEvent is a given RaceSetup with Sessions.
func DuplicateChampionshipEvent ¶
func DuplicateChampionshipEvent(event *ChampionshipEvent) *ChampionshipEvent
copied an existing ChampionshipEvent but assigns a new ID
func ExtractRaceWeekendSessionsIntoIndividualEvents ¶
func ExtractRaceWeekendSessionsIntoIndividualEvents(inEvents []*ChampionshipEvent) []*ChampionshipEvent
extractRaceWeekendSessionsIntoIndividualEvents looks for race weekend events, and makes each indiivdual session of that race weekend a Championship Event, to aide with points tallying
func NewChampionshipEvent ¶
func NewChampionshipEvent() *ChampionshipEvent
NewChampionshipEvent creates a ChampionshipEvent with an ID
func (*ChampionshipEvent) Cars ¶
func (cr *ChampionshipEvent) Cars(c *Championship) []string
func (*ChampionshipEvent) CombineEntryLists ¶
func (cr *ChampionshipEvent) CombineEntryLists(championship *Championship) EntryList
func (*ChampionshipEvent) Completed ¶
func (cr *ChampionshipEvent) Completed() bool
Completed ChampionshipEvents have a non-zero CompletedTime
func (*ChampionshipEvent) GetID ¶
func (cr *ChampionshipEvent) GetID() uuid.UUID
func (*ChampionshipEvent) GetRaceSetup ¶
func (cr *ChampionshipEvent) GetRaceSetup() CurrentRaceConfig
func (*ChampionshipEvent) GetScheduledServerID ¶
func (cr *ChampionshipEvent) GetScheduledServerID() ServerID
func (*ChampionshipEvent) GetSummary ¶
func (cr *ChampionshipEvent) GetSummary() string
func (*ChampionshipEvent) GetURL ¶
func (cr *ChampionshipEvent) GetURL() string
func (*ChampionshipEvent) HasSignUpForm ¶
func (cr *ChampionshipEvent) HasSignUpForm() bool
func (*ChampionshipEvent) InProgress ¶
func (cr *ChampionshipEvent) InProgress() bool
InProgress indicates whether a ChampionshipEvent has been started but not stopped
func (*ChampionshipEvent) IsRaceWeekend ¶
func (cr *ChampionshipEvent) IsRaceWeekend() bool
func (*ChampionshipEvent) LastSession ¶
func (cr *ChampionshipEvent) LastSession() SessionType
LastSession returns the last configured session in the championship, in the following order: Race, Qualifying, Practice, Booking
func (*ChampionshipEvent) ReadOnlyEntryList ¶
func (cr *ChampionshipEvent) ReadOnlyEntryList() EntryList
type ChampionshipManager ¶
type ChampionshipManager struct { *RaceManager // contains filtered or unexported fields }
func NewChampionshipManager ¶
func NewChampionshipManager(raceManager *RaceManager, acsrClient *ACSRClient) *ChampionshipManager
func (*ChampionshipManager) AddEntrantFromSessionData ¶
func (cm *ChampionshipManager) AddEntrantFromSessionData(championship *Championship, potentialEntrant PotentialChampionshipEntrant, overwriteSkinForAllEvents bool, takeFirstFreeSlot bool) (foundFreeEntrantSlot bool, entrantClass *ChampionshipClass, err error)
func (*ChampionshipManager) BuildChampionshipEventOpts ¶
func (cm *ChampionshipManager) BuildChampionshipEventOpts(r *http.Request) (*RaceTemplateVars, error)
func (*ChampionshipManager) BuildChampionshipOpts ¶
func (cm *ChampionshipManager) BuildChampionshipOpts(r *http.Request) (championship *Championship, opts *ChampionshipTemplateVars, err error)
func (*ChampionshipManager) BuildICalFeed ¶
func (cm *ChampionshipManager) BuildICalFeed(championshipID string, w io.Writer) error
func (*ChampionshipManager) CancelEvent ¶
func (cm *ChampionshipManager) CancelEvent(championshipID string, eventID string) error
func (*ChampionshipManager) ChampionshipEventCallback ¶
func (cm *ChampionshipManager) ChampionshipEventCallback(message udp.Message)
func (*ChampionshipManager) ChampionshipEventIsRunning ¶
func (cm *ChampionshipManager) ChampionshipEventIsRunning() bool
func (*ChampionshipManager) DeleteChampionship ¶
func (cm *ChampionshipManager) DeleteChampionship(id string) error
func (*ChampionshipManager) DeleteEvent ¶
func (cm *ChampionshipManager) DeleteEvent(championshipID string, eventID string) error
func (*ChampionshipManager) DuplicateChampionship ¶
func (cm *ChampionshipManager) DuplicateChampionship(championshipID string) (*Championship, error)
func (*ChampionshipManager) DuplicateEvent ¶
func (cm *ChampionshipManager) DuplicateEvent(event *ChampionshipEvent, championship *Championship) (*ChampionshipEvent, error)
func (*ChampionshipManager) DuplicateEventInChampionship ¶
func (cm *ChampionshipManager) DuplicateEventInChampionship(championshipID, eventID string) (*ChampionshipEvent, error)
func (*ChampionshipManager) FinalEventConfigurationFiles ¶
func (cm *ChampionshipManager) FinalEventConfigurationFiles(championship *Championship, event *ChampionshipEvent, isPreChampionshipPracticeEvent bool) (CurrentRaceConfig, EntryList)
func (*ChampionshipManager) FindNextEventRecurrence ¶
func (cm *ChampionshipManager) FindNextEventRecurrence(event *ChampionshipEvent, start time.Time) time.Time
func (*ChampionshipManager) GetChampionshipAndEvent ¶
func (cm *ChampionshipManager) GetChampionshipAndEvent(championshipID string, eventID string) (*Championship, *ChampionshipEvent, error)
func (*ChampionshipManager) HandleChampionshipSignUp ¶
func (cm *ChampionshipManager) HandleChampionshipSignUp(r *http.Request) (response *ChampionshipSignUpResponse, foundSlot bool, err error)
func (*ChampionshipManager) HandleCreateChampionship ¶
func (cm *ChampionshipManager) HandleCreateChampionship(r *http.Request) (championship *Championship, edited bool, err error)
func (*ChampionshipManager) ImportChampionship ¶
func (cm *ChampionshipManager) ImportChampionship(jsonData string) (string, error)
func (*ChampionshipManager) ImportEvent ¶
func (*ChampionshipManager) ImportEventSetup ¶
func (cm *ChampionshipManager) ImportEventSetup(championshipID string, eventID string) error
func (*ChampionshipManager) ImportRaceWeekendSetup ¶
func (cm *ChampionshipManager) ImportRaceWeekendSetup(championshipID string, eventID string) error
func (*ChampionshipManager) InitScheduledChampionships ¶
func (cm *ChampionshipManager) InitScheduledChampionships() error
func (*ChampionshipManager) ListAvailableResultsFilesForEvent ¶
func (cm *ChampionshipManager) ListAvailableResultsFilesForEvent(championshipID string, eventID string) (*ChampionshipEvent, []SessionResults, error)
func (*ChampionshipManager) ListChampionships ¶
func (cm *ChampionshipManager) ListChampionships() ([]*Championship, error)
func (*ChampionshipManager) LoadACSRRanges ¶
func (cm *ChampionshipManager) LoadACSRRanges() ([]*ACSRRatingRanges, error)
func (*ChampionshipManager) LoadACSRRating ¶
func (cm *ChampionshipManager) LoadACSRRating(guid string) (*ACSRDriverRating, error)
func (*ChampionshipManager) LoadACSRRatings ¶
func (cm *ChampionshipManager) LoadACSRRatings(championship *Championship) (map[string]*ACSRDriverRating, error)
func (*ChampionshipManager) LoadChampionship ¶
func (cm *ChampionshipManager) LoadChampionship(id string) (*Championship, error)
func (*ChampionshipManager) ModifyDriverPenalty ¶
func (cm *ChampionshipManager) ModifyDriverPenalty(championshipID, classID, driverGUID string, action PenaltyAction, penalty int) error
func (*ChampionshipManager) ModifyTeamPenalty ¶
func (cm *ChampionshipManager) ModifyTeamPenalty(championshipID, classID, team string, action PenaltyAction, penalty int) error
func (*ChampionshipManager) ReorderChampionshipEvents ¶
func (cm *ChampionshipManager) ReorderChampionshipEvents(championshipID string, championshipEventIDsInOrder []string) error
func (*ChampionshipManager) RestartActiveEvent ¶
func (cm *ChampionshipManager) RestartActiveEvent() error
func (*ChampionshipManager) RestartEvent ¶
func (cm *ChampionshipManager) RestartEvent(championshipID string, eventID string) error
func (*ChampionshipManager) SaveChampionshipEvent ¶
func (cm *ChampionshipManager) SaveChampionshipEvent(r *http.Request) (championship *Championship, event *ChampionshipEvent, edited bool, err error)
func (*ChampionshipManager) ScheduleEvent ¶
func (*ChampionshipManager) ScheduleNextEventFromRecurrence ¶
func (cm *ChampionshipManager) ScheduleNextEventFromRecurrence(championship *Championship, event *ChampionshipEvent) error
func (*ChampionshipManager) StartEvent ¶
func (cm *ChampionshipManager) StartEvent(championshipID string, eventID string, isPreChampionshipPracticeEvent bool) error
func (*ChampionshipManager) StartPracticeEvent ¶
func (cm *ChampionshipManager) StartPracticeEvent(championshipID string, eventID string) error
Start a 2hr long Practice Event based off the existing championship event with eventID
func (*ChampionshipManager) StartScheduledEvent ¶
func (cm *ChampionshipManager) StartScheduledEvent(championship *Championship, event *ChampionshipEvent) error
func (*ChampionshipManager) StopActiveEvent ¶
func (cm *ChampionshipManager) StopActiveEvent() error
func (*ChampionshipManager) UpsertChampionship ¶
func (cm *ChampionshipManager) UpsertChampionship(c *Championship) error
type ChampionshipPoints ¶
type ChampionshipPoints struct { Places []int BestLap int PolePosition int CollisionWithDriver int CollisionWithEnv int CutTrack int SecondRaceMultiplier float64 }
ChampionshipPoints represent the potential points for positions as well as other awards in a Championship.
func (*ChampionshipPoints) ForPos ¶
func (pts *ChampionshipPoints) ForPos(i int) float64
PointForPos uses the Championship's Points to determine what number should be awarded to a given position
type ChampionshipSession ¶
type ChampionshipSession struct { StartedTime time.Time CompletedTime time.Time Results *SessionResults RaceWeekendSession *RaceWeekendSession }
A ChampionshipSession contains information found from the live portion of the Championship tool
func (*ChampionshipSession) Completed ¶
func (ce *ChampionshipSession) Completed() bool
Completed ChampionshipSessions have a non-zero CompletedTime
func (*ChampionshipSession) InProgress ¶
func (ce *ChampionshipSession) InProgress() bool
InProgress indicates whether a ChampionshipSession has been started but not stopped
func (*ChampionshipSession) IsRaceWeekend ¶
func (ce *ChampionshipSession) IsRaceWeekend() bool
type ChampionshipSignUpForm ¶
type ChampionshipSignUpForm struct { Enabled bool AskForEmail bool AskForTeam bool HideCarChoice bool ExtraFields []string RequiresApproval bool Responses []*ChampionshipSignUpResponse }
func (ChampionshipSignUpForm) EmailList ¶
func (c ChampionshipSignUpForm) EmailList(group string) string
type ChampionshipSignUpResponse ¶
type ChampionshipSignUpResponse struct { Created time.Time Name string GUID string Team string Email string Car string Skin string Questions map[string]string Status ChampionshipEntrantStatus }
func (ChampionshipSignUpResponse) GetCar ¶
func (csr ChampionshipSignUpResponse) GetCar() string
func (ChampionshipSignUpResponse) GetGUID ¶
func (csr ChampionshipSignUpResponse) GetGUID() string
func (ChampionshipSignUpResponse) GetName ¶
func (csr ChampionshipSignUpResponse) GetName() string
func (ChampionshipSignUpResponse) GetSkin ¶
func (csr ChampionshipSignUpResponse) GetSkin() string
func (ChampionshipSignUpResponse) GetTeam ¶
func (csr ChampionshipSignUpResponse) GetTeam() string
type ChampionshipStanding ¶
type ChampionshipStanding struct { Car *SessionCar // Teams is a map of Team Name to how many Events per team were completed. Teams map[string]int Points float64 }
ChampionshipStanding is the current number of Points an Entrant in the Championship has.
func NewChampionshipStanding ¶
func NewChampionshipStanding(car *SessionCar) *ChampionshipStanding
func (*ChampionshipStanding) AddEventForTeam ¶
func (cs *ChampionshipStanding) AddEventForTeam(team string)
func (*ChampionshipStanding) TeamSummary ¶
func (cs *ChampionshipStanding) TeamSummary() string
type ChampionshipStandingWithTableInfo ¶
type ChampionshipStandingWithTableInfo struct { *ChampionshipStanding BackgroundColour template.CSS NoFinishReason string }
type ChampionshipStandingsOrderEntryListSort ¶
type ChampionshipStandingsOrderEntryListSort struct{}
func (ChampionshipStandingsOrderEntryListSort) Sort ¶
func (ChampionshipStandingsOrderEntryListSort) Sort(rw *RaceWeekend, _ *RaceWeekendSession, entrants []*RaceWeekendSessionEntrant, _ *RaceWeekendSessionToSessionFilter) error
type ChampionshipTab ¶
type ChampionshipTab string
const ( ChampionshipTabDriverStandings ChampionshipTab = "Driver Standings" ChampionshipTabTeamStandings ChampionshipTab = "Team Standings" ChampionshipTabOverview ChampionshipTab = "Overview" ChampionshipTabEntrants ChampionshipTab = "Entrants" ChampionshipTabPointsReference ChampionshipTab = "Points Reference" )
type ChampionshipTemplateVars ¶
type ChampionshipTemplateVars struct { *RaceTemplateVars DefaultPoints ChampionshipPoints DefaultClass *ChampionshipClass ACSREnabled bool ACSRRanges *ACSRRanges AvailableChampionshipTabs []ChampionshipTab }
type ChampionshipsConfig ¶
type ChampionshipsHandler ¶
type ChampionshipsHandler struct { *BaseHandler SteamLoginHandler // contains filtered or unexported fields }
func NewChampionshipsHandler ¶
func NewChampionshipsHandler(baseHandler *BaseHandler, championshipManager *ChampionshipManager) *ChampionshipsHandler
type Collision ¶
type Collision struct { ID string `json:"ID"` Type CollisionType `json:"Type"` Time time.Time `json:"Time" ts:"date"` OtherDriverGUID udp.DriverGUID `json:"OtherDriverGUID"` OtherDriverName string `json:"OtherDriverName"` Speed float64 `json:"Speed"` }
type CollisionType ¶
type CollisionType string
const ( CollisionWithCar CollisionType = "with other car" CollisionWithEnvironment CollisionType = "with environment" )
type CommandPlugin ¶
type CommandPlugin struct { Executable string `yaml:"executable"` Arguments []string `yaml:"arguments"` }
func (*CommandPlugin) String ¶
func (c *CommandPlugin) String() string
type Configuration ¶
type Configuration struct { HTTP HTTPConfig `yaml:"http"` Steam SteamConfig `yaml:"steam"` Store StoreConfig `yaml:"store"` LiveMap LiveMapConfig `yaml:"live_map"` Server ServerExtraConfig `yaml:"server"` Accounts AccountsConfig `yaml:"accounts"` Monitoring MonitoringConfig `yaml:"monitoring"` Championships ChampionshipsConfig `yaml:"championships"` Lua LuaConfig `yaml:"lua"` }
func ReadConfig ¶
func ReadConfig(location string) (conf *Configuration, err error)
type ContentFile ¶
type ContentManagerWrapper ¶
type ContentManagerWrapper struct {
// contains filtered or unexported fields
}
func NewContentManagerWrapper ¶
func NewContentManagerWrapper(store Store, carManager *CarManager, trackManager *TrackManager) *ContentManagerWrapper
func (*ContentManagerWrapper) NewCMContent ¶
func (*ContentManagerWrapper) ServeHTTP ¶
func (cmw *ContentManagerWrapper) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ContentManagerWrapper) Start ¶
func (cmw *ContentManagerWrapper) Start(servePort int, event RaceEvent, logger cmwSessionLogger) error
func (*ContentManagerWrapper) Stop ¶
func (cmw *ContentManagerWrapper) Stop()
func (*ContentManagerWrapper) UDPCallback ¶
func (cmw *ContentManagerWrapper) UDPCallback(message udp.Message)
type ContentManagerWrapperData ¶
type ContentManagerWrapperData struct { ACHTTPSessionInfo Players ACHTTPPlayers `json:"players"` Description string `json:"description"` AmbientTemperature uint8 `json:"ambientTemperature"` RoadTemperature uint8 `json:"roadTemperature"` WindDirection int `json:"windDirection"` WindSpeed int `json:"windSpeed"` CurrentWeatherID string `json:"currentWeatherId"` Grip int `json:"grip"` GripTransfer int `json:"gripTransfer"` Assists CMAssists `json:"assists"` MaxContactsPerKM int `json:"maxContactsPerKm"` City string `json:"city"` PasswordChecksum [2]string `json:"passwordChecksum"` WrappedPort int `json:"wrappedPort"` Content *CMContent `json:"content"` Frequency int `json:"frequency"` Until int64 `json:"until"` }
type ContentType ¶
type ContentType string
type ContentURL ¶
type ContentURL struct {
URL string `json:"url"`
}
type ContentUploadHandler ¶
type ContentUploadHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewContentUploadHandler ¶
func NewContentUploadHandler(baseHandler *BaseHandler, carManager *CarManager, trackManager *TrackManager) *ContentUploadHandler
type CurrentRaceConfig ¶
type CurrentRaceConfig struct { Cars string `ini:"CARS" show:"quick" input:"multiSelect" formopts:"CarOpts" help:"Models of cars allowed in the server"` Track string `ini:"TRACK" show:"quick" input:"dropdown" formopts:"TrackOpts" help:"Track name"` TrackLayout string `` /* 128-byte string literal not displayed */ SunAngle int `ini:"SUN_ANGLE" help:"Angle of the position of the sun"` LegalTyres string `ini:"LEGAL_TYRES" help:"List of tyres short names that are allowed"` FuelRate int `ini:"FUEL_RATE" min:"0" help:"Fuel usage from 0 (no fuel usage) to XXX (100 is the realistic one)"` DamageMultiplier int `ini:"DAMAGE_MULTIPLIER" min:"0" max:"100" help:"Damage from 0 (no damage) to 100 (full damage)"` TyreWearRate int `ini:"TYRE_WEAR_RATE" min:"0" help:"Tyre wear from 0 (no tyre wear) to XXX (100 is the realistic one)"` AllowedTyresOut int `ini:"ALLOWED_TYRES_OUT" help:"TODO: I have no idea"` ABSAllowed FactoryAssist `` /* 133-byte string literal not displayed */ TractionControlAllowed FactoryAssist `` /* 129-byte string literal not displayed */ StabilityControlAllowed int `ini:"STABILITY_ALLOWED" input:"checkbox" help:"Stability assist 0 -> OFF; 1 -> ON"` AutoClutchAllowed int `ini:"AUTOCLUTCH_ALLOWED" input:"checkbox" help:"Autoclutch assist 0 -> OFF; 1 -> ON"` TyreBlanketsAllowed int `` /* 147-byte string literal not displayed */ ForceVirtualMirror int `` /* 126-byte string literal not displayed */ RacePitWindowStart int `ini:"RACE_PIT_WINDOW_START" help:"pit window opens at lap/minute specified"` RacePitWindowEnd int `ini:"RACE_PIT_WINDOW_END" help:"pit window closes at lap/minute specified"` ReversedGridRacePositions int `` /* 216-byte string literal not displayed */ TimeOfDayMultiplier int `ini:"TIME_OF_DAY_MULT" help:"multiplier for the time of day"` QualifyMaxWaitPercentage int `` /* 205-byte string literal not displayed */ RaceGasPenaltyDisabled int `` /* 195-byte string literal not displayed */ MaxBallastKilograms int `` /* 131-byte string literal not displayed */ RaceExtraLap int `ini:"RACE_EXTRA_LAP" input:"checkbox" help:"If the race is timed, force an extra lap after the leader has crossed the line"` MaxContactsPerKilometer int `ini:"MAX_CONTACTS_PER_KM" help:"Maximum number times you can make contact with another car in 1 kilometer."` ResultScreenTime int `ini:"RESULT_SCREEN_TIME" help:"Seconds of result screen between racing sessions"` PickupModeEnabled int `` /* 227-byte string literal not displayed */ LockedEntryList int `ini:"LOCKED_ENTRY_LIST" input:"checkbox" help:"Only players already included in the entry list can join the server"` LoopMode int `ini:"LOOP_MODE" input:"checkbox" help:"the server restarts from the first track, to disable this set it to 0"` DriverSwapEnabled int `ini:"-" help:"Enable Driver Swaps, in order to carry out a Driver Swap give an entrant two or more GUIDs separated by ;'s'"` DriverSwapMinTime int `` /* 221-byte string literal not displayed */ DriverSwapDisqualifyTime int `` /* 131-byte string literal not displayed */ DriverSwapPenaltyTime int `` /* 155-byte string literal not displayed */ DriverSwapMinimumNumberOfSwaps int `ini:"-" help:"Minimum number of swaps required."` DriverSwapNotEnoughSwapsPenalty int `` /* 127-byte string literal not displayed */ MaxClients int `ini:"MAX_CLIENTS" help:"max number of clients (must be <= track's number of pits)"` RaceOverTime int `` /* 128-byte string literal not displayed */ StartRule StartRule `` /* 173-byte string literal not displayed */ IsSol int `` /* 138-byte string literal not displayed */ DisableDRSZones bool `ini:"-"` TimeAttack bool `ini:"-"` // time attack races will force loop ON and merge all results files (practice only) ExportSecondRaceToACSR bool `ini:"-"` DynamicTrack DynamicTrackConfig `ini:"-"` Sessions Sessions `ini:"-"` Weather map[string]*WeatherConfig `ini:"-"` }
func (*CurrentRaceConfig) AddSession ¶
func (c *CurrentRaceConfig) AddSession(sessionType SessionType, config *SessionConfig)
func (*CurrentRaceConfig) AddWeather ¶
func (c *CurrentRaceConfig) AddWeather(weather *WeatherConfig)
func (CurrentRaceConfig) GetSession ¶
func (c CurrentRaceConfig) GetSession(sessionType SessionType) *SessionConfig
func (CurrentRaceConfig) HasMultipleRaces ¶
func (c CurrentRaceConfig) HasMultipleRaces() bool
func (CurrentRaceConfig) HasSession ¶
func (c CurrentRaceConfig) HasSession(sess SessionType) bool
func (*CurrentRaceConfig) RemoveSession ¶
func (c *CurrentRaceConfig) RemoveSession(sessionType SessionType)
func (*CurrentRaceConfig) RemoveWeather ¶
func (c *CurrentRaceConfig) RemoveWeather(weather *WeatherConfig)
func (CurrentRaceConfig) Tyres ¶
func (c CurrentRaceConfig) Tyres() map[string]bool
type CustomRace ¶
type CustomRace struct { ScheduledEventBase Name string HasCustomName, OverridePassword bool ReplacementPassword string Created time.Time Updated time.Time Deleted time.Time UUID uuid.UUID Starred bool // Deprecated: Replaced by LoopServer Loop bool LoopServer map[ServerID]bool TimeAttackCombinedResultFile string ForceStopTime int ForceStopWithDrivers bool RaceConfig CurrentRaceConfig EntryList EntryList ScheduledEvents map[ServerID]*ScheduledEventBase }
func (*CustomRace) EventDescription ¶
func (cr *CustomRace) EventDescription() string
func (*CustomRace) EventName ¶
func (cr *CustomRace) EventName() string
func (*CustomRace) GetEntryList ¶
func (cr *CustomRace) GetEntryList() EntryList
func (*CustomRace) GetForceStopTime ¶
func (cr *CustomRace) GetForceStopTime() time.Duration
func (*CustomRace) GetForceStopWithDrivers ¶
func (cr *CustomRace) GetForceStopWithDrivers() bool
func (*CustomRace) GetID ¶
func (cr *CustomRace) GetID() uuid.UUID
func (*CustomRace) GetRaceConfig ¶
func (cr *CustomRace) GetRaceConfig() CurrentRaceConfig
func (*CustomRace) GetRaceSetup ¶
func (cr *CustomRace) GetRaceSetup() CurrentRaceConfig
func (*CustomRace) GetScheduledServerID ¶
func (cr *CustomRace) GetScheduledServerID() ServerID
func (*CustomRace) GetSummary ¶
func (cr *CustomRace) GetSummary() string
func (*CustomRace) GetURL ¶
func (cr *CustomRace) GetURL() string
func (*CustomRace) HasSignUpForm ¶
func (cr *CustomRace) HasSignUpForm() bool
func (*CustomRace) IsChampionship ¶
func (cr *CustomRace) IsChampionship() bool
func (*CustomRace) IsLooping ¶
func (cr *CustomRace) IsLooping() bool
func (*CustomRace) IsPractice ¶
func (cr *CustomRace) IsPractice() bool
func (*CustomRace) IsRaceWeekend ¶
func (cr *CustomRace) IsRaceWeekend() bool
func (*CustomRace) IsTimeAttack ¶
func (cr *CustomRace) IsTimeAttack() bool
func (*CustomRace) OverrideServerPassword ¶
func (cr *CustomRace) OverrideServerPassword() bool
func (*CustomRace) ReadOnlyEntryList ¶
func (cr *CustomRace) ReadOnlyEntryList() EntryList
func (*CustomRace) ReplacementServerPassword ¶
func (cr *CustomRace) ReplacementServerPassword() string
type CustomRaceHandler ¶
type CustomRaceHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewCustomRaceHandler ¶
func NewCustomRaceHandler(base *BaseHandler, raceManager *RaceManager, store Store, championshipManager *ChampionshipManager, raceWeekendManager *RaceWeekendManager) *CustomRaceHandler
type DiscordManager ¶
type DiscordManager struct {
// contains filtered or unexported fields
}
func NewDiscordManager ¶
func NewDiscordManager(store Store, scheduledRacesManager *ScheduledRacesManager) (*DiscordManager, error)
NewDiscordManager instantiates the DiscordManager type. On error, it will log the error and return the type flagged as disabled
func (*DiscordManager) CommandHandler ¶
func (dm *DiscordManager) CommandHandler(s *discordgo.Session, m *discordgo.MessageCreate)
func (*DiscordManager) CommandNotify ¶
func (dm *DiscordManager) CommandNotify(s *discordgo.Session, m *discordgo.MessageCreate) (string, error)
CommandNotify attempts to add a role ID (if configured) to the user issuing the !notify command The role will be added as a mention on all Discord notifications
func (*DiscordManager) CommandSchedule ¶
func (dm *DiscordManager) CommandSchedule() (string, error)
CommandSchedule outputs an abbreviated list of all scheduled events
func (*DiscordManager) CommandSessions ¶
func (dm *DiscordManager) CommandSessions() (string, error)
CommandSessions outputs a full list of all scheduled sessions (P, Q & R), using buildCalendar as a base
func (*DiscordManager) SaveServerOptions ¶
func (dm *DiscordManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
func (*DiscordManager) SendMessage ¶
func (dm *DiscordManager) SendMessage(title string, msg string) error
SendMessage sends a message to the configured channel and logs any errors
func (*DiscordManager) SendMessageWithLink ¶
func (dm *DiscordManager) SendMessageWithLink(title string, msg string, linkText string, link *url.URL) error
SendMessage sends a message to the configured channel and logs any errors
func (*DiscordManager) Stop ¶
func (dm *DiscordManager) Stop() error
type DriverMap ¶
type DriverMap struct { Drivers map[udp.DriverGUID]*RaceControlDriver `json:"Drivers"` GUIDsInPositionalOrder []udp.DriverGUID `json:"GUIDsInPositionalOrder"` // contains filtered or unexported fields }
func NewDriverMap ¶
func NewDriverMap(driverGroup RaceControlDriverGroup, driverSortLessFunc driverSortLessFunc) *DriverMap
func (*DriverMap) Add ¶
func (d *DriverMap) Add(driverGUID udp.DriverGUID, driver *RaceControlDriver)
func (*DriverMap) Del ¶
func (d *DriverMap) Del(driverGUID udp.DriverGUID)
func (*DriverMap) Each ¶
func (d *DriverMap) Each(fn func(driverGUID udp.DriverGUID, driver *RaceControlDriver) error) error
func (*DriverMap) Get ¶
func (d *DriverMap) Get(driverGUID udp.DriverGUID) (*RaceControlDriver, bool)
type DynamicTrackConfig ¶
type DynamicTrackConfig struct { SessionStart int `ini:"SESSION_START" help:"% level of grip at session start"` Randomness int `ini:"RANDOMNESS" help:"level of randomness added to the start grip"` SessionTransfer int `` /* 281-byte string literal not displayed */ LapGain int `ini:"LAP_GAIN" help:"how many laps are needed to add 1% grip"` }
type Entrant ¶
type Entrant struct { InternalUUID uuid.UUID `ini:"-"` PitBox int `ini:"-"` Name string `ini:"DRIVERNAME"` Team string `ini:"TEAM"` GUID string `ini:"GUID"` Model string `ini:"MODEL"` Skin string `ini:"SKIN"` Ballast int `ini:"BALLAST"` SpectatorMode int `ini:"SPECTATOR_MODE"` Restrictor int `ini:"RESTRICTOR"` FixedSetup string `ini:"FIXED_SETUP"` TransferTeamPoints bool `ini:"-" json:"-"` OverwriteAllEvents bool `ini:"-" json:"-"` IsPlaceHolder bool `ini:"-"` }
func NewEntrant ¶
func NewEntrant() *Entrant
func (*Entrant) AsSessionCar ¶
func (e *Entrant) AsSessionCar() *SessionCar
func (*Entrant) AsSessionResult ¶
func (e *Entrant) AsSessionResult() *SessionResult
func (*Entrant) AssignFromResult ¶
func (e *Entrant) AssignFromResult(result *SessionResult, car *SessionCar)
func (*Entrant) OverwriteProperties ¶
func (*Entrant) SwapProperties ¶
type EntryList ¶
func (EntryList) AddInPitBox ¶
AddInPitBox adds an Entrant in a specific pitbox - overwriting any entrant that was in that pitbox previously.
func (EntryList) AddToBackOfGrid ¶
Add an Entrant to the EntryList
func (EntryList) AlphaSlice ¶
func (EntryList) FindEntrantByInternalUUID ¶
func (EntryList) FindGreatestBallast ¶
returns the greatest ballast set on any entrant
func (EntryList) PrettyList ¶
func (EntryList) ReadString ¶
type FactoryAssist ¶
type FactoryAssist int
func (FactoryAssist) String ¶
func (a FactoryAssist) String() string
type FilterError ¶
type FilterError string
func (FilterError) Error ¶
func (f FilterError) Error() string
type FormHeading ¶
type FormHeading string
func (FormHeading) BuildFormElement ¶
func (f FormHeading) BuildFormElement(_ string, parent *html.Node, field formulate.StructField, _ formulate.Decorator) error
type GlobalServerConfig ¶
type GlobalServerConfig struct { AssettoCorsaServer FormHeading `ini:"-" json:"-" input:"heading"` Name string `ini:"NAME" help:"Server Name"` Password string `ini:"PASSWORD" type:"password" help:"Server password"` AdminPassword string `` /* 296-byte string literal not displayed */ UDPPort int `ini:"UDP_PORT" show:"open" min:"0" max:"65535" help:"UDP port number: open this port on your server's firewall"` TCPPort int `ini:"TCP_PORT" show:"open" min:"0" max:"65535" help:"TCP port number: open this port on your server's firewall"` HTTPPort int `` /* 135-byte string literal not displayed */ UDPPluginLocalPort int `` /* 487-byte string literal not displayed */ UDPPluginAddress string `` /* 463-byte string literal not displayed */ AuthPluginAddress string `ini:"AUTH_PLUGIN_ADDRESS" show:"open" help:"The address of the auth plugin"` RegisterToLobby formulate.BoolNumber `ini:"REGISTER_TO_LOBBY" show:"open" help:"Register the AC Server to the main lobby"` ClientSendIntervalInHertz int `` /* 228-byte string literal not displayed */ SendBufferSize int `ini:"SEND_BUFFER_SIZE" show:"open" help:""` ReceiveBufferSize int `ini:"RECV_BUFFER_SIZE" show:"open" help:""` KickQuorum int `ini:"KICK_QUORUM" help:"Percentage that is required for the kick vote to pass"` VotingQuorum int `ini:"VOTING_QUORUM" min:"0" help:"Percentage that is required for the session vote to pass"` VoteDuration int `ini:"VOTE_DURATION" min:"0" help:"Vote length in seconds"` BlacklistMode BlockListMode `ini:"BLACKLIST_MODE" name:"BlockList mode" help:"How to handle blocklisting of players."` NumberOfThreads int `ini:"NUM_THREADS" show:"open" min:"1" help:"Number of threads to run on"` WelcomeMessage string `ini:"WELCOME_MESSAGE" show:"-" help:"Path to the file that contains the server welcome message"` SleepTime int `` /* 178-byte string literal not displayed */ FreeUDPPluginLocalPort int `ini:"-" show:"-"` FreeUDPPluginAddress string `ini:"-" show:"-"` // ACSR AssettoCorsaSkillRating FormHeading `ini:"-" json:"-" show:"premium"` EnableACSR bool `` /* 140-byte string literal not displayed */ ACSRAccountID string `` /* 144-byte string literal not displayed */ ACSRAPIKey string `` /* 161-byte string literal not displayed */ ServerName FormHeading `ini:"-" json:"-"` ShowRaceNameInServerLobby formulate.BoolNumber `` /* 137-byte string literal not displayed */ ServerNameTemplate string `` /* 445-byte string literal not displayed */ Theme FormHeading `ini:"-" json:"-"` DarkTheme formulate.BoolNumber `ini:"-" help:"Enable Server Manager's Dark Theme by default"` CustomCSS string `` /* 214-byte string literal not displayed */ OGImage string `` /* 126-byte string literal not displayed */ ContentManagerIntegration FormHeading `ini:"-" json:"-"` EnableContentManagerWrapper formulate.BoolNumber `` /* 475-byte string literal not displayed */ ContentManagerWrapperPort int `` /* 170-byte string literal not displayed */ ShowContentManagerJoinLink formulate.BoolNumber `` /* 173-byte string literal not displayed */ ContentManagerIPOverride string `` /* 166-byte string literal not displayed */ Miscellaneous FormHeading `ini:"-" json:"-"` UseShortenedDriverNames formulate.BoolNumber `` /* 129-byte string literal not displayed */ FallBackResultsSorting formulate.BoolNumber `` /* 164-byte string literal not displayed */ UseMPH formulate.BoolNumber `ini:"-" help:"When on, this option will make Server Manager use MPH instead of Km/h for all speed values."` PreventWebCrawlers formulate.BoolNumber `` /* 178-byte string literal not displayed */ RestartEventOnServerManagerLaunch formulate.BoolNumber `` /* 168-byte string literal not displayed */ LogACServerOutputToFile bool `ini:"-" show:"open" help:"When on, Server Manager will output each Assetto Corsa session into a log file in the logs folder."` NumberOfACServerLogsToKeep int `` /* 140-byte string literal not displayed */ ShowEventDetailsPopup bool `` /* 146-byte string literal not displayed */ // Discord Integration DiscordIntegration FormHeading `ini:"-" json:"-"` DiscordAPIToken string `` /* 169-byte string literal not displayed */ DiscordChannelID string `` /* 246-byte string literal not displayed */ DiscordRoleID string `` /* 272-byte string literal not displayed */ DiscordRoleCommand string `` /* 431-byte string literal not displayed */ NotificationReminderTimer int `` /* 160-byte string literal not displayed */ NotificationReminderTimers string `` /* 237-byte string literal not displayed */ ShowPasswordInNotifications formulate.BoolNumber `ini:"-" help:"Show the server password in race start notifications."` NotifyWhenScheduled formulate.BoolNumber `ini:"-" help:"Send a notification when a race is scheduled (or cancelled)."` // Messages ContentManagerWelcomeMessage string `ini:"-" show:"-"` ServerJoinMessage string `ini:"-" show:"-"` }
func (GlobalServerConfig) GetName ¶
func (gsc GlobalServerConfig) GetName() string
type HTTPConfig ¶
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
func NewHealthCheck ¶
func NewHealthCheck(raceControl *RaceControl, store Store, process ServerProcess) *HealthCheck
func (*HealthCheck) ServeHTTP ¶
func (h *HealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HealthCheckResponse ¶
type HealthCheckResponse struct { OK bool Version string IsPremium bool IsHosted bool OS string NumCPU int NumGoroutines int Uptime string GoVersion string AssettoIsInstalled bool StrackerIsInstalled bool CarDirectoryIsWritable bool TrackDirectoryIsWritable bool WeatherDirectoryIsWritable bool SetupsDirectoryIsWritable bool ConfigDirectoryIsWritable bool ResultsDirectoryIsWritable bool ServerName string ServerID ServerID EventInProgress bool EventIsCritical bool EventIsChampionship bool EventIsRaceWeekend bool EventIsPractice bool NumConnectedDrivers int MaxClientsOverride int }
type JSONStore ¶
type JSONStore struct {
// contains filtered or unexported fields
}
func (*JSONStore) AddAuditEntry ¶
func (rs *JSONStore) AddAuditEntry(entry *AuditEntry) error
func (*JSONStore) ClearLastRaceEvent ¶
func (*JSONStore) DeleteAccount ¶
func (*JSONStore) DeleteChampionship ¶
func (*JSONStore) DeleteCustomRace ¶
func (rs *JSONStore) DeleteCustomRace(race *CustomRace) error
func (*JSONStore) DeleteEntrant ¶
func (*JSONStore) DeleteRaceWeekend ¶
func (*JSONStore) FindAccountByID ¶
func (*JSONStore) FindAccountByName ¶
func (*JSONStore) FindCustomRaceByID ¶
func (rs *JSONStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
func (*JSONStore) GetAuditEntries ¶
func (rs *JSONStore) GetAuditEntries() ([]*AuditEntry, error)
func (*JSONStore) ListAccounts ¶
func (*JSONStore) ListChampionships ¶
func (rs *JSONStore) ListChampionships() ([]*Championship, error)
func (*JSONStore) ListCustomRaces ¶
func (rs *JSONStore) ListCustomRaces() ([]*CustomRace, error)
func (*JSONStore) ListEntrants ¶
func (*JSONStore) ListPrevFrames ¶
func (*JSONStore) ListRaceWeekends ¶
func (rs *JSONStore) ListRaceWeekends() ([]*RaceWeekend, error)
func (*JSONStore) LoadChampionship ¶
func (rs *JSONStore) LoadChampionship(id string) (*Championship, error)
func (*JSONStore) LoadKissMyRankOptions ¶
func (rs *JSONStore) LoadKissMyRankOptions() (*KissMyRankConfig, error)
func (*JSONStore) LoadLastRaceEvent ¶
func (*JSONStore) LoadLiveTimingsData ¶
func (rs *JSONStore) LoadLiveTimingsData() (*LiveTimingsPersistedData, error)
func (*JSONStore) LoadRaceWeekend ¶
func (rs *JSONStore) LoadRaceWeekend(id string) (*RaceWeekend, error)
func (*JSONStore) LoadRealPenaltyOptions ¶
func (rs *JSONStore) LoadRealPenaltyOptions() (*RealPenaltyConfig, error)
func (*JSONStore) LoadServerOptions ¶
func (rs *JSONStore) LoadServerOptions() (*GlobalServerConfig, error)
func (*JSONStore) LoadStrackerOptions ¶
func (rs *JSONStore) LoadStrackerOptions() (*StrackerConfiguration, error)
func (*JSONStore) UpsertAccount ¶
func (*JSONStore) UpsertChampionship ¶
func (rs *JSONStore) UpsertChampionship(c *Championship) error
func (*JSONStore) UpsertCustomRace ¶
func (rs *JSONStore) UpsertCustomRace(race *CustomRace) error
func (*JSONStore) UpsertEntrant ¶
func (*JSONStore) UpsertKissMyRankOptions ¶
func (rs *JSONStore) UpsertKissMyRankOptions(kmr *KissMyRankConfig) error
func (*JSONStore) UpsertLastRaceEvent ¶
func (*JSONStore) UpsertLiveFrames ¶
func (*JSONStore) UpsertLiveTimingsData ¶
func (rs *JSONStore) UpsertLiveTimingsData(lt *LiveTimingsPersistedData) error
func (*JSONStore) UpsertRaceWeekend ¶
func (rs *JSONStore) UpsertRaceWeekend(rw *RaceWeekend) error
func (*JSONStore) UpsertRealPenaltyOptions ¶
func (rs *JSONStore) UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error
func (*JSONStore) UpsertServerOptions ¶
func (rs *JSONStore) UpsertServerOptions(so *GlobalServerConfig) error
func (*JSONStore) UpsertStrackerOptions ¶
func (rs *JSONStore) UpsertStrackerOptions(sto *StrackerConfiguration) error
type KissMyRankConfig ¶
type KissMyRankConfig struct { EnableKissMyRank bool // Pings n stuff ConnectionOptions FormHeading `ini:"-" json:"-"` UpdateInterval int `` /* 160-byte string literal not displayed */ MaxPing int `` /* 335-byte string literal not displayed */ MaxPingDeviation int `` /* 357-byte string literal not displayed */ PingCheckInterval int `` /* 200-byte string literal not displayed */ // WebStats WebInterface FormHeading `ini:"-" json:"-"` WebStatsInterface formulate.BoolNumber `` /* 143-byte string literal not displayed */ WebStatsServerAddress string `` /* 157-byte string literal not displayed */ WebStatsServerPort int `` /* 142-byte string literal not displayed */ WebStatsPublicURL string `` /* 360-byte string literal not displayed */ WebStatsDriversPerPage int `` /* 140-byte string literal not displayed */ WebStatsCacheTime int `json:"web_stats_cache_time" help:"Time to cache the stats in seconds (decreasing might increase CPU usage)"` WebStatsOverridePublicAddress string `` /* 173-byte string literal not displayed */ WebStatsOverridePublicPort int `` /* 197-byte string literal not displayed */ WebStatsResultsShowLapLog formulate.BoolNumber `` /* 222-byte string literal not displayed */ WebAdminConsolePassword string `` /* 487-byte string literal not displayed */ WebAdminConsoleGuestPassword string `` /* 389-byte string literal not displayed */ LiveTrackView formulate.BoolNumber `` /* 139-byte string literal not displayed */ // WebAuth WebAuth FormHeading `ini:"-" json:"-" show:"open"` WebAuthServerAddress string `` /* 154-byte string literal not displayed */ WebAuthServerPort int `json:"web_auth_server_port" show:"open" help:"Stats Web Auth Port For linux don't use ports below 1024."` WebAuthCacheTime int `json:"web_auth_cache_time" show:"open" help:"Time to cache the web auth result in seconds"` WebAuthRelayTo NewLineSeparatedList `` /* 644-byte string literal not displayed */ UDPRelay FormHeading `ini:"-" json:"-" show:"open"` UDPReplayTo NewLineSeparatedList `` /* 841-byte string literal not displayed */ // Money Money FormHeading `ini:"-" json:"-"` CurrencySymbol string `json:"currency_symbol" help:"The symbol of the currency used for all drivers fines and payments (e.g. €,$,RUB)."` ThousandSeparator string `json:"thousand_separator" help:"The symbol to be used to separate thousands (e.g. 19,000 or 19.000)."` StartMoney float64 `` /* 218-byte string literal not displayed */ MinMoney int `` /* 267-byte string literal not displayed */ NoMoney formulate.BoolNumber `json:"no_money" help:"Set this to ON if you wish to use points instead of money (no money, no party :D)."` RaceMinimumPlayers int `` /* 192-byte string literal not displayed */ RaceDriverEntryFee float64 `` /* 200-byte string literal not displayed */ RaceSponsorEntryFee float64 `` /* 249-byte string literal not displayed */ RaceSponsorRewardBaseLength int `` /* 359-byte string literal not displayed */ RaceSponsorRewardBaseTime int `` /* 344-byte string literal not displayed */ RaceSponsorCleanGainReward int `` /* 278-byte string literal not displayed */ RaceSponsorCleanGainOvertakes int `` /* 263-byte string literal not displayed */ RaceFastestLapPrize float64 `` /* 130-byte string literal not displayed */ LaptimeChallengeBasePrize float64 `` /* 192-byte string literal not displayed */ LaptimeChallengeBaseAverageSpeed int `` /* 205-byte string literal not displayed */ LaptimeChallengeLevelAverageSpeedGap int `` /* 189-byte string literal not displayed */ AlltimeFastestLapPrize float64 `` /* 135-byte string literal not displayed */ DamageCostBetweenCars int `` /* 326-byte string literal not displayed */ DamageCostWithEnvironment int `` /* 350-byte string literal not displayed */ DamageCostBetweenCarsBaseSpeed int `json:"damage_cost_between_cars_base_speed" help:"The base speed (in km/h) for damage_cost_between_cars."` DamageCostWithEnvironmentBaseSpeed int `json:"damage_cost_with_environment_base_speed" help:"The base speed (in km/h) for damage_cost_with_environment."` CarTowingCost float64 `` /* 271-byte string literal not displayed */ JLPMoneyKillSwitch formulate.BoolNumber `` /* 360-byte string literal not displayed */ QualifyTopThreeBasePrize float64 `` /* 258-byte string literal not displayed */ QualifyTopThreePrizeMinPlayers int `json:"qualify_top_three_prize_min_players" help:"How many players need to post a time before the pole prizes are assigned."` Protections FormHeading `ini:"-" json:"-"` HotlapProtection int `` /* 157-byte string literal not displayed */ LappingProtection int `` /* 149-byte string literal not displayed */ RelativeHotlapProtection float64 `` /* 299-byte string literal not displayed */ RelativeLappingProtection float64 `` /* 294-byte string literal not displayed */ WarnedCarGrace int `` /* 180-byte string literal not displayed */ MinimumDrivingStandard float64 `` /* 304-byte string literal not displayed */ MinimumDrivingStandardLaps int `` /* 252-byte string literal not displayed */ MinimumDrivingStandardRechargePeriod int `` /* 316-byte string literal not displayed */ MinimumDrivingStandardMinPlayers int `` /* 280-byte string literal not displayed */ CutLinesEnabled formulate.BoolNumber `` /* 302-byte string literal not displayed */ MaxCollisionsPer100km int `` /* 207-byte string literal not displayed */ MaxCollisionsPer100kmMinDistance int `` /* 140-byte string literal not displayed */ MacCollisionsPer100kmRechargeHours int `` /* 375-byte string literal not displayed */ ReverseGearMaxDistance int `` /* 145-byte string literal not displayed */ CollisionMinimumDamageWithEnvironment float64 `` /* 258-byte string literal not displayed */ CollisionMinimumDamageBetweenCars float64 `` /* 246-byte string literal not displayed */ TrackBoundaryCutMaxSpeed int `` /* 128-byte string literal not displayed */ TrackBoundarySameLapCutMaxSpeed int `` /* 221-byte string literal not displayed */ TrackBoundarySampleLength int `` /* 263-byte string literal not displayed */ CleanLapReward float64 `` /* 199-byte string literal not displayed */ AnticheatLaptimeInvalidateMaxClockDelta int `` /* 681-byte string literal not displayed */ AnticheatPenalizeDriverMaxClockDeltaConsecutiveHits int `` /* 245-byte string literal not displayed */ MaxInfractions int `` /* 233-byte string literal not displayed */ ParkedCarMaxGrace int `` /* 176-byte string literal not displayed */ ParkedCarSeconds int `` /* 220-byte string literal not displayed */ ParkedCarDistance int `` /* 253-byte string literal not displayed */ RightToBeForgottenChatCommand formulate.BoolNumber `` /* 224-byte string literal not displayed */ DriveThroughNoKick formulate.BoolNumber `` /* 152-byte string literal not displayed */ Rules FormHeading `ini:"-" json:"-"` TimeBasedRaceExtraLap formulate.BoolNumber `` /* 248-byte string literal not displayed */ RacePodiumAnnouncement formulate.BoolNumber `json:"race_podium_announcement" help:"Whether to announce the first three drivers at the end of the race."` MaxCollisions int `` /* 165-byte string literal not displayed */ TrackRejoinMaxSpeed int `` /* 184-byte string literal not displayed */ TrackBoundaryCutMaxTime int `` /* 177-byte string literal not displayed */ TrackBoundaryCutGainFilter formulate.BoolNumber `` /* 235-byte string literal not displayed */ TrackBoundaryCutGainFilterMinLossPercent int `` /* 283-byte string literal not displayed */ TrackBoundaryCutGainFilterMinAverageSpeed int `` /* 388-byte string literal not displayed */ DrivingLinePenaltyRepeatGrace int `` /* 282-byte string literal not displayed */ PitSpeedLimit int `` /* 234-byte string literal not displayed */ RollingStart formulate.BoolNumber `json:"rolling_start" help:"If you wish to use Kissmyrank Rolling Start at the beginning of a race."` ImprovingQualifyLaptimeWithInfractionsCutoffPercent int `` /* 362-byte string literal not displayed */ VirtualSafetyCar FormHeading `ini:"-" json:"-" ` VSCSpeedingMaxGrace int `` /* 172-byte string literal not displayed */ VSCSlowingMaxGrace int `` /* 154-byte string literal not displayed */ VSCDefaultSpeedLimit int `json:"vsc_default_speed_limit" help:"The maximum speed (in km/h) a player is allowed to drive during a Virtual Safety Car."` VSCOvertakingMaxGrace int `` /* 191-byte string literal not displayed */ VSCFormationLapSpeedLimit int `` /* 140-byte string literal not displayed */ VSCFormationLapMinSpeed int `` /* 157-byte string literal not displayed */ VSCDefaultLeaderSlowAllowOvertakeSpeed int `` /* 239-byte string literal not displayed */ VSCDefaultSlowAndFarAllowOvertakeSpeed int `` /* 261-byte string literal not displayed */ VSCDefaultSlowAndFarAllowOvertakeDistance int `` /* 276-byte string literal not displayed */ VSCFormationLapFarAllowOvertakeDistance int `` /* 246-byte string literal not displayed */ RaceMassAccidentCrashedPlayersPercentage int `` /* 283-byte string literal not displayed */ RaceMassAccidentCrashTime int `` /* 143-byte string literal not displayed */ RaceMassAccidentMinCrashedPlayers int `` /* 223-byte string literal not displayed */ RaceMassAccidentResponse RaceMassAccidentResponse `` /* 226-byte string literal not displayed */ RaceControl FormHeading `ini:"-" json:"-" ` RaceControlPassword string `` /* 197-byte string literal not displayed */ RaceControlMaxEvents int `json:"race_control_max_events" help:"The maximum number of events that race control should display."` RaceControlCollisionSpace float64 `` /* 265-byte string literal not displayed */ RaceControlCollisionTime int `` /* 197-byte string literal not displayed */ RaceControlLogOvertakes formulate.BoolNumber `` /* 248-byte string literal not displayed */ RaceControlCollisionReplayTime int `` /* 156-byte string literal not displayed */ RaceControlCutReplayTime int `` /* 145-byte string literal not displayed */ RaceControlOvertakeReplayTime int `` /* 155-byte string literal not displayed */ RaceControlIncludePlayersNearerThan int `` /* 288-byte string literal not displayed */ Database FormHeading `ini:"-" json:"-" show:"open"` DatabaseSharingUniqueName string `` /* 200-byte string literal not displayed */ DatabaseSharingLocalGroupPort int `` /* 723-byte string literal not displayed */ DatabaseSharingRemoteListenPort int `` /* 367-byte string literal not displayed */ DatabaseSharingRemoteSecretKey string `` /* 206-byte string literal not displayed */ DatabaseSharingRemoteListenAddress string `` /* 183-byte string literal not displayed */ DatabaseSharingRemoteConnectToAddresses NewLineSeparatedList `` /* 693-byte string literal not displayed */ DatabaseSharingRelayForNames NewLineSeparatedList `` /* 1143-byte string literal not displayed */ Miscellaneous FormHeading `ini:"-" json:"-"` SessionHistoryLength int `` /* 161-byte string literal not displayed */ MemoryMonitorEnabled formulate.BoolNumber `` /* 272-byte string literal not displayed */ SpeedUnitFormat string `` /* 248-byte string literal not displayed */ ReservedSlotsGUIDList NewLineSeparatedList `` /* 297-byte string literal not displayed */ ReservedSlotsAccessKey string `` /* 455-byte string literal not displayed */ ReservedSlotsBootPlayersAtRace int `` /* 479-byte string literal not displayed */ RankSortByWinStats formulate.BoolNumber `` /* 132-byte string literal not displayed */ ACAppLinkUDPPort int `` /* 300-byte string literal not displayed */ CustomChatDriverWelcomeMessages NewLineSeparatedList `` /* 153-byte string literal not displayed */ ChatDriverWelcomeMessageShowRaceControlLink formulate.BoolNumber `json:"chat_driver_welcome_message_show_race_control_link" help:"Whether to show the Race Control link when a driver joins."` ACChatAdminPassword string `` /* 159-byte string literal not displayed */ ACChatAdminGUIDList NewLineSeparatedList `` /* 285-byte string literal not displayed */ PenaltyInfractionMap PenaltyInfractionMap `json:"penalty_infraction_map"` PenaltyCosts PenaltyCostMap `json:"penalty_cost_map"` PenaltyActions PenaltyActionMap `json:"penalty_action_map"` // Hidden values below here... // ACServer ACServerIP string `` /* 172-byte string literal not displayed */ ACServerHTTPPort int `` /* 183-byte string literal not displayed */ ACServerPluginLocalPort int `` /* 134-byte string literal not displayed */ ACServerPluginAddressPort int `` /* 224-byte string literal not displayed */ AfterACServerStartRunPath string `` /* 392-byte string literal not displayed */ BeforeACServerStartRunPath string `` /* 626-byte string literal not displayed */ ACServerRestartIfInactiveForMinutes int `` /* 358-byte string literal not displayed */ ACServerResultsBasePath string `` /* 482-byte string literal not displayed */ ACServerConfigIniPath string `` /* 258-byte string literal not displayed */ ACServerBinaryPath string `` /* 274-byte string literal not displayed */ ACServerBinaryArguments string `` /* 334-byte string literal not displayed */ ACServerLogPath string `json:"ac_server_log_path" show:"-" help:"The path where you wish to save the Assetto Corsa Server logs."` MaxPlayers int `json:"max_players" show:"-" help:"Number of server slots."` // Track Rotation is not supported with Server Manager. TrackList []interface{} `json:"track_list" help:"" show:"-"` TrackRotationMaxPlayers int `json:"track_rotation_max_players" help:"" show:"-"` TrackRotationVoteMinPercent int `` /* 280-byte string literal not displayed */ TrackRotationVoteMinVotes int `` /* 268-byte string literal not displayed */ }
func DefaultKissMyRankConfig ¶
func DefaultKissMyRankConfig() *KissMyRankConfig
func (*KissMyRankConfig) Write ¶
func (kmr *KissMyRankConfig) Write() error
type KissMyRankHandler ¶
type KissMyRankHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewKissMyRankHandler ¶
func NewKissMyRankHandler(baseHandler *BaseHandler, store Store) *KissMyRankHandler
type LiveMapConfig ¶
type LiveMapConfig struct {
IntervalMs int `yaml:"refresh_interval_ms"`
}
func (*LiveMapConfig) IsEnabled ¶
func (l *LiveMapConfig) IsEnabled() bool
type LiveTimingsPersistedData ¶
type LiveTimingsPersistedData struct { SessionType udp.SessionType Track string TrackLayout string SessionName string Drivers map[udp.DriverGUID]*RaceControlDriver }
type LuaPlugin ¶
type LuaPlugin struct {
// contains filtered or unexported fields
}
func NewLuaPlugin ¶
func NewLuaPlugin() *LuaPlugin
type MonitoringConfig ¶
type MonitoringConfig struct {
Enabled bool `yaml:"enabled"`
}
type NewLineSeparatedList ¶
type NewLineSeparatedList string
func (NewLineSeparatedList) MarshalJSON ¶
func (c NewLineSeparatedList) MarshalJSON() ([]byte, error)
func (*NewLineSeparatedList) UnmarshalJSON ¶
func (c *NewLineSeparatedList) UnmarshalJSON(data []byte) error
type NilBroadcaster ¶
type NilBroadcaster struct{}
type NotificationDispatcher ¶
type NotificationDispatcher interface { HasNotificationReminders() bool GetNotificationReminders() []int SendMessage(title string, msg string) error SendMessageWithLink(title string, msg string, linkText string, link *url.URL) error SendRaceStartMessage(config ServerConfig, event RaceEvent) error SendRaceScheduledMessage(event *CustomRace, date time.Time) error SendRaceCancelledMessage(event *CustomRace, date time.Time) error SendRaceReminderMessage(event *CustomRace, timer int) error SendChampionshipReminderMessage(championship *Championship, event *ChampionshipEvent, timer int) error SendRaceWeekendReminderMessage(raceWeekend *RaceWeekend, session *RaceWeekendSession, timer int) error SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error }
type NotificationManager ¶
type NotificationManager struct {
// contains filtered or unexported fields
}
NotificationManager is the generic notification handler, which calls the individual notification managers. Initially, only a Discord manager is implemented.
func NewNotificationManager ¶
func NewNotificationManager(discord *DiscordManager, cars *CarManager, store Store) *NotificationManager
func (*NotificationManager) GetCarList ¶
func (nm *NotificationManager) GetCarList(cars string) string
GetCarList takes a ; sep string of cars from a race config, returns , sep of UI names with download links added
func (*NotificationManager) GetNotificationReminders ¶
func (nm *NotificationManager) GetNotificationReminders() []int
GetNotificationReminders returns an array of int timers Doesn't return errors, just omits anything it doesn't like and logs errors
func (*NotificationManager) GetTrackInfo ¶
func (nm *NotificationManager) GetTrackInfo(track string, layout string, download bool) string
GetTrackInfo returns the track summary with any download link appended
func (*NotificationManager) HasNotificationReminders ¶
func (nm *NotificationManager) HasNotificationReminders() bool
HasNotificationReminders just tells us if we need to do any reminder scheduling
func (*NotificationManager) SaveServerOptions ¶
func (nm *NotificationManager) SaveServerOptions(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
check to see if any notification handlers need to process option changes
func (*NotificationManager) SendChampionshipReminderMessage ¶
func (nm *NotificationManager) SendChampionshipReminderMessage(championship *Championship, event *ChampionshipEvent, timer int) error
SendChampionshipReminderMessage sends a reminder a configurable number of minutes prior to a championship race starting
func (*NotificationManager) SendMessage ¶
func (nm *NotificationManager) SendMessage(title string, msg string) error
SendMessage sends a message (surprise surprise)
func (*NotificationManager) SendMessageWithLink ¶
func (nm *NotificationManager) SendMessageWithLink(title string, msg string, linkText string, link *url.URL) error
SendMessageWithLink sends a message with an embedded CM join link
func (*NotificationManager) SendRaceCancelledMessage ¶
func (nm *NotificationManager) SendRaceCancelledMessage(event *CustomRace, date time.Time) error
SendRaceCancelledMessage sends a notification when a race is cancelled
func (*NotificationManager) SendRaceReminderMessage ¶
func (nm *NotificationManager) SendRaceReminderMessage(event *CustomRace, timer int) error
SendRaceReminderMessage sends a reminder a configurable number of minutes prior to a race starting
func (*NotificationManager) SendRaceScheduledMessage ¶
func (nm *NotificationManager) SendRaceScheduledMessage(event *CustomRace, date time.Time) error
SendRaceScheduledMessage sends a notification when a race is scheduled
func (*NotificationManager) SendRaceStartMessage ¶
func (nm *NotificationManager) SendRaceStartMessage(config ServerConfig, event RaceEvent) error
SendRaceStartMessage sends a message as a race session is started
func (*NotificationManager) SendRaceWeekendReminderMessage ¶
func (nm *NotificationManager) SendRaceWeekendReminderMessage(raceWeekend *RaceWeekend, session *RaceWeekendSession, timer int) error
SendRaceWeekendReminderMessage sends a reminder a configurable number of minutes prior to a RaceWeekendSession starting
func (*NotificationManager) Stop ¶
func (nm *NotificationManager) Stop() error
type PenaltiesHandler ¶
type PenaltiesHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewPenaltiesHandler ¶
func NewPenaltiesHandler(baseHandler *BaseHandler, penaltiesManager *PenaltiesManager) *PenaltiesHandler
type PenaltiesManager ¶
type PenaltiesManager struct {
// contains filtered or unexported fields
}
func NewPenaltiesManager ¶
func NewPenaltiesManager(store Store) *PenaltiesManager
type PenaltyAction ¶
type PenaltyAction string
const ( SetPenalty PenaltyAction = "set" RemovePenalty PenaltyAction = "remove" )
type PenaltyActionMap ¶
type PenaltyActionMap struct { HotLapProtection PenaltyActionSessions `json:"hotlap_protection"` HotLappingCarCollision PenaltyActionSessions `json:"hotlapping_car_collision"` LappingProtection PenaltyActionSessions `json:"lapping_protection"` LappingCarCollision PenaltyActionSessions `json:"lapping_car_collision"` ReverseGear PenaltyActionSessions `json:"reverse_gear"` TrackBoundaryCut PenaltyActionSessions `json:"track_boundary_cut"` TrackRejoinMaxSpeed PenaltyActionSessions `json:"track_rejoin_max_speed"` MaxInfractions PenaltyActionSessions `json:"max_infractions"` MaxCollisions PenaltyActionSessions `json:"max_collisions"` FirstBlood PenaltyActionSessions `json:"first_blood"` PitLaneSpeeding PenaltyActionSessions `json:"pit_lane_speeding"` PitExitLineCrossing PenaltyActionSessions `json:"pit_exit_line_crossing"` CutLineYourCustomCutLine PenaltyActionSessions `json:"cut_line_your_custom_cut_line"` AntiCheatMaxClockDeltaConsecutiveHits PenaltyActionSessions `json:"anticheat_max_clock_delta_consecutive_hits"` SpeedingUnderVirtualSafetyCar PenaltyActionSessions `json:"speeding_under_vsc"` SlowingUnderVirtualSafetyCar PenaltyActionSessions `json:"slowing_under_vsc"` OvertakingUnderVirtualSafety PenaltyActionSessions `json:"overtaking_under_vsc"` ImprovingQualifyLapTimeWithInfractions PenaltyActionSessions `json:"improving_qualify_laptime_with_infractions"` ParkingNearTrack PenaltyActionSessions `json:"parking_near_track"` }
type PenaltyActionSessions ¶
type PenaltyCostMap ¶
type PenaltyCostMap struct { HotLapProtection PenaltyCostSessions `json:"hotlap_protection"` HotLappingCarCollision PenaltyCostSessions `json:"hotlapping_car_collision"` LappingProtection PenaltyCostSessions `json:"lapping_protection"` LappingCarCollision PenaltyCostSessions `json:"lapping_car_collision"` ReverseGear PenaltyCostSessions `json:"reverse_gear"` TrackBoundaryCut PenaltyCostSessions `json:"track_boundary_cut"` TrackRejoinMaxSpeed PenaltyCostSessions `json:"track_rejoin_max_speed"` MaxInfractions PenaltyCostSessions `json:"max_infractions"` MaxCollisions PenaltyCostSessions `json:"max_collisions"` FirstBlood PenaltyCostSessions `json:"first_blood"` PitLaneSpeeding PenaltyCostSessions `json:"pit_lane_speeding"` PitExitLineCrossing PenaltyCostSessions `json:"pit_exit_line_crossing"` CutLineYourCustomCutLine PenaltyCostSessions `json:"cut_line_your_custom_cut_line"` AntiCheatMaxClockDeltaConsecutiveHits PenaltyCostSessions `json:"anticheat_max_clock_delta_consecutive_hits"` SpeedingUnderVirtualSafetyCar PenaltyCostSessions `json:"speeding_under_vsc"` SlowingUnderVirtualSafetyCar PenaltyCostSessions `json:"slowing_under_vsc"` OvertakingUnderVirtualSafety PenaltyCostSessions `json:"overtaking_under_vsc"` ImprovingQualifyLapTimeWithInfractions PenaltyCostSessions `json:"improving_qualify_laptime_with_infractions"` ParkingNearTrack PenaltyCostSessions `json:"parking_near_track"` }
type PenaltyCostSessions ¶
type PenaltyCostSessions struct { Practice float64 `json:"practice" help:"The money penalties (in thousands) that you would like to give for any given situation."` Qualify float64 `json:"qualify" help:"The money penalties (in thousands) that you would like to give for any given situation."` Race float64 `json:"race" help:"The money penalties (in thousands) that you would like to give for any given situation."` Other float64 `json:"other" help:"The money penalties (in thousands) that you would like to give for any given situation."` }
type PenaltyInfractionMap ¶
type PenaltyInfractionMap struct { HotLapProtection PenaltyInfractionSessions `json:"hotlap_protection"` HotLappingCarCollision PenaltyInfractionSessions `json:"hotlapping_car_collision"` LappingProtection PenaltyInfractionSessions `json:"lapping_protection"` LappingCarCollision PenaltyInfractionSessions `json:"lapping_car_collision"` ReverseGear PenaltyInfractionSessions `json:"reverse_gear"` TrackBoundaryCut PenaltyInfractionSessions `json:"track_boundary_cut"` TrackRejoinMaxSpeed PenaltyInfractionSessions `json:"track_rejoin_max_speed"` MaxInfractions PenaltyInfractionSessions `json:"max_infractions"` MaxCollisions PenaltyInfractionSessions `json:"max_collisions"` FirstBlood PenaltyInfractionSessions `json:"first_blood"` PitLaneSpeeding PenaltyInfractionSessions `json:"pit_lane_speeding"` PitExitLineCrossing PenaltyInfractionSessions `json:"pit_exit_line_crossing"` CutLineYourCustomCutLine PenaltyInfractionSessions `json:"cut_line_your_custom_cut_line"` AntiCheatMaxClockDeltaConsecutiveHits PenaltyInfractionSessions `json:"anticheat_max_clock_delta_consecutive_hits"` SpeedingUnderVirtualSafetyCar PenaltyInfractionSessions `json:"speeding_under_vsc"` SlowingUnderVirtualSafetyCar PenaltyInfractionSessions `json:"slowing_under_vsc"` OvertakingUnderVirtualSafety PenaltyInfractionSessions `json:"overtaking_under_vsc"` ImprovingQualifyLapTimeWithInfractions PenaltyInfractionSessions `json:"improving_qualify_laptime_with_infractions"` ParkingNearTrack PenaltyInfractionSessions `json:"parking_near_track"` }
type PenaltyInfractionSessions ¶
type PenaltyInfractionSessions struct { Practice float64 `` /* 129-byte string literal not displayed */ Qualify float64 `` /* 128-byte string literal not displayed */ Race float64 `json:"race" help:"How many infractions you would like to add to the infraction counter for each penalty during each session."` }
type PointsReason ¶
type PointsReason int
const ( PointsEventFinish PointsReason = iota PointsPolePosition PointsFastestLap PointsCollisionWithCar PointsCollisionWithEnvironment PointsCutTrack )
type QuickRace ¶
type QuickRace struct { OverridePassword bool ReplacementPassword string RaceConfig CurrentRaceConfig EntryList EntryList }
func (QuickRace) EventDescription ¶
func (QuickRace) GetEntryList ¶
func (QuickRace) GetForceStopTime ¶
func (QuickRace) GetForceStopWithDrivers ¶
func (QuickRace) GetRaceConfig ¶
func (q QuickRace) GetRaceConfig() CurrentRaceConfig
func (QuickRace) IsChampionship ¶
func (QuickRace) IsPractice ¶
func (QuickRace) IsRaceWeekend ¶
func (QuickRace) IsTimeAttack ¶
func (QuickRace) OverrideServerPassword ¶
func (QuickRace) ReplacementServerPassword ¶
type QuickRaceHandler ¶
type QuickRaceHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewQuickRaceHandler ¶
func NewQuickRaceHandler(baseHandler *BaseHandler, raceManager *RaceManager) *QuickRaceHandler
type RaceControl ¶
type RaceControl struct { SessionInfo udp.SessionInfo `json:"SessionInfo"` TrackMapData TrackMapData `json:"TrackMapData"` TrackInfo TrackInfo `json:"TrackInfo"` SessionStartTime time.Time `json:"SessionStartTime"` CurrentRealtimePosInterval int `json:"CurrentRealtimePosInterval"` ChatMessages []udp.Chat ChatMessagesMutex sync.Mutex ConnectedDrivers *DriverMap `json:"ConnectedDrivers"` DisconnectedDrivers *DriverMap `json:"DisconnectedDrivers"` CarIDToGUID map[udp.CarID]udp.DriverGUID `json:"CarIDToGUID"` // contains filtered or unexported fields }
func NewRaceControl ¶
func NewRaceControl(broadcaster Broadcaster, trackDataGateway TrackDataGateway, process ServerProcess, store Store, penaltiesManager *PenaltiesManager) *RaceControl
func (*RaceControl) AllLapTimes ¶
func (rc *RaceControl) AllLapTimes() map[udp.DriverGUID]*RaceControlDriver
func (*RaceControl) Event ¶
func (rc *RaceControl) Event() udp.Event
RaceControl piggyback's on the udp.Message interface so that the entire data can be sent to newly connected clients.
func (*RaceControl) LuaBroadcastChat ¶
func (rc *RaceControl) LuaBroadcastChat(L *lua.LState) int
func (*RaceControl) LuaSendChat ¶
func (rc *RaceControl) LuaSendChat(L *lua.LState) int
func (*RaceControl) OnCarUpdate ¶
func (rc *RaceControl) OnCarUpdate(update udp.CarUpdate) error
OnCarUpdate occurs every udp.RealTimePosInterval and returns car position, speed, etc. drivers top speeds are recorded per lap, as well as their last seen updated.
func (*RaceControl) OnChatMessage ¶
func (rc *RaceControl) OnChatMessage(chat udp.Chat) error
func (*RaceControl) OnClientConnect ¶
func (rc *RaceControl) OnClientConnect(client udp.SessionCarInfo) error
OnClientConnect stores CarID -> DriverGUID mappings. if a driver is known to have previously been in this event, they will be moved from DisconnectedDrivers to ConnectedDrivers.
func (*RaceControl) OnClientDisconnect ¶
func (rc *RaceControl) OnClientDisconnect(client udp.SessionCarInfo) error
OnClientDisconnect moves a client from ConnectedDrivers to DisconnectedDrivers.
func (*RaceControl) OnClientLoaded ¶
func (rc *RaceControl) OnClientLoaded(loadedCar udp.ClientLoaded) error
OnClientLoaded marks a connected client as having loaded in.
func (*RaceControl) OnCollisionWithCar ¶
func (rc *RaceControl) OnCollisionWithCar(collision udp.CollisionWithCar) error
OnCollisionWithCar registers a driver's collision with another car.
func (*RaceControl) OnCollisionWithEnvironment ¶
func (rc *RaceControl) OnCollisionWithEnvironment(collision udp.CollisionWithEnvironment) error
OnCollisionWithEnvironment registers a driver's collision with the environment.
func (*RaceControl) OnEndSession ¶
func (rc *RaceControl) OnEndSession(sessionFile udp.EndSession) error
OnEndSession is called at the end of every session.
func (*RaceControl) OnLapCompleted ¶
func (rc *RaceControl) OnLapCompleted(lap udp.LapCompleted) error
OnLapCompleted occurs every time a driver crosses the line. Lap information is collected for the driver and best lap time and top speed are calculated. OnLapCompleted also remembers the car the lap was completed in a PreviousCars map on the driver. This is so that lap times between different cars can be compared.
func (*RaceControl) OnNewSession ¶
func (rc *RaceControl) OnNewSession(sessionInfo udp.SessionInfo) error
OnNewSession occurs every new session. If the session is the first in an event and it is not a looped practice, then all driver information is cleared.
func (*RaceControl) OnSessionUpdate ¶
func (rc *RaceControl) OnSessionUpdate(sessionInfo udp.SessionInfo) (bool, error)
OnSessionUpdate is called every sessionRequestInterval.
func (*RaceControl) OnVersion ¶
func (rc *RaceControl) OnVersion(version udp.Version) error
OnVersion occurs when the Assetto Corsa Server starts up for the first time.
func (*RaceControl) SortDrivers ¶
func (rc *RaceControl) SortDrivers(driverGroup RaceControlDriverGroup, driverA, driverB *RaceControlDriver) bool
func (*RaceControl) UDPCallback ¶
func (rc *RaceControl) UDPCallback(message udp.Message)
type RaceControlCarLapInfo ¶
type RaceControlCarLapInfo struct { TopSpeedThisLap float64 `json:"TopSpeedThisLap"` TopSpeedBestLap float64 `json:"TopSpeedBestLap"` BestLap time.Duration `json:"BestLap"` NumLaps int `json:"NumLaps"` LastLap time.Duration `json:"LastLap"` LastLapCompletedTime time.Time `json:"LastLapCompletedTime" ts:"date"` TotalLapTime time.Duration `json:"TotalLapTime"` CarName string `json:"CarName"` }
func NewRaceControlCarLapInfo ¶
func NewRaceControlCarLapInfo(carModel string) *RaceControlCarLapInfo
type RaceControlDriver ¶
type RaceControlDriver struct { CarInfo udp.SessionCarInfo `json:"CarInfo"` TotalNumLaps int `json:"TotalNumLaps"` ConnectedTime time.Time `json:"ConnectedTime" ts:"date"` LoadedTime time.Time `json:"LoadedTime" ts:"date"` Position int `json:"Position"` Split string `json:"Split"` LastSeen time.Time `json:"LastSeen" ts:"date"` LastPos udp.Vec `json:"LastPos"` Collisions []Collision `json:"Collisions"` // Cars is a map of CarModel to the information for that car. Cars map[string]*RaceControlCarLapInfo `json:"Cars"` // contains filtered or unexported fields }
func NewRaceControlDriver ¶
func NewRaceControlDriver(carInfo udp.SessionCarInfo) *RaceControlDriver
func (*RaceControlDriver) CurrentCar ¶
func (rcd *RaceControlDriver) CurrentCar() *RaceControlCarLapInfo
type RaceControlDriverGroup ¶
type RaceControlDriverGroup int
const ( ConnectedDrivers RaceControlDriverGroup = 0 DisconnectedDrivers RaceControlDriverGroup = 1 )
type RaceControlHandler ¶
type RaceControlHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewRaceControlHandler ¶
func NewRaceControlHandler(baseHandler *BaseHandler, store Store, raceManager *RaceManager, raceControl *RaceControl, raceControlHub *RaceControlHub, serverProcess ServerProcess) *RaceControlHandler
type RaceControlHub ¶
type RaceControlHub struct {
// contains filtered or unexported fields
}
type RaceEvent ¶
type RaceEvent interface { GetRaceConfig() CurrentRaceConfig GetEntryList() EntryList IsLooping() bool IsChampionship() bool IsRaceWeekend() bool IsPractice() bool IsTimeAttack() bool OverrideServerPassword() bool ReplacementServerPassword() string GetForceStopTime() time.Duration GetForceStopWithDrivers() bool EventName() string EventDescription() string GetURL() string }
type RaceManager ¶
type RaceManager struct {
// contains filtered or unexported fields
}
func NewRaceManager ¶
func NewRaceManager( store Store, process ServerProcess, carManager *CarManager, trackManager *TrackManager, notificationManager NotificationDispatcher, raceControl *RaceControl, ) *RaceManager
func (*RaceManager) BuildCustomRaceFromForm ¶
func (rm *RaceManager) BuildCustomRaceFromForm(r *http.Request) (*CurrentRaceConfig, error)
func (*RaceManager) BuildEntryList ¶
func (*RaceManager) BuildRaceOpts ¶
func (rm *RaceManager) BuildRaceOpts(r *http.Request) (*RaceTemplateVars, error)
BuildRaceOpts builds a quick race form
func (*RaceManager) CurrentRace ¶
func (rm *RaceManager) CurrentRace() (*ServerConfig, EntryList)
func (*RaceManager) DeleteCustomRace ¶
func (rm *RaceManager) DeleteCustomRace(uuid string) error
func (*RaceManager) FindNextRecurrence ¶
func (rm *RaceManager) FindNextRecurrence(race *CustomRace, start time.Time) time.Time
func (*RaceManager) InitScheduledRaces ¶
func (rm *RaceManager) InitScheduledRaces() error
func (*RaceManager) ListAutoFillEntrants ¶
func (rm *RaceManager) ListAutoFillEntrants() ([]*Entrant, error)
func (*RaceManager) ListCustomRaces ¶
func (rm *RaceManager) ListCustomRaces() (recent, starred, looped, scheduled []*CustomRace, err error)
func (*RaceManager) LoadServerOptions ¶
func (rm *RaceManager) LoadServerOptions() (*GlobalServerConfig, error)
func (*RaceManager) LoopCallback ¶
func (rm *RaceManager) LoopCallback(message udp.Message)
callback check for udp end session, load result file, check session type against sessionTypes if session matches last session in sessionTypes then stop server and clear sessionTypes
func (*RaceManager) LoopRaces ¶
func (rm *RaceManager) LoopRaces()
func (*RaceManager) RescheduleNotifications ¶
func (rm *RaceManager) RescheduleNotifications(oldServerOpts *GlobalServerConfig, newServerOpts *GlobalServerConfig) error
reschedule notifications if notification timer changed
func (*RaceManager) SaveCustomRace ¶
func (rm *RaceManager) SaveCustomRace( name string, overridePassword bool, replacementPassword string, config CurrentRaceConfig, entryList EntryList, starred bool, forceStopTime int, forceStopWithDrivers bool, ) (*CustomRace, error)
func (*RaceManager) SaveEntrantsForAutoFill ¶
func (rm *RaceManager) SaveEntrantsForAutoFill(entryList EntryList) error
func (*RaceManager) SaveServerOptions ¶
func (rm *RaceManager) SaveServerOptions(newServerOpts *GlobalServerConfig) error
func (*RaceManager) ScheduleNextFromRecurrence ¶
func (rm *RaceManager) ScheduleNextFromRecurrence(race *CustomRace) error
func (*RaceManager) ScheduleRace ¶
func (*RaceManager) SetupCustomRace ¶
func (rm *RaceManager) SetupCustomRace(r *http.Request) error
func (*RaceManager) SetupQuickRace ¶
func (rm *RaceManager) SetupQuickRace(r *http.Request) error
func (*RaceManager) StartCustomRace ¶
func (rm *RaceManager) StartCustomRace(uuid string, forceRestart bool) (*CustomRace, error)
func (*RaceManager) StartScheduledRace ¶
func (rm *RaceManager) StartScheduledRace(race *CustomRace) error
func (*RaceManager) ToggleLoopCustomRace ¶
func (rm *RaceManager) ToggleLoopCustomRace(uuid string) (bool, error)
func (*RaceManager) ToggleStarCustomRace ¶
func (rm *RaceManager) ToggleStarCustomRace(uuid string) error
type RaceTemplateVars ¶
type RaceTemplateVars struct { BaseTemplateVars CarOpts Cars TrackOpts TrackOptsGrouped AvailableSessions []SessionType Weather Weather SolIsInstalled bool Current CurrentRaceConfig CurrentEntrants EntryList PossibleEntrants []*Entrant FixedSetups CarSetups IsEditing bool EditingID string CustomRaceName string SurfacePresets []TrackSurfacePreset OverridePassword bool ReplacementPassword string Tyres Tyres DeselectedTyres map[string]bool ForceStopTime int ForceStopWithDrivers bool IsChampionship bool Championship *Championship ChampionshipHasAtLeastOnceRace bool ChampionshipEventIndex int IsRaceWeekend bool RaceWeekend *RaceWeekend RaceWeekendSession *RaceWeekendSession RaceWeekendHasAtLeastOneSession bool ShowOverridePasswordCard bool }
type RaceWeekend ¶
type RaceWeekend struct { ID uuid.UUID Name string Created time.Time Updated time.Time Deleted time.Time // Filters is a map of Parent ID -> Child ID -> Filter Filters map[string]map[string]*RaceWeekendSessionToSessionFilter // Deprecated: use GetEntryList() instead EntryList EntryList Sessions []*RaceWeekendSession // ChampionshipID links a RaceWeekend to a Championship. It can be uuid.Nil ChampionshipID uuid.UUID // Championship is the Championship that is linked to the RaceWeekend. // If ChampionshipID is uuid.Nil, Championship will also be nil Championship *Championship `json:"-"` SpectatorCar Entrant SpectatorCarEnabled bool }
RaceWeekends are a collection of sessions, where one session influences the EntryList of the next.
func (*RaceWeekend) AddFilter ¶
func (rw *RaceWeekend) AddFilter(parentID, childID string, filter *RaceWeekendSessionToSessionFilter)
AddFilter creates a link between parentID and childID with a filter that specifies how to take the EntrantResult of parent and modify them to make an EntryList for child
func (*RaceWeekend) AddSession ¶
func (rw *RaceWeekend) AddSession(s *RaceWeekendSession, parent *RaceWeekendSession)
AddSession adds a RaceWeekendSession to a RaceWeekend, with an optional parent session (can be nil).
func (*RaceWeekend) Completed ¶
func (rw *RaceWeekend) Completed() bool
func (*RaceWeekend) CompletedTime ¶
func (rw *RaceWeekend) CompletedTime() time.Time
func (*RaceWeekend) DelSession ¶
func (rw *RaceWeekend) DelSession(sessionID string)
DelSession removes a RaceWeekendSession from a RaceWeekend. This also removes any parent links from the removed session to any other sessions.
func (*RaceWeekend) Duplicate ¶
func (rw *RaceWeekend) Duplicate() (*RaceWeekend, error)
func (*RaceWeekend) EnhanceResults ¶
func (rw *RaceWeekend) EnhanceResults(results *SessionResults)
EnhanceResults takes a set of SessionResults and attaches Championship information to them.
func (*RaceWeekend) FindChildren ¶
func (rw *RaceWeekend) FindChildren(parentID string) []*RaceWeekendSession
func (*RaceWeekend) FindSessionByID ¶
func (rw *RaceWeekend) FindSessionByID(id string) (*RaceWeekendSession, error)
FindSessionByID finds a RaceWeekendSession by its unique identifier
func (*RaceWeekend) FindTotalNumParents ¶
func (rw *RaceWeekend) FindTotalNumParents(session *RaceWeekendSession) int
FindTotalNumParents recursively finds all parents for a given session, including their parents etc...
func (*RaceWeekend) GetAvailableSplitTypes ¶
func (rw *RaceWeekend) GetAvailableSplitTypes() []RaceWeekendFilterSplitType
func (*RaceWeekend) GetEntryList ¶
func (rw *RaceWeekend) GetEntryList() EntryList
func (*RaceWeekend) GetFilter ¶
func (rw *RaceWeekend) GetFilter(parentID, childID string) (*RaceWeekendSessionToSessionFilter, error)
GetFilter returns the Filter between parentID and childID, erroring if no Filter is found.
func (*RaceWeekend) GetFilterOrUseDefault ¶
func (rw *RaceWeekend) GetFilterOrUseDefault(parentID, childID string) (*RaceWeekendSessionToSessionFilter, error)
GetFilterOrUseDefault attempts to find a filter between parentID and childID. If a filter is not found, a 'default' filter is created. The default filter takes all entrants from the parent results and applies them directly to the child entrylist, in their finishing order.
func (*RaceWeekend) GetSpectatorCar ¶
func (rw *RaceWeekend) GetSpectatorCar() Entrant
func (*RaceWeekend) HasLinkedChampionship ¶
func (rw *RaceWeekend) HasLinkedChampionship() bool
func (*RaceWeekend) HasParentRecursive ¶
func (rw *RaceWeekend) HasParentRecursive(session *RaceWeekendSession, otherSessionID string) bool
HasParentRecursive looks for otherSessionID in session's parents, grandparents, etc...
func (*RaceWeekend) HasSpectatorCar ¶
func (rw *RaceWeekend) HasSpectatorCar() bool
func (*RaceWeekend) HasTeamNames ¶
func (rw *RaceWeekend) HasTeamNames() bool
HasTeamNames indicates whether a RaceWeekend entrylist has team names in it
func (*RaceWeekend) InProgress ¶
func (rw *RaceWeekend) InProgress() bool
func (*RaceWeekend) MostRecentScheduledDateFormat ¶
func (rw *RaceWeekend) MostRecentScheduledDateFormat(format string) string
func (*RaceWeekend) Progress ¶
func (rw *RaceWeekend) Progress() float64
Progress indicates how far (0 -> 1) a RaceWeekend has progressed.
func (*RaceWeekend) RemoveFilter ¶
func (rw *RaceWeekend) RemoveFilter(parentID, childID string)
RemoveFilter removes the link between parent and child
func (*RaceWeekend) SessionCanBeRun ¶
func (rw *RaceWeekend) SessionCanBeRun(s *RaceWeekendSession) bool
SessionCanBeRun determines whether a RaceWeekendSession has all of its parent dependencies met to be allowed to run (i.e. all parent RaceWeekendSessions must be complete to allow it to run)
func (*RaceWeekend) SortedSessions ¶
func (rw *RaceWeekend) SortedSessions() []*RaceWeekendSession
SortedSessions returns the RaceWeekendSessions in order by the number of parents the sessions have.
func (*RaceWeekend) TrackOverview ¶
func (rw *RaceWeekend) TrackOverview() string
type RaceWeekendEntryList ¶
type RaceWeekendEntryList []*RaceWeekendSessionEntrant
A RaceWeekendEntryList is a collection of RaceWeekendSessionEntrants
func EntryListToRaceWeekendEntryList ¶
func EntryListToRaceWeekendEntryList(e EntryList, sessionID uuid.UUID) RaceWeekendEntryList
EntryListToRaceWeekendEntryList converts an EntryList to a RaceWeekendEntryList for a given RaceWeekendSession
func (*RaceWeekendEntryList) Add ¶
func (e *RaceWeekendEntryList) Add(entrant *RaceWeekendSessionEntrant)
Add an Entrant to the EntryList
func (*RaceWeekendEntryList) AddInPitBox ¶
func (e *RaceWeekendEntryList) AddInPitBox(entrant *RaceWeekendSessionEntrant, pitBox int)
AddInPitBox adds an Entrant in a specific pitbox - overwriting any entrant that was in that pitbox previously.
func (RaceWeekendEntryList) AsEntryList ¶
func (e RaceWeekendEntryList) AsEntryList() EntryList
AsEntryList returns a RaceWeekendEntryList as an EntryList
func (*RaceWeekendEntryList) Delete ¶
func (e *RaceWeekendEntryList) Delete(entrant *RaceWeekendSessionEntrant)
Remove an Entrant from the EntryList
func (*RaceWeekendEntryList) Sorted ¶
func (e *RaceWeekendEntryList) Sorted() []*RaceWeekendSessionEntrant
Sorted returns the RaceWeekendEntryList ordered by Entrant PitBoxes
type RaceWeekendEntryListSortFunc ¶
type RaceWeekendEntryListSortFunc func(*RaceWeekend, *RaceWeekendSession, []*RaceWeekendSessionEntrant, *RaceWeekendSessionToSessionFilter) error
func (RaceWeekendEntryListSortFunc) Sort ¶
func (rwelsf RaceWeekendEntryListSortFunc) Sort(rw *RaceWeekend, rws *RaceWeekendSession, rwes []*RaceWeekendSessionEntrant, rwsf *RaceWeekendSessionToSessionFilter) error
type RaceWeekendEntryListSorter ¶
type RaceWeekendEntryListSorter interface {
Sort(*RaceWeekend, *RaceWeekendSession, []*RaceWeekendSessionEntrant, *RaceWeekendSessionToSessionFilter) error
}
RaceWeekendEntryListSorter is a function which takes a race weekend, session and entrylist and sorts the entrylist based on some criteria.
func GetRaceWeekendEntryListSort ¶
func GetRaceWeekendEntryListSort(key string) RaceWeekendEntryListSorter
func PerClassSort ¶
func PerClassSort(sorter RaceWeekendEntryListSorter) RaceWeekendEntryListSorter
type RaceWeekendFilterSplitType ¶
type RaceWeekendFilterSplitType string
const ( SplitTypeNumeric RaceWeekendFilterSplitType = "Numeric" SplitTypeManualDriverSelection RaceWeekendFilterSplitType = "Manual Driver Selection" SplitTypeChampionshipClass RaceWeekendFilterSplitType = "Championship Class" )
func (RaceWeekendFilterSplitType) String ¶
func (fst RaceWeekendFilterSplitType) String() string
type RaceWeekendGridPreview ¶
type RaceWeekendGridPreview struct { Results map[int]SessionPreviewEntrant Grid map[int]SessionPreviewEntrant Classes map[string]string }
func NewRaceWeekendGridPreview ¶
func NewRaceWeekendGridPreview() *RaceWeekendGridPreview
type RaceWeekendHandler ¶
type RaceWeekendHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewRaceWeekendHandler ¶
func NewRaceWeekendHandler(baseHandler *BaseHandler, raceWeekendManager *RaceWeekendManager) *RaceWeekendHandler
type RaceWeekendManager ¶
type RaceWeekendManager struct {
// contains filtered or unexported fields
}
func NewRaceWeekendManager ¶
func NewRaceWeekendManager( raceManager *RaceManager, championshipManager *ChampionshipManager, store Store, process ServerProcess, notificationManager NotificationDispatcher, acsrClient *ACSRClient, carManager *CarManager, ) *RaceWeekendManager
func (*RaceWeekendManager) BuildRaceWeekendSessionOpts ¶
func (rwm *RaceWeekendManager) BuildRaceWeekendSessionOpts(r *http.Request) (*RaceTemplateVars, error)
func (*RaceWeekendManager) BuildRaceWeekendTemplateOpts ¶
func (rwm *RaceWeekendManager) BuildRaceWeekendTemplateOpts(r *http.Request) (*RaceTemplateVars, error)
func (*RaceWeekendManager) CancelSession ¶
func (rwm *RaceWeekendManager) CancelSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) ClearLockedTyreSetups ¶
func (rwm *RaceWeekendManager) ClearLockedTyreSetups(raceWeekend *RaceWeekend, session *RaceWeekendSession) error
func (*RaceWeekendManager) DeScheduleSession ¶
func (rwm *RaceWeekendManager) DeScheduleSession(raceWeekendID, sessionID string) error
func (*RaceWeekendManager) DeleteRaceWeekend ¶
func (rwm *RaceWeekendManager) DeleteRaceWeekend(id string) error
func (*RaceWeekendManager) DeleteSession ¶
func (rwm *RaceWeekendManager) DeleteSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) FindConnectedSessions ¶
func (rwm *RaceWeekendManager) FindConnectedSessions(raceWeekendID, parentSessionID, childSessionID string) (*RaceWeekend, *RaceWeekendSession, *RaceWeekendSession, error)
func (*RaceWeekendManager) FindSession ¶
func (rwm *RaceWeekendManager) FindSession(raceWeekendID, sessionID string) (*RaceWeekend, *RaceWeekendSession, error)
func (*RaceWeekendManager) ImportRaceWeekend ¶
func (rwm *RaceWeekendManager) ImportRaceWeekend(data string) (string, error)
func (*RaceWeekendManager) ImportSession ¶
func (*RaceWeekendManager) ListAvailableResultsFilesForSession ¶
func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSession(raceWeekendID string, raceWeekendSessionID string) (*RaceWeekendSession, []SessionResults, error)
func (*RaceWeekendManager) ListAvailableResultsFilesForSorting ¶
func (rwm *RaceWeekendManager) ListAvailableResultsFilesForSorting(raceWeekend *RaceWeekend, session *RaceWeekendSession) ([]SessionResults, error)
func (*RaceWeekendManager) ListRaceWeekends ¶
func (rwm *RaceWeekendManager) ListRaceWeekends() ([]*RaceWeekend, error)
func (*RaceWeekendManager) LoadRaceWeekend ¶
func (rwm *RaceWeekendManager) LoadRaceWeekend(id string) (*RaceWeekend, error)
func (*RaceWeekendManager) PreviewGrid ¶
func (rwm *RaceWeekendManager) PreviewGrid(raceWeekendID, parentSessionID, childSessionID string, filter *RaceWeekendSessionToSessionFilter) (*RaceWeekendGridPreview, error)
func (*RaceWeekendManager) PreviewSessionEntryList ¶
func (rwm *RaceWeekendManager) PreviewSessionEntryList(raceWeekendID, sessionID, sortType string, reverseGrid int) (*RaceWeekendGridPreview, error)
func (*RaceWeekendManager) RaceWeekendSessionIsRunning ¶
func (rwm *RaceWeekendManager) RaceWeekendSessionIsRunning() bool
func (*RaceWeekendManager) RestartActiveSession ¶
func (rwm *RaceWeekendManager) RestartActiveSession() error
func (*RaceWeekendManager) RestartSession ¶
func (rwm *RaceWeekendManager) RestartSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) SaveRaceWeekend ¶
func (rwm *RaceWeekendManager) SaveRaceWeekend(r *http.Request) (raceWeekend *RaceWeekend, edited bool, err error)
func (*RaceWeekendManager) SaveRaceWeekendSession ¶
func (rwm *RaceWeekendManager) SaveRaceWeekendSession(r *http.Request) (raceWeekend *RaceWeekend, session *RaceWeekendSession, edited bool, err error)
func (*RaceWeekendManager) ScheduleSession ¶
func (*RaceWeekendManager) StartPracticeSession ¶
func (rwm *RaceWeekendManager) StartPracticeSession(raceWeekendID string, raceWeekendSessionID string) error
func (*RaceWeekendManager) StartSession ¶
func (rwm *RaceWeekendManager) StartSession(raceWeekendID string, raceWeekendSessionID string, isPracticeSession bool) error
func (*RaceWeekendManager) StopActiveSession ¶
func (rwm *RaceWeekendManager) StopActiveSession() error
func (*RaceWeekendManager) UDPCallback ¶
func (rwm *RaceWeekendManager) UDPCallback(message udp.Message)
func (*RaceWeekendManager) UpdateGrid ¶
func (rwm *RaceWeekendManager) UpdateGrid(raceWeekendID, parentSessionID, childSessionID string, filter *RaceWeekendSessionToSessionFilter) error
func (*RaceWeekendManager) UpdateSessionSorting ¶
func (rwm *RaceWeekendManager) UpdateSessionSorting(raceWeekendID, sessionID string, sortType string, numEntrantsToReverse int) error
func (*RaceWeekendManager) UpsertRaceWeekend ¶
func (rwm *RaceWeekendManager) UpsertRaceWeekend(raceWeekend *RaceWeekend) error
func (*RaceWeekendManager) WatchForScheduledSessions ¶
func (rwm *RaceWeekendManager) WatchForScheduledSessions() error
type RaceWeekendSession ¶
type RaceWeekendSession struct { ID uuid.UUID Created time.Time Updated time.Time Deleted time.Time ParentIDs []uuid.UUID SortType string NumEntrantsToReverse int RaceConfig CurrentRaceConfig OverridePassword bool ReplacementPassword string StartedTime time.Time CompletedTime time.Time ScheduledTime time.Time ScheduledServerID ServerID Results *SessionResults StartWhenParentHasFinished bool Points map[uuid.UUID]*ChampionshipPoints // contains filtered or unexported fields }
A RaceWeekendSession is a single session within a RaceWeekend. It can have parent sessions. It must have a RaceConfig. Once completed, a RaceWeekendSession will contain EntrantResult from that session.
func NewRaceWeekendSession ¶
func NewRaceWeekendSession() *RaceWeekendSession
NewRaceWeekendSession creates an empty RaceWeekendSession
func (*RaceWeekendSession) ClearRecurrenceRule ¶
func (rws *RaceWeekendSession) ClearRecurrenceRule()
func (*RaceWeekendSession) Completed ¶
func (rws *RaceWeekendSession) Completed() bool
Completed RaceWeekendSessions have a non-zero CompletedTime
func (*RaceWeekendSession) FinishingGrid ¶
func (rws *RaceWeekendSession) FinishingGrid(raceWeekend *RaceWeekend) ([]*RaceWeekendSessionEntrant, error)
FinishingGrid returns the finishing grid of the session, if complete. Otherwise, it returns the EntryList of that session
func (*RaceWeekendSession) GetID ¶
func (rws *RaceWeekendSession) GetID() uuid.UUID
func (*RaceWeekendSession) GetRaceSetup ¶
func (rws *RaceWeekendSession) GetRaceSetup() CurrentRaceConfig
func (*RaceWeekendSession) GetRaceWeekendEntryList ¶
func (rws *RaceWeekendSession) GetRaceWeekendEntryList(rw *RaceWeekend, overrideFilter *RaceWeekendSessionToSessionFilter, overrideFilterSessionID string) (RaceWeekendEntryList, error)
GetRaceWeekendEntryList returns the RaceWeekendEntryList for the given session, built from the parent session(s) results and applied filters.
func (*RaceWeekendSession) GetRecurrenceRule ¶
func (rws *RaceWeekendSession) GetRecurrenceRule() (*rrule.RRule, error)
func (*RaceWeekendSession) GetScheduledServerID ¶
func (rws *RaceWeekendSession) GetScheduledServerID() ServerID
func (*RaceWeekendSession) GetScheduledTime ¶
func (rws *RaceWeekendSession) GetScheduledTime() time.Time
func (*RaceWeekendSession) GetSummary ¶
func (rws *RaceWeekendSession) GetSummary() string
func (*RaceWeekendSession) GetURL ¶
func (rws *RaceWeekendSession) GetURL() string
func (*RaceWeekendSession) HasParent ¶
func (rws *RaceWeekendSession) HasParent(id string) bool
HasParent determines if a RaceWeekendSession has a parent with id
func (*RaceWeekendSession) HasRecurrenceRule ¶
func (rws *RaceWeekendSession) HasRecurrenceRule() bool
func (*RaceWeekendSession) HasSignUpForm ¶
func (rws *RaceWeekendSession) HasSignUpForm() bool
func (*RaceWeekendSession) InProgress ¶
func (rws *RaceWeekendSession) InProgress() bool
InProgress indicates whether a RaceWeekendSession has been started but not stopped
func (*RaceWeekendSession) IsBase ¶
func (rws *RaceWeekendSession) IsBase() bool
IsBase indicates that a RaceWeekendSession has no parent
func (*RaceWeekendSession) Name ¶
func (rws *RaceWeekendSession) Name() string
Name of the RaceWeekendSession
func (*RaceWeekendSession) ParentsDataAttr ¶
func (rws *RaceWeekendSession) ParentsDataAttr(raceWeekend *RaceWeekend) template.HTMLAttr
ParentsDataAttr returns a html-safe data attribute for identifying parent sessions of a given RaceWeekendSession in the frontend
func (*RaceWeekendSession) ReadOnlyEntryList ¶
func (rws *RaceWeekendSession) ReadOnlyEntryList() EntryList
func (*RaceWeekendSession) RemoveParent ¶
func (rws *RaceWeekendSession) RemoveParent(parentID string)
RemoveParent removes a parent RaceWeekendSession from this session
func (*RaceWeekendSession) SessionInfo ¶
func (rws *RaceWeekendSession) SessionInfo() *SessionConfig
SessionInfo returns the information about the Assetto Corsa Session (i.e. practice, qualifying, race)
func (*RaceWeekendSession) SessionType ¶
func (rws *RaceWeekendSession) SessionType() SessionType
SessionType returns the type of the RaceWeekendSession (practice, qualifying, race)
func (*RaceWeekendSession) SetRecurrenceRule ¶
func (rws *RaceWeekendSession) SetRecurrenceRule(input string) error
type RaceWeekendSessionEntrant ¶
type RaceWeekendSessionEntrant struct { // SessionID is the last session the Entrant participated in SessionID uuid.UUID // EntrantResult is the result of the last session the Entrant participated in EntrantResult *SessionResult // Car is the car from the EntryList that matches the results of the last session the Entrant participated in Car *SessionCar // PitBox is used to determine the starting pitbox of the Entrant. PitBox int // SessionResults are the whole results for the session the entrant took part in SessionResults *SessionResults `json:"-"` IsPlaceholder bool `json:"-"` // OverrideSetupFile is a path to an overridden setup for a Race Weekend OverrideSetupFile string }
A RaceWeekendSessionEntrant is someone who has entered at least one RaceWeekend event.
func NewRaceWeekendSessionEntrant ¶
func NewRaceWeekendSessionEntrant(previousSessionID uuid.UUID, car *SessionCar, entrantResult *SessionResult, sessionResults *SessionResults) *RaceWeekendSessionEntrant
NewRaceWeekendSessionEntrant creates a RaceWeekendSessionEntrant
func (*RaceWeekendSessionEntrant) ChampionshipClass ¶
func (se *RaceWeekendSessionEntrant) ChampionshipClass(raceWeekend *RaceWeekend) *ChampionshipClass
func (*RaceWeekendSessionEntrant) GetEntrant ¶
func (se *RaceWeekendSessionEntrant) GetEntrant() *Entrant
GetEntrant returns the RaceWeekendSessionEntrant as an EntryList Entrant (used for building the final entry_list.ini)
type RaceWeekendSessionToSessionFilter ¶
type RaceWeekendSessionToSessionFilter struct { // IsPreview indicates that the Filter is for preview only, and will not actually affect a starting grid. IsPreview bool // ResultStart is the beginning of the split from the previous session's result ResultStart int // ResultEnd is the end of the split from the previous session's result ResultEnd int // NumEntrantsToReverse defines how many entrants to reverse. -1 indicates all, 0 indicates none, or N entrants. NumEntrantsToReverse int // EntryListStart is where to place the entrants in the starting grid of the next session EntryListStart int // SortType defines how the entrants are sorted SortType string // ForceUseTyreFromFastestLap forces drivers to start on the same tyre compound as the tyre compound that // they achieved their fastest lap on in the previous session ForceUseTyreFromFastestLap bool // AvailableResultsForSorting are the results files to be used for sorting the entrants. AvailableResultsForSorting []string // SplitType defines the kind of splitting that we want to do. SplitType RaceWeekendFilterSplitType // SelectedDriverGUIDs is a list of the currently selected driver GUIDs. This is only populated if SplitType == SplitTypeManualDriverSelection SelectedDriverGUIDs []string // SelectedChampionshipClassIDs is a list of the currently selected ChampionshipClass IDs. This is only populated if SplitType == SplitTypeChampionshipClass SelectedChampionshipClassIDs map[uuid.UUID]bool // Deprecated: ManualDriverSelection indicates that drivers are picked manually from the above results file. ManualDriverSelection bool }
func (RaceWeekendSessionToSessionFilter) Filter ¶
func (f RaceWeekendSessionToSessionFilter) Filter(raceWeekend *RaceWeekend, parentSession, childSession *RaceWeekendSession, parentSessionResults []*RaceWeekendSessionEntrant, childSessionEntryList *RaceWeekendEntryList) error
Filter takes a set of RaceWeekendSessionEntrants formed by the results of the parent session and filters them into a child session entry list.
type RealPenaltyACSettings ¶
type RealPenaltyACSettings struct { General RealPenaltyACSettingsGeneral `ini:"General" help:""` App RealPenaltyACSettingsApp `ini:"App" help:""` Sol RealPenaltyACSettingsSol `ini:"Sol" help:""` CustomShadersPatch RealPenaltyACSettingsCustomShadersPatch `ini:"Custom_Shaders_Patch"` SafetyCar RealPenaltyACSettingsSafetyCar `ini:"Safety_Car" help:""` NoPenalty RealPenaltyACSettingsNoPenalty `ini:"No_Penalty" help:""` Admin RealPenaltyACSettingsAdmin `ini:"Admin" help:""` Helicorsa RealPenaltyACSettingsHelicorsa `ini:"Helicorsa" help:""` }
func DefaultRealPenaltyACSettings ¶
func DefaultRealPenaltyACSettings() RealPenaltyACSettings
type RealPenaltyACSettingsAdmin ¶
type RealPenaltyACSettingsAdmin struct {
GUIDs string `ini:"GUIDs" name:"GUIDs" help:"List of Steam GUIDs (separated by a semicolon) that can send commands to the server via chat"`
}
type RealPenaltyACSettingsApp ¶
type RealPenaltyACSettingsApp struct { Mandatory boolString `ini:"MANDATORY" help:"on = Real Penalty app is mandatory, off = Real Penalty app is not mandatory"` CheckFrequency int `ini:"CHECK_FREQUENCY" help:"Frequency (seconds) for app check"` }
type RealPenaltyACSettingsGeneral ¶
type RealPenaltyACSettingsGeneral struct { FirstCheckTime int `ini:"FIRST_CHECK_TIME" help:"Delay (seconds) after connection of new driver for the first check (app + sol)"` CockpitCamera bool `` /* 169-byte string literal not displayed */ TrackChecksum bool `` /* 135-byte string literal not displayed */ WeatherChecksum bool `ini:"WEATHER_CHECKSUM" help:"Set to true if you want the weather checksum (if the weather exists on the server)"` CarChecksum bool `` /* 143-byte string literal not displayed */ }
type RealPenaltyACSettingsHelicorsa ¶
type RealPenaltyACSettingsHelicorsa struct { Mandatory bool `ini:"MANDATORY" help:"Set to true if the Helicorsa app is mandatory for the race"` DistanceThreshold float64 `ini:"DISTANCE_THRESHOLD" help:"How far away are the cars we paint?"` WorldZoom float64 `ini:"WORLD_ZOOM" help:"World coordinates zoom or how big the bars are"` OpacityThreshold float64 `ini:"OPACITY_THRESHOLD" help:"Opacity threshold: At which distance (in meters) should the cars start to fade?"` FrontFadeOutArc float64 `ini:"FRONT_FADE_OUT_ARC" help:"Fade out cars in front of the player in an arc of X degrees (0 to disable)"` FrontFadeAngle float64 `` /* 128-byte string literal not displayed */ CarLength float64 `ini:"CAR_LENGHT" help:"How long are the cars (in meters). Sorry, no data from AC available"` // this is misspelt in the example ac_settings.ini CarWidth float64 `ini:"CAR_WIDTH" help:"How wide are the cars (in meters). Sorry, no data from AC available"` }
type RealPenaltyACSettingsNoPenalty ¶
type RealPenaltyACSettingsNoPenalty struct {
GUIDs string `` /* 178-byte string literal not displayed */
}
type RealPenaltyACSettingsSafetyCar ¶
type RealPenaltyACSettingsSafetyCar struct { CarModel string `ini:"CAR_MODEL" help:"Car model of safety car"` RaceStartBehindSC bool `` /* 157-byte string literal not displayed */ NormalizedLightOffPosition float64 `` /* 179-byte string literal not displayed */ NormalizedStartPosition float64 `` /* 253-byte string literal not displayed */ GreenLightDelay float64 `ini:"GREEN_LIGHT_DELAY" help:"Rolling start: delay of the green light after red signal (seconds)"` }
type RealPenaltyACSettingsSol ¶
type RealPenaltyACSettingsSol struct { Mandatory bool `ini:"MANDATORY" help:"Set to true if the event is with mod Sol day to night transition"` PerformanceModeAllowed bool `ini:"PERFORMACE_MODE_ALLOWED" help:"Set to true if Sol performance mode is allowed"` // misspelt in real penalty INI CheckFrequency int `ini:"CHECK_FREQUENCY" help:"Frequency (seconds) for Sol check"` }
type RealPenaltyAppConfig ¶
type RealPenaltyAppConfig struct { General RealPenaltyConfigGeneral `ini:"General"` PluginsRelay RealPenaltyPluginsRelay `ini:"Plugins_Relay" show:"open"` }
func DefaultRealPenaltyAppConfig ¶
func DefaultRealPenaltyAppConfig() RealPenaltyAppConfig
type RealPenaltyConfig ¶
type RealPenaltyConfig struct { RealPenaltyAppConfig RealPenaltyAppConfig `show:"contents"` RealPenaltySettings RealPenaltySettings `show:"contents"` RealPenaltyACSettings RealPenaltyACSettings `show:"contents"` }
each of these is a separate ini file
func DefaultRealPenaltyConfig ¶
func DefaultRealPenaltyConfig() *RealPenaltyConfig
func (*RealPenaltyConfig) Write ¶
func (rpc *RealPenaltyConfig) Write() error
type RealPenaltyConfigGeneral ¶
type RealPenaltyConfigGeneral struct { EnableRealPenalty bool `ini:"-" help:"Turn Real Penalty on or off"` ACServerPath string `ini:"AC_SERVER_PATH" show:"-" help:"Path to the AC Server folder"` ACCFGFile string `` /* 143-byte string literal not displayed */ ACTracksFolder string `` /* 137-byte string literal not displayed */ ACWeatherFolder string `` /* 139-byte string literal not displayed */ UDPPort int `ini:"UDP_PORT" show:"-" help:"Listening UDP port - Set the same port (without IP) of cfg of the server, UDP_PLUGIN_ADDRESS "` UDPResponse string `` /* 146-byte string literal not displayed */ AppTCPPort int `` /* 290-byte string literal not displayed */ AppUDPPort int `ini:"APP_UDP_PORT" show:"open" help:"Listening UDP port from AC app (to open in firewall/router). Any free UDP port is OK"` AppFile string `ini:"APP_FILE" show:"-" help:"Path and file names of the app from the plugin package"` ImagesFile string `ini:"IMAGES_FILE" show:"-" help:"Path and file names of the images from the plugin package"` SoundsFile string `ini:"SOUNDS_FILE" show:"-" help:"Path and file names of the sounds from the plugin package"` TracksFolder string `ini:"TRACKS_FOLDER" show:"-" help:"Folder of the additional .ini track files"` }
type RealPenaltyHandler ¶
type RealPenaltyHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewRealPenaltyHandler ¶
func NewRealPenaltyHandler(baseHandler *BaseHandler, store Store) *RealPenaltyHandler
type RealPenaltyPluginsRelay ¶
type RealPenaltySettings ¶
type RealPenaltySettings struct { General RealPenaltySettingsGeneral `ini:"General"` Cutting RealPenaltySettingsCutting `ini:"Cutting"` Speeding RealPenaltySettingsSpeeding `ini:"Speeding"` Crossing RealPenaltySettingsCrossing `ini:"Crossing"` JumpStart RealPenaltySettingsJumpStart `ini:"Jump_Start"` DRS RealPenaltySettingsDRS `ini:"Drs"` BlueFlag RealPenaltySettingsBlueFlag `ini:"Blue_Flag"` }
func DefaultRealPenaltySettings ¶
func DefaultRealPenaltySettings() RealPenaltySettings
type RealPenaltySettingsCrossing ¶
type RealPenaltySettingsCrossing struct {
PenaltyType string `` /* 145-byte string literal not displayed */
}
type RealPenaltySettingsCutting ¶
type RealPenaltySettingsCutting struct { EnabledDuringSafetyCar bool `ini:"ENABLED_DURING_SAFETY_CAR" help:"Cutting penalty enable during Safety Car or Virtual Safety Car"` TotalCutWarnings int `ini:"TOTAL_CUT_WARNINGS" help:"How many warnings are allowed before a penalty is given"` EnableTyresDirtLevel bool `ini:"ENABLE_TYRES_DIRT_LEVEL" help:"Tyres dirt for cutting"` WheelsOut int `ini:"WHEELS_OUT" help:"The maximum number of wheels that are allowed to go off track"` MinSpeed int `ini:"MIN_SPEED" help:"The minimum speed, in kph, that will trigger a cut"` SecondsBetweenCuts int `ini:"SECONDS_BETWEEN_CUTS" help:"You won't get a cut until this many seconds after the last one"` MaxCutTime int `` /* 153-byte string literal not displayed */ MinSlowDownRatio float64 `` /* 442-byte string literal not displayed */ QualifySlowDownSpeed int `` /* 133-byte string literal not displayed */ QualifyMaxSectorOutSpeed int `` /* 196-byte string literal not displayed */ QualifySlowDownSpeedRatio float64 `` /* 234-byte string literal not displayed */ PostCuttingTime int `` /* 206-byte string literal not displayed */ PenaltyType string `` /* 144-byte string literal not displayed */ }
type RealPenaltySettingsDRS ¶
type RealPenaltySettingsDRS struct { PenaltyType string `` /* 152-byte string literal not displayed */ Gap float64 `ini:"GAP" help:"Max gap in seconds from front car"` EnabledAfterLaps int `ini:"ENABLED_AFTER_LAPS" help:"DRS enabled after N lap from start (+1 if rolling start with SC - file ac_settings.ini)"` MinSpeed int `ini:"MIN_SPEED" help:"If the car speed < MIN SPEED no penalty for illegal DRS use"` BonusTime float64 `ini:"BONUS_TIME" help:"How many seconds the DRS can remain open during each illegal use before the penalty"` MaxIllegalUses int `ini:"MAX_ILLEGAL_USES" help:"How many time the driver can open the illegal DRS in each sector before the penalty"` EnabledDuringSafetyCar bool `ini:"ENABLED_DURING_SAFETY_CAR" help:"DRS penalty enabled during Safety Car or Virtual Safety Car"` OmitCars string `ini:"OMIT_CARS" help:"List of cars without DRS, semicolon separated."` }
type RealPenaltySettingsGeneral ¶
type RealPenaltySettingsGeneral struct { EnableCuttingPenalties bool `ini:"ENABLE_CUTTING_PENALTIES" help:"Set to true to enable cuttings penalties; false to issue warnings only"` EnableSpeedingPenalties bool `ini:"ENABLE_SPEEDING_PENALTIES" help:"Set to true to enable pit lane speeding penalties"` EnableCrossingPenalties bool `ini:"ENABLE_CROSSING_PENALTIES" help:"Set to true to enable exit pit lane crossing line penalty"` EnableDRSPenalties bool `ini:"ENABLE_DRS_PENALTIES" help:"Set to true to enable DRS penalty (only for car with DRS)"` LapsToTakePenalty int `` /* 151-byte string literal not displayed */ PenaltySeconds int `` /* 131-byte string literal not displayed */ LastTimeWithoutPenalty int `` /* 430-byte string literal not displayed */ LastLapsWithoutPenalty int `` /* 296-byte string literal not displayed */ }
type RealPenaltySettingsJumpStart ¶
type RealPenaltySettingsJumpStart struct { PenaltyType0 string `` /* 164-byte string literal not displayed */ SpeedLimitPenalty0 int `ini:"SPEED_LIMIT_PENALTY_0" help:""` PenaltyType1 string `ini:"PENALTY_TYPE_1" help:""` SpeedLimitPenalty1 int `` /* 171-byte string literal not displayed */ PenaltyType2 string `ini:"PENALTY_TYPE_2" help:""` SpeedLimitPenalty2 int `` /* 171-byte string literal not displayed */ }
type RealPenaltySettingsSpeeding ¶
type RealPenaltySettingsSpeeding struct { PitLaneSpeed int `` /* 158-byte string literal not displayed */ PenaltyType0 string `` /* 180-byte string literal not displayed */ SpeedLimitPenalty0 int `ini:"SPEED_LIMIT_PENALTY_0" help:""` PenaltyType1 string `` /* 180-byte string literal not displayed */ SpeedLimitPenalty1 int `ini:"SPEED_LIMIT_PENALTY_1" help:""` PenaltyType2 string `` /* 180-byte string literal not displayed */ SpeedLimitPenalty2 int `ini:"SPEED_LIMIT_PENALTY_2" help:""` }
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer is the template engine.
func NewRenderer ¶
func NewRenderer(loader TemplateLoader, store Store, process ServerProcess, reload bool) (*Renderer, error)
func (*Renderer) LoadPartial ¶
func (tr *Renderer) LoadPartial(w http.ResponseWriter, r *http.Request, partial string, vars TemplateVars) error
func (*Renderer) LoadTemplate ¶
func (tr *Renderer) LoadTemplate(w http.ResponseWriter, r *http.Request, view string, vars TemplateVars) error
LoadTemplate reads a template from templates and renders it with data to the given io.Writer
func (*Renderer) MustLoadPartial ¶
func (tr *Renderer) MustLoadPartial(w http.ResponseWriter, r *http.Request, partial string, vars TemplateVars)
func (*Renderer) MustLoadTemplate ¶
func (tr *Renderer) MustLoadTemplate(w http.ResponseWriter, r *http.Request, view string, vars TemplateVars)
MustLoadTemplate asserts that a LoadTemplate call must succeed or be dealt with via the http.ResponseWriter
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver(templateLoader TemplateLoader, reloadTemplates bool, store Store) (*Resolver, error)
func (*Resolver) ResolveRaceControl ¶
func (r *Resolver) ResolveRaceControl() *RaceControl
func (*Resolver) ResolveRouter ¶
func (r *Resolver) ResolveRouter(fs http.FileSystem) http.Handler
func (*Resolver) ResolveStore ¶
func (*Resolver) UDPCallback ¶
type ResultsHandler ¶
type ResultsHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewResultsHandler ¶
func NewResultsHandler(baseHandler *BaseHandler, store Store) *ResultsHandler
type ScheduledEvent ¶
type ScheduledEvent interface { GetID() uuid.UUID GetScheduledServerID() ServerID GetRaceSetup() CurrentRaceConfig GetScheduledTime() time.Time GetSummary() string GetURL() string HasSignUpForm() bool ReadOnlyEntryList() EntryList HasRecurrenceRule() bool GetRecurrenceRule() (*rrule.RRule, error) SetRecurrenceRule(input string) error ClearRecurrenceRule() }
type ScheduledEventBase ¶
type ScheduledEventBase struct { Scheduled time.Time ScheduledInitial time.Time Recurrence string ScheduledServerID ServerID }
func (*ScheduledEventBase) ClearRecurrenceRule ¶
func (seb *ScheduledEventBase) ClearRecurrenceRule()
func (*ScheduledEventBase) GetRecurrenceRule ¶
func (seb *ScheduledEventBase) GetRecurrenceRule() (*rrule.RRule, error)
func (*ScheduledEventBase) GetScheduledTime ¶
func (seb *ScheduledEventBase) GetScheduledTime() time.Time
func (*ScheduledEventBase) HasRecurrenceRule ¶
func (seb *ScheduledEventBase) HasRecurrenceRule() bool
func (*ScheduledEventBase) SetRecurrenceRule ¶
func (seb *ScheduledEventBase) SetRecurrenceRule(input string) error
type ScheduledRacesHandler ¶
type ScheduledRacesHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewScheduledRacesHandler ¶
func NewScheduledRacesHandler(baseHandler *BaseHandler, scheduledRacesManager *ScheduledRacesManager) *ScheduledRacesHandler
type ScheduledRacesManager ¶
type ScheduledRacesManager struct {
// contains filtered or unexported fields
}
func NewScheduledRacesManager ¶
func NewScheduledRacesManager(store Store) *ScheduledRacesManager
type ServerAccountOptions ¶
type ServerAccountOptions struct {
IsOpen bool
}
type ServerAdministrationHandler ¶
type ServerAdministrationHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewServerAdministrationHandler ¶
func NewServerAdministrationHandler( baseHandler *BaseHandler, store Store, raceManager *RaceManager, championshipManager *ChampionshipManager, raceWeekendManager *RaceWeekendManager, process ServerProcess, acsrClient *ACSRClient, ) *ServerAdministrationHandler
type ServerConfig ¶
type ServerConfig struct { GlobalServerConfig GlobalServerConfig `ini:"SERVER"` CurrentRaceConfig CurrentRaceConfig `ini:"SERVER"` }
func ConfigIniDefault ¶
func ConfigIniDefault() ServerConfig
ConfigIniDefault is the default server config (ish) as supplied via the assetto corsa server.
func (ServerConfig) ReadString ¶
func (sc ServerConfig) ReadString() (string, error)
func (ServerConfig) Write ¶
func (sc ServerConfig) Write() error
type ServerExtraConfig ¶
type ServerExtraConfig struct { Plugins []*CommandPlugin `yaml:"plugins"` AuditLogging bool `yaml:"audit_logging"` PerformanceMode bool `yaml:"performance_mode"` DisableWindowsBrowserOpen bool `yaml:"dont_open_browser"` ScanContentFolderForChanges bool `yaml:"scan_content_folder_for_changes"` UseCarNameCache bool `yaml:"use_car_name_cache"` PersistMidSessionResults bool `yaml:"persist_mid_session_results"` // Deprecated: use Plugins instead RunOnStart []string `yaml:"run_on_start"` }
type ServerProcess ¶
type ServerProcess interface { Start(event RaceEvent, udpPluginAddress string, udpPluginLocalPort int, forwardingAddress string, forwardListenPort int) error Stop() error Restart() error IsRunning() bool Event() RaceEvent UDPCallback(message udp.Message) SendUDPMessage(message udp.Message) error NotifyDone(chan struct{}) Logs() string }
type SessionCar ¶
type SessionCar struct { BallastKG int `json:"BallastKG"` CarID int `json:"CarId"` Driver SessionDriver `json:"Driver"` Model string `json:"Model"` Restrictor int `json:"Restrictor"` Skin string `json:"Skin"` }
func (*SessionCar) GetCar ¶
func (c *SessionCar) GetCar() string
func (*SessionCar) GetGUID ¶
func (c *SessionCar) GetGUID() string
func (*SessionCar) GetName ¶
func (c *SessionCar) GetName() string
func (*SessionCar) GetSkin ¶
func (c *SessionCar) GetSkin() string
func (*SessionCar) GetTeam ¶
func (c *SessionCar) GetTeam() string
func (*SessionCar) HasMultipleDrivers ¶
func (c *SessionCar) HasMultipleDrivers() bool
type SessionConfig ¶
type SessionConfig struct { Name string `ini:"NAME" show:"quick"` Time int `ini:"TIME" show:"quick" help:"session length in minutes"` Laps int `ini:"LAPS" show:"quick" help:"number of laps in the race"` IsOpen SessionOpenness `ini:"IS_OPEN" input:"checkbox" help:"0 = no join, 1 = free join, 2 = free join until 20 seconds to the green light"` WaitTime int `ini:"WAIT_TIME" help:"seconds before the start of the session"` }
type SessionDriver ¶
type SessionDriver struct { GUID string `json:"Guid"` GuidsList []string `json:"GuidsList"` Name string `json:"Name"` Nation string `json:"Nation"` Team string `json:"Team"` ClassID uuid.UUID `json:"ClassID"` }
func (*SessionDriver) AssignEntrant ¶
func (sd *SessionDriver) AssignEntrant(entrant *Entrant, classID uuid.UUID)
type SessionEvent ¶
type SessionEvent struct { CarID int `json:"CarId"` Driver *SessionDriver `json:"Driver"` ImpactSpeed float64 `json:"ImpactSpeed"` OtherCarID int `json:"OtherCarId"` OtherDriver *SessionDriver `json:"OtherDriver"` RelPosition *SessionPos `json:"RelPosition"` Type string `json:"Type"` WorldPosition *SessionPos `json:"WorldPosition"` }
func (*SessionEvent) GetRelPosition ¶
func (se *SessionEvent) GetRelPosition() string
func (*SessionEvent) GetWorldPosition ¶
func (se *SessionEvent) GetWorldPosition() string
type SessionLap ¶
type SessionLap struct { BallastKG int `json:"BallastKG"` CarID int `json:"CarId"` CarModel string `json:"CarModel"` Cuts int `json:"Cuts"` DriverGUID string `json:"DriverGuid"` DriverName string `json:"DriverName"` LapTime int `json:"LapTime"` Restrictor int `json:"Restrictor"` Sectors []int `json:"Sectors"` Timestamp int `json:"Timestamp"` Tyre string `json:"Tyre"` ClassID uuid.UUID `json:"ClassID"` }
func (*SessionLap) GetLapTime ¶
func (sl *SessionLap) GetLapTime() time.Duration
type SessionOpenness ¶
type SessionOpenness int
func (SessionOpenness) String ¶
func (s SessionOpenness) String() string
type SessionPos ¶
type SessionPreviewEntrant ¶
type SessionResult ¶
type SessionResult struct { BallastKG int `json:"BallastKG"` BestLap int `json:"BestLap"` CarID int `json:"CarId"` CarModel string `json:"CarModel"` DriverGUID string `json:"DriverGuid"` DriverName string `json:"DriverName"` Restrictor int `json:"Restrictor"` TotalTime int `json:"TotalTime"` HasPenalty bool `json:"HasPenalty"` PenaltyTime time.Duration `json:"PenaltyTime"` LapPenalty int `json:"LapPenalty"` Disqualified bool `json:"Disqualified"` ClassID uuid.UUID `json:"ClassID"` }
func (*SessionResult) BestLapTyre ¶
func (s *SessionResult) BestLapTyre(results *SessionResults) string
type SessionResults ¶
type SessionResults struct { Cars []*SessionCar `json:"Cars"` Events []*SessionEvent `json:"Events"` Laps []*SessionLap `json:"Laps"` Result []*SessionResult `json:"Result"` TrackConfig string `json:"TrackConfig"` TrackName string `json:"TrackName"` Type SessionType `json:"Type"` Date time.Time `json:"Date"` SessionFile string `json:"SessionFile"` ChampionshipID string `json:"ChampionshipID"` RaceWeekendID string `json:"RaceWeekendID"` }
func ListAllResults ¶
func ListAllResults() ([]SessionResults, error)
func LoadResult ¶
func LoadResult(fileName string, opts ...LoadResultOpts) (*SessionResults, error)
func (*SessionResults) Anonymize ¶
func (s *SessionResults) Anonymize()
func (*SessionResults) ClearKickedGUIDs ¶
func (s *SessionResults) ClearKickedGUIDs()
Clear Kicked GUIDs removes any instances of the kicked guid from the results
func (*SessionResults) DriversHaveTeams ¶
func (s *SessionResults) DriversHaveTeams() bool
func (*SessionResults) FallBackSort ¶
func (s *SessionResults) FallBackSort()
func (*SessionResults) FastestLap ¶
func (s *SessionResults) FastestLap() *SessionLap
func (*SessionResults) FastestLapInClass ¶
func (s *SessionResults) FastestLapInClass(classID uuid.UUID) *SessionLap
func (*SessionResults) FindCarByGUIDAndModel ¶
func (s *SessionResults) FindCarByGUIDAndModel(guid, model string) (*SessionCar, error)
func (*SessionResults) FindCarIDForGUIDAndModel ¶
func (s *SessionResults) FindCarIDForGUIDAndModel(guid, model string) int
func (*SessionResults) GetAverageLapTime ¶
func (s *SessionResults) GetAverageLapTime(guid, model string) time.Duration
func (*SessionResults) GetConsistency ¶
func (s *SessionResults) GetConsistency(guid, model string) float64
func (*SessionResults) GetCrashes ¶
func (s *SessionResults) GetCrashes(guid, model string) int
func (*SessionResults) GetCrashesOfType ¶
func (s *SessionResults) GetCrashesOfType(guid, model, collisionType string) int
func (*SessionResults) GetCuts ¶
func (s *SessionResults) GetCuts(driverGUID, model string) int
func (*SessionResults) GetDate ¶
func (s *SessionResults) GetDate() string
func (*SessionResults) GetDriverDescriptionForLap ¶
func (s *SessionResults) GetDriverDescriptionForLap(lap *SessionLap, autoFillEntrantList []*Entrant) string
func (*SessionResults) GetDriverPosition ¶
func (s *SessionResults) GetDriverPosition(driverGUID, model string) int
func (*SessionResults) GetDrivers ¶
func (s *SessionResults) GetDrivers() string
func (*SessionResults) GetDriversFastestLap ¶
func (s *SessionResults) GetDriversFastestLap(guid, model string) *SessionLap
func (*SessionResults) GetLastLapPos ¶
func (s *SessionResults) GetLastLapPos(driverGUID, model string) int
func (*SessionResults) GetLastLapTime ¶
func (s *SessionResults) GetLastLapTime(driverGUID, model string) time.Duration
func (*SessionResults) GetNumLaps ¶
func (s *SessionResults) GetNumLaps(driverGUID, model string) int
func (*SessionResults) GetNumSectors ¶
func (s *SessionResults) GetNumSectors() []int
func (*SessionResults) GetOverallAverageLapTime ¶
func (s *SessionResults) GetOverallAverageLapTime() time.Duration
func (*SessionResults) GetPosForLap ¶
func (s *SessionResults) GetPosForLap(guid, model string, lapNum int64) int
lapNum is the drivers current lap
func (*SessionResults) GetPotentialLap ¶
func (s *SessionResults) GetPotentialLap(driverGUID, model string) time.Duration
func (*SessionResults) GetTeamName ¶
func (s *SessionResults) GetTeamName(driverGUID string) string
func (*SessionResults) GetURL ¶
func (s *SessionResults) GetURL() string
func (*SessionResults) HasHandicaps ¶
func (s *SessionResults) HasHandicaps() bool
func (*SessionResults) IsDriversFastestLap ¶
func (s *SessionResults) IsDriversFastestLap(guid, model string, time, cuts int) bool
func (*SessionResults) IsDriversFastestSector ¶
func (s *SessionResults) IsDriversFastestSector(guid, model string, sector, time, cuts int) bool
func (*SessionResults) IsFastestLap ¶
func (s *SessionResults) IsFastestLap(time, cuts int) bool
func (*SessionResults) IsFastestSector ¶
func (s *SessionResults) IsFastestSector(sector, time, cuts int) bool
func (*SessionResults) IsTimeAttack ¶
func (s *SessionResults) IsTimeAttack() bool
func (*SessionResults) LapAssociatedWithGUIDAndModel ¶
func (s *SessionResults) LapAssociatedWithGUIDAndModel(lap *SessionLap, driverGUID, model string) bool
func (*SessionResults) MaskDriverNames ¶
func (s *SessionResults) MaskDriverNames()
func (*SessionResults) NormaliseCarIDs ¶
func (s *SessionResults) NormaliseCarIDs()
NormaliseCarIDs fixes any instances where CarID may have changed in some laps
func (*SessionResults) NormaliseDriverSwapGUIDs ¶
func (s *SessionResults) NormaliseDriverSwapGUIDs()
func (*SessionResults) NumberOfDriverSwaps ¶
func (s *SessionResults) NumberOfDriverSwaps(carID int) int
func (*SessionResults) RenameDriver ¶
func (s *SessionResults) RenameDriver(guid, newName string)
func (*SessionResults) ResultHasMultipleDrivers ¶
func (s *SessionResults) ResultHasMultipleDrivers(result *SessionResult) bool
func (*SessionResults) UpdateDate ¶
func (s *SessionResults) UpdateDate(date time.Time)
type SessionType ¶
type SessionType string
const ( SessionTypeBooking SessionType = "BOOK" SessionTypePractice SessionType = "PRACTICE" SessionTypeQualifying SessionType = "QUALIFY" SessionTypeRace SessionType = "RACE" // SessionTypeSecondRace is a convenience const to allow for checking of // reversed grid positions signifying a second race. SessionTypeSecondRace SessionType = "RACEx2" )
func (SessionType) OriginalString ¶
func (s SessionType) OriginalString() string
func (SessionType) String ¶
func (s SessionType) String() string
type Sessions ¶
type Sessions map[SessionType]*SessionConfig
func (Sessions) AsSlice ¶
func (s Sessions) AsSlice() []*SessionConfig
func (Sessions) AsSliceWithSessionTypes ¶
func (s Sessions) AsSliceWithSessionTypes() ([]*SessionConfig, []SessionType)
type ShouldBeAnInt ¶
type ShouldBeAnInt int
ShouldBeAnInt can be used in JSON struct definitions in places where the value provided should be an int, but isn't.
func (*ShouldBeAnInt) UnmarshalJSON ¶
func (i *ShouldBeAnInt) UnmarshalJSON(b []byte) error
type StandingsOption ¶
type StandingsOption int
const (
StandingsNoPointsPenalties StandingsOption = iota
)
type SteamConfig ¶
type SteamLoginHandler ¶
type SteamLoginHandler struct{}
type Store ¶
type Store interface { // Custom Races UpsertCustomRace(race *CustomRace) error FindCustomRaceByID(uuid string) (*CustomRace, error) ListCustomRaces() ([]*CustomRace, error) DeleteCustomRace(race *CustomRace) error // Entrants UpsertEntrant(entrant Entrant) error ListEntrants() ([]*Entrant, error) DeleteEntrant(id string) error // Server Options UpsertServerOptions(so *GlobalServerConfig) error LoadServerOptions() (*GlobalServerConfig, error) // Championships UpsertChampionship(c *Championship) error ListChampionships() ([]*Championship, error) LoadChampionship(id string) (*Championship, error) DeleteChampionship(id string) error // Live Timings UpsertLiveTimingsData(*LiveTimingsPersistedData) error LoadLiveTimingsData() (*LiveTimingsPersistedData, error) UpsertLastRaceEvent(r RaceEvent) error LoadLastRaceEvent() (RaceEvent, error) ClearLastRaceEvent() error UpsertLiveFrames([]string) error ListPrevFrames() ([]string, error) // Meta SetMeta(key string, value interface{}) error GetMeta(key string, out interface{}) error // Accounts ListAccounts() ([]*Account, error) UpsertAccount(a *Account) error FindAccountByName(name string) (*Account, error) FindAccountByID(id string) (*Account, error) DeleteAccount(id string) error // Audit Log GetAuditEntries() ([]*AuditEntry, error) AddAuditEntry(entry *AuditEntry) error // Race Weekend ListRaceWeekends() ([]*RaceWeekend, error) UpsertRaceWeekend(rw *RaceWeekend) error LoadRaceWeekend(id string) (*RaceWeekend, error) DeleteRaceWeekend(id string) error // Stracker Options UpsertStrackerOptions(sto *StrackerConfiguration) error LoadStrackerOptions() (*StrackerConfiguration, error) // KissMyRank Options UpsertKissMyRankOptions(kmr *KissMyRankConfig) error LoadKissMyRankOptions() (*KissMyRankConfig, error) // RealPenalty options UpsertRealPenaltyOptions(rpc *RealPenaltyConfig) error LoadRealPenaltyOptions() (*RealPenaltyConfig, error) }
func NewBoltStore ¶
func NewJSONStore ¶
type StoreConfig ¶
type StoreConfig struct { Type string `yaml:"type"` Path string `yaml:"path"` ScheduledEventCheckLoop time.Duration `yaml:"scheduled_event_check_loop"` }
func (*StoreConfig) BuildStore ¶
func (s *StoreConfig) BuildStore() (Store, error)
type StrackerACPlugin ¶
type StrackerACPlugin struct { ReceivePort int `` /* 126-byte string literal not displayed */ SendPort int `ini:"sendPort" show:"open" help:"UDP port the plugins sends to. -1 means to use the AC servers setting UDP_PLUGIN_LOCAL_PORT"` ProxyPluginLocalPort int `` /* 189-byte string literal not displayed */ ProxyPluginPort int `` /* 181-byte string literal not displayed */ }
type StrackerConfiguration ¶
type StrackerConfiguration struct { EnableStracker bool `ini:"-" help:"Turn Stracker on or off"` InstanceConfiguration StrackerInstanceConfiguration `ini:"STRACKER_CONFIG" show:"open"` SwearFilter StrackerSwearFilter `ini:"SWEAR_FILTER"` SessionManagement StrackerSessionManagement `ini:"SESSION_MANAGEMENT"` Messages StrackerMessages `ini:"MESSAGES"` Database StrackerDatabase `ini:"DATABASE" show:"open"` DatabaseCompression StrackerDatabaseCompression `ini:"DB_COMPRESSION" show:"open"` HTTPConfiguration StrackerHTTPConfiguration `ini:"HTTP_CONFIG"` WelcomeMessage StrackerWelcomeMessage `ini:"WELCOME_MSG"` ACPlugin StrackerACPlugin `ini:"ACPLUGIN" show:"open"` LapValidChecks StrackerLapValidChecks `ini:"LAP_VALID_CHECKS"` }
func DefaultStrackerIni ¶
func DefaultStrackerIni() *StrackerConfiguration
func (*StrackerConfiguration) Write ¶
func (stc *StrackerConfiguration) Write() error
type StrackerDatabase ¶
type StrackerDatabase struct { DatabaseFile string `` /* 182-byte string literal not displayed */ DatabaseType string `ini:"database_type" show:"open" help:"Valid values are 'sqlite3' and 'postgres'. Selects the database to be used."` PerformBackups bool `` /* 222-byte string literal not displayed */ PostgresDatabaseName string `ini:"postgres_db" show:"open" help:"The name of the postgres database"` PostgresHostname string `ini:"postgres_host" show:"open" help:"Name of the host running the postgresql server."` PostgresUsername string `ini:"postgres_user" show:"open" help:"Name of the postgresql user"` PostgresPassword string `ini:"postgres_pwd" show:"open" help:"Postgresql user password"` }
type StrackerHTTPConfiguration ¶
type StrackerHTTPConfiguration struct { Enabled bool `ini:"enabled" show:"open"` ListenAddress string `` /* 199-byte string literal not displayed */ ListenPort int `ini:"listen_port" show:"open" help:"TCP listening port of the http server"` PublicURL string `` /* 371-byte string literal not displayed */ AdminUsername string `ini:"admin_username" help:"Username for the stracker admin pages. Leaving empty results in disabled admin pages"` AdminPassword string `` /* 128-byte string literal not displayed */ TemperatureUnit string `ini:"temperature_unit" help:"Valid values are 'degc' or 'degf'"` VelocityUnit string `ini:"velocity_unit" help:"Valid values are 'kmh' or 'mph'"` AuthBanAnonymisedPlayers bool `ini:"auth_ban_anonymized_players" help:"Add anonymized players to blacklist."` AuthLogFile string `` /* 171-byte string literal not displayed */ Banner string `ini:"banner" help:"Icon to be used in webpages (leave empty for default Assetto Corsa icon)"` EnableSVGGeneration bool `` /* 129-byte string literal not displayed */ ItemsPerPage int `ini:"items_per_page" help:"Number of items displayed per page"` LapTimesAddColumns string `` /* 306-byte string literal not displayed */ LogRequests bool `` /* 128-byte string literal not displayed */ MaximumStreamingClients int `` /* 241-byte string literal not displayed */ SSL bool `` /* 209-byte string literal not displayed */ SSLCertificate string `` /* 221-byte string literal not displayed */ SSLPrivateKey string `` /* 181-byte string literal not displayed */ }
type StrackerHandler ¶
type StrackerHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewStrackerHandler ¶
func NewStrackerHandler(baseHandler *BaseHandler, store Store) *StrackerHandler
type StrackerInstanceConfiguration ¶
type StrackerInstanceConfiguration struct { ACServerAddress string `` /* 145-byte string literal not displayed */ ACServerConfigIni string `` /* 163-byte string literal not displayed */ ACServerWorkingDir string `` /* 230-byte string literal not displayed */ AppendLogFile bool `` /* 175-byte string literal not displayed */ IDBasedOnDriverNames bool `` /* 201-byte string literal not displayed */ KeepAlivePtrackerConnections bool `` /* 146-byte string literal not displayed */ ListeningPort int `` /* 310-byte string literal not displayed */ LogFile string `ini:"log_file" show:"open" help:"Name of the stracker log file (utf-8 encoded), all messages go into there"` LogLevel string `` /* 145-byte string literal not displayed */ LogTimestamps bool `ini:"log_timestamps" show:"open" help:"Set to ON if you want the log messages to be prefixed with a timestamp"` LowerPriority bool `` /* 149-byte string literal not displayed */ PerformChecksumComparisons bool `ini:"perform_checksum_comparisons" show:"open" help:"Set to ON if you want stracker to compare the players checksums."` PtrackerConnectionMode string `` /* 156-byte string literal not displayed */ ServerName string `` /* 190-byte string literal not displayed */ TeeToStdout bool `ini:"tee_to_stdout" show:"open" help:"Set to ON if you want the messages appear on stdout (in Server Manager's plugin logs)"` }
type StrackerLapValidChecks ¶
type StrackerLapValidChecks struct { InvalidateOnCarCollisions bool `ini:"invalidateOnCarCollisions" help:"If ON, collisions with other cars will invalidate laps"` InvalidateOnEnvironmentCollisions bool `ini:"invalidateOnEnvCollisions" help:"If ON, collisions with environment objects will invalidate laps"` PtrackerAllowedTyresOut int `` /* 143-byte string literal not displayed */ }
type StrackerMessages ¶
type StrackerMessages struct { BestLapTimeBroadcastThreshold int `` /* 208-byte string literal not displayed */ CarToCarCollisionMessage bool `ini:"car_to_car_collision_msg" help:"Set to ON to enable car to car private messages."` MessageTypesToSendOverChat string `` /* 202-byte string literal not displayed */ }
type StrackerSwearFilter ¶
type StrackerSwearFilter struct { Action string `ini:"action" help:"Valid values are 'none', 'kick' and 'ban'"` BanDuration int `ini:"ban_duration" help:"The number of days to ban a player for (if the Action is 'ban')"` NumberOfWarnings int `ini:"num_warnings" help:"The number of warnings issued before the player is kicked"` SwearFile string `ini:"swear_file" help:"A file with bad words to be used for filtering" show:"open"` Warning string `ini:"warning" help:"The message sent to a player after swear detection"` }
type StrackerWelcomeMessage ¶
type 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 ¶
type TemplateVars interface {
Get() *BaseTemplateVars
}
type ThemeDetails ¶
type Track ¶
type Track struct { Name string Layouts []string CalculatedPrettyName string MetaData TrackMetaData }
func (Track) GetImagePath ¶
func (*Track) LayoutsCSV ¶
func (*Track) LoadMetaData ¶
func (Track) PrettyName ¶
type TrackDataGateway ¶
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 ¶
type TrackManager struct { }
func NewTrackManager ¶
func NewTrackManager() *TrackManager
func (*TrackManager) GetTrackFromName ¶
func (tm *TrackManager) GetTrackFromName(name string) (*Track, error)
func (*TrackManager) GetTrackImage ¶
func (*TrackManager) ListTracks ¶
func (tm *TrackManager) ListTracks() ([]Track, error)
func (*TrackManager) ResultsForLayout ¶
func (tm *TrackManager) ResultsForLayout(trackName, layout string) ([]SessionResults, error)
func (*TrackManager) UpdateTrackMetadata ¶
func (tm *TrackManager) UpdateTrackMetadata(name string, r *http.Request) error
type TrackMapData ¶
type TrackMapData struct { Width float64 `ini:"WIDTH" json:"width"` Height float64 `ini:"HEIGHT" json:"height"` Margin float64 `ini:"MARGIN" json:"margin"` ScaleFactor float64 `ini:"SCALE_FACTOR" json:"scale_factor"` OffsetX float64 `ini:"X_OFFSET" json:"offset_x"` OffsetZ float64 `ini:"Z_OFFSET" json:"offset_y"` DrawingSize float64 `ini:"DRAWING_SIZE" json:"drawing_size"` }
func LoadTrackMapData ¶
func LoadTrackMapData(track, trackLayout string) (*TrackMapData, error)
type TrackMetaData ¶
func LoadTrackMetaDataFromName ¶
func LoadTrackMetaDataFromName(name string) (*TrackMetaData, error)
func (*TrackMetaData) Save ¶
func (tmd *TrackMetaData) Save(name string) error
type TrackOptsGrouped ¶
type TrackOptsGrouped []Track
func (TrackOptsGrouped) Split ¶
func (tog TrackOptsGrouped) Split() TracksSplit
type TrackSurfacePreset ¶
type TracksHandler ¶
type TracksHandler struct { *BaseHandler // contains filtered or unexported fields }
func NewTracksHandler ¶
func NewTracksHandler(baseHandler *BaseHandler, trackManager *TrackManager) *TracksHandler
type TracksSplit ¶
type TracksSplit struct {
Stock, DLC, Mod []Track
}
type Tyres ¶
type ValidationError ¶
type ValidationError string
func (ValidationError) Error ¶
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"` WindBaseSpeedMin int `ini:"WIND_BASE_SPEED_MIN" help:"Min speed of the session possible"` WindBaseSpeedMax int `ini:"WIND_BASE_SPEED_MAX" help:"Max speed of session possible (max 40)"` WindBaseDirection int `ini:"WIND_BASE_DIRECTION" help:"base direction of the wind (wind is pointing at); 0 = North, 90 = East etc"` WindVariationDirection int `ini:"WIND_VARIATION_DIRECTION" help:"variation (+ or -) of the base direction"` ChampionshipPracticeWeather string `ini:"-"` CMGraphics string `ini:"__CM_GRAPHICS" help:"Graphics folder name"` CMWFXType int `ini:"__CM_WFX_TYPE" help:"Weather ini file number, inside weather.ini"` CMWFXUseCustomTime int `ini:"__CM_WFX_USE_CUSTOM_TIME" help:"If Sol is active then this should be too"` CMWFXTime int `ini:"__CM_WFX_TIME" help:"Seconds after 12 noon, usually leave at 0 and use unix timestamp instead"` CMWFXTimeMulti int `ini:"__CM_WFX_TIME_MULT" help:"Time speed multiplier, default to 1x"` CMWFXUseCustomDate int `ini:"__CM_WFX_USE_CUSTOM_DATE" help:"If Sol is active then this should be too"` CMWFXDate int `ini:"__CM_WFX_DATE" help:"Unix timestamp (UTC + 10)"` CMWFXDateUnModified int `ini:"__CM_WFX_DATE_UNMODIFIED" help:"Unix timestamp (UTC + 10), without multiplier correction"` }
func (WeatherConfig) TrimName ¶
func (w WeatherConfig) TrimName(name string) string
func (WeatherConfig) UnixToTime ¶
func (w WeatherConfig) UnixToTime(unix int) time.Time
type WeatherHandler ¶
type WeatherHandler struct {
*BaseHandler
}
func NewWeatherHandler ¶
func NewWeatherHandler(baseHandler *BaseHandler) *WeatherHandler
Notes ¶
Bugs ¶
splitting commands on spaces breaks child processes that have a space in their path name
Source Files ¶
- accounts.go
- acsr.go
- audit_log.go
- championship_manager.go
- championships.go
- championships_handler.go
- combine_results.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
- formulate.go
- healthcheck.go
- hosted.go
- init.go
- lua.go
- migrations.go
- monitoring.go
- notification_manager.go
- penalties.go
- plugin_kissmyrank.go
- plugin_kissmyrank_config.go
- plugin_realpenalty.go
- plugin_realpenalty_config.go
- plugin_stracker.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
- templates.go