server

package
v0.11.9 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NewSimCreateLocal = iota
	NewSimCreateRemote
	NewSimJoinRemote
)
View Source
const ViceRPCVersion = 24
View Source
const ViceServerAddress = "vice.pharr.org"
View Source
const ViceServerPort = 8000 + 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")
	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 BroadcastMessage

func BroadcastMessage(hostname, msg, password string, lg *log.Logger)

func LaunchLocalServer

func LaunchLocalServer(extraScenario string, extraVideoMap string, e *util.ErrorLogger, lg *log.Logger) (chan *Server, error)

func LoadScenarioGroups

func LoadScenarioGroups(isLocal bool, extraScenarioFilename string, extraVideoMapFilename string,
	e *util.ErrorLogger, lg *log.Logger) (map[string]map[string]*ScenarioGroup, map[string]map[string]*Configuration, map[string]*av.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 *av.STARSFacilityAdaptation, e *util.ErrorLogger, sg *ScenarioGroup, manifest *av.VideoMapManifest)

func RunServer

func RunServer(extraScenario string, extraVideoMap string, serverPort int, lg *log.Logger)

func TryConnectRemoteServer

func TryConnectRemoteServer(hostname string, lg *log.Logger) chan *serverConnection

func TryDecodeError

func TryDecodeError(e error) error

func TryDecodeErrorString

func TryDecodeErrorString(s string) error

Types

type AcceptHandoffArgs

type AcceptHandoffArgs AircraftSpecifier

type ActiveSim

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

func (*ActiveSim) AddHumanController

func (as *ActiveSim) AddHumanController(tcp, token string) *HumanController

type AircraftCommandsArgs

type AircraftCommandsArgs struct {
	ControllerToken string
	Callsign        string
	Commands        string
}

type AircraftCommandsResult

type AircraftCommandsResult struct {
	ErrorMessage   string
	RemainingInput string
}

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        string
}

type AssignAltitudeArgs

type AssignAltitudeArgs struct {
	ControllerToken string
	Callsign        string
	Altitude        int
}

type CancelHandoffArgs

type CancelHandoffArgs AircraftSpecifier

type ChangeControlPositionArgs

type ChangeControlPositionArgs struct {
	ControllerToken string
	Callsign        string
	KeepTracks      bool
}

type Configuration

type Configuration struct {
	ScenarioConfigs  map[string]*SimScenarioConfiguration
	ControlPositions map[string]*av.Controller
	DefaultScenario  string
}

type ConnectResult

type ConnectResult struct {
	Configurations map[string]map[string]*Configuration
	RunningSims    map[string]*RemoteSim
}

type Connection

type Connection struct {
	SimState sim.State
	SimProxy *proxy
}

type ConnectionManager

type ConnectionManager struct {
	LocalServer  *Server
	RemoteServer *Server
	// contains filtered or unexported fields
}

func MakeServerConnection

func MakeServerConnection(address, additionalScenario, additionalVideoMap string, e *util.ErrorLogger, lg *log.Logger,
	onNewClient func(*ControlClient), onError func(error)) (*ConnectionManager, error)

func (*ConnectionManager) ClientIsLocal

func (cm *ConnectionManager) ClientIsLocal() bool

func (*ConnectionManager) Connected

func (cm *ConnectionManager) Connected() bool

func (*ConnectionManager) ConnectionStartTime

func (cm *ConnectionManager) ConnectionStartTime() time.Time

func (*ConnectionManager) CreateNewSim

func (cm *ConnectionManager) CreateNewSim(config NewSimConfiguration, srv *Server) error

func (*ConnectionManager) Disconnect

func (cm *ConnectionManager) Disconnect()

func (*ConnectionManager) LoadLocalSim

func (cm *ConnectionManager) LoadLocalSim(s *sim.Sim, lg *log.Logger) (*ControlClient, error)

func (*ConnectionManager) NewConnection

func (cm *ConnectionManager) NewConnection(state sim.State, controllerToken string, client *util.RPCClient)

func (*ConnectionManager) Update

func (cm *ConnectionManager) Update(es *sim.EventStream, lg *log.Logger)

func (*ConnectionManager) UpdateRemoteSims

func (cm *ConnectionManager) UpdateRemoteSims() error

type ControlClient

type ControlClient struct {
	SessionStats struct {
		Departures    int
		Arrivals      int
		IntraFacility int
		Overflights   int

		SignOnTime time.Time
	}

	// This is all read-only data that we expect other parts of the system
	// to access directly.
	sim.State
	// contains filtered or unexported fields
}

