server

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const AcceptHandoffRPC = "Sim.AcceptHandoff"
View Source
const AcceptRedirectedHandoffRPC = "Sim.AcceptRedirectedHandoff"
View Source
const AcknowledgePointOutRPC = "Sim.AcknowledgePointOut"
View Source
const ActivateFlightPlanRPC = "Sim.ActivateFlightPlan"
View Source
const AddLocalRPC = "SimManager.AddLocal"
View Source
const AnnotateFlightStripRPC = "Sim.AnnotateFlightStrip"
View Source
const AssociateFlightPlanRPC = "Sim.AssociateFlightPlan"
View Source
const BroadcastRPC = "SimManager.Broadcast"
View Source
const CancelHandoffRPC = "Sim.CancelHandoff"
View Source
const ConfigureATPARPC = "Sim.ConfigureATPA"
View Source
const ConfigureFDAMRPC = "Sim.ConfigureFDAM"
View Source
const ConnectRPC = "SimManager.Connect"
View Source
const ConnectToSimRPC = "SimManager.ConnectToSim"
View Source
const ConsolidateTCPRPC = "Sim.ConsolidateTCP"
View Source
const CreateArrivalRPC = "Sim.CreateArrival"
View Source
const CreateDepartureRPC = "Sim.CreateDeparture"
View Source
const CreateFlightPlanRPC = "Sim.CreateFlightPlan"
View Source
const CreateInterfacilityVFRRPC = "Sim.CreateInterfacilityVFR"
View Source
const CreateOverflightRPC = "Sim.CreateOverflight"
View Source
const CreateRestrictionAreaRPC = "Sim.CreateRestrictionArea"
View Source
const DeconsolidateTCPRPC = "Sim.DeconsolidateTCP"
View Source
const DeleteAircraftRPC = "Sim.DeleteAircraft"
View Source
const DeleteAllAircraftRPC = "Sim.DeleteAllAircraft"
View Source
const DeleteFlightPlanRPC = "Sim.DeleteFlightPlan"
View Source
const DeleteRestrictionAreaRPC = "Sim.DeleteRestrictionArea"
View Source
const FastForwardRPC = "Sim.FastForward"
View Source
const FlightPlanDirectRPC = "Sim.FlightPlanDirect"
View Source
const ForceQLRPC = "Sim.ForceQL"
View Source
const GetAircraftDisplayStateRPC = "Sim.GetAircraftDisplayState"
View Source
const GetRunningSimsRPC = "SimManager.GetRunningSims"
View Source
const GetSerializeSimRPC = "SimManager.GetSerializeSim"
View Source
const GetStateUpdateRPC = "Sim.GetStateUpdate"
View Source
const GetVideoMapLibraryRPC = "Sim.GetVideoMapLibrary"
View Source
const GlobalMessageRPC = "Sim.GlobalMessage"
View Source
const HandoffTrackRPC = "Sim.HandoffTrack"
View Source
const LaunchAircraftRPC = "Sim.LaunchAircraft"
View Source
const ModifyFlightPlanRPC = "Sim.ModifyFlightPlan"
View Source
const NewSimRPC = "SimManager.NewSim"
View Source
const PointOutRPC = "Sim.PointOut"
View Source
const PushFlightStripRPC = "Sim.PushFlightStrip"
View Source
const RecallPointOutRPC = "Sim.RecallPointOut"
View Source
const RedirectHandoffRPC = "Sim.RedirectHandoff"
View Source
const RejectPointOutRPC = "Sim.RejectPointOut"
View Source
const ReleaseDepartureRPC = "Sim.ReleaseDeparture"
View Source
const ReportSTTLogRPC = "SimManager.ReportSTTLog"
View Source
const ReportWhisperBenchmarkRPC = "SimManager.ReportWhisperBenchmark"
View Source
const RepositionTrackRPC = "Sim.RepositionTrack"
View Source
const RequestContactTransmissionRPC = "Sim.RequestContactTransmission"
View Source
const RequestFlightFollowingRPC = "Sim.RequestFlightFollowing"
View Source
const RunAircraftCommandsRPC = "Sim.RunAircraftCommands"
View Source
const SendRouteCoordinatesRPC = "Sim.SendRouteCoordinates"
View Source
const SetLaunchConfigRPC = "Sim.SetLaunchConfig"
View Source
const SetSimRateRPC = "Sim.SetSimRate"
View Source
const SetWaypointCommandsRPC = "Sim.SetWaypointCommands"
View Source
const SignOffRPC = "Sim.SignOff"
View Source
const TakeOrReturnLaunchControlRPC = "Sim.TakeOrReturnLaunchControl"
View Source
const TogglePauseRPC = "Sim.TogglePause"
View Source
const TriggerEmergencyRPC = "Sim.TriggerEmergency"
View Source
const UpdateATISGITextRPC = "Sim.UpdateATISGIText"
View Source
const UpdateRestrictionAreaRPC = "Sim.UpdateRestrictionArea"
View Source
const ViceHTTPServerPort = 6502
View Source
const ViceRPCVersion = ViceSerializeVersion
View Source
const ViceSerializeVersion = 69

