data displaying properly now
This commit is contained in:
31
cobblemon.md
Normal file
31
cobblemon.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Cobblemon UI — Project Reference
|
||||
|
||||
## Stack
|
||||
Phoenix 1.8 LiveView app (Elixir). Dark mode daisyUI. Docker dev setup with SSHFS mount to remote Minecraft server.
|
||||
|
||||
## Data Source
|
||||
`.cobblemon-data/` — SSHFS mount of remote Minecraft server root (`dev.sh` mounts it). Mounted into Docker container at `/cobblemon-data`.
|
||||
|
||||
### Key server files
|
||||
- `usercache.json` — JSON array of `{"name", "uuid", "expiresOn"}`. Maps UUIDs to player names.
|
||||
- `world/pokemon/playerpartystore/<2-char-prefix>/<uuid>.dat` — NBT binary, player's party (6 slots).
|
||||
- `world/pokemon/pcstore/<2-char-prefix>/<uuid>.dat` — NBT binary, player's PC boxes (30 boxes × 30 slots).
|
||||
- `world/playerdata/<uuid>.dat` — vanilla Minecraft player data (not currently parsed).
|
||||
|
||||
**Important:** `.dat` files use 2-character UUID prefix subdirectories (e.g. `54/54e75a91-...dat`).
|
||||
|
||||
## App Modules
|
||||
|
||||
### `lib/cobblemon_ui/cobblemon_fs/`
|
||||
- `cobblemon_fs.ex` — GenServer. Cached player data access. Reads from `/cobblemon-data`. Parses `usercache.json` for names. API: `list_players/0`, `get_player/1`, `get_party/1`, `get_pc/1`, `get_pokemon/2`.
|
||||
- `nbt.ex` — Pure Elixir NBT decoder. Handles gzip + uncompressed. All 13 tag types.
|
||||
- `pokemon.ex` — Normalizes raw NBT compound → `%{species, level, form, shiny, nature, gender, ivs, evs, moves, ...}`.
|
||||
- `party_store.ex` — Parses party `.dat` → list of 6 pokemon slots.
|
||||
- `pc_store.ex` — Parses PC `.dat` → list of `%{box: n, pokemon: [...]}`.
|
||||
|
||||
### `lib/cobblemon_ui_web/live/`
|
||||
- `dashboard_live.ex` — Main LiveView. Player sidebar (names from usercache), party/PC tabs, pokemon detail panel with IV/EV bars.
|
||||
|
||||
### Config
|
||||
- `docker-compose.yml` — Dev container. Bind mounts `.cobblemon-data` → `/cobblemon-data` (needs `allow_other` SSHFS).
|
||||
- `dev.sh` — SSHFS mount script for `.cobblemon-data`.
|
||||
Reference in New Issue
Block a user