How icedynamix/reliquary-archiver works
Project type and purpose
• This is a Rust‑based CLI tool (an open‑source packet‑capture archiver) called “reliquary‑archiver”.
• Purpose: capture network packets from a turn‑based anime game (live via libpcap or from a .pcap file), parse game‑specific data, and export it to a JSON format compatible with downstream tools (e.g., fribbels hsr optimizer).
File structure
• Top‑level files:
• Cargo.toml / Cargo.lock (Rust package config)
• build.rs (build‑time resource downloader & embedder)
• src/main.rs (CLI entrypoint)
• src/lib.rs (core library definitions)
• src/export/ (exporter modules: database.rs, fribbels.rs)
• .github/workflows/release.yml (CI/CD pipeline for releases)
• README.md / LICENSE / .gitignore
Extract insights from the README
• Dependencies: libpcap (Linux) or npcap (Windows), Rust pcap crate
• Supports live capture (CAP_NET_RAW) or offline .pcap input
• CLI options: output path, timeout, verbosity, log path, update‑check flags, exit behavior
• Build script pulls in static resource files at compile time
• Outputs JSON and optionally log files
• Integrates with external services (GitHub for update checks)
a. Main components
• CLI & Configuration Layer (src/main.rs)
• Layer (pcap live capture or file reader via pcap crate)
• Parser / Core Library (src/lib.rs + underlying reliquary library)
• Exporter Modules (src/export/database.rs & fribbels.rs)
• Output Writer (JSON file sink + optional log file)
• Build Script (build.rs, invoked at compile time)
• External Dependencies / Services
• libpcap / npcap
• GitHub API (update‑check on Windows)
b. Relationships & data flow
1. User invokes CLI → parses arguments & config
2. CLI initializes Capture Layer → binds to live interface or opens .pcap file
3. Raw packets flow into the Parser / Core Library → extracts game‑specific events
4. Parsed events feed into appropriate Exporter(s) → transform into JSON structures
5. Output Writer writes JSON to disk; logs get emitted via tracing‑subscriber
6. (Windows only) CLI optionally queries GitHub API for updates
7. build.rs runs at build time to fetch & embed resource files
c. Architectural patterns & principles
• Layered, pipeline architecture (capture → parse → export → write)
• Modular exporter plugins (database vs. fribbels)
• Clear separation between CLI, core logic, and I/O
• Build‑time codegen (via build.rs) for embedding static assets
d. Key technologies & libraries
• Rust (Cargo, build.rs)
• pcap crate (libpcap/npcap binding)
• tracing + tracing‑subscriber (logging)
• serde_json (JSON serialization)
• reliquary (underlying packet decode library)