func NewControlClient

func NewControlClient(ss sim.State, local bool, controllerToken string, client *util.RPCClient, lg *log.Logger) *ControlClient

func (*ControlClient) AcceptHandoff

func (c *ControlClient) AcceptHandoff(callsign string, success func(any), err func(error))

func (*ControlClient) AcceptRedirectedHandoff

func (c *ControlClient) AcceptRedirectedHandoff(callsign string, success func(any), err func(error))

func (*ControlClient) AcknowledgePointOut

func (c *ControlClient) AcknowledgePointOut(callsign string, success func(any), err func(error))

func (*ControlClient) AmendFlightPlan

func (c *ControlClient) AmendFlightPlan(callsign string, fp av.FlightPlan) error

func (*ControlClient) AutoAssociateFP

func (c *ControlClient) AutoAssociateFP(callsign string, fp *av.STARSFlightPlan, success func(any),
	err func(error))

func (*ControlClient) CancelHandoff

func (c *ControlClient) CancelHandoff(callsign string, success func(any), err func(error))

func (*ControlClient) ChangeControlPosition

func (c *ControlClient) ChangeControlPosition(tcp string, keepTracks bool) error

func (*ControlClient) Connected

func (c *ControlClient) Connected() bool

func (*ControlClient) ControllerAirspace

func (c *ControlClient) ControllerAirspace(id string) []av.ControllerAirspaceVolume

func (*ControlClient) CreateArrival

func (c *ControlClient) CreateArrival(group, airport string, ac *av.Aircraft, success func(any), err func(error))

func (*ControlClient) CreateDeparture

func (c *ControlClient) CreateDeparture(airport, runway, category string, rules av.FlightRules, ac *av.Aircraft,
	success func(any), err func(error))

func (*ControlClient) CreateOverflight

func (c *ControlClient) CreateOverflight(group string, ac *av.Aircraft, success func(any), err func(error))

func (*ControlClient) CreateRestrictionArea

func (c *ControlClient) CreateRestrictionArea(ra av.RestrictionArea, success func(int), err func(error))

Note that the success callback is passed an integer, giving the index of the newly-created restriction area.

func (*ControlClient) CreateUnsupportedTrack

func (c *ControlClient) CreateUnsupportedTrack(callsign string, ut *sim.UnsupportedTrack,
	success func(any), err func(error))

func (*ControlClient) CurrentTime

func (c *ControlClient) CurrentTime() time.Time

CurrentTime returns an extrapolated value that models the current Sim's time. (Because the Sim may be running remotely, we have to make some approximations, though they shouldn't cause much trouble since we get an update from the Sim at least once a second...)

func (*ControlClient) DeleteAllAircraft

func (c *ControlClient) DeleteAllAircraft(onErr func(err error))

func (*ControlClient) DeleteRestrictionArea

func (c *ControlClient) DeleteRestrictionArea(idx int, success func(any), err func(error))

func (*ControlClient) Disconnect

func (c *ControlClient) Disconnect()

func (*ControlClient) DropTrack

func (c *ControlClient) DropTrack(callsign string, success func(any), err func(error))

func (*ControlClient) ForceQL

func (c *ControlClient) ForceQL(callsign, controller string, success func(any), err func(error))

func (*ControlClient) GetSerializeSim

func (c *ControlClient) GetSerializeSim() (*sim.Sim, error)

func (*ControlClient) GetSimRate

func (c *ControlClient) GetSimRate() float32

func (*ControlClient) GetUpdates

func (c *ControlClient) GetUpdates(eventStream *sim.EventStream, onErr func(error))

func (*ControlClient) GetVideoMapLibrary

func (c *ControlClient) GetVideoMapLibrary(filename string) (*av.VideoMapLibrary, error)

func (*ControlClient) HandoffTrack

func (c *ControlClient) HandoffTrack(callsign string, controller string, success func(any), err func(error))

func (*ControlClient) InitiateTrack

func (c *ControlClient) InitiateTrack(callsign string, fp *av.STARSFlightPlan, success func(any),
	err func(error))

func (*ControlClient) LaunchArrivalOverflight

func (c *ControlClient) LaunchArrivalOverflight(ac av.Aircraft)

func (*ControlClient) LaunchDeparture

func (c *ControlClient) LaunchDeparture(ac av.Aircraft, rwy string)