Version history 0-7 not explicitly recorded 8: STARSPane DCB improvements, added DCB font size control 9: correct STARSColors, so update brightness settings to compensate 10: stop being clever about JSON encoding Waypoint arrays to strings 11: expedite, intercept localizer, fix airspace serialization 12: set 0 DCB brightness to 50 (WAR not setting a default for it) 13: update departure handling for multi-controllers (and rename some members) 14: Aircraft ArrivalHandoffController -> WaypointHandoffController 15: audio engine rewrite 16: cleared/assigned alt for departures, minor nav changes 17: weather intensity default bool 18: STARS ATPA 19: runway waypoints now per-airport 20: "stars_config" and various scenario fields moved there, plus STARSFacilityAdaptation 21: STARS DCB drawing changes, so system list positions changed 22: draw points using triangles, remove some CommandBuffer commands 23: video map format update 24: packages, audio to platform, flight plan processing 25: remove ArrivalGroup/Index from Aircraft 26: make allow_long_scratchpad a single bool 27: rework prefs, videomaps 28: new departure flow 29: TFR cache 30: video map improvements 31: audio squelch for pilot readback 32: VFRs, custom spcs, pilot reported altitude, ... 33: VFRs v2 34: sim/server refactor, signon flow 35: VFRRunways in sim.State, METAR Wind struct changes 36: STARS center representation changes 37: rework STARS flight plan (et al) 38: rework STARS flight plan (et al) ongoing 39: speech v0.1 40: clean up what's transmitted server->client at initial connect/spawn, gob->msgpack 41: sim.State.SimStartTime 42: server.NewSimRequest.StartTime 43: WX rework (scrape, etc.) 44: store pane instances and split positions separately, rather than the entire DisplayNode hierarchy 45: Change STARSFacilityAdaptation to FacilityAdaptation 46: Remove token from video map fetch RPC, misc wx updates 47: pass PrimaryAirport to GetAtmosGrid RPC 48: release bump 49: STARS consolidation 50: rework State/StateUpdate management 51: preemptive before v0.13.3 release 52: STT 53: local STT 54: Move ControllerFrequency from NASFlightPlan to Aircraft 55: STT logging 56: STT iteration 57: rework contact radio transmission management 58: STT fin rev? 59: server-side flightstrip management 60: restructure scenario JSON 61: restructure config JSON 62: new route/waypoint options 63: stars [A]TPA brightness controls 64: stars datablock intervals 65: TFR ingest pipeline 66: Waypoint SpeedRestriction 67: visual approach v2 68: sim.Future{Field,Traffic}Checks -> map 69: METAR JSON shape: WindDir round-trips via custom Marshal/UnmarshalJSON; ICAO populated by Decode

View Source
const ViceServerAddress = "vice.pharr.org"
View Source
const ViceServerPort = 8000 - 50 + ViceRPCVersion

Variables

