Commit graph

19 commits

Author SHA1 Message Date
Aaron Wood
39f8220eb7 feat: rewrite seed-dev-data for MariaDB with test users and campaign members
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:20:15 -04:00
Aaron Wood
ec75add5b7 fix: correct character:updated broadcast payload and existence check order
- Broadcast enriched DB row (with parsed overrides) instead of raw req.body
- Check affectedRows from UPDATE to detect missing characters before SELECT
- Import ExecuteValues from mysql2 at the top level instead of inline cast
2026-04-11 00:16:18 -04:00
Aaron Wood
385d9b6e9e feat: convert characters routes to async mysql2
Replace synchronous better-sqlite3 calls with async mysql2 db.execute(),
import parseJson from shared utility, and add try/catch error handling
throughout all character, gear, talent, and stat endpoints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:14:49 -04:00
Aaron Wood
2812d81979 fix: add error handling and safe JSON parsing to route handlers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:12:08 -04:00
Aaron Wood
268997a009 feat: convert campaigns, game-items, game-talents, rolls routes to async mysql2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:09:46 -04:00
Aaron Wood
dbc12ac816 feat: wire up migrations, CORS with credentials, cookie-parser 2026-04-11 00:07:42 -04:00
Aaron Wood
5dce775dce fix: add transaction wrapping and SQL splitter documentation in migrate.ts
Each migration file now runs in a transaction - if any statement fails,
the entire file is rolled back and no _migrations record is written.
Also documents the naive semicolon-split constraint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 00:01:58 -04:00
Aaron Wood
602dc3d098 fix: correct MIGRATIONS_DIR path in migrate.ts
Path was resolving to repo root instead of server/migrations/.
Changed from two '..' segments to one.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:59:55 -04:00
Aaron Wood
ed45a84e5a feat: add MariaDB schema migration and runner 2026-04-10 23:56:00 -04:00
Aaron Wood
be38cdc3dc feat: replace better-sqlite3 with mysql2 connection pool
Removes better-sqlite3 and its types, installs mysql2 (async MariaDB
driver) along with jsonwebtoken, bcrypt, cookie-parser, and dotenv.
Rewrites db.ts to export a mysql2 connection pool pointed at the
Darkwatch MariaDB instance (port 3307).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:53:40 -04:00
Aaron Wood
c953b8c79c fix: move socket interfaces to module scope, fix CSSProperties import 2026-04-10 19:38:34 -04:00
Aaron Wood
993875f8ef feat: update atmosphere:update socket type for full effect state 2026-04-10 19:32:14 -04:00
Aaron Wood
33032bcd07 Add torch timer, fog atmosphere, DM card redesign, and avatars
- Torch timer: 60min countdown per character, visual warnings at 10m/5m/1m
- Fog overlay: CSS radial gradient layers with seamless infinite drift
- Fog synced across all clients via socket, adapts to light/dark themes
- DM card redesign: compact layout with HP/AC/luck/torch + modifier row
- Grid changed to 3-up (from 4) with larger fonts
- DiceBear avatars on cards and character sheets with style picker
- Campaign name shown in header
- Server: JSON.stringify fix for object fields in PATCH handler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:41:22 -04:00
Aaron Wood
b88fa0cb3e Add luck token toggle, color picker, and click-to-edit ability scores
- Luck token: star toggle (filled/empty) in header, always clickable
- Color picker: input[type=color] next to name in edit mode
- Ability scores: InlineNumber click-to-edit replaces +/- buttons
- Server: added color and luck_token to allowed update fields
- DB: luck_token column migration (default 1)
- Fix dice color for hex color values (was only handling HSL)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:35:49 -04:00
Aaron Wood
f552a475c1 Wire up talent HP bonus with per-level scaling (e.g. Grit +2 HP and +1/level)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 14:19:18 -04:00
Aaron Wood
28e57a77ee Add dev seed data: auto-creates campaign with Limpie and Brynn on fresh DB 2026-04-09 12:34:08 -04:00
Aaron Wood
3e2e43ca95 Split attack/damage dice buttons, nat 20 highlighting, crit damage, character colors 2026-04-09 12:27:25 -04:00
Aaron Wood
20a1778cbd Add dice rolling: server-side engine, roll log panel, DiceButton on stats/attacks, advantage/disadvantage, real-time sync 2026-04-09 01:25:29 -04:00
Aaron Wood
2c73dd9ec4 Initial commit: Shadowdark character sheet manager with item/talent databases, view/edit modes, real-time sync 2026-04-09 01:03:40 -04:00