serverapi

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package serverapi defines types that mirror the game server's JSON wire format.

These types are used exclusively for deserializing server responses and should change freely as the server evolves. Internal code should use the stable types defined in pkg/game/types.go instead.

Import direction: serverapi imports game (one-way). The game package imports serverapi only in client.go for parsing server responses.

Converter functions (e.g. PlayerToInternal) map external types to internal ones, filtering superfluous fields and normalizing data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzeMarketResponse

type AnalyzeMarketResponse struct {
	Mode            string           `json:"mode"`
	SkillLevel      int              `json:"skill_level"`
	ScanningRange   string           `json:"scanning_range"`
	StationsInRange int              `json:"stations_in_range,omitempty"`
	ItemsScanned    int              `json:"items_scanned,omitempty"`
	TopInsights     []map[string]any `json:"top_insights,omitempty"`
	TotalItems      int              `json:"total_items,omitempty"`
	TotalPages      int              `json:"total_pages,omitempty"`
	Page            int              `json:"page,omitempty"`
	Hint            string           `json:"hint,omitempty"`
	XPGained        map[string]any   `json:"xp_gained,omitempty"`
	Analysis        map[string]any   `json:"analysis,omitempty"`
}

AnalyzeMarketResponse wraps the response from analyze_market command.

type Base

type Base struct {
	ID           string          `json:"id"`
	Name         string          `json:"name"`
	Description  string          `json:"description,omitempty"`
	Type         string          `json:"type"`
	OwnerID      string          `json:"owner_id"`
	OwnerName    string          `json:"owner_name,omitempty"`
	FactionID    string          `json:"faction_id,omitempty"`
	Empire       string          `json:"empire,omitempty"`
	POIID        string          `json:"poi_id"`
	SystemID     string          `json:"system_id"`
	Services     map[string]bool `json:"services"`
	PublicAccess bool            `json:"public_access"`
	DefenseLevel int             `json:"defense_level"`
	HasDrones    bool            `json:"has_drones,omitempty"`
	Health       int             `json:"health,omitempty"`
	MaxHealth    int             `json:"max_health,omitempty"`
	Facilities   []string        `json:"facilities,omitempty"`
}

Base represents a player-owned or NPC base.

type BaseDestroyed

type BaseDestroyed struct {
	BaseID    string `json:"base_id"`
	BaseName  string `json:"base_name"`
	OwnerID   string `json:"owner_id"`
	OwnerName string `json:"owner_name"`
	WreckID   string `json:"wreck_id"`
	Message   string `json:"message"`
}

BaseDestroyed is sent when a base is destroyed. Server event type: base_destroyed

type BaseRaidUpdate

type BaseRaidUpdate struct {
	BaseID        string `json:"base_id"`
	BaseName      string `json:"base_name"`
	CurrentHealth int    `json:"current_health"`
	MaxHealth     int    `json:"max_health"`
	DamagePerTick int    `json:"damage_per_tick"`
	AttackerCount int    `json:"attacker_count"`
	Message       string `json:"message"`
}

BaseRaidUpdate is sent during a base raid. Server event type: base_raid_update

type BattleResponse

type BattleResponse struct {
	Action   string `json:"action"`
	BattleID string `json:"battle_id"`
	Message  string `json:"message"`
	Stance   string `json:"stance,omitempty"`
	TargetID string `json:"target_id,omitempty"`
}

BattleResponse wraps the response from battle command actions.

type BrowseShipsResponse

type BrowseShipsResponse struct {
	Action   string           `json:"action"`
	Listings []map[string]any `json:"listings"`
}

BrowseShipsResponse wraps the response from browse_ships command.

type CaptainsLogEntry

type CaptainsLogEntry struct {
	Index     int    `json:"index"`
	Entry     string `json:"entry"`
	CreatedAt string `json:"created_at"`
}

CaptainsLogEntry represents an entry in the captain's log.

type CargoItem

type CargoItem struct {
	ItemID   string  `json:"item_id"`
	Quantity float64 `json:"quantity"`
}

CargoItem represents an item in cargo. Used by both events and entity types.

type CatalogItem

type CatalogItem struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Category    string `json:"category,omitempty"`
	Rarity      string `json:"rarity,omitempty"`
	Size        int    `json:"size,omitempty"`
	BaseValue   int    `json:"base_value,omitempty"`
	Stackable   bool   `json:"stackable,omitempty"`
	Tradeable   bool   `json:"tradeable,omitempty"`
}

CatalogItem represents an item from the catalog API.

type CatalogResponse

type CatalogResponse struct {
	Type       string           `json:"type"`
	Items      []map[string]any `json:"items"`
	Total      int              `json:"total"`
	Page       int              `json:"page"`
	PageSize   int              `json:"page_size"`
	TotalPages int              `json:"total_pages"`
	Message    string           `json:"message,omitempty"`
}

CatalogResponse wraps the response from catalog command.

type ChatHistoryResponse

type ChatHistoryResponse struct {
	Action   string        `json:"action"`
	Messages []ChatMessage `json:"messages"`
	Channel  string        `json:"channel"`
}

ChatHistoryResponse wraps the response from get_chat_history command.

type ChatMessage

type ChatMessage struct {
	ID           string `json:"id"`
	Channel      string `json:"channel"`
	SenderID     string `json:"sender_id"`
	Sender       string `json:"sender"`
	Content      string `json:"content"`
	TargetID     string `json:"target_id,omitempty"`
	TargetName   string `json:"target_name,omitempty"`
	TimestampUTC string `json:"timestamp_utc"`
	Timestamp    string `json:"timestamp,omitempty"`
}

ChatMessage represents a chat message.

type ClaimInsuranceResponse

