Skip to content

Latest commit

 

History

History
145 lines (105 loc) · 5.04 KB

File metadata and controls

145 lines (105 loc) · 5.04 KB

TODO for CactusMC

1. Organization & Architecture

  • Create a root Cargo workspace

  • Split into child crates:

    • server-core
    • protocol
    • slp-parser
    • player-management
  • Update each crate's Cargo.toml with clear dependencies

  • Add an installation/bootstrap script (e.g., make init)

2. Code Quality & Best Practices

  • Integrate Clippy into CI (cargo clippy -- -D warnings)
  • Configure rustfmt and enforce a consistent code style
  • Replace Box<dyn std::error::Error> with thiserror or anyhow
  • Move from log to tracing for structured logging
  • Add /// comments to public APIs

3. Testing, Benchmarks & CI/CD

  • Write unit tests for each module (#[cfg(test)])

  • Create integration tests for:

    • Handshake and minimal login
    • Sending/receiving SLP packets
  • Set up benchmarks with criterion.rs:

    • Chunk encoding
    • Seed hashing
  • Extend GitHub Actions:

    • Tests on Linux, macOS, and Windows
      • Linux
      • Windows
      • macOS
    • Builds on Stable, Beta, and Nightly
    • Coverage report (using tarpaulin or grcov)
  • Automatically publish documentation to docs.rs

4. Networking & Protocol Features

  • Implement the Handshake state (packet 0x00)
  • Handle Login Start → Encryption → Mojang authentication
  • Support packet compression/decompression (Minecraft 1.8+)
  • Structure the network codec with tokio_util::codec::Framed
  • Add timeouts and handle idle connections
  • Implement the state machine (Handshake → Status → Play)
  • Ensure big-endian byte order when sending/receiving packets

5. Developer Experience & Deployment

  • Provide a Dockerfile and docker-compose.yml for a local environment
  • Add a config watcher (notify) for hot-reloading server.properties
  • Expose a Prometheus endpoint for metrics (TPS, players, latency)
  • Create an automated deployment script (CI/CD)

6. Security & Reliability

  • Integrate cargo-fuzz for fuzz testing parsers
  • Strictly validate all incoming data (sizes, values)
  • Handle network errors and client disconnections gracefully
  • Set up stress/load testing if possible

7. Roadmap & Project Management

  • Complete and prioritize TODO.md and ROADMAP.md
  • Create a GitHub project board (issues, milestones, labels)
  • Document contribution guidelines (CONTRIBUTING.md, CODE_OF_CONDUCT.md)
  • Plan releases (SemVer versioning)

8. SLP

  • Parse server.properties to retrieve server info
  • Global values such as server version
  • Implement the SLP interface
  • Separate VarInt/VarLong encoding/decoding into a dedicated module
  • Add structured logging to the SLP parser

9. Players

  • Allow a player to connect and complete the handshake/login
  • Read the map file and send chunks
  • Handle keep-alive and client-side timeouts

10. Architecture & Networking

  • Implement a connection state machine (Handshake → Status → Login → Play)
  • Support packet compression/decompression (Minecraft 1.8+)
  • Ensure big-endian byte order for packets
  • Complete missing handlers in net and net/packet (TODOs and todo!())
  • Switch to an event-driven model using Tokio
  • Use config files (config) instead of hard-coded values

11. Commands

  • Implement the Command Pattern system in src/commands
  • Create a queue manager for user commands
  • Separate command logic from the CLI

12. Configuration

  • Implement generator_settings and text_filtering_config in src/config
  • Finalize mapping of Settings (as a singleton or global struct)
  • Add validation and dynamic reloading via notify

13. Constants & Static Data

  • Reimplement consts with a query API (HashMap) to reflect current state
  • Handle conditional inclusion of the server icon in the JSON response

14. Chunk Management

  • Complete implementation of chunks_manager (todo!())
  • Benchmark chunk encoding via criterion

15. Logging

  • Restore colored output for INFO, DEBUG, WARN, ERROR in the logger
  • Migrate to tracing for structured logging and spans

16. World Generation (WorldGen)

  • Decide whether worldgen should be a workspace crate or a separate repo

    • Crate advantage: simpler integration, shared types and dependencies
    • Separate repo advantage: independent release cycle, strong decoupling
  • Create a worldgen module/crate in the workspace (or initialize the repo)

  • Implement noise functions (Perlin, Simplex)

  • Generate chunks:

    • Raw terrain generation (heightmap)
    • Biomes and sub-biomes
    • Structures (village, cave, fortress)
  • WorldGen configuration (seed, advanced options)

  • Unit and integration tests for terrain consistency

  • Chunk generation benchmarks (via criterion)

  • CLI or API to test/generate maps independently

Date updated: May 19, 2025