mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 22:51:30 -07:00
add playersettings, img, more match endpoints
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# playersettings
|
||||
|
||||
Player-settings worker served at `playersettings.rec.djdevin.net`.
|
||||
|
||||
- `GET /` — service status `{ "service": "playersettings", "status": "ok" }`.
|
||||
- `GET /playersettings` — `[Authorize]`. The player's settings as
|
||||
`{ PlayerId, Key, Value }`, read from the per-player KV map. On a player's
|
||||
first read it seeds (and persists) the C# default settings.
|
||||
- `PUT /playersettings` — `[Authorize]`. Accepts a form-urlencoded
|
||||
`key=…&value=…` (or a JSON `{key,value}` / array) and **upserts** it into the
|
||||
player's settings, keyed by the `sub` claim of the Bearer JWT. Returns `200`.
|
||||
Persisted in Workers KV (`PLAYER_SETTINGS`, key `player:<id>`).
|
||||
|
||||
> The C# `PutPlayerSettings` replaces the player's *entire* settings set on each
|
||||
> call; we merge instead, so a single-key PUT (e.g. `key=PlayerSessionCount`)
|
||||
> doesn't wipe the others.
|
||||
|
||||
## KV namespace
|
||||
|
||||
```sh
|
||||
wrangler kv namespace create PLAYER_SETTINGS # then put the id in wrangler.jsonc
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Run in dev mode
|
||||
|
||||
```sh
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Run tests
|
||||
|
||||
```sh
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### Deploy
|
||||
|
||||
```sh
|
||||
pnpm turbo deploy
|
||||
```
|
||||
Reference in New Issue
Block a user