client

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastMessage

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

func TryConnectRemoteServer

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

Types

type ConnectionManager

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

func MakeServerManager

func MakeServerManager(serverAddress, additionalScenario, additionalVideoMap string, lg *log.Logger,
	onNewClient func(*ControlClient), onError func(error)) (*ConnectionManager, util.ErrorLogger, string)

func (*ConnectionManager) ClientIsLocal

func (cm *ConnectionManager) ClientIsLocal() bool

func (*ConnectionManager) ConnectToSim

func (cm *ConnectionManager) ConnectToSim(config server.SimConnectionConfiguration, srv *Server, lg *log.Logger) error

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 server.NewSimConfiguration, srv *Server, lg *log.Logger) error

func (*ConnectionManager) Disconnect

func (cm *ConnectionManager) Disconnect()

func (*ConnectionManager) GetMETAR added in v0.13.0

func (cm *ConnectionManager) GetMETAR(srv *Server, airports []string, callback func(map[string][]wx.METAR, error))

func (*ConnectionManager) LoadLocalSim

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

func (*ConnectionManager) Update

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

func (*ConnectionManager) UpdateAvailableWX added in v0.13.0

func (cm *ConnectionManager) UpdateAvailableWX(srv *Server) error

func (*ConnectionManager) UpdateRemoteSims

func (cm *ConnectionManager) UpdateRemoteSims() error

type ControlClient