type ClaimInsuranceResponse struct {
	Action   string           `json:"action"`
	Policies []map[string]any `json:"policies"`
}

ClaimInsuranceResponse wraps the response from claim_insurance command.

type CombatUpdate

type CombatUpdate struct {
	Tick       int64   `json:"tick"`
	Attacker   string  `json:"attacker"`
	Target     string  `json:"target"`
	Damage     float64 `json:"damage"`
	DamageType string  `json:"damage_type"`
	ShieldHit  float64 `json:"shield_hit"`
	HullHit    float64 `json:"hull_hit"`
	Destroyed  bool    `json:"destroyed"`
}

CombatUpdate represents a combat event (player vs player or player vs pirate). Server event type: combat_update

type CommissionQuoteResponse

type CommissionQuoteResponse struct {
	ShipClass string         `json:"ship_class"`
	Quote     map[string]any `json:"quote"`
	Message   string         `json:"message"`
}

CommissionQuoteResponse wraps the response from commission_quote command.

type CommissionStatusResponse

type CommissionStatusResponse struct {
	Commissions []map[string]any `json:"commissions"`
	Count       int              `json:"count"`
}

CommissionStatusResponse wraps the response from commission_status command.

type ConnectionInfo

type ConnectionInfo struct {
	SystemID string `json:"system_id"`
	Name     string `json:"name"`
	Distance int    `json:"distance"`
}

ConnectionInfo represents a connection from one system to another.

type CurrentPOI

type CurrentPOI struct {
	ID       string   `json:"id"`
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	HasBase  bool     `json:"has_base"`
	BaseID   string   `json:"base_id,omitempty"`
	BaseName string   `json:"base_name,omitempty"`
	Online   int      `json:"online"`
	Position Position `json:"position,omitempty"`
}

CurrentPOI represents the current POI with minimal info (from get_system response).

type Drone

type Drone struct {
	ID        string `json:"id"`
	DroneType string `json:"drone_type"`
	ItemID    string `json:"item_id"`
	Status    string `json:"status"`
	Hull      int    `json:"hull"`
	MaxHull   int    `json:"max_hull"`
	Damage    int    `json:"damage,omitempty"`
	TargetID  string `json:"target_id,omitempty"`
	POIID     string `json:"poi_id"`
}

Drone represents a deployed drone.

type DroneDestroyed

type DroneDestroyed struct {
	DroneID   string `json:"drone_id"`
	DroneType string `json:"drone_type"`
	Message   string `json:"message"`
}

DroneDestroyed is sent when one of your drones is destroyed in combat. Server event type: drone_destroyed

type DroneUpdate

type DroneUpdate struct {
	Tick      int64   `json:"tick"`
	DroneID   string  `json:"drone_id"`
	TargetID  string  `json:"target_id"`
	Damage    float64 `json:"damage"`
	Destroyed bool    `json:"destroyed"`
}

DroneUpdate represents drone combat activity. Server event type: drone_update

type EstimatePurchaseResponse

type EstimatePurchaseResponse struct {
	Action    string  `json:"action"`
	ItemID    string  `json:"item_id"`
	Quantity  int     `json:"quantity"`
	TotalCost float64 `json:"total_cost"`
	Available int     `json:"available"`
	Message   string  `json:"message"`
}

EstimatePurchaseResponse wraps the response from estimate_purchase command.

type ExchangeOrder

type ExchangeOrder struct {
	ID             string `json:"id"`
	Type           string `json:"type"`
	ItemID         string `json:"item_id"`
	Quantity       int    `json:"quantity"`
	QuantityFilled int    `json:"quantity_filled,omitempty"`
	PriceEach      int    `json:"price_each"`
	SellerID       string `json:"seller_id,omitempty"`
	BuyerID        string `json:"buyer_id,omitempty"`
	BaseID         string `json:"base_id"`
	CreatedAt      string `json:"created_at"`
}

ExchangeOrder represents a buy or sell order on the station exchange.

type FacilityResponse

type FacilityResponse struct {
	Action       string           `json:"action"`
	Command      string           `json:"command,omitempty"`
	BaseID       string           `json:"base_id,omitempty"`
	FacilityID   string           `json:"facility_id,omitempty"`
	FacilityName string           `json:"facility_name,omitempty"`
	FacilityType string           `json:"facility_type,omitempty"`
	Description  string           `json:"description,omitempty"`
	Hint         string           `json:"hint,omitempty"`
	Message      string           `json:"message,omitempty"`
	Actions      []map[string]any `json:"actions,omitempty"`
	Types        []map[string]any `json:"types,omitempty"`
	Upgrades     []map[string]any `json:"upgrades,omitempty"`
}

FacilityResponse wraps the response from facility command.

type Faction

type Faction struct {
	ID             string          `json:"id"`
	Name           string          `json:"name"`
	Tag            string          `json:"tag"`
	LeaderID       string          `json:"leader_id"`
	LeaderName     string          `json:"leader_name,omitempty"`
	MemberCount    int             `json:"member_count"`
	Treasury       int             `json:"treasury,omitempty"`
	Members        []FactionMember `json:"members,omitempty"`
	Allies         []string        `json:"allies,omitempty"`
	Enemies        []string        `json:"enemies,omitempty"`
	AtWar          []FactionWar    `json:"at_war,omitempty"`
	PeaceProposals []PeaceProposal `json:"peace_proposals,omitempty"`
}

Faction represents faction information.

type FactionInfoResponse

type FactionInfoResponse struct {
	Action  string         `json:"action"`
	Faction map[string]any `json:"faction,omitempty"`
}

FactionInfoResponse wraps the response from faction_info command.

type FactionMember

