protocol

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: 0 Imported by: 0 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

Index

Constants

View Source
const (
	// Connection and Authentication
	TypeWelcome    = "welcome"
	TypeRegistered = "registered"
	TypeLoggedIn   = "logged_in"

	// Action responses
	TypeOK          = "ok"
	TypeError       = "error"
	TypeActionError = "action_error"
	TypeDocked      = "docked"
	TypeUndocked    = "undocked"
	TypeStateUpdate = "state_update"
	TypeTick        = "tick"
	TypeListings    = "listings"

	// Game events
	TypeChatMessage        = "chat_message"
	TypeCombatUpdate       = "combat_update"
	TypePlayerDied         = "player_died"
	TypeMining             = "mining"
	TypeMiningYield        = "mining_yield"
	TypeScanResult         = "scan_result"
	TypeScanDetected       = "scan_detected"
	TypeTradeOfferReceived = "trade_offer_received"

	// Travel and location events
	TypePOIArrival   = "poi_arrival"
	TypePOIDeparture = "poi_departure"

	// Combat and ship events
	TypePilotlessShip = "pilotless_ship"
	TypeReconnected   = "reconnected"

	// Police system events
	TypePoliceWarning  = "police_warning"
	TypePoliceSpawn    = "police_spawn"
	TypePoliceCombat   = "police_combat"
	TypePoliceResponse = "police_response"

	// Pirate system events
	TypePirateWarning   = "pirate_warning"
	TypePirateCombat    = "pirate_combat"
	TypePirateDestroyed = "pirate_destroyed"
	TypePirateSpawn     = "pirate_spawn"

	// Drone system events
	TypeDroneUpdate    = "drone_update"
	TypeDroneDestroyed = "drone_destroyed"

	// Base building and raiding events
	TypeBaseRaidUpdate = "base_raid_update"
	TypeBaseDestroyed  = "base_destroyed"

	// Skill progression events
	TypeSkillLevelUp = "skill_level_up"

	// Gameplay tips and notifications
	TypeGameplayTip = "gameplay_tip"
)

Message types sent to/from the Spacemolt server

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type      string         `json:"type"`
	Payload   map[string]any `json:"payload,omitempty"`
	Timestamp int64          `json:"timestamp,omitempty"`
}

Message represents a message sent to the server

type Response

type Response struct {
	Type    string         `json:"type"`
	Payload map[string]any `json:"payload,omitempty"`
}

Response represents a message received from the server

Jump to

Keyboard shortcuts

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