func (*ControlClient) PointOut

func (c *ControlClient) PointOut(callsign string, controller string, success func(any), err func(error))

func (*ControlClient) RPCClient

func (c *ControlClient) RPCClient() *util.RPCClient

func (*ControlClient) RecallPointOut

func (c *ControlClient) RecallPointOut(callsign string, success func(any), err func(error))

func (*ControlClient) RedirectHandoff

func (c *ControlClient) RedirectHandoff(callsign, controller string, success func(any), err func(error))

func (*ControlClient) RejectPointOut

func (c *ControlClient) RejectPointOut(callsign string, success func(any), err func(error))

func (*ControlClient) ReleaseDeparture

func (c *ControlClient) ReleaseDeparture(callsign string, success func(any), err func(error))

func (*ControlClient) RunAircraftCommands

func (c *ControlClient) RunAircraftCommands(callsign string, cmds string, handleResult func(message string, remainingInput string))

func (*ControlClient) SendGlobalMessage

func (c *ControlClient) SendGlobalMessage(global sim.GlobalMessage)

func (*ControlClient) SetGlobalLeaderLine

func (c *ControlClient) SetGlobalLeaderLine(callsign string, dir *math.CardinalOrdinalDirection, success func(any), err func(error))

func (*ControlClient) SetLaunchConfig

func (c *ControlClient) SetLaunchConfig(lc sim.LaunchConfig)

func (*ControlClient) SetPilotReportedAltitude

func (c *ControlClient) SetPilotReportedAltitude(callsign string, alt int, success func(any), err func(error))

func (*ControlClient) SetScratchpad

func (c *ControlClient) SetScratchpad(callsign string, scratchpad string, success func(any), err func(error))

func (*ControlClient) SetSecondaryScratchpad

func (c *ControlClient) SetSecondaryScratchpad(callsign string, scratchpad string, success func(any), err func(error))

func (*ControlClient) SetSimRate

func (c *ControlClient) SetSimRate(r float32)

func (*ControlClient) SetSquawk

func (c *ControlClient) SetSquawk(callsign string, squawk av.Squawk) error

func (*ControlClient) SetSquawkAutomatic

func (c *ControlClient) SetSquawkAutomatic(callsign string) error

func (*ControlClient) SetTemporaryAltitude

func (c *ControlClient) SetTemporaryAltitude(callsign string, alt int, success func(any), err func(error))

func (*ControlClient) Status

func (c *ControlClient) Status() string

func (*ControlClient) StringIsSPC

func (c *ControlClient) StringIsSPC(s string) bool

func (*ControlClient) TakeOrReturnLaunchControl

func (c *ControlClient) TakeOrReturnLaunchControl(eventStream *sim.EventStream)

func (*ControlClient) ToggleDisplayModeCAltitude

func (c *ControlClient) ToggleDisplayModeCAltitude(callsign string, success func(any), err func(error))

func (*ControlClient) ToggleSPCOverride

func (c *ControlClient) ToggleSPCOverride(callsign string, spc string, success func(any), err func(error))

func (*ControlClient) ToggleSimPause

func (c *ControlClient) ToggleSimPause()

func (*ControlClient) TowerListAirports

func (c *ControlClient) TowerListAirports() []string

func (*ControlClient) UpdateRestrictionArea

func (c *ControlClient) UpdateRestrictionArea(idx int, ra av.RestrictionArea, success func(any), err func(error))

func (*ControlClient) UpdateWorld

func (c *ControlClient) UpdateWorld(wu *sim.WorldUpdate, eventStream *sim.EventStream)

func (*ControlClient) UploadFlightPlan

func (c *ControlClient) UploadFlightPlan(fp *av.STARSFlightPlan, typ int, success func(any), err func(error))

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 CreateOverflightArgs

type CreateOverflightArgs struct {
	ControllerToken string
	Group           string
}

type CreateUnsupportedTrackArgs

type CreateUnsupportedTrackArgs struct {
	ControllerToken  string
	Callsign         string
	UnsupportedTrack *sim.UnsupportedTrack
}

type DeleteAircraftArgs

type DeleteAircraftArgs AircraftSpecifier

type Dispatcher

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

func (*Dispatcher) AcceptHandoff

func (sd *Dispatcher) AcceptHandoff(ah *AcceptHandoffArgs, _ *struct{}) error

func (*Dispatcher) AcceptRedirectedHandoff