View Source
var (
	ErrControllerAlreadySignedIn = errors.New("Controller with that callsign already signed in")
	ErrDuplicateSimName          = errors.New("A sim with that name already exists")
	ErrInvalidCommandSyntax      = errors.New("Invalid command syntax")
	ErrInvalidControllerToken    = errors.New("Invalid controller token")
	ErrInvalidPassword           = errors.New("Invalid password")
	ErrInvalidSimConfiguration   = errors.New("Invalid SimConfiguration")
	ErrNoNamedSim                = errors.New("No Sim with that name")
	ErrNoSimForControllerToken   = errors.New("No Sim running for controller token")
	ErrRPCTimeout                = errors.New("RPC call timed out")
	ErrRPCVersionMismatch        = errors.New("Client and server RPC versions don't match")
	ErrServerDisconnected        = errors.New("Server disconnected")
	ErrTCWAlreadyOccupied        = errors.New("TCW is already occupied")
)

Functions

func CheckArrivalSpawnAltitudes added in v0.14.2

func CheckArrivalSpawnAltitudes(scenarioGroups map[string]map[string]*scenarioGroup, e *util.ErrorLogger)

CheckArrivalSpawnAltitudes checks each arrival's spawn altitude against its first altitude restriction to flag cases where the aircraft spawns too high and too close to meet the restriction.

func CreateLaunchConfig

func CreateLaunchConfig(scenario *scenario, scenarioGroup *scenarioGroup) sim.LaunchConfig

CreateLaunchConfig creates a properly initialized LaunchConfig from scenario data

func CreateNewSimConfiguration

func CreateNewSimConfiguration(catalog *ScenarioCatalog, scenarioGroup *scenarioGroup, scenarioName string) (*sim.NewSimConfiguration, error)

CreateNewSimConfiguration creates a NewSimConfiguration from scenario components

func LaunchServer

func LaunchServer(config ServerLaunchConfig, lg *log.Logger)

func LaunchServerAsync

func LaunchServerAsync(config ServerLaunchConfig, lg *log.Logger) (int, util.ErrorLogger, string)

func ListAllScenarios

func ListAllScenarios(scenarioFilename, videoMapFilename string, lg *log.Logger) ([]string, error)

ListAllScenarios returns a sorted list of all available scenarios in TRACON/scenario format

func LoadScenarioGroups

func LoadScenarioGroups(extraScenarioFilename string, extraVideoMapFilename string, skipVideoMaps bool,
	e *util.ErrorLogger, lg *log.Logger) (map[string]map[string]*scenarioGroup, map[string]map[string]*ScenarioCatalog, map[string]*sim.VideoMapManifest, string)

LoadScenarioGroups loads all of the available scenarios, both from the scenarios/ directory in the source code distribution as well as, optionally, a scenario file provided on the command line. It doesn't try to do any sort of meaningful error handling but it does try to continue on in the presence of errors; all errors will be printed and the program will exit if there are any. We'd rather force any errors due to invalid scenario definitions to be fixed...

If skipVideoMaps is true, video map manifests are not loaded and video map validation is skipped. This is useful for CLI tools that don't need video maps.

Returns: scenarioGroups, catalogs, mapManifests, extraScenarioErrors If the extra scenario file has errors, they are returned in extraScenarioErrors and that scenario is not loaded, but execution continues.

func PostDeserializeFacilityAdaptation added in v0.13.0

func PostDeserializeFacilityAdaptation(s *sim.FacilityAdaptation, e *util.ErrorLogger, sg *scenarioGroup,
	manifest *sim.VideoMapManifest, mapManifests map[string]*sim.VideoMapManifest)

PostDeserializeFacilityAdaptation validates FacilityAdaptation fields that require the scenario group's Locator, manifest, or airport data. Self-contained validation is done earlier in FacilityAdaptation.ValidateConfig.

func TryDecodeError

func TryDecodeError(e error) error

func TryDecodeErrorString

func TryDecodeErrorString(s string) error

Types

type ACIDSpecifier

type ACIDSpecifier struct {
	ControllerToken string
	ACID            sim.ACID
}

type ATPAConfigArgs added in v0.13.3

type ATPAConfigArgs struct {
	ControllerToken string
	Op              sim.ATPAConfigOp
	VolumeId        string
}

type ATPAConfigResult added in v0.13.3

type ATPAConfigResult struct {
	SimStateUpdate
	Output string
}

type AcceptHandoffArgs