type FactionMember struct {
	PlayerID string `json:"player_id"`
	Username string `json:"username"`
	Role     string `json:"role"`
	JoinedAt string `json:"joined_at"`
}

FactionMember represents a member of a faction.

type FactionWar

type FactionWar struct {
	FactionID   string `json:"faction_id"`
	FactionName string `json:"faction_name"`
	StartedAt   string `json:"started_at"`
	OurKills    int    `json:"our_kills"`
	TheirKills  int    `json:"their_kills"`
}

FactionWar represents an active war between factions.

type FindRouteResponse

type FindRouteResponse struct {
	Action string      `json:"action"`
	Route  []RouteStep `json:"route"`
	Jumps  int         `json:"jumps"`
}

FindRouteResponse wraps the response from find_route command.

type ForumListResponse

type ForumListResponse struct {
	Action  string           `json:"action"`
	Threads []map[string]any `json:"threads"`
	Page    int              `json:"page"`
}

ForumListResponse wraps the response from forum_list command.

type ForumThreadResponse

type ForumThreadResponse struct {
	Action  string           `json:"action"`
	Thread  map[string]any   `json:"thread"`
	Replies []map[string]any `json:"replies"`
}

ForumThreadResponse wraps the response from forum_get_thread command.

type GetActiveMissionsResponse

type GetActiveMissionsResponse struct {
	Action   string           `json:"action"`
	Missions []map[string]any `json:"missions"`
}

GetActiveMissionsResponse wraps the response from get_active_missions command.

type GetBaseResponse

type GetBaseResponse struct {
	Action    string            `json:"action"`
	Base      *Base             `json:"base"`
	POI       POI               `json:"poi,omitempty"`
	Resources []ResourceDisplay `json:"resources,omitempty"`
	Services  []string          `json:"services,omitempty"`
	Market    []MarketListing   `json:"market,omitempty"`
}

GetBaseResponse wraps the response from get_base command.

type GetBattleStatusResponse

type GetBattleStatusResponse struct {
	BattleID      string           `json:"battle_id"`
	SystemID      string           `json:"system_id"`
	IsParticipant bool             `json:"is_participant"`
	Participants  []map[string]any `json:"participants"`
	Sides         []map[string]any `json:"sides"`
	TickDuration  int              `json:"tick_duration"`
}

GetBattleStatusResponse wraps the response from get_battle_status command.

type GetCargoResponse

type GetCargoResponse struct {
	Action    string      `json:"action"`
	Cargo     []CargoItem `json:"cargo"`
	Used      float64     `json:"used"`
	Capacity  float64     `json:"capacity"`
	Available float64     `json:"available"`
}

GetCargoResponse wraps the response from get_cargo command.

type GetCommandsResponse

type GetCommandsResponse struct {
	Action   string           `json:"action"`
	Commands []map[string]any `json:"commands"`
}

GetCommandsResponse wraps the response from get_commands command.

type GetDronesResponse

type GetDronesResponse struct {
	Action string  `json:"action"`
	Drones []Drone `json:"drones"`
}

GetDronesResponse wraps the response from get_drones command.

type GetGuideResponse

type GetGuideResponse struct {
	Action string `json:"action"`
	Guide  string `json:"guide"`
	Title  string `json:"title"`
}

GetGuideResponse wraps the response from get_guide command.

type GetInsuranceQuoteResponse

type GetInsuranceQuoteResponse struct {
	Message string         `json:"message"`
	Quote   map[string]any `json:"quote"`
}

GetInsuranceQuoteResponse wraps the response from get_insurance_quote command.

type GetListingsResponse

type GetListingsResponse struct {
	Action      string          `json:"action"`
	Listings    []MarketListing `json:"listings"`
	StationID   string          `json:"station_id"`
	StationName string          `json:"station_name"`
}

GetListingsResponse wraps the response from get_listings command.

type GetMapResponse

type GetMapResponse struct {
	Systems []MapSystem `json:"systems"`
}

GetMapResponse wraps the response from get_map command.

type GetMissionsResponse

type GetMissionsResponse struct {
	Action   string           `json:"action"`
	Missions []map[string]any `json:"missions"`
	BaseName string           `json:"base_name"`
	BaseID   string           `json:"base_id"`
}

GetMissionsResponse wraps the response from get_missions command.

type GetNotesResponse

type GetNotesResponse struct {
	Action string `json:"action"`
	Notes  []Note `json:"notes"`
}

GetNotesResponse wraps the response from get_notes command.

type GetPOIResponse

type GetPOIResponse struct {
	Action string `json:"action"`
	POI    POI    `json:"poi"`
}

GetPOIResponse wraps the response from get_poi command.

type GetRecipesResponse

type GetRecipesResponse struct {
	Action  string            `json:"action"`
	Recipes map[string]Recipe `json:"recipes"`
}

GetRecipesResponse wraps the response from get_recipes command.

type GetShipsResponse

type GetShipsResponse struct {
	Action      string      `json:"action"`
	Ships       []ShipClass `json:"ships"`
	StationID   string      `json:"station_id"`
	StationName string      `json:"station_name"`
}

GetShipsResponse wraps the response from get_ships/shipyard_showroom command.

type GetSkillsResponse

type GetSkillsResponse struct {
	Action       string                     `json:"action"`
	Skills       map[string]SkillDefinition `json:"skills"`
	PlayerSkills []PlayerSkill              `json:"player_skills"`
}

GetSkillsResponse wraps the response from get_skills command.

type GetStatusResponse

type GetStatusResponse struct {
	Action      string         `json:"action"`
	Player      Player         `json:"player"`
	Ship        Ship           `json:"ship"`
	System      SystemData     `json:"system"`
	POI         POI            `json:"poi"`
	Nearby      []NearbyPlayer `json:"nearby"`
	CurrentTick int64          `json:"current_tick"`
}