func (sd *Dispatcher) AcceptRedirectedHandoff(po *AcceptHandoffArgs, _ *struct{}) error

func (*Dispatcher) AcknowledgePointOut

func (sd *Dispatcher) AcknowledgePointOut(po *PointOutArgs, _ *struct{}) error

func (*Dispatcher) AutoAssociateFP

func (sd *Dispatcher) AutoAssociateFP(it *InitiateTrackArgs, _ *struct{}) error

func (*Dispatcher) CancelHandoff

func (sd *Dispatcher) CancelHandoff(ch *CancelHandoffArgs, _ *struct{}) error

func (*Dispatcher) ChangeControlPosition

func (sd *Dispatcher) ChangeControlPosition(cs *ChangeControlPositionArgs, _ *struct{}) error

func (*Dispatcher) CreateArrival

func (sd *Dispatcher) CreateArrival(aa *CreateArrivalArgs, arrAc *av.Aircraft) error

func (*Dispatcher) CreateDeparture

func (sd *Dispatcher) CreateDeparture(da *CreateDepartureArgs, depAc *av.Aircraft) error

func (*Dispatcher) CreateOverflight

func (sd *Dispatcher) CreateOverflight(oa *CreateOverflightArgs, ofAc *av.Aircraft) error

func (*Dispatcher) CreateRestrictionArea

func (sd *Dispatcher) CreateRestrictionArea(ra *RestrictionAreaArgs, idx *int) error

func (*Dispatcher) CreateUnsupportedTrack

func (sd *Dispatcher) CreateUnsupportedTrack(it *CreateUnsupportedTrackArgs, _ *struct{}) error

func (*Dispatcher) DeleteAllAircraft

func (sd *Dispatcher) DeleteAllAircraft(da *DeleteAircraftArgs, _ *struct{}) error

func (*Dispatcher) DeleteRestrictionArea

func (sd *Dispatcher) DeleteRestrictionArea(ra *RestrictionAreaArgs, _ *struct{}) error

func (*Dispatcher) DropTrack

func (sd *Dispatcher) DropTrack(dt *DropTrackArgs, _ *struct{}) error

func (*Dispatcher) ForceQL

func (sd *Dispatcher) ForceQL(ql *ForceQLArgs, _ *struct{}) error

func (*Dispatcher) GetVideoMapLibrary

func (sd *Dispatcher) GetVideoMapLibrary(vm *VideoMapsArgs, vmf *av.VideoMapLibrary) error

func (*Dispatcher) GetWorldUpdate

func (sd *Dispatcher) GetWorldUpdate(token string, update *sim.WorldUpdate) error

func (*Dispatcher) GlobalMessage

func (sd *Dispatcher) GlobalMessage(gm *GlobalMessageArgs, _ *struct{}) error

func (*Dispatcher) HandoffTrack

func (sd *Dispatcher) HandoffTrack(h *HandoffArgs, _ *struct{}) error

func (*Dispatcher) InitiateTrack

func (sd *Dispatcher) InitiateTrack(it *InitiateTrackArgs, _ *struct{}) error

func (*Dispatcher) LaunchAircraft

func (sd *Dispatcher) LaunchAircraft(ls *LaunchAircraftArgs, _ *struct{}) error

func (*Dispatcher) PointOut

func (sd *Dispatcher) PointOut(po *PointOutArgs, _ *struct{}) error

func (*Dispatcher) RecallPointOut

func (sd *Dispatcher) RecallPointOut(po *PointOutArgs, _ *struct{}) error

func (*Dispatcher) RedirectHandoff

func (sd *Dispatcher) RedirectHandoff(h *HandoffArgs, _ *struct{}) error

func (*Dispatcher) RejectPointOut

func (sd *Dispatcher) RejectPointOut(po *PointOutArgs, _ *struct{}) error

func (*Dispatcher) ReleaseDeparture

func (sd *Dispatcher) ReleaseDeparture(hd *HeldDepartureArgs, _ *struct{}) error

func (*Dispatcher) RunAircraftCommands

func (sd *Dispatcher) RunAircraftCommands(cmds *AircraftCommandsArgs, result *AircraftCommandsResult) error

func (*Dispatcher) SetGlobalLeaderLine

func (sd *Dispatcher) SetGlobalLeaderLine(a *SetGlobalLeaderLineArgs, _ *struct{}) error

func (*Dispatcher) SetLaunchConfig

func (sd *Dispatcher) SetLaunchConfig(lc *SetLaunchConfigArgs, _ *struct{}) error