type AcceptHandoffArgs ACIDSpecifier

type ActivateFlightPlanArgs

type ActivateFlightPlanArgs struct {
	ControllerToken     string
	TrackCallsign       av.ADSBCallsign
	FpACID              sim.ACID
	FlightPlanSpecifier sim.FlightPlanSpecifier
}

type AddLocalRequest added in v0.14.1

type AddLocalRequest struct {
	Sim      *sim.Sim
	Initials string
}

type AircraftCommandsArgs

type AircraftCommandsArgs struct {
	ControllerToken   string
	Callsign          av.ADSBCallsign
	Commands          string
	Multiple          bool
	ClickedTrack      bool
	EnableTTS         bool          // Whether to synthesize readback audio
	WhisperDuration   time.Duration // Time from PTT release to whisper completion (zero for keyboard input)
	AudioDuration     time.Duration // Duration of the recorded audio (zero for keyboard input)
	WhisperTranscript string        // Raw whisper transcript (empty for keyboard input)
	WhisperProcessor  string        // Description of the processor running whisper (GPU model or CPU info)
	WhisperModel      string
	AircraftContext   map[string]stt.Aircraft // Aircraft context used for STT decoding (for logging)
	STTDebugLogs      []string                // Local STT processing logs (for logging)
}

type AircraftCommandsResult

type AircraftCommandsResult struct {
	ErrorMessage      string
	RemainingInput    string
	ReadbackText      string          // Text for client to synthesize
	ReadbackVoiceName string          // Voice name for synthesis (e.g., "am_adam")
	ReadbackCallsign  av.ADSBCallsign // Callsign for the readback
}

If an RPC call returns an error, then the result argument is not returned(!?). So we don't use the error type for syntax errors...

type AircraftSpecifier

type AircraftSpecifier struct {
	ControllerToken string
	Callsign        av.ADSBCallsign
}

type AnnotateFlightStripArgs added in v0.14.1

type AnnotateFlightStripArgs struct {
	ControllerToken string
	ACID            sim.ACID
	Annotations     [9]string
}

type AssociateFlightPlanArgs

type AssociateFlightPlanArgs struct {
	ControllerToken     string
	Callsign            av.ADSBCallsign
	FlightPlanSpecifier sim.FlightPlanSpecifier
}

type BroadcastMessage added in v0.13.3

type BroadcastMessage struct {
	Password string
	Message  string
}

type CancelHandoffArgs

type CancelHandoffArgs ACIDSpecifier

type ConnectResult

type ConnectResult struct {
	ScenarioCatalogs      map[string]map[string]*ScenarioCatalog
	RunningSims           map[string]*RunningSim
	AvailableWXByFacility map[string][]util.TimeInterval
}

type ConsolidateTCPArgs added in v0.13.3

type ConsolidateTCPArgs struct {
	ControllerToken string
	ReceivingTCW    sim.TCW
	SendingTCP      sim.TCP
	Type            sim.ConsolidationType
}

type CreateArrivalArgs

type CreateArrivalArgs struct {
	ControllerToken string
	Group           string
	Airport         string
}

type CreateDepartureArgs

type CreateDepartureArgs struct {
	ControllerToken string
	Airport         string
	Runway          string
	Category        string
	Rules           av.FlightRules
}

type CreateFlightPlanArgs

type CreateFlightPlanArgs struct {
	ControllerToken     string
	FlightPlanSpecifier sim.FlightPlanSpecifier
}

type CreateInterfacilityVFRArgs added in v0.14.3

type CreateInterfacilityVFRArgs struct {
	ControllerToken string
	ACID            sim.ACID
	IsIntermediate  bool
	RequestedAlt    int
}

type CreateOverflightArgs

type CreateOverflightArgs struct {
	ControllerToken string
	Group           string
}

type CreateRestrictionAreaResultArgs

type CreateRestrictionAreaResultArgs struct {
	Index       int
	StateUpdate SimStateUpdate
}

type DeconsolidateTCPArgs added in v0.13.3

type DeconsolidateTCPArgs struct {
	ControllerToken string
	TCP             sim.TCP // TCP to deconsolidate (optional - if empty, deconsolidate user's own TCP)
}