GetStatusResponse wraps the response from get_status command.

type GetSystemResponse

type GetSystemResponse struct {
	Action         string     `json:"action"`
	POI            CurrentPOI `json:"poi"`
	SecurityStatus string     `json:"security_status"`
	System         SystemData `json:"system"`
}

GetSystemResponse wraps the response from get_system command.

type GetTradesResponse

type GetTradesResponse struct {
	Action string           `json:"action"`
	Trades []map[string]any `json:"trades"`
}

GetTradesResponse wraps the response from get_trades command.

type GetVersionResponse

type GetVersionResponse struct {
	Action       string           `json:"action"`
	Version      string           `json:"version"`
	ReleaseDate  string           `json:"release_date"`
	ReleaseNotes []string         `json:"release_notes"`
	Changelog    []map[string]any `json:"changelog,omitempty"`
}

GetVersionResponse wraps the response from get_version command.

type GetWrecksResponse

type GetWrecksResponse struct {
	Action string  `json:"action"`
	Wrecks []Wreck `json:"wrecks"`
}

GetWrecksResponse wraps the response from get_wrecks command.

type ListShipsResponse

type ListShipsResponse struct {
	Ships           []map[string]any `json:"ships"`
	Count           int              `json:"count"`
	ActiveShipID    string           `json:"active_ship_id"`
	ActiveShipClass string           `json:"active_ship_class"`
}

ListShipsResponse wraps the response from list_ships command.

type LoginResponse

type LoginResponse struct {
	Player        Player           `json:"player"`
	Ship          Ship             `json:"ship"`
	System        SystemData       `json:"system"`
	POI           POI              `json:"poi"`
	CaptainsLog   []map[string]any `json:"captains_log,omitempty"`
	PendingTrades []map[string]any `json:"pending_trades,omitempty"`
}

LoginResponse wraps the response from the logged_in message.

type MapSystem

type MapSystem struct {
	SystemID    string   `json:"system_id"`
	Name        string   `json:"name"`
	Position    Position `json:"position"`
	Connections []string `json:"connections"`
	POICount    int      `json:"poi_count"`
	Online      int      `json:"online"`
	Visited     bool     `json:"visited"`
	VisitedAt   string   `json:"visited_at"`
	Empire      string   `json:"empire,omitempty"`
}

MapSystem represents a system in the galaxy map (from get_map).

type MarketListing

type MarketListing struct {
	ItemID       string  `json:"item_id"`
	ItemType     string  `json:"item_type"`
	Quantity     float64 `json:"quantity"`
	PricePerUnit float64 `json:"price_per_unit"`
	PriceEach    float64 `json:"price_each"`
	TotalPrice   float64 `json:"total_price"`
	Total        float64 `json:"total"`
	Type         string  `json:"type"`
	ListedBy     string  `json:"listed_by,omitempty"`
	Seller       string  `json:"seller,omitempty"`
}

MarketListing represents a single market listing.

type MarketOrder

type MarketOrder struct {
	PriceEach float64 `json:"price_each"`
	Quantity  float64 `json:"quantity"`
}

MarketOrder represents a single buy or sell order in the market order book.

type MiningYield

type MiningYield struct {
	ResourceID string  `json:"resource_id"`
	Quantity   float64 `json:"quantity"`
	Remaining  float64 `json:"remaining"`
}

MiningYield represents successful mining action with resource extraction. Server event type: mining_yield

type Mission

type Mission struct {
	ID          string             `json:"id"`
	Type        string             `json:"type"`
	Title       string             `json:"title"`
	Description string             `json:"description"`
	Giver       string             `json:"giver"`
	GiverBaseID string             `json:"giver_base_id"`
	Rewards     MissionRewards     `json:"rewards"`
	Objectives  []MissionObjective `json:"objectives"`
	Difficulty  int                `json:"difficulty"`
	ExpiresAt   string             `json:"expires_at,omitempty"`
	AcceptedAt  string             `json:"accepted_at,omitempty"`
	Progress    map[string]int     `json:"progress,omitempty"`
}

Mission represents a mission from a mission board.

type MissionObjective

type MissionObjective struct {
	Type        string `json:"type"`
	Description string `json:"description"`
	ItemID      string `json:"item_id,omitempty"`
	Quantity    int    `json:"quantity,omitempty"`
	TargetID    string `json:"target_id,omitempty"`
	Completed   bool   `json:"completed,omitempty"`
}

MissionObjective represents a single objective in a mission.

type MissionRewards

type MissionRewards struct {
	Credits int            `json:"credits"`
	Items   []RecipeItem   `json:"items,omitempty"`
	SkillXP map[string]int `json:"skill_xp,omitempty"`
}

MissionRewards represents mission completion rewards.

type ModuleDefinition

type ModuleDefinition struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

ModuleDefinition represents a module's definition including stats and requirements.

type NearbyPlayer

type NearbyPlayer struct {
	PlayerID       string `json:"player_id"`
	Username       string `json:"username"`
	ShipClass      string `json:"ship_class"`
	PrimaryColor   string `json:"primary_color,omitempty"`
	SecondaryColor string `json:"secondary_color,omitempty"`
	Anonymous      bool   `json:"anonymous"`
	InCombat       bool   `json:"in_combat"`
	FactionID      string `json:"faction_id,omitempty"`
	FactionTag     string `json:"faction_tag,omitempty"`
	StatusMessage  string `json:"status_message,omitempty"`
	ClanTag        string `json:"clan_tag,omitempty"`
}

NearbyPlayer represents another player or pirate NPC at the same POI.

type Note

