Quantumlyy/drydock

Read-only digital twin of an Azur Lane (EN/global) account. Passively decodes game traffic into SurrealDB for agent queries and dashboard live views.

★ 0Forks 0RustGitHub ↗Compare

README

drydock

Read-only digital twin of an Azur Lane (EN/global) account. Passively decodes game traffic into SurrealDB for agent queries and (future) dashboard live views.

Architecture

PacketSource → Reassembler → FrameCarver → Decoder → Enricher → Store

Only PacketSource varies: .pcap file, PCAPdroid HTTP stream, or TCP exporter.

Quick start

Install tools and list recipes:

mise install          # rust, uv, task, surrealkit — see mise.toml
task --list
task setup            # refs + protos + db schema (sequenced deps)

Individual tasks:

task refs:fetch       # ALDB + REGAL JSON (skips if manifest unchanged)
task vendor:belfast    # Belfast from _vendor/ mirror (skips if vendor/belfast exists)
task protos:extract   # Belfast → proto/ (skips if sources unchanged)
task db:up            # docker compose up
task db:setup         # surrealkit sync + seed (skips sync if schema unchanged)
task db:watch         # schema sync watch mode
task test             # cargo test (deps: refs + protos)

See Taskfile.yml for the full graph.

Reference data (ALDB + REGAL)

Fetched JSON is gitignored; task refs:fetch writes refs/manifest.json and skips re-download when inputs are unchanged.

ALDB_VERSION=1.7.6.4 task refs:fetch
task refs:fetch-maintained

See refs/README.md and refs/aldb/catalog.json.

Replay a local pcap (dry run)

cargo run -p drydock-collector -- \
  --source pcaps/PCAPdroid_08_Jun_15_18_28.pcap \
  --dry-run \
  --frame-dump artifacts/frame-dump.jsonl

SurrealDB (v3.1.3)

cp .env.example .env   # optional; gitignored
task db:setup          # starts docker + sync + seed

Optional Surrealism WASM helpers:

task db:surrealism:target   # once: installs wasm32-wasip2 (~30MB; slow on first run)
task db:surrealism          # build .surli if needed, then surrealkit apply

Schema files: database/schema/*.surql — see database/README.md.

Ingest with DB writes:

export SURREAL_URL=ws://127.0.0.1:8000
export SURREAL_PASS=root
cargo run -p drydock-collector -- \
  --source pcaps/PCAPdroid_08_Jun_15_18_28.pcap

Agent queries

cargo run -p drydock-query -- 'SELECT count() FROM ship GROUP ALL'

See schema/AGENT.md for example SurrealQL.

Live capture (PCAPdroid)

  • Disable TLS decryption in PCAPdroid (game protocol is cleartext; MITM breaks login)
  • App filter: com.YoStarEN.AzurLane
  • Start capture before launching Azur Lane for full login-sync snapshot
  • HTTP mode: cargo run -p drydock-collector -- --source-type http --source http://127.0.0.1:8080/
  • TCP exporter (preferred): cargo run -p drydock-collector -- --source-type tcp --source 0.0.0.0:5123
  • ADB forward: adb forward tcp:8080 tcp:8080

Headless PCAPdroid-API start:

adb shell am start \
  -e action start \
  -e pcap_dump_mode tcp_exporter \
  -e collector_ip_address 127.0.0.1 -e collector_port 5123 \
  -e app_filter com.YoStarEN.AzurLane \
  -n com.emanuelef.remote_capture/.activities.CaptureCtrl

Crates

Crate Role
drydock-frame CheshireLane-derived frame carver (BSL)
drydock-reassemble TCP flow buffering (RAW IP + Ethernet)
drydock-pcap-source File / HTTP / TCP PacketSource
drydock-proto Belfast protos + dynamic decoder
drydock-refs ALDB + REGAL reference loader
drydock-enrich LB, equip split, affinity derivations
drydock-store SurrealDB upsert + snapshots
drydock-collector Main ingest binary
drydock-query SurrealQL CLI for agents

License

  • Frame carver adapted from CheshireLane — BSL 1.1, educational/non-commercial. Mirror archive in _vendor/ (cheshire-<sha>.git.tar.gz).
  • Protobuf definitions recovered from Belfast for interoperability. Mirror archive in _vendor/ (belfast-<sha>.git.tar.gz).

Contributors

Quantumlyy

Issues