type DeleteAircraftArgs

type DeleteAircraftArgs AircraftSpecifier

type DeleteAircraftListArgs

type DeleteAircraftListArgs struct {
	ControllerToken string
	Aircraft        []sim.Aircraft
}

type DeleteFlightPlanArgs

type DeleteFlightPlanArgs ACIDSpecifier

type FDAMConfigArgs added in v0.14.1

type FDAMConfigArgs struct {
	ControllerToken string
	Op              sim.FDAMConfigOp
	RegionId        string
}

type FDAMConfigResult added in v0.14.1

type FDAMConfigResult struct {
	SimStateUpdate
	Output string
}

type FlightPlanDirectArgs added in v0.13.0

type FlightPlanDirectArgs struct {
	ControllerToken string
	ACID            sim.ACID
	Fix             string
}

type ForceQLArgs

type ForceQLArgs struct {
	ControllerToken string
	ACID            sim.ACID
	ToPosition      sim.ControlPosition
}

type GlobalMessageArgs

type GlobalMessageArgs struct {
	ControllerToken string
	Message         string
}

type HandoffArgs

type HandoffArgs struct {
	ControllerToken string
	ACID            sim.ACID
	ToPosition      sim.ControlPosition
}

type HeldDepartureArgs

type HeldDepartureArgs AircraftSpecifier

type JoinSimRequest added in v0.13.3

type JoinSimRequest struct {
	SimName         string
	TCW             sim.TCW   // Which TCW to sign into
	SelectedTCPs    []sim.TCP // TCPs to consolidate (non-relief only)
	Initials        string    // Controller initials (e.g., "MP")
	Password        string
	Privileged      bool
	JoiningAsRelief bool
}

type LaunchAircraftArgs

type LaunchAircraftArgs struct {
	ControllerToken string
	Aircraft        sim.Aircraft
	DepartureRunway string
}

type ModifyFlightPlanArgs

type ModifyFlightPlanArgs struct {
	ControllerToken     string
	FlightPlanSpecifier sim.FlightPlanSpecifier
	ACID                sim.ACID
}

type NewSimRequest added in v0.13.3

type NewSimRequest struct {
	Facility     string
	NewSimName   string
	GroupName    string
	ScenarioName string

	ScenarioSpec *ScenarioSpec
	StartTime    time.Time

	Emergencies []sim.Emergency

	RequirePassword bool
	Password        string

	EnforceUniqueCallsignSuffix bool

	PilotErrorInterval float32

	Initials   string // Controller initials (e.g., "XX")
	Privileged bool
}

func MakeNewSimRequest added in v0.13.3

func MakeNewSimRequest() NewSimRequest

type NewSimResult

type NewSimResult struct {
	SimState        *SimState
	ControllerToken string
}

type PointOutArgs

type PointOutArgs struct {
	ControllerToken string
	ACID            sim.ACID
	ToPosition      sim.ControlPosition
}

type PushFlightStripArgs added in v0.14.1

type PushFlightStripArgs struct {
	ControllerToken string
	ACID            sim.ACID
	ToTCP           sim.TCP
}

type RepositionTrackArgs

type RepositionTrackArgs struct {
	ControllerToken string
	ACID            sim.ACID        // from
	Callsign        av.ADSBCallsign // to
	Position        math.Point2LL   // to
}

type RequestContactArgs added in v0.14.0

type RequestContactArgs struct {
	ControllerToken string
}

type RequestContactResult added in v0.14.0

type RequestContactResult struct {
	ContactText      string          // Text to synthesize
	ContactVoiceName string          // Voice name for synthesis (e.g., "am_adam")
	ContactCallsign  av.ADSBCallsign // Callsign of the aircraft
	ContactType      av.RadioTransmissionType
}

type RestrictionAreaArgs

type RestrictionAreaArgs struct {
	ControllerToken string
	Index           int
	RestrictionArea av.RestrictionArea
}

type RunningSim added in v0.13.3

type RunningSim struct {
	GroupName                    string
	ScenarioName                 string
	RequirePassword              bool
	ScenarioDefaultConsolidation map[sim.TCP][]sim.TCP
	CurrentConsolidation         map[sim.TCW]TCPConsolidation
}

