app

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: GPL-3.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const ChanJEvt = "jevt"
View Source
const JumpMax = 51
View Source
const (
	TLSCommonName = "de.fractalqb.bcplus.app"
)

Variables

View Source
var (
	App BCpApp

	LogWrs = []io.Writer{os.Stderr, &webLog}

	LogCfg = qbsllm.Config(log, elogCfg, ship.LogCfg, watched.LogCfg)
)
View Source
var (
	EventQ = make(chan Event, 16)
)
View Source
var (
	GxName = nmconv.Conversion{
		Norm:   nmconv.Uncamel,
		Xform:  nmconv.PerSegment(strings.ToLower),
		Denorm: nmconv.Sep(nmconv.Lisp),
	}
)

Functions

This section is empty.

Types

type BCpApp

type BCpApp struct {
	JournalDir string

	LastEvent time.Time
	GoOffline bool
	ApiKey    string
	WebPort   uint16
	WebAddr   string
	WebPin    string
	WebTheme  string
	Speak     SpeakCfg

	Lang string
	// contains filtered or unexported fields
}

func (*BCpApp) Flags

func (app *BCpApp) Flags()

func (*BCpApp) Run

func (app *BCpApp) Run(signals <-chan os.Signal)

type ChanConfig

type ChanConfig struct {
	Flags []string
	Black []string
	White []string
	// contains filtered or unexported fields
}

func (*ChanConfig) Filter

func (cc *ChanConfig) Filter(msg string) bool

type Change

type Change uint32
const (
	ChgCmdr Change = (1 << iota)
	ChgShip
	ChgPos
	ChgLoc
	WuiUpInSys
	WuiUpTrvl
)

type Commander

type Commander struct {
	Fid          string
	Name         string
	Loc          Location
	Ship         ship.ShipRef
	OnScreenShot ggja.GenArr
	Mats         map[string]MatState `json:"MatNeed"`
	Rcps         map[string]int      `json:"RcpNeed"`
	JumpHist     []FsdJump
	JumpW        int
	// contains filtered or unexported fields
}

func NewCommander

func NewCommander(fid, name string) *Commander

func (*Commander) AddJump

func (cmdr *Commander) AddJump(t time.Time, addr uint64, sys string, coos galaxy.SysCoos)

func (*Commander) LastJump

func (cmdr *Commander) LastJump() *FsdJump

type DateTime

type DateTime time.Time

func (DateTime) MarshalJSON

func (dt DateTime) MarshalJSON() ([]byte, error)

func (DateTime) UnmarshalJSON

func (dt DateTime) UnmarshalJSON(data []byte) error

type Dujason

type Dujason time.Duration

func (Dujason) MarshalJSON

func (d Dujason) MarshalJSON() ([]byte, error)

func (*Dujason) UnmarshalJSON

func (d *Dujason) UnmarshalJSON(data []byte) error

type Event

type Event struct {
	Src  EventSrc
	Data interface{}
}

type EventSrc

type EventSrc rune
const (
	ESRC_JOURNAL EventSrc = watched.EscrJournal
	ESRC_JSTATUS EventSrc = watched.EscrStatus
	ESRC_WEBUI            = 'u'
)

type FsdJump

type FsdJump struct {
	galaxy.SysDesc
	Time time.Time
}

type GormID

type GormID = uint

type Hint

type Hint struct {
	ID      GormID
	StoryID GormID
	Story   *Story
	Found   time.Time `gorm:"not null"`
	Written time.Time
	Text    string
}

type InSysBody

type InSysBody struct {
	Id              int
	Name            string
	Dist            float32
	R, Grav, Temp   float32
	Volcano         string
	Land, TidalLock bool
	Disco, Mapd     bool
}

type InSysInfo

type InSysInfo struct {
	BodyNum int
	MiscNum int
	Sigs    map[string]int
	Bodies  []*InSysBody
	BdyDsp  string `json:"bdyDsp"`
}

type JeEngineering

type JeEngineering struct {
	BlueprintName      string
	Level              int
	ExperimentalEffect string `json:",omitempty"`
}

type JeLdoModule