func (*Dispatcher) SetPilotReportedAltitude

func (sd *Dispatcher) SetPilotReportedAltitude(alt *AssignAltitudeArgs, _ *struct{}) error

func (*Dispatcher) SetScratchpad

func (sd *Dispatcher) SetScratchpad(a *SetScratchpadArgs, _ *struct{}) error

func (*Dispatcher) SetSecondaryScratchpad

func (sd *Dispatcher) SetSecondaryScratchpad(a *SetScratchpadArgs, _ *struct{}) error

func (*Dispatcher) SetSimRate

func (sd *Dispatcher) SetSimRate(r *SetSimRateArgs, _ *struct{}) error

func (*Dispatcher) SetTemporaryAltitude

func (sd *Dispatcher) SetTemporaryAltitude(alt *AssignAltitudeArgs, _ *struct{}) error

func (*Dispatcher) SignOff

func (sd *Dispatcher) SignOff(token string, _ *struct{}) error

func (*Dispatcher) TakeOrReturnLaunchControl

func (sd *Dispatcher) TakeOrReturnLaunchControl(token string, _ *struct{}) error

func (*Dispatcher) ToggleDisplayModeCAltitude

func (sd *Dispatcher) ToggleDisplayModeCAltitude(ac *AircraftSpecifier, _ *struct{}) error

func (*Dispatcher) TogglePause

func (sd *Dispatcher) TogglePause(token string, _ *struct{}) error

func (*Dispatcher) ToggleSPCOverride

func (sd *Dispatcher) ToggleSPCOverride(ts *ToggleSPCArgs, _ *struct{}) error

func (*Dispatcher) UpdateRestrictionArea

func (sd *Dispatcher) UpdateRestrictionArea(ra *RestrictionAreaArgs, _ *struct{}) error

func (*Dispatcher) UploadFlightPlan

func (sd *Dispatcher) UploadFlightPlan(it *UploadPlanArgs, _ *struct{}) error

type DropTrackArgs

type DropTrackArgs AircraftSpecifier

type ForceQLArgs

type ForceQLArgs struct {
	ControllerToken string
	Callsign        string
	Controller      string
}

type GlobalMessageArgs

type GlobalMessageArgs struct {
	ControllerToken string
	Message         string
}

type HandoffArgs

type HandoffArgs struct {
	ControllerToken string
	Callsign        string
	Controller      string
}

type HeldDepartureArgs

type HeldDepartureArgs AircraftSpecifier

type HumanController

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

type InitiateTrackArgs

type InitiateTrackArgs struct {
	AircraftSpecifier
	Plan *av.STARSFlightPlan
}

type LaunchAircraftArgs

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

type NewSimConfiguration

type NewSimConfiguration struct {
	// FIXME: unify Password/RemoteSimPassword, SelectedRemoteSim / NewSimName, etc.
	NewSimType   int
	NewSimName   string
	GroupName    string
	ScenarioName string

	SelectedRemoteSim         string
	SelectedRemoteSimPosition string

	Scenario *SimScenarioConfiguration

	TFRs []av.TFR

	TRACONName        string
	RequirePassword   bool
	Password          string // for create remote only
	RemoteSimPassword string // for join remote only

	LiveWeather bool

	InstructorAllowed bool
	Instructor        bool
}

func MakeNewSimConfiguration

func MakeNewSimConfiguration() NewSimConfiguration

type NewSimResult

type NewSimResult struct {
	SimState        *sim.State
	ControllerToken string
}

type PointOutArgs

type PointOutArgs struct {
	ControllerToken string
	Callsign        string
	Controller      string
}

type RemoteSim

type RemoteSim struct {
	GroupName          string
	ScenarioName       string
	PrimaryController  string
	RequirePassword    bool
	InstructorAllowed  bool
	AvailablePositions map[string]av.Controller
	CoveredPositions   map[string]av.Controller
}

type RestrictionAreaArgs

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

type Scenario