type STTLogArgs added in v0.14.0

type STTLogArgs struct {
	Callsign          string
	Commands          string
	WhisperDuration   time.Duration
	AudioDuration     time.Duration
	WhisperTranscript string
	WhisperProcessor  string
	WhisperModel      string
	AircraftContext   map[string]stt.Aircraft
	STTDebugLogs      []string
}

STTLogArgs contains STT command data for logging (sent by local sim clients).

type ScenarioCatalog added in v0.13.3

type ScenarioCatalog struct {
	Scenarios        map[string]*ScenarioSpec
	ControlPositions map[sim.TCP]*av.Controller
	DefaultScenario  string
	Facility         string
	ARTCC            string
	Area             string
	Airports         []string // ICAO codes of airports in this scenario group
}

Client-side info about the available scenarios.

func LookupScenario

func LookupScenario(tracon, scenarioName string, scenarioGroups map[string]map[string]*scenarioGroup, catalogs map[string]map[string]*ScenarioCatalog) (*ScenarioCatalog, *scenarioGroup, error)

LookupScenario finds a scenario configuration by TRACON/scenario name

type ScenarioSpec added in v0.13.3

type ScenarioSpec struct {
	ControllerConfiguration *sim.ControllerConfiguration
	PrimaryAirport          string
	MagneticVariation       float32
	WindSpecifier           *wx.WindSpecifier

	LaunchConfig sim.LaunchConfig

	DepartureRunways []sim.DepartureRunway
	ArrivalRunways   []sim.ArrivalRunway
}

func (*ScenarioSpec) AllAirports added in v0.13.3

func (s *ScenarioSpec) AllAirports() []string

type SendRouteCoordinatesArgs added in v0.13.0

type SendRouteCoordinatesArgs struct {
	ControllerToken string
	ACID            sim.ACID
	Minutes         int
}

type ServerLaunchConfig

type ServerLaunchConfig struct {
	Port          int // if 0, finds an open one
	ExtraScenario string
	ExtraVideoMap string
	ServerAddress string // address to use for remote TTS provider
	IsLocal       bool
}

type SetLaunchConfigArgs

type SetLaunchConfigArgs struct {
	ControllerToken string
	Config          sim.LaunchConfig
}

type SetSimRateArgs

type SetSimRateArgs struct {
	ControllerToken string
	Rate            float32
}

type SetWaypointCommandsArgs added in v0.13.0

type SetWaypointCommandsArgs struct {
	ControllerToken string
	Commands        string
}

type SimManager

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

func NewSimManager

func NewSimManager(scenarioGroups map[string]map[string]*scenarioGroup, scenarioCatalogs map[string]map[string]*ScenarioCatalog,
	mapManifests map[string]*sim.VideoMapManifest, serverAddress string, isLocal bool, lg *log.Logger) *SimManager

func (*SimManager) Add

func (sm *SimManager) Add(session *simSession, result *NewSimResult, initialTCP sim.ControlPosition, initials string, instructor bool,
	prespawn bool) error

func (*SimManager) AddLocal

func (sm *SimManager) AddLocal(req *AddLocalRequest, result *NewSimResult) error

func (*SimManager) Broadcast

func (sm *SimManager) Broadcast(m *BroadcastMessage, _ *struct{}) error

func (*SimManager) Connect

func (sm *SimManager) Connect(version int, result *ConnectResult) error

func (*SimManager) ConnectToSim

func (sm *SimManager) ConnectToSim(req *JoinSimRequest, result *NewSimResult) error

func (*SimManager) GetAtmosGrid added in v0.13.0

func (sm *SimManager) GetAtmosGrid(args wx.GetAtmosArgs, result *wx.GetAtmosResult) error

func (*SimManager) GetPrecipURL added in v0.13.0

func (sm *SimManager) GetPrecipURL(args wx.PrecipURLArgs, result *wx.PrecipURL) error

func (*SimManager) GetRunningSims

func (sm *SimManager) GetRunningSims(_ int, result *map[string]*RunningSim) error

func (*SimManager) GetSerializeSim