type Note struct {
	ID         string `json:"id"`
	Title      string `json:"title"`
	Content    string `json:"content,omitempty"`
	AuthorID   string `json:"author_id"`
	AuthorName string `json:"author_name,omitempty"`
	CreatedAt  string `json:"created_at"`
	Value      int    `json:"value"`
}

Note represents a tradeable text document.

type POI

type POI struct {
	ID          string        `json:"id"`
	SystemID    string        `json:"system_id"`
	Type        string        `json:"type"`
	Name        string        `json:"name"`
	Description string        `json:"description"`
	Position    Position      `json:"position"`
	Resources   []POIResource `json:"resources"`
	BaseID      string        `json:"base_id,omitempty"`
	HasBase     bool          `json:"has_base,omitempty"`
	BaseName    string        `json:"base_name,omitempty"`
	Online      int           `json:"online,omitempty"`
	Hidden      bool          `json:"hidden,omitempty"`
}

POI represents a Point of Interest in a system.

type POIArrival

type POIArrival struct {
	Username string `json:"username"`
	ClanTag  string `json:"clan_tag"`
	POIName  string `json:"poi_name"`
	POIID    string `json:"poi_id"`
}

POIArrival is broadcast when a player arrives at your POI. Server event type: poi_arrival

type POIDeparture

type POIDeparture struct {
	Username string `json:"username"`
	ClanTag  string `json:"clan_tag"`
	POIName  string `json:"poi_name"`
	POIID    string `json:"poi_id"`
}

POIDeparture is broadcast when a player leaves your POI. Server event type: poi_departure

type POIResource

type POIResource struct {
	ResourceID       string  `json:"resource_id"`
	Name             string  `json:"name,omitempty"`
	Richness         float64 `json:"richness"`
	Remaining        float64 `json:"remaining"`
	RemainingDisplay string  `json:"remaining_display,omitempty"`
}

POIResource represents a minable resource at a POI.

type PeaceProposal

type PeaceProposal struct {
	FromFactionID   string `json:"from_faction_id"`
	FromFactionName string `json:"from_faction_name"`
	Terms           string `json:"terms,omitempty"`
	ProposedAt      string `json:"proposed_at"`
}

PeaceProposal represents a peace proposal between factions.

type PilotlessShip

type PilotlessShip struct {
	PlayerID       string `json:"player_id"`
	PlayerUsername string `json:"player_username"`
	ShipID         string `json:"ship_id"`
	ShipClass      string `json:"ship_class"`
	SystemID       string `json:"system_id"`
	POIID          string `json:"poi_id"`
	ExpireTick     int64  `json:"expire_tick"`
	TicksRemaining int    `json:"ticks_remaining"`
}

PilotlessShip represents a player who disconnected during combat. Server event type: pilotless_ship

type PirateCombat

type PirateCombat struct {
	Tick         int64   `json:"tick"`
	PirateID     string  `json:"pirate_id"`
	PirateName   string  `json:"pirate_name"`
	Damage       float64 `json:"damage"`
	DamageType   string  `json:"damage_type"`
	PlayerHull   float64 `json:"player_hull"`
	PlayerShield float64 `json:"player_shield"`
	Destroyed    bool    `json:"destroyed"`
}

PirateCombat represents pirate NPC combat (damage dealt each tick). Server event type: pirate_combat

type PirateDestroyed

type PirateDestroyed struct {
	PirateID      string  `json:"pirate_id"`
	PirateName    string  `json:"pirate_name"`
	Tier          string  `json:"tier"`
	IsBoss        bool    `json:"is_boss"`
	CreditsReward int     `json:"credits_reward"`
	XPGained      float64 `json:"xp_gained"`
	WreckID       string  `json:"wreck_id"`
	Message       string  `json:"message"`
}

PirateDestroyed is sent when you destroy a pirate NPC. Server event type: pirate_destroyed

type PirateSpawn

type PirateSpawn struct {
	PirateID   string `json:"pirate_id"`
	PirateName string `json:"pirate_name"`
	Tier       string `json:"tier"`
	IsBoss     bool   `json:"is_boss"`
	Message    string `json:"message"`
}

PirateSpawn is sent when a pirate NPC respawns at your current POI. Server event type: pirate_spawn

type PirateWarning

type PirateWarning struct {
	PirateID      string `json:"pirate_id"`
	PirateName    string `json:"pirate_name"`
	Tier          string `json:"tier"`
	IsBoss        bool   `json:"is_boss"`
	AttackInTicks int    `json:"attack_in_ticks"`
	Message       string `json:"message"`
}

PirateWarning is sent when a pirate NPC detects you at their POI. Server event type: pirate_warning

type Player

type Player struct {
	ID                string                      `json:"id"`
	Username          string                      `json:"username"`
	Empire            string                      `json:"empire"`
	Credits           float64                     `json:"credits"`
	CurrentSystem     string                      `json:"current_system"`
	CurrentPOI        string                      `json:"current_poi"`
	CurrentShipID     string                      `json:"current_ship_id"`
	HomeBase          string                      `json:"home_base"`
	DockedAtBase      string                      `json:"docked_at_base"`
	FactionID         string                      `json:"faction_id,omitempty"`
	FactionRank       string                      `json:"faction_rank,omitempty"`
	StatusMessage     string                      `json:"status_message,omitempty"`
	ClanTag           string                      `json:"clan_tag,omitempty"`
	PrimaryColor      string                      `json:"primary_color,omitempty"`
	SecondaryColor    string                      `json:"secondary_color,omitempty"`
	Anonymous         bool                        `json:"anonymous"`
	IsCloaked         bool                        `json:"is_cloaked"`
	Skills            map[string]Skill            `json:"skills"`
	SkillXP           map[string]float64          `json:"skill_xp,omitempty"`
	Stats             PlayerStats                 `json:"stats"`
	Modules           map[string]ModuleDefinition `json:"modules,omitempty"`
	TowingWreckID     string                      `json:"towing_wreck_id,omitempty"`
	Experience        int64                       `json:"experience,omitempty"`
	DiscoveredSystems map[string]any              `json:"discovered_systems,omitempty"`
	LastActiveAt      string                      `json:"last_active_at,omitempty"`
	LastLoginAt       string                      `json:"last_login_at,omitempty"`
	CreatedAt         string                      `json:"created_at,omitempty"`
}

