Documentation
¶
Index ¶
- Variables
- func AddErrFlashQuick(w http.ResponseWriter, r *http.Request, message string)
- func AddFlashQuick(w http.ResponseWriter, r *http.Request, message string)
- func AdminAccess(r *http.Request) func() bool
- func AdminAccessMiddleware(next http.Handler) http.Handler
- func CarNameFromFilepath(path string) (string, error)
- func FileServer(r chi.Router, path string, root http.FileSystem)
- func FreeUDPPort() (int, error)
- func InitialiseScheduledChampionshipEvents() error
- func InitialiseScheduledCustomRaces() error
- func InstallAssettoCorsaServer(login, password string, force bool) error
- func LiveMapCallback(message udp.Message)
- func LiveMapHandler(w http.ResponseWriter, r *http.Request)
- func LiveTimingCallback(response udp.Message)
- func LoadTyresFromACDINI(data []byte) (map[string]string, error)
- func LoggedIn(r *http.Request) func() bool
- func LoginUser(r *http.Request, w http.ResponseWriter) error
- func LoopCallback(message udp.Message)
- func LoopRaces()
- func MustLoginMiddleware(requiredGroup Group, next http.Handler) http.Handler
- func ReadAccess(r *http.Request) func() bool
- func ReadAccessMiddleware(next http.Handler) http.Handler
- func Router(fs http.FileSystem) chi.Router
- func SetAssettoInstallPath(installPath string)
- func SetupRaceManager(store RaceStore)
- func WriteAccess(r *http.Request) func() bool
- func WriteAccessMiddleware(next http.Handler) http.Handler
- type Account
- type ActiveChampionship
- type AssetHelper
- type AssettoServerProcess
- type BoltRaceStore
- func (rs *BoltRaceStore) DeleteChampionship(id string) error
- func (rs *BoltRaceStore) DeleteCustomRace(race *CustomRace) error
- func (rs *BoltRaceStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
- func (rs *BoltRaceStore) ListChampionships() ([]*Championship, error)
- func (rs *BoltRaceStore) ListCustomRaces() ([]*CustomRace, error)
- func (rs *BoltRaceStore) ListEntrants() ([]*Entrant, error)
- func (rs *BoltRaceStore) LoadChampionship(id string) (*Championship, error)
- func (rs *BoltRaceStore) LoadServerOptions() (*GlobalServerConfig, error)
- func (rs *BoltRaceStore) UpsertChampionship(c *Championship) error
- func (rs *BoltRaceStore) UpsertCustomRace(race *CustomRace) error
- func (rs *BoltRaceStore) UpsertEntrant(entrant Entrant) error
- func (rs *BoltRaceStore) UpsertServerOptions(so *GlobalServerConfig) error
- type Car
- type Cars
- type Championship
- func (c *Championship) AddClass(class *ChampionshipClass)
- func (c *Championship) AllEntrants() EntryList
- func (c *Championship) EventByID(id string) (*ChampionshipEvent, error)
- func (c *Championship) FindClassForCarModel(model string) (*ChampionshipClass, error)
- func (c *Championship) GetPlayerSummary(guid string) string
- func (c *Championship) IsMultiClass() bool
- func (c *Championship) NumEntrants() int
- func (c *Championship) Progress() float64
- func (c *Championship) ValidCarIDs() []string
- type ChampionshipClass
- func (c *ChampionshipClass) CarInClass(car string) bool
- func (c *ChampionshipClass) PointForPos(i int) float64
- func (c *ChampionshipClass) ResultsForClass(results []*SessionResult) (filtered []*SessionResult)
- func (c *ChampionshipClass) Standings(events []*ChampionshipEvent) []*ChampionshipStanding
- func (c *ChampionshipClass) TeamStandings(events []*ChampionshipEvent) []*TeamStanding
- func (c *ChampionshipClass) ValidCarIDs() []string
- type ChampionshipEvent
- type ChampionshipManager
- func (cm *ChampionshipManager) BuildChampionshipEventOpts(r *http.Request) (map[string]interface{}, error)
- func (cm *ChampionshipManager) BuildChampionshipOpts(r *http.Request) (map[string]interface{}, error)
- func (cm *ChampionshipManager) CancelEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) ChampionshipEventCallback(message udp.Message)
- func (cm *ChampionshipManager) DeleteChampionship(id string) error
- func (cm *ChampionshipManager) DeleteEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) GetChampionshipAndEvent(championshipID string, eventID string) (*Championship, *ChampionshipEvent, error)
- func (cm *ChampionshipManager) HandleCreateChampionship(r *http.Request) (championship *Championship, edited bool, err error)
- func (cm *ChampionshipManager) ListChampionships() ([]*Championship, error)
- func (cm *ChampionshipManager) LoadChampionship(id string) (*Championship, 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) StartEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) StartPracticeEvent(championshipID string, eventID string) error
- func (cm *ChampionshipManager) UpsertChampionship(c *Championship) error
- type ChampionshipPoints
- type ChampionshipSession
- type ChampionshipStanding
- type Collision
- type Configuration
- type ContentFile
- type CurrentRaceConfig
- func (c *CurrentRaceConfig) AddSession(sessionType SessionType, config SessionConfig)
- func (c *CurrentRaceConfig) AddWeather(weather *WeatherConfig)
- func (c CurrentRaceConfig) HasMultipleRaces() bool
- func (c CurrentRaceConfig) HasSession(sess SessionType) bool
- func (c *CurrentRaceConfig) RemoveSession(sessionType SessionType)
- func (c *CurrentRaceConfig) RemoveWeather(weather *WeatherConfig)
- type CustomRace
- type DynamicTrackConfig
- type Entrant
- type EntryList
- type Form
- type FormElement
- type FormHeader
- type FormOption
- type GlobalServerConfig
- type Group
- type HTTPConfig
- type JSONRaceStore
- func (rs *JSONRaceStore) DeleteChampionship(id string) error
- func (rs *JSONRaceStore) DeleteCustomRace(race *CustomRace) error
- func (rs *JSONRaceStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
- func (rs *JSONRaceStore) ListChampionships() ([]*Championship, error)
- func (rs *JSONRaceStore) ListCustomRaces() ([]*CustomRace, error)
- func (rs *JSONRaceStore) ListEntrants() ([]*Entrant, error)
- func (rs *JSONRaceStore) LoadChampionship(id string) (*Championship, error)
- func (rs *JSONRaceStore) LoadServerOptions() (*GlobalServerConfig, error)
- func (rs *JSONRaceStore) UpsertChampionship(c *Championship) error
- func (rs *JSONRaceStore) UpsertCustomRace(race *CustomRace) error
- func (rs *JSONRaceStore) UpsertEntrant(entrant Entrant) error
- func (rs *JSONRaceStore) UpsertServerOptions(so *GlobalServerConfig) error
- type LiveCar
- type LiveCarWID
- type LiveMapConfig
- type LiveTiming
- 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) (map[string]interface{}, error)
- func (rm *RaceManager) CurrentRace() (*ServerConfig, EntryList)
- func (rm *RaceManager) DeleteCustomRace(uuid string) error
- func (rm *RaceManager) ListCustomRaces() (recent, starred, looped, scheduled []*CustomRace, err error)
- func (rm *RaceManager) LoadServerOptions() (*GlobalServerConfig, error)
- func (rm *RaceManager) SaveCustomRace(name string, config CurrentRaceConfig, entryList EntryList, starred bool) (*CustomRace, error)
- func (rm *RaceManager) SaveServerOptions(so *GlobalServerConfig) error
- func (rm *RaceManager) ScheduleRace(uuid string, date time.Time, action string) error
- func (rm *RaceManager) SetupCustomRace(r *http.Request) error
- func (rm *RaceManager) SetupQuickRace(r *http.Request) error
- func (rm *RaceManager) StartCustomRace(uuid string, forceRestart bool) error
- func (rm *RaceManager) ToggleLoopCustomRace(uuid string) error
- func (rm *RaceManager) ToggleStarCustomRace(uuid string) error
- func (rm *RaceManager) UDPCallback(message udp.Message)
- type RaceStore
- type Renderer
- type ServerConfig
- type ServerProcess
- type SessionCar
- type SessionConfig
- type SessionDriver
- type SessionEvent
- type SessionLap
- type SessionPos
- type SessionResult
- type SessionResults
- func (s *SessionResults) FastestLap() *SessionLap
- func (s *SessionResults) GetAverageLapTime(guid string) time.Duration
- func (s *SessionResults) GetCrashes(guid string) int
- func (s *SessionResults) GetCuts(driverGuid string) int
- func (s *SessionResults) GetDate() string
- func (s *SessionResults) GetDrivers() string
- func (s *SessionResults) GetLaps(driverGUID string) int
- func (s *SessionResults) GetLastLapTime(driverGuid string) time.Duration
- func (s *SessionResults) GetNumSectors() []int
- func (s *SessionResults) GetPosForLap(guid string, lapNum int64) int
- func (s *SessionResults) GetTeamName(driverGUID string) string
- func (s *SessionResults) GetTime(timeINT int, driverGUID string, total bool) time.Duration
- func (s *SessionResults) IsDriversFastestLap(guid string, time, cuts int) bool
- func (s *SessionResults) IsDriversFastestSector(guid string, sector, time, cuts int) bool
- func (s *SessionResults) IsFastestLap(time, cuts int) bool
- func (s *SessionResults) IsFastestSector(sector, time, cuts int) bool
- type SessionType
- type SteamConfig
- type StoreConfig
- type TeamStanding
- type TemplateLoader
- type Track
- type TrackInfo
- type TrackMapData
- type TrackSurfacePreset
- type Tyres
- type UsersConfig
- type Weather
- type WeatherConfig
Constants ¶
This section is empty.
Variables ¶
var ( ErrSessionNotFound = errors.New("servermanager: session not found") ErrResultFileNotFound = errors.New("servermanager: results files not found") )
var ( ErrNoSteamCMD = errors.New("servermanager: steamcmd was not found in $PATH") // ServerInstallPath is where the assetto corsa server should be/is installed ServerInstallPath = "assetto" ServerConfigPath = "cfg" )
var AvailableSessions = []SessionType{ SessionTypeRace, SessionTypeQualifying, SessionTypePractice, SessionTypeBooking, }
var BuildTime string
BuildTime 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 ChampionshipEventStartTimers map[string]*time.Timer
var ConfigIniDefault = ServerConfig{ GlobalServerConfig: GlobalServerConfig{ Name: "Assetto Corsa Server", Password: "", AdminPassword: "", UDPPort: 9600, TCPPort: 9600, HTTPPort: 8081, ClientSendIntervalInHertz: 18, SendBufferSize: 0, ReceiveBufferSize: 0, KickQuorum: 85, VotingQuorum: 80, VoteDuration: 20, BlacklistMode: 1, RegisterToLobby: 1, UDPPluginLocalPort: 0, UDPPluginAddress: "", AuthPluginAddress: "", NumberOfThreads: 2, ResultScreenTime: 90, }, CurrentRaceConfig: CurrentRaceConfig{ Cars: "lotus_evora_gtc", Track: "ks_silverstone", TrackLayout: "gp", SunAngle: 48, PickupModeEnabled: 1, LoopMode: 1, SleepTime: 1, RaceOverTime: 180, FuelRate: 100, DamageMultiplier: 0, TyreWearRate: 100, AllowedTyresOut: 3, ABSAllowed: 1, TractionControlAllowed: 1, StabilityControlAllowed: 0, AutoClutchAllowed: 0, TyreBlanketsAllowed: 1, ForceVirtualMirror: 0, LegalTyres: "H;M;S", LockedEntryList: 0, RacePitWindowStart: 0, RacePitWindowEnd: 0, ReversedGridRacePositions: 0, TimeOfDayMultiplier: 0, QualifyMaxWaitPercentage: 200, RaceGasPenaltyDisabled: 1, MaxBallastKilograms: 50, WindBaseSpeedMin: 3, WindBaseSpeedMax: 15, MaxClients: 18, WindBaseDirection: 30, WindVariationDirection: 15, StartRule: 2, RaceExtraLap: 0, Sessions: map[SessionType]SessionConfig{ SessionTypePractice: { Name: "Practice", Time: 10, IsOpen: 1, }, SessionTypeQualifying: { Name: "Qualify", Time: 10, IsOpen: 1, }, SessionTypeRace: { Name: "Race", IsOpen: 1, WaitTime: 60, Laps: 5, }, }, DynamicTrack: DynamicTrackConfig{ SessionStart: 100, Randomness: 0, SessionTransfer: 100, LapGain: 10, }, Weather: map[string]*WeatherConfig{ "WEATHER_0": { Graphics: "3_clear", BaseTemperatureAmbient: 26, BaseTemperatureRoad: 11, VariationAmbient: 1, VariationRoad: 1, }, }, }, }
ConfigIniDefault is the default server config (ish) as supplied via the assetto corsa server.
var CustomRaceStartTimers map[string]*time.Timer
var DefaultChampionshipPoints = ChampionshipPoints{ Places: []int{ 25, 18, 15, 12, 10, 8, 6, 4, 2, 1, }, BestLap: 0, PolePosition: 0, SecondRaceMultiplier: 1, }
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 ErrChampionshipNotFound = errors.New("servermanager: championship not found")
var ErrClassNotFound = errors.New("servermanager: championship class not found")
var (
ErrCustomRaceNotFound = errors.New("servermanager: custom race not found")
)
var ErrInvalidChampionshipEvent = errors.New("servermanager: invalid championship event")
var ErrInvalidUsernameOrPassword = errors.New("servermanager: invalid username or password")
var ErrMustSubmitCar = errors.New("servermanager: you must set a car")
var ErrResultsPageNotFound = errors.New("servermanager: results page not found")
var ErrServerAlreadyRunning = errors.New("servermanager: assetto corsa server is already running")
var OpenUser = Account{ Name: "Free Access", Group: GroupRead, PasswordMD5Hash: "", }
Functions ¶
func AddErrFlashQuick ¶
func AddErrFlashQuick(w http.ResponseWriter, r *http.Request, message string)
func AddFlashQuick ¶
func AddFlashQuick(w http.ResponseWriter, r *http.Request, message string)
Helper function to get message session and add a flash
func AdminAccess ¶
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 FileServer ¶
func FileServer(r chi.Router, path string, root http.FileSystem)
func FreeUDPPort ¶
func InitialiseScheduledChampionshipEvents ¶ added in v1.1.0
func InitialiseScheduledChampionshipEvents() error
func InitialiseScheduledCustomRaces ¶ added in v1.1.0
func InitialiseScheduledCustomRaces() error
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 LiveMapCallback ¶ added in v1.1.0
func LiveMapHandler ¶ added in v1.1.0
func LiveMapHandler(w http.ResponseWriter, r *http.Request)
func LiveTimingCallback ¶ added in v1.1.0
func LoadTyresFromACDINI ¶
LoadTyresFromACDINI reads the tyres.ini file from within the data.acd of a car and finds all available tyre compounds.
func LoopCallback ¶ added in v1.1.0
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 MustLoginMiddleware ¶
MustLoginMiddleware determines whether a user needs to log in to access a given Group page
func ReadAccess ¶
func SetAssettoInstallPath ¶
func SetAssettoInstallPath(installPath string)
func SetupRaceManager ¶
func SetupRaceManager(store RaceStore)
func WriteAccess ¶
Types ¶
type Account ¶
type Account struct {
Name string `yaml:"name"`
Group Group `yaml:"group"`
PasswordMD5Hash string `yaml:"password"`
}
func UserFromRequest ¶
func (Account) HasGroupPrivilege ¶
type ActiveChampionship ¶
type ActiveChampionship struct {
ChampionshipID, EventID uuid.UUID
SessionType SessionType
NumLapsCompleted int
NumRaceStartEvents int
// contains filtered or unexported fields
}
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 (*AssettoServerProcess) IsRunning ¶
func (as *AssettoServerProcess) IsRunning() bool
IsRunning of the server. returns true if running
func (*AssettoServerProcess) Logs ¶
func (as *AssettoServerProcess) Logs() string
Logs outputs the server logs
func (*AssettoServerProcess) Restart ¶
func (as *AssettoServerProcess) Restart() error
Restart the assetto server.
func (*AssettoServerProcess) Start ¶
func (as *AssettoServerProcess) Start() error
Start the assetto server. If it's already running, an ErrServerAlreadyRunning is returned.
func (*AssettoServerProcess) Stop ¶
func (as *AssettoServerProcess) Stop() error
Stop the assetto server.
type BoltRaceStore ¶
type BoltRaceStore struct {
// contains filtered or unexported fields
}
func (*BoltRaceStore) DeleteChampionship ¶
func (rs *BoltRaceStore) DeleteChampionship(id string) error
func (*BoltRaceStore) DeleteCustomRace ¶
func (rs *BoltRaceStore) DeleteCustomRace(race *CustomRace) error
func (*BoltRaceStore) FindCustomRaceByID ¶
func (rs *BoltRaceStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
func (*BoltRaceStore) ListChampionships ¶
func (rs *BoltRaceStore) ListChampionships() ([]*Championship, error)
func (*BoltRaceStore) ListCustomRaces ¶
func (rs *BoltRaceStore) ListCustomRaces() ([]*CustomRace, error)
func (*BoltRaceStore) ListEntrants ¶
func (rs *BoltRaceStore) ListEntrants() ([]*Entrant, error)
func (*BoltRaceStore) LoadChampionship ¶
func (rs *BoltRaceStore) LoadChampionship(id string) (*Championship, error)
func (*BoltRaceStore) LoadServerOptions ¶
func (rs *BoltRaceStore) LoadServerOptions() (*GlobalServerConfig, error)
func (*BoltRaceStore) UpsertChampionship ¶
func (rs *BoltRaceStore) UpsertChampionship(c *Championship) error
func (*BoltRaceStore) UpsertCustomRace ¶
func (rs *BoltRaceStore) UpsertCustomRace(race *CustomRace) error
func (*BoltRaceStore) UpsertEntrant ¶
func (rs *BoltRaceStore) UpsertEntrant(entrant Entrant) error
func (*BoltRaceStore) UpsertServerOptions ¶
func (rs *BoltRaceStore) UpsertServerOptions(so *GlobalServerConfig) error
type Car ¶
func (Car) PrettyName ¶
type Championship ¶
type Championship struct {
ID uuid.UUID
Name string
Created time.Time
Updated time.Time
Deleted time.Time
// 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
Classes []*ChampionshipClass
Events []*ChampionshipEvent
}
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) AllEntrants ¶
func (c *Championship) AllEntrants() EntryList
AllEntrants returns the list of all entrants in the championship (across ALL classes)
func (*Championship) EventByID ¶
func (c *Championship) EventByID(id string) (*ChampionshipEvent, error)
EventByID finds a ChampionshipEvent by its ID string.
func (*Championship) FindClassForCarModel ¶
func (c *Championship) FindClassForCarModel(model string) (*ChampionshipClass, error)
func (*Championship) GetPlayerSummary ¶ added in v1.1.0
func (c *Championship) GetPlayerSummary(guid string) string
func (*Championship) IsMultiClass ¶
func (c *Championship) IsMultiClass() bool
IsMultiClass is true if the Championship has more than one Class
func (*Championship) NumEntrants ¶
func (c *Championship) NumEntrants() int
NumEntrants is the number of entrants across all Classes in a Championship.
func (*Championship) Progress ¶
func (c *Championship) Progress() float64
Progress of the Championship as a percentage
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 {
Name string
Entrants EntryList
Points ChampionshipPoints
}
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) CarInClass ¶
func (c *ChampionshipClass) CarInClass(car string) bool
func (*ChampionshipClass) PointForPos ¶
func (c *ChampionshipClass) PointForPos(i int) float64
PointForPos uses the Championship's Points to determine what number should be awarded to a given position
func (*ChampionshipClass) ResultsForClass ¶
func (c *ChampionshipClass) ResultsForClass(results []*SessionResult) (filtered []*SessionResult)
func (*ChampionshipClass) Standings ¶
func (c *ChampionshipClass) Standings(events []*ChampionshipEvent) []*ChampionshipStanding
Standings returns the current Driver Standings for the Championship.
func (*ChampionshipClass) TeamStandings ¶
func (c *ChampionshipClass) TeamStandings(events []*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 ChampionshipEvent ¶
type ChampionshipEvent struct {
ID uuid.UUID
RaceSetup CurrentRaceConfig
Sessions map[SessionType]*ChampionshipSession
StartedTime time.Time
CompletedTime time.Time
Scheduled time.Time
}
A ChampionshipEvent is a given RaceSetup with Sessions.
func NewChampionshipEvent ¶
func NewChampionshipEvent() *ChampionshipEvent
NewChampionshipEvent creates a ChampionshipEvent with an ID
func (*ChampionshipEvent) Completed ¶
func (cr *ChampionshipEvent) Completed() bool
Completed ChampionshipEvents have a non-zero CompletedTime
func (*ChampionshipEvent) InProgress ¶
func (cr *ChampionshipEvent) InProgress() bool
InProgress indicates whether a ChampionshipEvent has been started but not stopped
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
type ChampionshipManager ¶
type ChampionshipManager struct {
*RaceManager
// contains filtered or unexported fields
}
func NewChampionshipManager ¶
func NewChampionshipManager(rm *RaceManager) *ChampionshipManager
func (*ChampionshipManager) BuildChampionshipEventOpts ¶
func (cm *ChampionshipManager) BuildChampionshipEventOpts(r *http.Request) (map[string]interface{}, error)
func (*ChampionshipManager) BuildChampionshipOpts ¶
func (cm *ChampionshipManager) BuildChampionshipOpts(r *http.Request) (map[string]interface{}, 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) DeleteChampionship ¶
func (cm *ChampionshipManager) DeleteChampionship(id string) error
func (*ChampionshipManager) DeleteEvent ¶
func (cm *ChampionshipManager) DeleteEvent(championshipID string, eventID string) error
func (*ChampionshipManager) GetChampionshipAndEvent ¶ added in v1.1.0
func (cm *ChampionshipManager) GetChampionshipAndEvent(championshipID string, eventID string) (*Championship, *ChampionshipEvent, error)
func (*ChampionshipManager) HandleCreateChampionship ¶
func (cm *ChampionshipManager) HandleCreateChampionship(r *http.Request) (championship *Championship, edited bool, err error)
func (*ChampionshipManager) ListChampionships ¶
func (cm *ChampionshipManager) ListChampionships() ([]*Championship, error)
func (*ChampionshipManager) LoadChampionship ¶
func (cm *ChampionshipManager) LoadChampionship(id string) (*Championship, error)
func (*ChampionshipManager) RestartEvent ¶
func (cm *ChampionshipManager) RestartEvent(championshipID string, eventID string) error
func (*ChampionshipManager) SaveChampionshipEvent ¶
func (cm *ChampionshipManager) SaveChampionshipEvent(r *http.Request) (championship *Championship, event *ChampionshipEvent, edited bool, err error)
func (*ChampionshipManager) ScheduleEvent ¶ added in v1.1.0
func (*ChampionshipManager) StartEvent ¶
func (cm *ChampionshipManager) StartEvent(championshipID string, eventID string) 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) UpsertChampionship ¶
func (cm *ChampionshipManager) UpsertChampionship(c *Championship) error
type ChampionshipPoints ¶
type ChampionshipPoints struct {
Places []int
BestLap int
PolePosition int
SecondRaceMultiplier float64
}
ChampionshipPoints represent the potential points for positions as well as other awards in a Championship.
type ChampionshipSession ¶
type ChampionshipSession struct {
StartedTime time.Time
CompletedTime time.Time
Results *SessionResults
}
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
type ChampionshipStanding ¶
ChampionshipStanding is the current number of Points an Entrant in the Championship has.
type Configuration ¶
type Configuration struct {
HTTP HTTPConfig `yaml:"http"`
Steam SteamConfig `yaml:"steam"`
Store StoreConfig `yaml:"store"`
Users UsersConfig `yaml:"users"`
LiveMap LiveMapConfig `yaml:"live_map"`
}
func ReadConfig ¶
func ReadConfig(location string) (conf *Configuration, err error)
type ContentFile ¶
type CurrentRaceConfig ¶
type CurrentRaceConfig struct {
Cars string `ini:"CARS" show:"quick" input:"multiSelect" formopts:"CarOpts" help:"Models of cars allowed in the server"`
Track string `ini:"TRACK" show:"quick" input:"dropdown" formopts:"TrackOpts" help:"Track name"`
TrackLayout string `` /* 128-byte string literal not displayed */
SunAngle int `ini:"SUN_ANGLE" help:"Angle of the position of the sun"`
LegalTyres string `ini:"LEGAL_TYRES" help:"List of tyres short names that are allowed"`
FuelRate int `ini:"FUEL_RATE" min:"0" help:"Fuel usage from 0 (no fuel usage) to XXX (100 is the realistic one)"`
DamageMultiplier int `ini:"DAMAGE_MULTIPLIER" min:"0" max:"100" help:"Damage from 0 (no damage) to 100 (full damage)"`
TyreWearRate int `ini:"TYRE_WEAR_RATE" min:"0" help:"Tyre wear from 0 (no tyre wear) to XXX (100 is the realistic one)"`
AllowedTyresOut int `ini:"ALLOWED_TYRES_OUT" help:"TODO: I have no idea"`
ABSAllowed int `` /* 133-byte string literal not displayed */
TractionControlAllowed int `` /* 129-byte string literal not displayed */
StabilityControlAllowed int `ini:"STABILITY_ALLOWED" input:"checkbox" help:"Stability assist 0 -> OFF; 1 -> ON"`
AutoClutchAllowed int `ini:"AUTOCLUTCH_ALLOWED" input:"checkbox" help:"Autoclutch assist 0 -> OFF; 1 -> ON"`
TyreBlanketsAllowed int `` /* 147-byte string literal not displayed */
ForceVirtualMirror int `` /* 126-byte string literal not displayed */
LockedEntryList int `ini:"LOCKED_ENTRY_LIST" input:"checkbox" help:"Only players already included in the entry list can join the server"`
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 `ini:"MAX_BALLAST_KG" help:"the max total of ballast that can be added through the admin command"`
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"`
PickupModeEnabled int `` /* 210-byte string literal not displayed */
LoopMode int `ini:"LOOP_MODE" input:"checkbox" help:"the server restarts from the first track, to disable this set it to 0"`
MaxClients int `ini:"MAX_CLIENTS" help:"max number of clients (must be <= track's number of pits)"`
SleepTime int `ini:"SLEEP_TIME" help:"TODO"`
RaceOverTime int `` /* 128-byte string literal not displayed */
StartRule int `` /* 173-byte string literal not displayed */
IsSol int `` /* 138-byte string literal not displayed */
WindBaseSpeedMin int `ini:"WIND_BASE_SPEED_MIN" help:"Min speed of the session possible"`
WindBaseSpeedMax int `ini:"WIND_BASE_SPEED_MAX" help:"Max speed of session possible (max 40)"`
WindBaseDirection int `ini:"WIND_BASE_DIRECTION" help:"base direction of the wind (wind is pointing at); 0 = North, 90 = East etc"`
WindVariationDirection int `ini:"WIND_VARIATION_DIRECTION" help:"variation (+ or -) of the base direction"`
DynamicTrack DynamicTrackConfig `ini:"-"`
Sessions map[SessionType]SessionConfig `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) HasMultipleRaces ¶ added in v1.1.0
func (c CurrentRaceConfig) HasMultipleRaces() bool
func (CurrentRaceConfig) HasSession ¶
func (c CurrentRaceConfig) HasSession(sess SessionType) bool
func (*CurrentRaceConfig) RemoveSession ¶
func (c *CurrentRaceConfig) RemoveSession(sessionType SessionType)
func (*CurrentRaceConfig) RemoveWeather ¶
func (c *CurrentRaceConfig) RemoveWeather(weather *WeatherConfig)
type CustomRace ¶
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 Form ¶
type Form struct {
// contains filtered or unexported fields
}
func (Form) Fields ¶
func (f Form) Fields() []FormElement
type FormElement ¶
type FormHeader ¶
type FormHeader struct {
Name string
}
func (FormHeader) HTML ¶
func (fh FormHeader) HTML() template.HTML
type FormOption ¶
type FormOption struct {
Name string
Key string
Type string
HelpText string
Value interface{}
Min, Max string
Opts map[string]bool
}
func (FormOption) HTML ¶
func (f FormOption) HTML() template.HTML
type GlobalServerConfig ¶
type GlobalServerConfig struct {
Name string `ini:"NAME" help:"Server Name"`
Password string `ini:"PASSWORD" input:"password" help:"Server password"`
AdminPassword string `` /* 225-byte string literal not displayed */
UDPPort int `ini:"UDP_PORT" min:"0" max:"65535" help:"UDP port number: open this port on your server's firewall"`
TCPPort int `ini:"TCP_PORT" min:"0" max:"65535" help:"TCP port number: open this port on your server's firewall"`
HTTPPort int `ini:"HTTP_PORT" min:"0" max:"65535" help:"Lobby port number: open these ports (both UDP and TCP) on your server's firewall"`
UDPPluginLocalPort int `ini:"UDP_PLUGIN_LOCAL_PORT" min:"0" max:"65535" help:"The port on which to listen for UDP messages from a plugin"`
UDPPluginAddress string `ini:"UDP_PLUGIN_ADDRESS" help:"The address of the plugin to which UDP messages are sent"`
AuthPluginAddress string `ini:"AUTH_PLUGIN_ADDRESS" help:"The address of the auth plugin"`
RegisterToLobby int `ini:"REGISTER_TO_LOBBY" input:"checkbox" help:"Register the AC Server to the main lobby"`
ClientSendIntervalInHertz int `` /* 216-byte string literal not displayed */
SendBufferSize int `ini:"SEND_BUFFER_SIZE" help:""`
ReceiveBufferSize int `ini:"RECV_BUFFER_SIZE" help:""`
KickQuorum int `ini:"KICK_QUORUM" help:"Percentage that is required for the kick vote to pass"`
VotingQuorum int `ini:"VOTING_QUORUM" min:"0" max:"100" help:"Percentage that is required for the session vote to pass"`
VoteDuration int `ini:"VOTE_DURATION" min:"0" help:"Vote length in seconds"`
BlacklistMode int `` /* 294-byte string literal not displayed */
NumberOfThreads int `ini:"NUM_THREADS" min:"1" help:"Number of threads to run on"`
WelcomeMessage string `ini:"WELCOME_MESSAGE" help:"Path to the file that contains the server welcome message"`
ResultScreenTime int `ini:"RESULT_SCREEN_TIME" help:"Seconds of result screen between racing sessions"`
FreeUDPPluginLocalPort int `ini:"-" show:"-"`
FreeUDPPluginAddress string `ini:"-" show:"-"`
}
type HTTPConfig ¶
type JSONRaceStore ¶
type JSONRaceStore struct {
// contains filtered or unexported fields
}
func (*JSONRaceStore) DeleteChampionship ¶
func (rs *JSONRaceStore) DeleteChampionship(id string) error
func (*JSONRaceStore) DeleteCustomRace ¶
func (rs *JSONRaceStore) DeleteCustomRace(race *CustomRace) error
func (*JSONRaceStore) FindCustomRaceByID ¶
func (rs *JSONRaceStore) FindCustomRaceByID(uuid string) (*CustomRace, error)
func (*JSONRaceStore) ListChampionships ¶
func (rs *JSONRaceStore) ListChampionships() ([]*Championship, error)
func (*JSONRaceStore) ListCustomRaces ¶
func (rs *JSONRaceStore) ListCustomRaces() ([]*CustomRace, error)
func (*JSONRaceStore) ListEntrants ¶
func (rs *JSONRaceStore) ListEntrants() ([]*Entrant, error)
func (*JSONRaceStore) LoadChampionship ¶
func (rs *JSONRaceStore) LoadChampionship(id string) (*Championship, error)
func (*JSONRaceStore) LoadServerOptions ¶
func (rs *JSONRaceStore) LoadServerOptions() (*GlobalServerConfig, error)
func (*JSONRaceStore) UpsertChampionship ¶
func (rs *JSONRaceStore) UpsertChampionship(c *Championship) error
func (*JSONRaceStore) UpsertCustomRace ¶
func (rs *JSONRaceStore) UpsertCustomRace(race *CustomRace) error
func (*JSONRaceStore) UpsertEntrant ¶
func (rs *JSONRaceStore) UpsertEntrant(entrant Entrant) error
func (*JSONRaceStore) UpsertServerOptions ¶
func (rs *JSONRaceStore) UpsertServerOptions(so *GlobalServerConfig) error
type LiveCar ¶
type LiveCar struct {
// Static Car Info
DriverName, DriverGUID string
CarMode, CarSkin string
// On disconnect
Delete bool
// Live Info
LapNum int
Loaded bool
LoadedTime int64
LastLap string
BestLap string
BestLapTime time.Duration
LastLapCompleteTime time.Time
LastLapCompleteTimeUnix int64
Pos int
Split string
Collisions []Collision
}
type LiveCarWID ¶
type LiveMapConfig ¶ added in v1.1.0
type LiveMapConfig struct {
IntervalMs int `yaml:"refresh_interval_ms"`
}
func (*LiveMapConfig) IsEnabled ¶ added in v1.1.0
func (l *LiveMapConfig) IsEnabled() bool
type LiveTiming ¶
type LiveTiming struct {
// Server Info, static
ServerName, Track, TrackConfig, Name string
Type uint8
Time, Laps, WaitTime uint16
WeatherGraphics string
ElapsedMilliseconds int32
SessionStarted int64
Cars map[uint8]*LiveCar // map[carID]LiveCar
// Live data
LapNum int
}
Live timing output format
type RaceManager ¶
type RaceManager struct {
// contains filtered or unexported fields
}
func NewRaceManager ¶
func NewRaceManager(raceStore RaceStore) *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) (map[string]interface{}, 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) ListCustomRaces ¶
func (rm *RaceManager) ListCustomRaces() (recent, starred, looped, scheduled []*CustomRace, err error)
func (*RaceManager) LoadServerOptions ¶
func (rm *RaceManager) LoadServerOptions() (*GlobalServerConfig, error)
func (*RaceManager) SaveCustomRace ¶
func (rm *RaceManager) SaveCustomRace(name string, config CurrentRaceConfig, entryList EntryList, starred bool) (*CustomRace, error)
func (*RaceManager) SaveServerOptions ¶
func (rm *RaceManager) SaveServerOptions(so *GlobalServerConfig) error
func (*RaceManager) ScheduleRace ¶ added in v1.1.0
func (*RaceManager) SetupCustomRace ¶
func (rm *RaceManager) SetupCustomRace(r *http.Request) error
func (*RaceManager) SetupQuickRace ¶
func (rm *RaceManager) SetupQuickRace(r *http.Request) error
func (*RaceManager) StartCustomRace ¶
func (rm *RaceManager) StartCustomRace(uuid string, forceRestart bool) error
func (*RaceManager) ToggleLoopCustomRace ¶
func (rm *RaceManager) ToggleLoopCustomRace(uuid string) error
func (*RaceManager) ToggleStarCustomRace ¶
func (rm *RaceManager) ToggleStarCustomRace(uuid string) error
func (*RaceManager) UDPCallback ¶
func (rm *RaceManager) UDPCallback(message udp.Message)
type RaceStore ¶
type RaceStore 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)
// 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
}
func NewBoltRaceStore ¶
func NewJSONRaceStore ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer is the template engine.
var (
ViewRenderer *Renderer
)
func NewRenderer ¶
func NewRenderer(loader TemplateLoader, reload bool) (*Renderer, error)
func (*Renderer) LoadTemplate ¶
func (tr *Renderer) LoadTemplate(w http.ResponseWriter, r *http.Request, view string, data map[string]interface{}) error
LoadTemplate reads a template from templates and renders it with data to the given io.Writer
func (*Renderer) MustLoadTemplate ¶
func (tr *Renderer) MustLoadTemplate(w http.ResponseWriter, r *http.Request, view string, data map[string]interface{})
MustLoadTemplate asserts that a LoadTemplate call must succeed or be dealt with via the http.ResponseWriter
type ServerConfig ¶
type ServerConfig struct {
GlobalServerConfig GlobalServerConfig `ini:"SERVER"`
CurrentRaceConfig CurrentRaceConfig `ini:"SERVER"`
}
func (ServerConfig) Write ¶
func (sc ServerConfig) Write() error
type ServerProcess ¶
type ServerProcess interface {
Logs() string
Start() error
Stop() error
Restart() error
IsRunning() bool
}
var AssettoProcess ServerProcess
type SessionCar ¶
type SessionConfig ¶
type SessionConfig struct {
Name string `ini:"NAME" show:"quick"`
Time int `ini:"TIME" show:"quick" help:"session length in minutes"`
Laps int `ini:"LAPS" show:"quick" help:"number of laps in the race"`
IsOpen int `ini:"IS_OPEN" input:"checkbox" help:"0 = no join, 1 = free join, 2 = free join until 20 seconds to the green light"`
WaitTime int `ini:"WAIT_TIME" help:"seconds before the start of the session"`
}
type SessionDriver ¶
type 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"`
}
func (*SessionLap) GetLapTime ¶
func (sl *SessionLap) GetLapTime() time.Duration
type SessionPos ¶
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"`
}
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 string `json:"Type"`
Date time.Time `json:"Date"`
SessionFile string `json:"SessionFile"`
ChampionshipID string `json:"ChampionshipID"`
}
func LoadResult ¶
func LoadResult(fileName string) (*SessionResults, error)
func (*SessionResults) FastestLap ¶
func (s *SessionResults) FastestLap() *SessionLap
func (*SessionResults) GetAverageLapTime ¶
func (s *SessionResults) GetAverageLapTime(guid string) time.Duration
func (*SessionResults) GetCrashes ¶
func (s *SessionResults) GetCrashes(guid string) int
func (*SessionResults) GetCuts ¶
func (s *SessionResults) GetCuts(driverGuid string) int
func (*SessionResults) GetDate ¶
func (s *SessionResults) GetDate() string
func (*SessionResults) GetDrivers ¶
func (s *SessionResults) GetDrivers() string
func (*SessionResults) GetLaps ¶
func (s *SessionResults) GetLaps(driverGUID string) int
func (*SessionResults) GetLastLapTime ¶
func (s *SessionResults) GetLastLapTime(driverGuid string) time.Duration
func (*SessionResults) GetNumSectors ¶
func (s *SessionResults) GetNumSectors() []int
func (*SessionResults) GetPosForLap ¶
func (s *SessionResults) GetPosForLap(guid string, lapNum int64) int
lapNum is the drivers current lap
func (*SessionResults) GetTeamName ¶
func (s *SessionResults) GetTeamName(driverGUID string) string
func (*SessionResults) IsDriversFastestLap ¶
func (s *SessionResults) IsDriversFastestLap(guid string, time, cuts int) bool
func (*SessionResults) IsDriversFastestSector ¶
func (s *SessionResults) IsDriversFastestSector(guid 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
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) String ¶
func (s SessionType) String() string
type SteamConfig ¶
type StoreConfig ¶
func (*StoreConfig) BuildStore ¶
func (s *StoreConfig) BuildStore() (RaceStore, error)
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 TrackInfo ¶
type TrackInfo struct {
Name string `json:"name"`
City string `json:"city"`
Country string `json:"country"`
Description string `json:"description"`
Length json.Number `json:"length"`
Pitboxes json.Number `json:"pitboxes"`
Run string `json:"run"`
Tags []string `json:"tags"`
Width json.Number `json:"width"`
}
func GetTrackInfo ¶
type TrackMapData ¶ added in v1.1.0
type TrackMapData struct {
Width float64 `ini:"WIDTH"`
Height float64 `ini:"HEIGHT"`
Margin float64 `ini:"MARGIN"`
ScaleFactor float64 `ini:"SCALE_FACTOR"`
OffsetX float64 `ini:"X_OFFSET"`
OffsetZ float64 `ini:"Z_OFFSET"`
DrawingSize float64 `ini:"DRAWING_SIZE"`
}
func LoadTrackMapData ¶ added in v1.1.0
func LoadTrackMapData(track, trackLayout string) (*TrackMapData, error)
func (*TrackMapData) Event ¶ added in v1.1.0
func (*TrackMapData) Event() udp.Event
type TrackSurfacePreset ¶
type Tyres ¶
type UsersConfig ¶
type Weather ¶
func ListWeather ¶
type WeatherConfig ¶
type WeatherConfig struct {
Graphics string `ini:"GRAPHICS" help:"exactly one of the folder names that you find in the 'content\\weather'' directory"`
BaseTemperatureAmbient int `ini:"BASE_TEMPERATURE_AMBIENT" help:"ambient temperature"` // 0-36
BaseTemperatureRoad int `` // 0-36
/* 215-byte string literal not displayed */
VariationAmbient int `` /* 130-byte string literal not displayed */
VariationRoad int `ini:"VARIATION_ROAD" help:"variation of the road's temperature. Like the ambient one"`
CMGraphics string `ini:"__CM_GRAPHICS" help:"Graphics folder name"`
CMWFXType int `ini:"__CM_WFX_TYPE" help:"Weather ini file number, inside weather.ini"`
CMWFXUseCustomTime int `ini:"__CM_WFX_USE_CUSTOM_TIME" help:"If Sol is active then this should be too"`
CMWFXTime int `ini:"__CM_WFX_TIME" help:"Seconds after 12 noon, usually leave at 0 and use unix timestamp instead"`
CMWFXTimeMulti int `ini:"__CM_WFX_TIME_MULT" help:"Time speed multiplier, default to 1x"`
CMWFXUseCustomDate int `ini:"__CM_WFX_USE_CUSTOM_DATE" help:"If Sol is active then this should be too"`
CMWFXDate int `ini:"__CM_WFX_DATE" help:"Unix timestamp (UTC + 10)"`
CMWFXDateUnModified int `ini:"__CM_WFX_DATE_UNMODIFIED" help:"Unix timestamp (UTC + 10), without multiplier correction"`
}
func (WeatherConfig) TrimName ¶
func (w WeatherConfig) TrimName(name string) string
func (WeatherConfig) UnixToTime ¶
func (w WeatherConfig) UnixToTime(unix int) time.Time
Source Files
¶
- accounts.go
- championship_manager.go
- championships.go
- config_ini.go
- config_ini_default.go
- content_cars.go
- content_cars_skins.go
- content_tracks.go
- content_tyres.go
- content_weather.go
- entrylist_ini.go
- form.go
- handlers.go
- live_map.go
- live_timings.go
- loop_races.go
- penalties.go
- race_custom.go
- race_manager.go
- race_quick.go
- race_store.go
- race_store_json.go
- results.go
- scheduled_races.go
- server_install.go
- server_process.go
- server_process_nonwindows.go
- servermanager_config.go
- templates.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
car-upload
command
|
|
|
form-generate
command
|
|
|
server-manager
command
|
|
|
udp-session-logger
command
|
|
|
pkg
|
|
|
acd
This code would not have been possible without the two following projects: * AcTools (and Content Manager) - https://github.com/gro-ove/actools - Licensed under the Microsoft Public License (Ms-PL) * Luigi Auriemma's QuickBMS, specifically the "Assetto Corsa ACD" script.
|
This code would not have been possible without the two following projects: * AcTools (and Content Manager) - https://github.com/gro-ove/actools - Licensed under the Microsoft Public License (Ms-PL) * Luigi Auriemma's QuickBMS, specifically the "Assetto Corsa ACD" script. |