func (sm *SimManager) GetSerializeSim(token string, s *sim.Sim) error

func (*SimManager) GetSimStatus

func (sm *SimManager) GetSimStatus() []simStatus

func (*SimManager) GetStateUpdate

func (sm *SimManager) GetStateUpdate(token string) (*SimStateUpdate, error)

func (*SimManager) LookupController

func (sm *SimManager) LookupController(token string) *controllerContext

func (*SimManager) NewSim

func (sm *SimManager) NewSim(req *NewSimRequest, result *NewSimResult) error

func (*SimManager) ReportCrash added in v0.14.0

func (sm *SimManager) ReportCrash(report *log.CrashReport, _ *struct{}) error

ReportCrash receives crash reports from clients and logs them. This RPC does not require a controller token.

func (*SimManager) ReportSTTLog added in v0.14.0

func (sm *SimManager) ReportSTTLog(args *STTLogArgs, _ *struct{}) error

ReportSTTLog receives STT command data from local sim clients and logs it.

func (*SimManager) ReportWhisperBenchmark added in v0.14.0

func (sm *SimManager) ReportWhisperBenchmark(report *WhisperBenchmarkReport, _ *struct{}) error

ReportWhisperBenchmark receives whisper benchmark results from clients and logs them.

func (*SimManager) SignOff

func (sm *SimManager) SignOff(token string) error

type SimState added in v0.13.3

type SimState struct {
	sim.UserState

	// User-related items not managed by the Sim.
	UserTCW                             sim.TCW
	ActiveTCWs                          []sim.TCW
	ControllerVideoMaps                 []string
	ControllerDefaultVideoMaps          []string
	ControllerMonitoredBeaconCodeBlocks []av.Squawk
	ControllerVideoMapFile              string
	ControllerVideoMapLibraryHash       []byte

	UserIsPrivileged bool // Whether this user has elevated privileges (can control any aircraft)

	FlightStripACIDs []sim.ACID
}

SimState wraps sim.UserState and adds server-specific fields.

func (*SimState) TCWIsPrivileged added in v0.14.0

func (ss *SimState) TCWIsPrivileged(tcw sim.TCW) bool

TCWIsPrivileged returns whether the given TCW has elevated privileges. Note: only the current user's TCW should be passed; this is for API compatibility.

type SimStateUpdate added in v0.13.3

type SimStateUpdate struct {
	sim.StateUpdate

	ActiveTCWs []sim.TCW
	Events     []sim.Event
}

SimStateUpdate wraps sim.StateUpdate and adds server-specific fields.

func (*SimStateUpdate) Apply added in v0.13.3

func (su *SimStateUpdate) Apply(state *SimState, eventStream *sim.EventStream)

Apply applies the update to the state, including server-specific fields. If eventStream is provided, events from the update are posted to it.

type TCPConsolidation added in v0.13.3

type TCPConsolidation struct {
	sim.TCPConsolidation
	Initials []string // Server-layer addition: initials of signed-in controllers
}

func (TCPConsolidation) IsOccupied added in v0.13.3

func (s TCPConsolidation) IsOccupied() bool

type TriggerEmergencyArgs added in v0.13.2

type TriggerEmergencyArgs struct {
	ControllerToken string
	EmergencyName   string
}

type UpdateATISGITextArgs added in v0.14.3

type UpdateATISGITextArgs struct {
	ControllerToken string
	Line            int
	Auxiliary       bool
	ATIS            *string
	GIText          *string
}

type VideoMapsArgs

type VideoMapsArgs struct {
	Filename string
}

type WhisperBenchmarkReport added in v0.14.0

type WhisperBenchmarkReport struct {
	DeviceName    string // GPU/device description from whisper.ProcessorDescription()
	SelectedModel string
	Results       []WhisperBenchmarkResult
}

WhisperBenchmarkReport contains the full benchmark results from a client.

type WhisperBenchmarkResult added in v0.14.0

type WhisperBenchmarkResult struct {
	ModelName string
	LatencyMs int64
	Status    string // "selected", "acceptable", "too_slow", "failed", "skipped"
}

WhisperBenchmarkResult contains benchmark results for a single model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL