Documentation
¶
Index ¶
- Constants
- Variables
- func LaunchServer(config ServerLaunchConfig, lg *log.Logger)
- func LaunchServerAsync(config ServerLaunchConfig, lg *log.Logger) (int, util.ErrorLogger)
- func LoadScenarioGroups(multiControllerOnly bool, extraScenarioFilename string, ...) (map[string]map[string]*scenarioGroup, map[string]map[string]*Configuration, ...)
- func PostDeserializeSTARSFacilityAdaptation(s *sim.STARSFacilityAdaptation, e *util.ErrorLogger, sg *scenarioGroup, ...)
- func TryDecodeError(e error) error
- func TryDecodeErrorString(s string) error
- type ACIDSpecifier
- type AcceptHandoffArgs
- type ActivateFlightPlanArgs
- type AircraftCommandsArgs
- type AircraftCommandsResult
- type AircraftSpecifier
- type AssociateFlightPlanArgs
- type CancelHandoffArgs
- type ChangeControlPositionArgs
- type Configuration
- type ConnectResult
- type CreateArrivalArgs
- type CreateDepartureArgs
- type CreateFlightPlanArgs
- type CreateOverflightArgs
- type CreateRestrictionAreaResultArgs
- type DeleteAircraftArgs
- type DeleteAircraftListArgs
- type DeleteFlightPlanArgs
- type ForceQLArgs
- type GlobalMessageArgs
- type HandoffArgs
- type HeldDepartureArgs
- type LaunchAircraftArgs
- type ModifyFlightPlanArgs
- type NewSimConfiguration
- type NewSimResult
- type PointOutArgs
- type RemoteSim
- type RepositionTrackArgs
- type RestrictionAreaArgs
- type ServerLaunchConfig
- type SetLaunchConfigArgs
- type SetSimRateArgs
- type SimBroadcastMessage
- type SimConnectionConfiguration
- type SimManager
- func (sm *SimManager) Add(as *activeSim, result *NewSimResult, initialTCP string, instructor bool, ...) error
- func (sm *SimManager) AddLocal(sim *sim.Sim, result *NewSimResult) error
- func (sm *SimManager) Broadcast(m *SimBroadcastMessage, _ *struct{}) error
- func (sm *SimManager) Connect(version int, result *ConnectResult) error
- func (sm *SimManager) ConnectToSim(config *SimConnectionConfiguration, result *NewSimResult) error
- func (sm *SimManager) GetRunningSims(_ int, result *map[string]*RemoteSim) error
- func (sm *SimManager) GetSerializeSim(token string, s *sim.Sim) error
- func (sm *SimManager) GetStateUpdate(token string, update *sim.StateUpdate) error
- func (sm *SimManager) LookupController(token string) (*humanController, *sim.Sim, bool)
- func (sm *SimManager) NewSim(config *NewSimConfiguration, result *NewSimResult) error
- func (sm *SimManager) SignOff(token string) error
- func (sm *SimManager) SimShouldExit(sim *sim.Sim) bool
- type SimScenarioConfiguration
- type VideoMapsArgs
Constants ¶
const ViceHTTPServerPort = 6502
const ViceRPCVersion = ViceSerializeVersion
const ViceSerializeVersion = 40
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
const ViceServerAddress = "vice.pharr.org"
const ViceServerPort = 8000 + ViceRPCVersion
Variables ¶
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") ErrInvalidSSimConfiguration = 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") )
Functions ¶
func LaunchServer ¶ added in v0.12.1
func LaunchServer(config ServerLaunchConfig, lg *log.Logger)
func LaunchServerAsync ¶ added in v0.12.1
func LaunchServerAsync(config ServerLaunchConfig, lg *log.Logger) (int, util.ErrorLogger)
func LoadScenarioGroups ¶
func LoadScenarioGroups(multiControllerOnly bool, extraScenarioFilename string, extraVideoMapFilename string, e *util.ErrorLogger, lg *log.Logger) (map[string]map[string]*scenarioGroup, map[string]map[string]*Configuration, map[string]*sim.VideoMapManifest)
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...
func PostDeserializeSTARSFacilityAdaptation ¶
func PostDeserializeSTARSFacilityAdaptation(s *sim.STARSFacilityAdaptation, e *util.ErrorLogger, sg *scenarioGroup, manifest *sim.VideoMapManifest)
func TryDecodeError ¶
func TryDecodeErrorString ¶
Types ¶
type ACIDSpecifier ¶ added in v0.12.0
type AcceptHandoffArgs ¶
type AcceptHandoffArgs ACIDSpecifier
type ActivateFlightPlanArgs ¶ added in v0.12.0
type ActivateFlightPlanArgs struct {
ControllerToken string
TrackCallsign av.ADSBCallsign
FpACID sim.ACID
FlightPlanSpecifier *sim.STARSFlightPlanSpecifier
}
type AircraftCommandsArgs ¶
type AircraftCommandsArgs struct {
ControllerToken string
Callsign av.ADSBCallsign
Commands string
}
type AircraftCommandsResult ¶
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 AssociateFlightPlanArgs ¶ added in v0.12.0
type AssociateFlightPlanArgs struct {
ControllerToken string
Callsign av.ADSBCallsign
FlightPlanSpecifier sim.STARSFlightPlanSpecifier
}
type CancelHandoffArgs ¶
type CancelHandoffArgs ACIDSpecifier
type Configuration ¶
type Configuration struct {
ScenarioConfigs map[string]*SimScenarioConfiguration
ControlPositions map[string]*av.Controller
DefaultScenario string
}
type ConnectResult ¶
type CreateArrivalArgs ¶
type CreateDepartureArgs ¶
type CreateFlightPlanArgs ¶ added in v0.12.0
type CreateFlightPlanArgs struct {
ControllerToken string
FlightPlanSpecifier sim.STARSFlightPlanSpecifier
}
type CreateOverflightArgs ¶
type CreateRestrictionAreaResultArgs ¶ added in v0.12.0
type CreateRestrictionAreaResultArgs struct {
Index int
StateUpdate sim.StateUpdate
}
type DeleteAircraftArgs ¶
type DeleteAircraftArgs AircraftSpecifier
type DeleteAircraftListArgs ¶ added in v0.12.0
type DeleteFlightPlanArgs ¶ added in v0.12.0
type DeleteFlightPlanArgs ACIDSpecifier
type ForceQLArgs ¶
type GlobalMessageArgs ¶
type HeldDepartureArgs ¶
type HeldDepartureArgs AircraftSpecifier
type LaunchAircraftArgs ¶
type ModifyFlightPlanArgs ¶ added in v0.12.0
type ModifyFlightPlanArgs struct {
ControllerToken string
FlightPlanSpecifier sim.STARSFlightPlanSpecifier
ACID sim.ACID
}
type NewSimConfiguration ¶
type NewSimConfiguration struct {
NewSimName string
GroupName string
ScenarioName string
Scenario *SimScenarioConfiguration
TFRs []av.TFR
TRACONName string
RequirePassword bool
Password string
LiveWeather bool
EnforceUniqueCallsignSuffix bool
AllowInstructorRPO bool
Instructor bool
IsLocal bool
DisableTextToSpeech bool
}
func MakeNewSimConfiguration ¶
func MakeNewSimConfiguration() NewSimConfiguration
type NewSimResult ¶
func (*NewSimResult) PruneForClient ¶ added in v0.12.1
func (r *NewSimResult) PruneForClient()
PruneForClient tidies the NewSimResult, removing fields that are not used by client code in order to reduce the amount of bandwidth used to send the NewSimResult to the client.
type PointOutArgs ¶
type RemoteSim ¶
type RemoteSim struct {
GroupName string
ScenarioName string
PrimaryController string
RequirePassword bool
AvailablePositions map[string]av.Controller
CoveredPositions map[string]av.Controller
}
type RepositionTrackArgs ¶ added in v0.12.0
type RestrictionAreaArgs ¶
type RestrictionAreaArgs struct {
ControllerToken string
Index int
RestrictionArea av.RestrictionArea
}
type ServerLaunchConfig ¶ added in v0.12.1
type SetLaunchConfigArgs ¶
type SetLaunchConfigArgs struct {
ControllerToken string
Config sim.LaunchConfig
}
type SetSimRateArgs ¶
type SimBroadcastMessage ¶
type SimConnectionConfiguration ¶ added in v0.12.1
type SimManager ¶
type SimManager struct {
// contains filtered or unexported fields
}
func NewSimManager ¶
func NewSimManager(scenarioGroups map[string]map[string]*scenarioGroup, simConfigurations map[string]map[string]*Configuration, manifests map[string]*sim.VideoMapManifest, lg *log.Logger) *SimManager
func (*SimManager) Add ¶
func (sm *SimManager) Add(as *activeSim, result *NewSimResult, initialTCP string, instructor bool, prespawn bool, disableTextToSpeech bool) error
func (*SimManager) AddLocal ¶
func (sm *SimManager) AddLocal(sim *sim.Sim, result *NewSimResult) error
func (*SimManager) Broadcast ¶
func (sm *SimManager) Broadcast(m *SimBroadcastMessage, _ *struct{}) error
func (*SimManager) Connect ¶
func (sm *SimManager) Connect(version int, result *ConnectResult) error
func (*SimManager) ConnectToSim ¶ added in v0.12.1
func (sm *SimManager) ConnectToSim(config *SimConnectionConfiguration, result *NewSimResult) error
func (*SimManager) GetRunningSims ¶
func (sm *SimManager) GetRunningSims(_ int, result *map[string]*RemoteSim) error
func (*SimManager) GetSerializeSim ¶
func (sm *SimManager) GetSerializeSim(token string, s *sim.Sim) error
func (*SimManager) GetStateUpdate ¶ added in v0.12.0
func (sm *SimManager) GetStateUpdate(token string, update *sim.StateUpdate) error
func (*SimManager) LookupController ¶
func (sm *SimManager) LookupController(token string) (*humanController, *sim.Sim, bool)
func (*SimManager) NewSim ¶ added in v0.12.1
func (sm *SimManager) NewSim(config *NewSimConfiguration, result *NewSimResult) error
func (*SimManager) SignOff ¶
func (sm *SimManager) SignOff(token string) error
func (*SimManager) SimShouldExit ¶
func (sm *SimManager) SimShouldExit(sim *sim.Sim) bool
type SimScenarioConfiguration ¶
type SimScenarioConfiguration struct {
SelectedController string
SelectedSplit string
SplitConfigurations av.SplitConfigurationSet
PrimaryAirport string
Wind av.Wind
LaunchConfig sim.LaunchConfig
DepartureRunways []sim.DepartureRunway
ArrivalRunways []sim.ArrivalRunway
}