Player represents a player in the game as returned by the server.

type PlayerDied

type PlayerDied struct {
	KillerID        string           `json:"killer_id"`
	KillerName      string           `json:"killer_name"`
	RespawnBase     string           `json:"respawn_base"`
	Cause           string           `json:"cause,omitempty"`
	CombatLog       []map[string]any `json:"combat_log,omitempty"`
	CloneCost       int              `json:"clone_cost"`
	InsurancePayout int              `json:"insurance_payout"`
	ShipLost        string           `json:"ship_lost"`
	NewShipClass    string           `json:"new_ship_class"`
	WreckID         string           `json:"wreck_id"`
}

PlayerDied represents ship destruction and respawn in an Escape Pod. Server event type: player_died

type PlayerSkill

type PlayerSkill struct {
	SkillID     string  `json:"skill_id"`
	Name        string  `json:"name"`
	Category    string  `json:"category"`
	Level       int     `json:"level"`
	MaxLevel    int     `json:"max_level"`
	CurrentXP   float64 `json:"current_xp"`
	NextLevelXP float64 `json:"next_level_xp"`
}

PlayerSkill represents a player's progress in a specific skill.

type PlayerStats

type PlayerStats struct {
	ShipsDestroyed    int     `json:"ships_destroyed"`
	TimesDestroyed    int     `json:"times_destroyed"`
	OreMined          float64 `json:"ore_mined"`
	CreditsEarned     float64 `json:"credits_earned"`
	CreditsSpent      float64 `json:"credits_spent"`
	TradesCompleted   int     `json:"trades_completed"`
	SystemsDiscovered int     `json:"systems_discovered"`
	ItemsCrafted      int     `json:"items_crafted"`
	MissionsCompleted int     `json:"missions_completed"`
	BasesDestroyed    int     `json:"bases_destroyed"`
	DistanceTraveled  int64   `json:"distance_traveled"`
	PiratesDestroyed  int     `json:"pirates_destroyed"`
	ShipsLost         int     `json:"ships_lost"`
	TimePlayed        int64   `json:"time_played"`
}

PlayerStats tracks player statistics and lifetime achievements.

type PoliceCombat

type PoliceCombat struct {
	Tick       int64   `json:"tick"`
	DroneID    string  `json:"drone_id"`
	TargetID   string  `json:"target_id"`
	Damage     float64 `json:"damage"`
	DamageType string  `json:"damage_type"`
	Destroyed  bool    `json:"destroyed"`
}

PoliceCombat represents police drone combat (damage dealt each tick). Server event type: police_combat

type PoliceSpawn

type PoliceSpawn struct {
	Message   string `json:"message"`
	NumDrones int    `json:"num_drones"`
	Target    string `json:"target"`
}

PoliceSpawn is sent when police drones arrive to engage hostile. Server event type: police_spawn

type PoliceWarning

type PoliceWarning struct {
	Message       string `json:"message"`
	PoliceLevel   int    `json:"police_level"`
	ResponseTicks int    `json:"response_ticks"`
	System        string `json:"system"`
}

PoliceWarning is sent when you commit a crime in policed space. Server event type: police_warning

type Position

type Position struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
	Z float64 `json:"z,omitempty"`
}

Position represents 3D coordinates.

type ReadNoteResponse

type ReadNoteResponse struct {
	Action string `json:"action"`
	Note   Note   `json:"note"`
}

ReadNoteResponse wraps the response from read_note command.

type Recipe

type Recipe struct {
	ID              string         `json:"id"`
	Name            string         `json:"name"`
	Description     string         `json:"description,omitempty"`
	Category        string         `json:"category"`
	RequiredSkills  map[string]int `json:"required_skills,omitempty"`
	Inputs          []RecipeItem   `json:"inputs"`
	Outputs         []RecipeItem   `json:"outputs"`
	CraftingTime    int            `json:"crafting_time"`
	BaseQuality     int            `json:"base_quality,omitempty"`
	SkillQualityMod int            `json:"skill_quality_mod,omitempty"`
}

Recipe represents a crafting recipe.

type RecipeItem

type RecipeItem struct {
	ItemID     string `json:"item_id"`
	Quantity   int    `json:"quantity"`
	QualityMod bool   `json:"quality_mod,omitempty"`
}

RecipeItem represents an item requirement or output in a recipe.

type ReconnectedMessage

type ReconnectedMessage struct {
	Message        string `json:"message"`
	WasPilotless   bool   `json:"was_pilotless"`
	TicksRemaining int    `json:"ticks_remaining"`
}

ReconnectedMessage is sent when you reconnect after disconnecting during combat. Server event type: reconnected

type ResourceDisplay

type ResourceDisplay struct {
	ResourceID       string  `json:"resource_id"`
	Name             string  `json:"name"`
	Richness         float64 `json:"richness"`
	Remaining        float64 `json:"remaining"`
	RemainingDisplay string  `json:"remaining_display"`
}

ResourceDisplay represents a resource with display information.

type RouteStep