type JeLdoModule struct {
	Slot        string
	Item        string
	Engineering *JeEngineering `json:",omitempty"`
}

func (*JeLdoModule) Type

func (m *JeLdoModule) Type() SlotType

type JeLoadout

type JeLoadout struct {
	Ts            time.Time `json:"timestamp"`
	CargoCapacity int
	HullHealth    int
	HullValue     int64
	Rebuy         int64
	MaxJumpRange  float64
	Ship          string
	UnladenMass   float64
	ShipID        int
	ModulesValue  int64
	ShipIdent     string
	ShipName      string
	FuelCapacity  struct {
		Reserve float64
		Main    int
	}
	Modules []JeLdoModule
}

type Location

type Location struct {
	Sys   galaxy.SysDesc
	Ref   PosRef
	RefNm string
	Vhcl  Vehicle
	Mode  Mode
	Surf  *SurfPos `json:",omitempty"`
}

func (*Location) SetMode

func (l *Location) SetMode(m Mode) (chg Change)

func (*Location) SetRef

func (l *Location) SetRef(r PosRef) (chg Change)

func (*Location) SetRefNm

func (l *Location) SetRefNm(nm string) (chg Change)

func (*Location) SetSurf

func (l *Location) SetSurf(p *SurfPos) (chg Change)

func (*Location) SetSys

func (l *Location) SetSys(id uint64, nm string, coos []float32) (chg Change)

func (*Location) SetVehicle

func (l *Location) SetVehicle(v Vehicle) (chg Change)

type MatState

type MatState struct {
	Have int `json:"have"`
	Free int `json:"free"`
}

type Mode

type Mode int
const (
	ModeUndef Mode = iota
	Parked
	Move
	Cruise
	Jump
)

type PosRef

type PosRef int
const (
	RefUndef PosRef = iota
	Space
	Star
	Belt
	Planet
	Ring
	Station
	Outpost
	Port
	Settlement
	JTarget
)

type Screen

type Screen struct {
	*goxic.Template
	Theme     goxic.PhIdxs
	ActiveTab goxic.PhIdxs
	InitHdr   goxic.PhIdxs
}

type SlotType

type SlotType int
const (
	StUndef SlotType = iota
	StFixed
	StCore
	StOptional
	StHardpoint
	StUtility
	StDeco
)

type SpeakCfg

type SpeakCfg struct {
	Cmd     string
	Flags   []string
	OldChat Dujason
	ChanCfg map[string]*ChanConfig
}

type Story

type Story struct {
	ID     GormID
	Master string    `gorm:"not null"`
	Title  string    `gorm:"not null"`
	Joined time.Time `gorm:"not null"`
	Over   *time.Time
}

type SurfPos

type SurfPos struct {
	LatLon [2]float64 `json:"ll"`
	Alt    float64    `json:"a"`
}

func (*SurfPos) SetAlt

func (p *SurfPos) SetAlt(a float64) (chg Change)

func (*SurfPos) SetLatLon

func (p *SurfPos) SetLatLon(lat, lon float64) (chg Change)

type Tab

type Tab struct {
	Key   string `json:"key"`
	Title string `json:"title"`
	Url   string `json:"url"`
}

type TmplLoader

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

func NewTmplLoader

func NewTmplLoader(dir string) *TmplLoader

type Vehicle

type Vehicle int
const (
	VhclUndef Vehicle = iota
	InShip
	InSRV
	InFighter
	AsCrew
)

type VoiceMsg

type VoiceMsg struct {
	Chan string
	Prio int
	Txt  string
}

type WebPage

type WebPage struct {
	*goxic.Template
	Lang  goxic.PhIdxs
	Title goxic.PhIdxs
	Style goxic.PhIdxs
	Main  goxic.PhIdxs
}

type WuiHdr

type WuiHdr struct {
	Name string
	Loc  *Location
	Ship struct {
		Ident string
		Name  string
	}
}

type WuiMsg

type WuiMsg struct {
	Cmd string
}

type WuiUpdate

type WuiUpdate struct {
	WuiMsg
	Hdr *WuiHdr     `json:",omitempty"`
	P   interface{} `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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