mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 22:51:30 -07:00
almost into a room
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# match
|
||||
|
||||
Matchmaking Worker served at `match.rec.djdevin.net`. A Hono app ported from the
|
||||
C# `MatchmakingController`. EF Core (`AppDbContext`) queries are stubbed for now
|
||||
— no real bindings yet.
|
||||
|
||||
## Behavior
|
||||
|
||||
- **Auth-gated routes** (`/player/heartbeat`, `/goto/room/:room`) validate the
|
||||
Bearer JWT issued by the `auth` worker (same dev secret, see `src/jwt.ts`) and
|
||||
401 when it's missing/invalid.
|
||||
- **`GET /player`** always returns the inlined `JSON/getplayer.json` default
|
||||
(the C# fell back to that file when the account/room instance wasn't found).
|
||||
- **`POST /goto/none`** returns the static offline-dorm instance with a fresh
|
||||
`photonRoomId`.
|
||||
- **`POST /goto/room/:room`** 404s — without a Rooms binding the room can't be
|
||||
resolved, matching the C# `NotFound` path.
|
||||
- **`POST /player/heartbeat`** echoes the posted heartbeat fields; `roomInstance`
|
||||
is always null and `isOnline` false until there's a DB binding.
|
||||
- **`/player/login`, `/player/statusvisibility`, `/roominstance/:id/reportjoinresult`**
|
||||
return empty 200s, as in the source.
|
||||
|
||||
## TODO before production
|
||||
|
||||
- Wire a DB binding (D1/DO) for `Accounts`, `Rooms`/`SubRooms`, `RoomInstances`.
|
||||
- Implement `/goto/room/:room` (resolve room, upsert instance) and the
|
||||
per-account `/player` + `/player/heartbeat` room-instance lookups.
|
||||
- Move the JWT secret to a shared secret binding (shared with `auth`).
|
||||
Reference in New Issue
Block a user