type RouteStep struct {
	SystemID string `json:"system_id"`
	Name     string `json:"name"`
	Jumps    int    `json:"jumps"`
}

RouteStep represents a step in a route from find_route.

type ScanDetected

type ScanDetected struct {
	ScannerID        string   `json:"scanner_id"`
	ScannerUsername  string   `json:"scanner_username"`
	ScannerShipClass string   `json:"scanner_ship_class"`
	RevealedInfo     []string `json:"revealed_info"`
	Message          string   `json:"message"`
}

ScanDetected is sent when you are scanned by another player. Server event type: scan_detected

type ScanResult

type ScanResult struct {
	TargetID     string   `json:"target_id"`
	Success      bool     `json:"success"`
	RevealedInfo []string `json:"revealed_info"`
	Username     string   `json:"username,omitempty"`
	ShipClass    string   `json:"ship_class,omitempty"`
	Hull         float64  `json:"hull,omitempty"`
	Shield       float64  `json:"shield,omitempty"`
	Cloaked      bool     `json:"cloaked,omitempty"`
}

ScanResult represents the results of scanning a player. Server event type: scan_result

type SearchChangelogResponse

type SearchChangelogResponse struct {
	Action  string           `json:"action"`
	Results []map[string]any `json:"results"`
}

SearchChangelogResponse wraps the response from search_changelog command.

type SearchSystemsResponse

type SearchSystemsResponse struct {
	Action  string               `json:"action"`
	Results []SystemSearchResult `json:"results"`
}

SearchSystemsResponse wraps the response from search_systems command.

type SendGiftResponse

type SendGiftResponse struct {
	Action    string `json:"action"`
	Message   string `json:"message"`
	Recipient string `json:"recipient"`
}

SendGiftResponse wraps the response from send_gift command.

type Ship

type Ship struct {
	ID                       string           `json:"id"`
	OwnerID                  string           `json:"owner_id"`
	ClassID                  string           `json:"class_id"`
	Name                     string           `json:"name"`
	Hull                     float64          `json:"hull"`
	MaxHull                  float64          `json:"max_hull"`
	Shield                   float64          `json:"shield"`
	MaxShield                float64          `json:"max_shield"`
	ShieldRecharge           float64          `json:"shield_recharge"`
	Armor                    float64          `json:"armor"`
	Speed                    float64          `json:"speed"`
	Fuel                     float64          `json:"fuel"`
	MaxFuel                  float64          `json:"max_fuel"`
	CargoUsed                float64          `json:"cargo_used"`
	CargoCapacity            float64          `json:"cargo_capacity"`
	CPUUsed                  float64          `json:"cpu_used"`
	CPUCapacity              float64          `json:"cpu_capacity"`
	PowerUsed                float64          `json:"power_used"`
	PowerCapacity            float64          `json:"power_capacity"`
	WeaponSlots              int              `json:"weapon_slots"`
	DefenseSlots             int              `json:"defense_slots"`
	UtilitySlots             int              `json:"utility_slots"`
	Modules                  []string         `json:"modules"`
	Cargo                    []CargoItem      `json:"cargo"`
	ActiveBuffs              []map[string]any `json:"active_buffs,omitempty"`
	DamagePenalty            float64          `json:"damage_penalty,omitempty"`
	SpeedPenalty             float64          `json:"speed_penalty,omitempty"`
	DisruptionTicksRemaining int              `json:"disruption_ticks_remaining,omitempty"`
	DockedAtBase             string           `json:"docked_at_base,omitempty"`
	LastProcessTick          int64            `json:"last_process_tick,omitempty"`
	CreatedAt                string           `json:"created_at,omitempty"`
}

Ship represents the player's ship with all stats, modules, and cargo.

type ShipClass

type ShipClass struct {
	ID                 string         `json:"id"`
	Name               string         `json:"name"`
	Class              string         `json:"class,omitempty"`
	Category           string         `json:"category,omitempty"`
	Description        string         `json:"description,omitempty"`
	Lore               string         `json:"lore,omitempty"`
	Faction            string         `json:"faction,omitempty"`
	Tier               int            `json:"tier,omitempty"`
	Scale              int            `json:"scale,omitempty"`
	Price              int            `json:"price"`
	BaseHull           int            `json:"base_hull"`
	BaseShield         int            `json:"base_shield,omitempty"`
	BaseShieldRecharge int            `json:"base_shield_recharge,omitempty"`
	BaseArmor          int            `json:"base_armor,omitempty"`
	BaseSpeed          int            `json:"base_speed"`
	BaseFuel           int            `json:"base_fuel"`
	CargoCapacity      int            `json:"cargo_capacity"`
	CPUCapacity        int            `json:"cpu_capacity"`
	PowerCapacity      int            `json:"power_capacity"`
	WeaponSlots        int            `json:"weapon_slots"`
	DefenseSlots       int            `json:"defense_slots"`
	UtilitySlots       int            `json:"utility_slots"`
	BuildTime          int            `json:"build_time,omitempty"`
	ShipyardTier       int            `json:"shipyard_tier,omitempty"`
	StarterShip        bool           `json:"starter_ship,omitempty"`
	RequiredSkills     map[string]int `json:"required_skills,omitempty"`
	DefaultModules     []string       `json:"default_modules,omitempty"`
	BuildMaterials     []RecipeItem   `json:"build_materials,omitempty"`
	FlavorTags         []string       `json:"flavor_tags,omitempty"`
	TowSpeedBonus      int            `json:"tow_speed_bonus,omitempty"`
}

ShipClass represents a ship class definition with stats, price, and requirements.

type ShipyardShowroomResponse

type ShipyardShowroomResponse struct {
	Action string           `json:"action"`
	Ships  []map[string]any `json:"ships"`
}

