Documentation ¶
Index ¶
- Constants
- Variables
- type AdminCommand
- type AssettoServerUDP
- type BroadcastChat
- type CallbackFunc
- type CarID
- type CarInfo
- type CarUpdate
- type Chat
- type ClientLoaded
- type CollisionWithCar
- type CollisionWithEnvironment
- type DriverGUID
- type EnableRealtimePosInterval
- type EndSession
- type Event
- type GetSessionInfo
- type KickUser
- type LapCompleted
- type LapCompletedCar
- type Message
- type NextSession
- type RestartSession
- type SendChat
- type ServerError
- type SessionCarInfo
- type SessionInfo
- type SessionType
- type Vec
- type Version
Constants ¶
View Source
const ( // Receive EventCollisionWithCar Event = 10 EventCollisionWithEnv Event = 11 EventNewSession Event = 50 EventNewConnection Event = 51 EventConnectionClosed Event = 52 EventCarUpdate Event = 53 EventCarInfo Event = 54 EventEndSession Event = 55 EventVersion Event = 56 EventChat Event = 57 EventClientLoaded Event = 58 EventSessionInfo Event = 59 EventError Event = 60 EventLapCompleted Event = 73 EventClientEvent Event = 130 // Send EventRealtimeposInterval Event = 200 EventGetCarInfo Event = 201 EventSendChat Event = 202 EventBroadcastChat Event = 203 EventGetSessionInfo Event = 204 EventSetSessionInfo Event = 205 EventKickUser Event = 206 EventNextSession Event = 207 EventRestartSession Event = 208 EventAdminCommand Event = 209 SessionTypeRace SessionType = 3 SessionTypeQualifying SessionType = 2 SessionTypePractice SessionType = 1 SessionTypeBooking SessionType = 0 )
Variables ¶
View Source
var CurrentRealtimePosIntervalMs = -1
View Source
var RealtimePosIntervalMs = -1
RealtimePosIntervalMs is the interval to request real time positional information. Set this to greater than 0 to enable.
Functions ¶
This section is empty.
Types ¶
type AdminCommand ¶ added in v1.5.0
func NewAdminCommand ¶ added in v1.5.0
func NewAdminCommand(data string) (*AdminCommand, error)
func (AdminCommand) Event ¶ added in v1.5.0
func (AdminCommand) Event() Event
type AssettoServerUDP ¶
type AssettoServerUDP struct {
// contains filtered or unexported fields
}
func NewServerClient ¶
func NewServerClient(addr string, receivePort, sendPort int, forward bool, forwardAddrStr string, forwardListenPort int, callback CallbackFunc) (*AssettoServerUDP, error)
func (*AssettoServerUDP) Close ¶
func (asu *AssettoServerUDP) Close() error
func (*AssettoServerUDP) SendMessage ¶ added in v1.1.0
func (asu *AssettoServerUDP) SendMessage(message Message) error
type BroadcastChat ¶ added in v1.5.0
func NewBroadcastChat ¶ added in v1.5.0
func NewBroadcastChat(data string) (*BroadcastChat, error)
func (BroadcastChat) Event ¶ added in v1.5.0
func (BroadcastChat) Event() Event
type CallbackFunc ¶
type CallbackFunc func(response Message)
type CarInfo ¶
type CarUpdate ¶
type ClientLoaded ¶
type ClientLoaded CarID
func (ClientLoaded) Event ¶
func (ClientLoaded) Event() Event
type CollisionWithCar ¶
type CollisionWithCar struct { CarID CarID `json:"CarID"` OtherCarID CarID `json:"OtherCarID"` ImpactSpeed float32 `json:"ImpactSpeed"` WorldPos Vec `json:"WorldPos"` RelPos Vec `json:"RelPos"` }
func (CollisionWithCar) Event ¶
func (CollisionWithCar) Event() Event
type CollisionWithEnvironment ¶
type CollisionWithEnvironment struct { CarID CarID `json:"CarID"` ImpactSpeed float32 `json:"ImpactSpeed"` WorldPos Vec `json:"WorldPos"` RelPos Vec `json:"RelPos"` }
func (CollisionWithEnvironment) Event ¶
func (CollisionWithEnvironment) Event() Event
type DriverGUID ¶ added in v1.3.3
type DriverGUID string
type EnableRealtimePosInterval ¶ added in v1.1.0
func NewEnableRealtimePosInterval ¶ added in v1.1.0
func NewEnableRealtimePosInterval(interval int) EnableRealtimePosInterval
func (EnableRealtimePosInterval) Event ¶ added in v1.1.0
func (EnableRealtimePosInterval) Event() Event
type GetSessionInfo ¶ added in v1.2.0
type GetSessionInfo struct { }
func (GetSessionInfo) Event ¶ added in v1.2.0
func (GetSessionInfo) Event() Event
type KickUser ¶ added in v1.5.0
func NewKickUser ¶ added in v1.5.0
type LapCompleted ¶
type LapCompleted struct { CarID CarID `json:"CarID"` LapTime uint32 `json:"LapTime"` Cuts uint8 `json:"Cuts"` CarsCount uint8 `json:"CarsCount"` Cars []*LapCompletedCar `json:"Cars"` }
func (LapCompleted) Event ¶
func (LapCompleted) Event() Event
type LapCompletedCar ¶
type NextSession ¶ added in v1.5.0
type NextSession struct { }
func (NextSession) Event ¶ added in v1.5.0
func (NextSession) Event() Event
type RestartSession ¶ added in v1.5.0
type RestartSession struct { }
func (RestartSession) Event ¶ added in v1.5.0
func (RestartSession) Event() Event
type ServerError ¶
type ServerError struct {
// contains filtered or unexported fields
}
func (ServerError) Event ¶
func (ServerError) Event() Event
type SessionCarInfo ¶
type SessionCarInfo struct { CarID CarID `json:"CarID"` DriverName string `json:"DriverName"` DriverGUID DriverGUID `json:"DriverGUID"` CarModel string `json:"CarModel"` CarSkin string `json:"CarSkin"` DriverInitials string `json:"DriverInitials"` EventType Event `json:"EventType"` }
func (SessionCarInfo) Event ¶
func (s SessionCarInfo) Event() Event
type SessionInfo ¶
type SessionInfo struct { Version uint8 `json:"Version"` SessionIndex uint8 `json:"SessionIndex"` CurrentSessionIndex uint8 `json:"CurrentSessionIndex"` SessionCount uint8 `json:"SessionCount"` ServerName string `json:"ServerName"` Track string `json:"Track"` TrackConfig string `json:"TrackConfig"` Name string `json:"Name"` Type SessionType `json:"Type"` Time uint16 `json:"Time"` Laps uint16 `json:"Laps"` WaitTime uint16 `json:"WaitTime"` AmbientTemp uint8 `json:"AmbientTemp"` RoadTemp uint8 `json:"RoadTemp"` WeatherGraphics string `json:"WeatherGraphics"` ElapsedMilliseconds int32 `json:"ElapsedMilliseconds"` EventType Event `json:"EventType"` }
func (SessionInfo) Event ¶
func (s SessionInfo) Event() Event
type SessionType ¶ added in v1.3.3
type SessionType uint8
func (SessionType) String ¶ added in v1.3.3
func (s SessionType) String() string
Click to show internal directories.
Click to hide internal directories.