type Scenario struct {
	SoloController      string                   `json:"solo_controller"`
	SplitConfigurations av.SplitConfigurationSet `json:"multi_controllers"`
	DefaultSplit        string                   `json:"default_split"`
	Wind                av.Wind                  `json:"wind"`
	VirtualControllers  []string                 `json:"controllers"`

	// Map from inbound flow names to a map from airport name to default rate,
	// with "overflights" a special case to denote overflights
	InboundFlowDefaultRates map[string]map[string]int `json:"inbound_rates"`
	// Temporary backwards compatibility
	ArrivalGroupDefaultRates map[string]map[string]int `json:"arrivals"`

	Airspace map[string][]string `json:"airspace"`

	DepartureRunways []sim.DepartureRunway `json:"departure_runways,omitempty"`
	ArrivalRunways   []sim.ArrivalRunway   `json:"arrival_runways,omitempty"`

	Center       math.Point2LL `json:"-"`
	CenterString string        `json:"center"`
	Range        float32       `json:"range"`
	DefaultMaps  []string      `json:"default_maps"`
	VFRRateScale *float32      `json:"vfr_rate_scale"`
}

func (*Scenario) PostDeserialize

func (s *Scenario) PostDeserialize(sg *ScenarioGroup, e *util.ErrorLogger, manifest *av.VideoMapManifest)

type ScenarioGroup

type ScenarioGroup struct {
	TRACON           string                     `json:"tracon"`
	Name             string                     `json:"name"`
	Airports         map[string]*av.Airport     `json:"airports"`
	Fixes            map[string]math.Point2LL   `json:"-"`
	FixesStrings     util.OrderedMap            `json:"fixes"`
	Scenarios        map[string]*Scenario       `json:"scenarios"`
	DefaultScenario  string                     `json:"default_scenario"`
	ControlPositions map[string]*av.Controller  `json:"control_positions"`
	Airspace         av.Airspace                `json:"airspace"`
	InboundFlows     map[string]*av.InboundFlow `json:"inbound_flows"`

	PrimaryAirport string `json:"primary_airport"`

	ReportingPointStrings []string            `json:"reporting_points"`
	ReportingPoints       []av.ReportingPoint // not in JSON

	NmPerLatitude           float32 // Always 60
	NmPerLongitude          float32 // Derived from Center
	MagneticVariation       float32
	MagneticAdjustment      float32                    `json:"magnetic_adjustment"`
	STARSFacilityAdaptation av.STARSFacilityAdaptation `json:"stars_config"`
}

func (*ScenarioGroup) Locate

func (sg *ScenarioGroup) Locate(s string) (math.Point2LL, bool)

func (*ScenarioGroup) PostDeserialize

func (sg *ScenarioGroup) PostDeserialize(multiController bool, e *util.ErrorLogger, simConfigurations map[string]map[string]*Configuration,
	manifest *av.VideoMapManifest)

type Server

type Server struct {
	*util.RPCClient
	// contains filtered or unexported fields
}

func (*Server) Close

func (s *Server) Close() error

func (*Server) GetConfigs

func (s *Server) GetConfigs() map[string]map[string]*Configuration

func (*Server) GetRunningSims

func (s *Server) GetRunningSims() map[string]*RemoteSim

type SetGlobalLeaderLineArgs

type SetGlobalLeaderLineArgs struct {
	ControllerToken string
	Callsign        string
	Direction       *math.CardinalOrdinalDirection
}

type SetLaunchConfigArgs

type SetLaunchConfigArgs struct {
	ControllerToken string
	Config          sim.LaunchConfig
}

type SetScratchpadArgs

type SetScratchpadArgs struct {
	ControllerToken string
	Callsign        string
	Scratchpad      string
}

type SetSimRateArgs

type SetSimRateArgs struct {
	ControllerToken string
	Rate            float32
}

type SimBroadcastMessage

type SimBroadcastMessage struct {
	Password string
	Message  string
}

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]*av.VideoMapManifest,
	lg *log.Logger) *SimManager

func (*SimManager) Add

func (sm *SimManager) Add(as *ActiveSim, result *NewSimResult, prespawn 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) 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) GetWorldUpdate

func (sm *SimManager) GetWorldUpdate(token string, update *sim.WorldUpdate) error

func (*SimManager) LookupController

func (sm *SimManager) LookupController(token string) (*HumanController, *sim.Sim, bool)

func (*SimManager) New

func (sm *SimManager) New(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
}

type ToggleSPCArgs

type ToggleSPCArgs struct {
	ControllerToken string
	Callsign        string
	SPC             string
}

type UploadPlanArgs

type UploadPlanArgs struct {
	ControllerToken string
	Type            int
	Plan            *av.STARSFlightPlan
}

type VideoMapsArgs

type VideoMapsArgs struct {
	ControllerToken string
	Filename        string
}

Jump to

Keyboard shortcuts

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