ShipyardShowroomResponse wraps the response from shipyard_showroom command.

type Skill

type Skill struct {
	Level int     `json:"level"`
	XP    float64 `json:"xp"`
}

Skill represents a player's skill level and XP. The server may send skills as either a plain number (level only) or an object with level and xp fields. UnmarshalJSON handles both formats.

func (*Skill) UnmarshalJSON

func (s *Skill) UnmarshalJSON(data []byte) error

UnmarshalJSON handles both simple (number) and detailed (object) skill formats.

type SkillDefinition

type SkillDefinition struct {
	ID             string             `json:"id"`
	Name           string             `json:"name"`
	Description    string             `json:"description,omitempty"`
	Category       string             `json:"category,omitempty"`
	MaxLevel       int                `json:"max_level"`
	XpPerLevel     []float64          `json:"xp_per_level"`
	BonusPerLevel  map[string]float64 `json:"bonus_per_level,omitempty"`
	RequiredSkills map[string]int     `json:"required_skills,omitempty"`
	TrainingSource string             `json:"training_source,omitempty"`
}

SkillDefinition holds static skill data.

type SkillLevelUp

type SkillLevelUp struct {
	SkillID  string  `json:"skill_id"`
	NewLevel int     `json:"new_level"`
	XPGained float64 `json:"xp_gained"`
}

SkillLevelUp is sent when you level up a skill through passive training. Server event type: skill_level_up

type Storage

type Storage struct {
	BaseID   string           `json:"base_id"`
	BaseName string           `json:"base_name"`
	Items    []CargoItem      `json:"items"`
	Credits  int              `json:"credits"`
	Ships    []map[string]any `json:"ships,omitempty"`
	Gifts    []map[string]any `json:"gifts,omitempty"`
}

Storage represents items and credits stored at a station.

type SurveySystemResponse

type SurveySystemResponse struct {
	Action   string           `json:"action"`
	Message  string           `json:"message"`
	Deposits []map[string]any `json:"deposits,omitempty"`
	XPGained map[string]any   `json:"xp_gained,omitempty"`
}

SurveySystemResponse wraps the response from survey_system command.

type SystemData

type SystemData struct {
	ID             string           `json:"id"`
	Name           string           `json:"name"`
	Description    string           `json:"description"`
	Empire         string           `json:"empire"`
	PoliceLevel    int              `json:"police_level"`
	SecurityStatus string           `json:"security_status,omitempty"`
	IsStronghold   bool             `json:"is_stronghold,omitempty"`
	Online         int              `json:"online,omitempty"`
	POIs           []POI            `json:"pois"`
	Connections    []ConnectionInfo `json:"connections"`
	Discovered     bool             `json:"discovered"`
	Position       Position         `json:"position"`
	DiscoveredBy   string           `json:"discovered_by,omitempty"`
}

SystemData holds complete system information.

type SystemSearchResult

type SystemSearchResult struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Position    Position `json:"position"`
	Connections []string `json:"connections"`
}

SystemSearchResult represents a system from search_systems.

type TradeOffer

type TradeOffer struct {
	TradeID        string      `json:"trade_id"`
	FromPlayer     string      `json:"from_player"`
	FromName       string      `json:"from_name"`
	OfferItems     []CargoItem `json:"offer_items"`
	OfferCredits   int         `json:"offer_credits"`
	RequestItems   []CargoItem `json:"request_items"`
	RequestCredits int         `json:"request_credits"`
}

TradeOffer represents an incoming trade offer from another player. Server event type: trade_offer_received

type TravelProgress

type TravelProgress struct {
	Progress    float64 `json:"travel_progress"`
	Destination string  `json:"travel_destination"`
	Type        string  `json:"travel_type"`
	ArrivalTick int64   `json:"travel_arrival_tick"`
}

TravelProgress represents travel state when in transit.

type ViewMarketItem

type ViewMarketItem struct {
	ItemID     string        `json:"item_id"`
	ItemName   string        `json:"item_name"`
	BestBuy    float64       `json:"best_buy"`
	BestSell   float64       `json:"best_sell"`
	BuyOrders  []MarketOrder `json:"buy_orders"`
	SellOrders []MarketOrder `json:"sell_orders"`
}

ViewMarketItem represents an item in the aggregated market order book returned by the view_market command. Each item shows the best buy/sell prices and full order book.

type ViewMarketResponse

type ViewMarketResponse struct {
	Action string           `json:"action"`
	Base   map[string]any   `json:"base,omitempty"`
	Items  []ViewMarketItem `json:"items"`
}

ViewMarketResponse wraps the response from view_market command.

type ViewOrdersResponse

type ViewOrdersResponse struct {
	Action string          `json:"action"`
	Orders []ExchangeOrder `json:"orders"`
}

ViewOrdersResponse wraps the response from view_orders command.

type ViewStorageResponse

type ViewStorageResponse struct {
	BaseID  string           `json:"base_id"`
	Credits int              `json:"credits"`
	Items   []CargoItem      `json:"items"`
	Ships   []map[string]any `json:"ships,omitempty"`
	Gifts   []map[string]any `json:"gifts,omitempty"`
}

ViewStorageResponse wraps the response from view_storage command.

type Wreck

type Wreck struct {
	ID        string      `json:"id"`
	ShipClass string      `json:"ship_class"`
	OwnerID   string      `json:"owner_id,omitempty"`
	OwnerName string      `json:"owner_name,omitempty"`
	POIID     string      `json:"poi_id"`
	Contents  []CargoItem `json:"contents"`
	ExpiresAt string      `json:"expires_at"`
}

Wreck represents a destroyed ship's wreckage.

Jump to

Keyboard shortcuts

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