type ControlClient struct {
	SessionStats SessionStats

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

func NewControlClient

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

func (*ControlClient) AcceptHandoff

func (c *ControlClient) AcceptHandoff(acid sim.ACID, callback func(error))

func (*ControlClient) AcceptRedirectedHandoff

func (c *ControlClient) AcceptRedirectedHandoff(acid sim.ACID, callback func(error))

func (*ControlClient) AcknowledgePointOut

func (c *ControlClient) AcknowledgePointOut(acid sim.ACID, callback func(error))

func (*ControlClient) ActivateFlightPlan

func (c *ControlClient) ActivateFlightPlan(callsign av.ADSBCallsign, fpACID sim.ACID, spec *sim.FlightPlanSpecifier,
	callback func(error))

func (*ControlClient) AllowRadioTransmissions

func (c *ControlClient) AllowRadioTransmissions()

func (*ControlClient) AssociateFlightPlan

func (c *ControlClient) AssociateFlightPlan(callsign av.ADSBCallsign, spec sim.FlightPlanSpecifier, callback func(error))

func (*ControlClient) CancelHandoff

func (c *ControlClient) CancelHandoff(acid sim.ACID, callback 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 *sim.Aircraft, callback func(error))

func (*ControlClient) CreateDeparture

func (c *ControlClient) CreateDeparture(airport, runway, category string, rules av.FlightRules, ac *sim.Aircraft,
	callback func(error))

func (*ControlClient) CreateFlightPlan

func (c *ControlClient) CreateFlightPlan(spec sim.FlightPlanSpecifier, callback func(error))

func (*ControlClient) CreateOverflight

func (c *ControlClient) CreateOverflight(group string, ac *sim.Aircraft, callback func(error))

func (*ControlClient) CreateRestrictionArea

func (c *ControlClient) CreateRestrictionArea(ra av.RestrictionArea, callback func(int, 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) DeleteAircraft

func (c *ControlClient) DeleteAircraft(aircraft []sim.Aircraft, callback func(err error))

func (*ControlClient) DeleteAllAircraft

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

func (*ControlClient) DeleteFlightPlan

func (c *ControlClient) DeleteFlightPlan(acid sim.ACID, callback func(error))

func (*ControlClient) DeleteRestrictionArea

func (c *ControlClient) DeleteRestrictionArea(idx int, callback func(error))

func (*ControlClient) Disconnect

func (c *ControlClient) Disconnect()

func (*ControlClient) FastForward

func (c *ControlClient) FastForward()

func (*ControlClient) FlightPlanDirect added in v0.13.0

func (c *ControlClient) FlightPlanDirect(aircraft sim.ACID, fix string, callback func(err error))

func (*ControlClient) ForceQL

func (c *ControlClient) ForceQL(acid sim.ACID, controller string, callback func(error))

func (*ControlClient) GetAircraftDisplayState

func (c *ControlClient) GetAircraftDisplayState(callsign av.ADSBCallsign) (sim.AircraftDisplayState, error)

func (*ControlClient) GetAtmosGrid added in v0.13.0

func (c *ControlClient) GetAtmosGrid(t time.Time, callback func(*wx.AtmosGrid, error))

func (*ControlClient) GetPrecipURL added in v0.13.0

func (c *ControlClient) GetPrecipURL(t time.Time, callback func(url string, nextTime time.Time, err 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, p platform.Platform, onErr func(error))

func (*ControlClient) GetVideoMapLibrary

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

func (*ControlClient) HandoffTrack

func (c *ControlClient) HandoffTrack(acid sim.ACID, controller string, callback func(error))

func (*ControlClient) HaveTTS

func (c *ControlClient) HaveTTS() bool

func (*ControlClient) HoldRadioTransmissions

func (c *ControlClient) HoldRadioTransmissions()

func (*ControlClient) LastTTSCallsign

func (c *ControlClient) LastTTSCallsign() av.ADSBCallsign

func (*ControlClient) LaunchArrivalOverflight

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

func (*ControlClient) LaunchDeparture

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

func (*ControlClient) ModifyFlightPlan

func (c *ControlClient) ModifyFlightPlan(acid sim.ACID, spec sim.FlightPlanSpecifier, callback func(error))

func (*ControlClient) PointOut

func (c *ControlClient) PointOut(acid sim.ACID, controller string, callback func(error))

func (*ControlClient) RPCClient

func (c *ControlClient) RPCClient() *RPCClient

func (*ControlClient) RadioIsActive

func (c *ControlClient) RadioIsActive() bool

func (*ControlClient) RecallPointOut

func (c *ControlClient) RecallPointOut(acid sim.ACID, callback func(error))

func (*ControlClient) RedirectHandoff

func (c *ControlClient) RedirectHandoff(acid sim.ACID, tcp string, callback func(error))

func (*ControlClient) RejectPointOut

func (c *ControlClient) RejectPointOut(acid sim.ACID, callback func(error))

func (*ControlClient) ReleaseDeparture

func (c *ControlClient) ReleaseDeparture(callsign av.ADSBCallsign, callback func(error))

func (*ControlClient) RepositionTrack

func (c *ControlClient) RepositionTrack(acid sim.ACID, callsign av.ADSBCallsign, p math.Point2LL, callback func(error))

func (*ControlClient) RequestFlightFollowing

func (c *ControlClient) RequestFlightFollowing()

func (*ControlClient) RunAircraftCommands

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

func (*ControlClient) SendGlobalMessage

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

func (*ControlClient) SendRouteCoordinates added in v0.13.0

func (c *ControlClient) SendRouteCoordinates(aircraft sim.ACID, callback func(err error))

func (*ControlClient) SetLaunchConfig

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

func (*ControlClient) SetSimRate

func (c *ControlClient) SetSimRate(r float32)

func (*ControlClient) SetWaypointCommands added in v0.13.0

func (c *ControlClient) SetWaypointCommands(commands string)

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) 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, callback func(error))

type RPCClient

type RPCClient struct {
	*rpc.Client
}

type Server

type Server struct {
	*RPCClient

	HaveTTS     bool
	AvailableWX []util.TimeInterval
	// contains filtered or unexported fields
}

This is the client-side representation of a server (perhaps could be better-named...)

func (*Server) Close

func (s *Server) Close() error

func (*Server) GetConfigs

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

func (*Server) GetRunningSims

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

func (*Server) UpdateAvailableWX added in v0.13.0

func (s *Server) UpdateAvailableWX() error

type SessionStats

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

	SignOnTime time.Time
	// contains filtered or unexported fields
}

func (*SessionStats) Update

func (s *SessionStats) Update(ss *sim.State)

Jump to

Keyboard shortcuts

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