SA-MP-Pilot

module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0

README

SA-MP-Pilot

SA-MP-Pilot is a browser console for managing multiple SA-MP server sessions. The backend is written in Go; the frontend uses React, Vite, Tailwind CSS, and shadcn/ui components.

The interface is available in English, Simplified Chinese, and Russian. Language resources live under web/src/i18n/locales, while feature components are grouped under web/src/features and reusable UI building blocks under web/src/components.

Requirements

  • Go 1.26 or newer
  • Node.js 22 or newer
  • pnpm 10 or newer

Development

pnpm --dir web install
pnpm --dir web dev
go run ./cmd/sa-mp-pilot -data . -web web/dist

Vite proxies /api to 127.0.0.1:8080. By default, the Go service stores data.json beside the executable and writes isolated instance logs under the adjacent logs directory. Starting a new connection clears that instance's log. Override the bind address and data directory with -addr and -data.

Release binaries embed the complete frontend and can be run directly from any working directory. Tags beginning with v trigger cross-platform single-binary releases and SHA-256 checksums. The -web option remains available for overriding embedded assets during development.

Verification

make format
make lint
make test
make build

The production build is written to bin/sa-mp-pilot with the frontend embedded in the executable.

Protocol and features

The backend contains a pure-Go implementation of the legacy RakNet wire protocol used by SA-MP 0.3.7. It supports the cookie and connection handshakes, reliability and ordering channels, acknowledgements, retransmission, split-packet reassembly, RPC framing, SA-MP authentication, text compression and configurable UTF-8/GBK/Windows-1251 text encoding.

The browser console supports multiple persisted instances, automatic connection, server configuration, chat and commands, reusable quick commands, player list and player clicks, Dialog responses and deferral, TextDraw display and clicks, nearby player/vehicle/object data, key masks, AFK mode, teleportation, and driver/passenger vehicle controls. Voice and audio streaming are intentionally excluded.

Network input is decoded field-by-field rather than mapped to platform-native packed structures. Queues, reliable retries, ordered frames, split assemblies and payload sizes are bounded; connection work is cancellation-aware and uses one transport event loop per session.

Instance synchronization

GET /api/instances and GET /api/instances/{id} provide complete snapshots for bootstrap and recovery. WebSocket instance.created events also contain a complete snapshot. Thereafter, instance.updated carries an InstancePatch: a syncEpoch, a monotonically increasing revision within that epoch, and replace operations for only the changed top-level fields. Clients apply a patch only when its epoch matches and its revision immediately follows their local snapshot; on a gap they fetch GET /api/instances/{id} again. A full snapshot from a new epoch is authoritative, which allows a connected browser to recover after the service restarts. This keeps the lossy, bounded WebSocket state queue safe while avoiding repeated transmission of unrelated instance collections.

License

Copyright 2026 SA-MP Android.

SA-MP-Pilot is licensed under the Apache License 2.0. See NOTICE for attribution.

Directories

Path Synopsis
cmd
sa-mp-pilot command
internal

Jump to

Keyboard shortcuts

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