hacknet

package
v0.0.0-...-fa728ab Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAttachment

type AccountAttachment struct {
	Computer string `xml:"comp,attr" json:"target"`
	Username string `xml:"user,attr" json:"username"`
	Password string `xml:"pass,attr" json:"password"`
}

func (*AccountAttachment) Type

type ActionSequence

type ActionSequence struct {
	Target               *string          `xml:"target,attr,omitempty"`
	NeedsMissionComplete *bool            `xml:"needsMissionComplete,attr,omitempty"`
	RequiredFlags        CSVList          `xml:"requiredFlags,attr,omitempty"`
	Flags                CSVList          `xml:"Flags,attr,omitempty"`
	Actions              []actions.Action `xml:",any"`
}

type AttachmentType

type AttachmentType string
const (
	Note    AttachmentType = "note"
	Link    AttachmentType = "link"
	Account AttachmentType = "account"
)

type BoardPosting

type BoardPosting struct {
	Title         string  `xml:"title,attr" json:"title"`
	RequiredFlags CSVList `xml:"reqs,attr" json:"requiredFlags"`
	RequiredRank  int     `xml:"requiredRank,attr" json:"requiredRank"`
	Body          string  `xml:",chardata"`
}

type CSVList

type CSVList []string

func (CSVList) MarshalXML

func (c CSVList) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML custom marshaller to convert []string to CSV string

func (CSVList) String

func (c CSVList) String() string

func (*CSVList) UnmarshalXML

