websocket

package
v5.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend streams mission data over WebSocket to the OCAP2 web server. It implements storage.Backend but not storage.Uploadable.

func New

func New(cfg Config) *Backend

New creates a new WebSocket storage backend.

func (*Backend) AddMarker

func (b *Backend) AddMarker(m *core.Marker) (uint, error)

AddMarker assigns an auto-increment ID and sends the marker. Returns the assigned ID.

func (*Backend) AddPlacedObject

func (b *Backend) AddPlacedObject(p *core.PlacedObject) error

func (*Backend) AddSoldier

func (b *Backend) AddSoldier(s *core.Soldier) error

func (*Backend) AddVehicle

func (b *Backend) AddVehicle(v *core.Vehicle) error

func (*Backend) Close

func (b *Backend) Close() error

Close disconnects from the WebSocket server.

func (*Backend) DeleteMarker

func (b *Backend) DeleteMarker(dm *core.DeleteMarker) error

func (*Backend) EndMission

func (b *Backend) EndMission() error

EndMission sends end_mission and waits for server ack.

func (*Backend) Init

func (b *Backend) Init() error

Init connects to the WebSocket server.

func (*Backend) RecordAce3DeathEvent

func (b *Backend) RecordAce3DeathEvent(e *core.Ace3DeathEvent) error

func (*Backend) RecordAce3UnconsciousEvent

func (b *Backend) RecordAce3UnconsciousEvent(e *core.Ace3UnconsciousEvent) error

func (*Backend) RecordChatEvent

func (b *Backend) RecordChatEvent(e *core.ChatEvent) error

func (*Backend) RecordFiredEvent

func (b *Backend) RecordFiredEvent(e *core.FiredEvent) error

func (*Backend) RecordGeneralEvent

func (b *Backend) RecordGeneralEvent(e *core.GeneralEvent) error

func (*Backend) RecordHitEvent

func (b *Backend) RecordHitEvent(e *core.HitEvent) error

func (*Backend) RecordKillEvent

func (b *Backend) RecordKillEvent(e *core.KillEvent) error

func (*Backend) RecordMarkerState

func (b *Backend) RecordMarkerState(s *core.MarkerState) error

func (*Backend) RecordPlacedObjectEvent

func (b *Backend) RecordPlacedObjectEvent(e *core.PlacedObjectEvent) error

func (*Backend) RecordProjectileEvent

func (b *Backend) RecordProjectileEvent(e *core.ProjectileEvent) error

func (*Backend) RecordRadioEvent

func (b *Backend) RecordRadioEvent(e *core.RadioEvent) error

func (*Backend) RecordSoldierState

func (b *Backend) RecordSoldierState(s *core.SoldierState) error

func (*Backend) RecordTelemetryEvent

func (b *Backend) RecordTelemetryEvent(e *core.TelemetryEvent) error

func (*Backend) RecordTimeState

func (b *Backend) RecordTimeState(t *core.TimeState) error

func (*Backend) RecordVehicleState

func (b *Backend) RecordVehicleState(v *core.VehicleState) error

func (*Backend) StartMission

func (b *Backend) StartMission(mission *core.Mission, world *core.World) error

StartMission sends mission and world data and waits for server ack.

type Config

type Config struct {
	URL    string
	Secret string
}

Config holds WebSocket backend configuration.

Jump to

Keyboard shortcuts

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