func (c *CSVList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML custom unmarshaler for a CSV string to []string

func (*CSVList) UnmarshalXMLAttr

func (c *CSVList) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr enables same functionality as UnmarshalXML for attributes

type Computer

type Computer struct {
	*ComputerAttrs
	AdminPass      *nodes.AdminPass        `xml:"adminPass,omitempty" json:"adminPass,omitempty"`
	Accounts       []nodes.ComputerAccount `xml:"account" json:"accounts"`
	Ports          CSVList                 `xml:"ports" json:"ports"`
	PortsForCrack  nodes.PortsForCrack     `xml:"portsForCrack" json:"portsForCrack"`
	Proxy          *nodes.ProxyConfig      `xml:"proxy,omitempty" json:"proxy"`
	Trace          *nodes.TraceConfig      `xml:"trace,omitempty" json:"trace"`
	AdminConfig    *nodes.AdminConfig      `xml:"admin,omitempty" json:"adminConfig"`
	PortRemap      nodes.PortRemap         `xml:"portRemap,omitempty" json:"portRemap"`
	HasTracker     nodes.Tracker           `xml:"tracker,omitempty" json:"hasTracker"`
	PositionNear   *nodes.PositionNear     `xml:"positionNear,omitempty" json:"positionNear"`
	Files          []nodes.File            `xml:"file" json:"files"`
	CustomThemes   []nodes.CustomThemeFile `xml:"customthemefile" json:"customThemes"`
	EncryptedFiles []nodes.EncryptedFile   `xml:"encryptedFile" json:"encryptedFiles"`
	Links          []ComputerLink          `xml:"dlink" json:"links"`
	EosLinks       []nodes.EosDevice       `xml:"eosDevice" json:"eosLinks"`
	*ProjectResource
}

type ComputerAttrs

type ComputerAttrs struct {
	ID                      string             `xml:"id,attr" json:"id"`
	Name                    string             `xml:"name,attr" json:"name"`
	IP                      string             `xml:"ip,attr" json:"ip"`
	Security                int                `xml:"security,attr" json:"security"`
	AllowsDefaultBootModule bool               `xml:"allowsDefaultBootModule,attr" json:"allowsDefaultBootModule"`
	Icon                    nodes.ComputerIcon `xml:"icon,attr" json:"icon"`
	Type                    nodes.ComputerType `xml:"type,attr" json:"type"`
}
type ComputerLink struct {
	Target string `xml:"target,attr"`
}

type ConditionalActionSet

type ConditionalActionSet struct {
	xml.Name         `xml:"ConditionalActions" json:"-"`
	OnConnect        []ActionSequence `xml:"OnConnect,omitempty" json:"onConnect"`
	HasFlags         []ActionSequence `xml:"HasFlags,omitempty" json:"hasFlags"`
	Instantly        []ActionSequence `xml:"Instantly,omitempty" json:"instantly"`
	OnAdminGained    []ActionSequence `xml:"OnAdminGained,omitempty" json:"onAdminGained"`
	DoesNotHaveFlags []ActionSequence `xml:"DoesNotHaveFlags,omitempty" json:"doesNotHaveFlags"`
	OnDisconnect     []ActionSequence `xml:"OnDisconnect,omitempty" json:"onDisconnect"`
	*ProjectResource
}

type Email

type Email struct {
	Sender   string              `xml:"sender" json:"sender"`
	Subject  string              `xml:"subject" json:"subject"`
	Body     string              `xml:"body" json:"body"`
	Notes    []NoteAttachment    `xml:"attachments>note"`
	Links    []LinkAttachment    `xml:"attachments>link"`
	Accounts []AccountAttachment `xml:"attachments>account"`
}

type EmailAttachment

type EmailAttachment interface {
	Type() AttachmentType
}

type ExeColours

type ExeColours struct {
	ExeModuleTopBar    RgbColour `xml:"exeModuleTopBar"`
	ExeModuleTitleText RgbColour `xml:"exeModuleTitleText"`
}

type ExtensionInfo

type ExtensionInfo struct {
	xml.Name           `xml:"HacknetExtension" json:"-"`
	Title              string `xml:"Name" json:"name"`
	AllowSaves         bool   `json:"allowSaves"`
	Language           `json:"language"`
	StartingNodes      CSVList           `xml:"StartingVisibleNodes" json:"startingNodes"`
	StartingMission    ProjectResource   `xml:"StartingMission" json:"startingMission"`
	StartingActions    ProjectResource   `xml:"StartingActions" json:"startingActions"`
	Description        string            `xml:"Description" json:"description"`
	Factions           []ProjectResource `xml:"Faction" json:"factions"`
	StartsWithTutorial bool              `xml:"StartsWithTutorial" json:"startsWithTutorial"`
	HasIntroStartup    bool              `xml:"HasIntroStartup" json:"hasIntroStartup"`
	StartingTheme      ProjectResource   `xml:"StartingTheme" json:"startingTheme"`
	IntroStartupSong   string            `xml:"IntroStartupSong" json:"introStartupSong"`
}

func (*ExtensionInfo) String

func (ext *ExtensionInfo) String() string

type ExtraColours

type ExtraColours struct {
	WarningColor            RgbColour `xml:"warningColor"`
	SubtleTextColor         RgbColour `xml:"subtleTextColor"`
	DarkBackgroundColor     RgbColour `xml:"darkBackgroundColor"`
	IndentBackgroundColor   RgbColour `xml:"indentBackgroundColor"`
	OutlineColor            RgbColour `xml:"outlineColor"`
	LockedColor             RgbColour `xml:"lockedColor"`
	BrightLockedColor       RgbColour `xml:"brightLockedColor"`
	BrightUnlockedColor     RgbColour `xml:"brightUnlockedColor"`
	UnlockedColor           RgbColour `xml:"unlockedColor"`
	LightGray               RgbColour `xml:"lightGray"`
	ShellColor              RgbColour `xml:"shellColor"`
	ShellButtonColor        RgbColour `xml:"shellButtonColor"`
	SemiTransText           RgbColour `xml:"semiTransText"`
	TerminalTextColor       RgbColour `xml:"terminalTextColor"`
	TopBarTextColor         RgbColour `xml:"topBarTextColor"`
	SuperLightWhite         RgbColour `xml:"superLightWhite"`
	ConnectedNodeHighlight  RgbColour `xml:"connectedNodeHighlight"`
	NetmapToolTipColor      RgbColour `xml:"netmapToolTipColor"`
	NetmapToolTipBackground RgbColour `xml:"netmapToolTipBackground"`
	TopBarIconsColor        RgbColour `xml:"topBarIconsColor"`
	ThisComputerNode        RgbColour `xml:"thisComputerNode"`
	ScanlinesColor          RgbColour `xml:"scanlinesColor"`
}

type Faction

type Faction struct {
	xml.Name    `xml:"CustomFaction"`
	ID          string             `xml:"id,attr"`
	FactionName string             `xml:"name,attr"`
	StartValue  int                `xml:"playerVal,attr"`
	ActionSets  []FactionActionSet `xml:"Action"`
	*ProjectResource
}

type FactionActionSet

type FactionActionSet struct {
	RequiresValue *int             `xml:"ValueRequired,attr,omitempty"`
	RequiredFlags CSVList          `xml:"Flags,attr"`
	Actions       []actions.Action `xml:",any"`
}

type Goal

type Goal struct {
	Type          GoalType `xml:"type,attr" json:"type"`
	Target        *string  `xml:"target,attr" json:"target,omitempty"`
	DestTarget    *string  `xml:"destTarget,attr" json:"destTarget,omitempty"`
	File          *string  `xml:"file,attr" json:"file,omitempty"`
	Path          *string  `xml:"path,attr" json:"path,omitempty"`
	DestPath      *string  `xml:"destPath,attr" json:"destPath,omitempty"`
	Keyword       *string  `xml:"keyword,attr" json:"keyword,omitempty"`
	Removal       *string  `xml:"removal,attr" json:"removal,omitempty"`
	CaseSensitive *string  `xml:"caseSensitive,attr" json:"caseSensitive,omitempty"`
	Time          *string  `xml:"time,attr" json:"time,omitempty"`
	Decrypt       *bool    `xml:"decrypt,attr" json:"decrypt,omitempty"`
	DecryptPass   *string  `xml:"decryptPass,attr" json:"decryptPass,omitempty"`
	MailServer    *string  `xml:"mailServer,attr" json:"mailServer,omitempty"`
	Recipient     *string  `xml:"recipient,attr" json:"recipient,omitempty"`
	Subject       *string  `xml:"subject,attr" json:"subject,omitempty"`
	Owner         *string  `xml:"owner,attr" json:"owner,omitempty"`
}

type GoalType

type GoalType string
const (
	FileDeletion         GoalType = "filedeletion"
	ClearFolder          GoalType = "clearfolder"
	FileDownload         GoalType = "filedownload"
	FileChange           GoalType = "filechange"
	GetAdmin             GoalType = "getadmin"
	GetString            GoalType = "getstring"
	Delay                GoalType = "delay"
	HasFlag              GoalType = "hasflag"
	FileUpload           GoalType = "fileupload"
	AddDegree            GoalType = "AddDegree"
	WipeDegrees          GoalType = "wipedegrees"
	SendEmail            GoalType = "sendemail"
	RemoveDeathRowRecord GoalType = "removeDeathRowRecord"
	ModifyDeathRowRecord GoalType = "modifyDeathRowRecord"
	GetAdminPass         GoalType = "getadminpasswordstring"
)

type Language

type Language string
const (
	English           Language = "en-us"
	German            Language = "de-de"
	French            Language = "fr-be"
	Russian           Language = "ru-ru"
	Spanish           Language = "es-ar"
	Korean            Language = "ko-kr"
	Japanese          Language = "ja-jp"
	ChineseSimplified Language = "zh-cn"
)

type LinkAttachment

type LinkAttachment struct {
	Computer string `xml:"comp,attr" json:"target"`
}

func (*LinkAttachment) Type

func (l *LinkAttachment) Type() AttachmentType

type MainColours

type MainColours struct {
	DefaultHighlightColor   RgbColour `xml:"defaultHighlightColor"`
	DefaultTopBarColor      RgbColour `xml:"defaultTopBarColor"`
	ModuleColorSolidDefault RgbColour `xml:"moduleColorSolidDefault"`
	ModuleColorStrong       RgbColour `xml:"moduleColorStrong"`
	ModuleColorBacking      RgbColour `xml:"moduleColorBacking"`
}

type Mission

type Mission struct {
	xml.Name     `xml:"mission" json:"-"`
	ID           string           `xml:"id,attr" json:"id"`
	ActiveCheck  bool             `xml:"activeCheck,attr" json:"activeCheck"`
	VerifySender bool             `xml:"shouldIgnoreSenderVerification,attr" json:"verifySender"`
	Goals        []Goal           `xml:"goals>goal" json:"goals"`
	Start        MissionFunctions `xml:"missionStart" json:"missionStart"`
	End          MissionFunctions `xml:"missionEnd" json:"missionEnd"`
	NextMission  NextMission      `xml:"nextMission" json:"nextMission"`
	//Branches     []ExternalReference[Mission] `xml:"branchMissions>branch" json:"branches"`
	Posting *BoardPosting `xml:"posting,omitempty" json:"posting,omitempty"`
	Email   Email         `xml:"email" json:"email"`
	*ProjectResource
}

type MissionFunctions

type MissionFunctions struct {
	Value         string `xml:",chardata" json:"function"`
	Suppress      *bool  `xml:"suppress,attr,omitempty" json:"suppress,omitempty"`
	FunctionValue *int   `xml:"val,attr,omitempty" json:"functionValue,omitempty"`
}

type NextMission

type NextMission struct {
	//Path   ExternalReference[Mission] `xml:",chardata" json:"path"`
	Silent bool `xml:"IsSilent" json:"silent"`
}

type NoteAttachment

type NoteAttachment struct {
	Title   string `xml:"title,attr" json:"title"`
	Content string `xml:",chardata" json:"content"`
}

func (*NoteAttachment) Type

func (n *NoteAttachment) Type() AttachmentType

type ProjectResource

type ProjectResource struct {
	Path string `xml:"-" json:"path"`
}

type RgbColour

type RgbColour []int

func (RgbColour) MarshalXML

func (rgb RgbColour) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*RgbColour) UnmarshalXML

func (rgb *RgbColour) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Theme

type Theme struct {
	XMLName         struct{}    `xml:"CustomTheme"`
	Layout          ThemeLayout `xml:"themeLayoutName"`
	BackgroundPath  string      `xml:"backgroundImagePath"`
	PreserveScaling bool        `xml:"UseAspectPreserveBackgroundScaling"`
	BackgroundFill  RgbColour   `xml:"BackgroundImageFillColor"`
	*MainColours
	*ExeColours
	*ExtraColours
	*ProjectResource
}

type ThemeLayout

type ThemeLayout string
const (
	Blue         ThemeLayout = "blue"
	Green        ThemeLayout = "green"
	White        ThemeLayout = "white"
	Mint         ThemeLayout = "mint"
	GreenCompact ThemeLayout = "greencompact"
	RipTide      ThemeLayout = "riptide"
	Colamaeleon  ThemeLayout = "colamaeleon"
	RipTide2     ThemeLayout = "riptide2"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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