Skip to content

Commit 5f26a4d

Browse files
Bot Updating Documentation
1 parent cda1a4a commit 5f26a4d

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

docs/images/docker-baseimage-selkies.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -226,26 +226,27 @@ When secure mode is enabled (`SELKIES_MASTER_TOKEN` is set), the server runs a c
226226
227227
**Permissions Object Fields:**
228228
* `"role"`: (String, required) Can be one of the following:
229-
* `"controller"`: Full access. Can send keyboard, mouse, and all other input events.
230-
* `"viewer"`: Restricted access. Primarily for viewing the stream. Can be granted specific input rights via the `slot` property.
231-
* `"slot"`: (Integer or `null`, required) Assigns an input slot, for gamepads.
232-
* `null`: No specific input slot. A viewer with a `null` slot has no input capabilities.
233-
* `1`: Grants the `viewer` control over the **Player 1** gamepad *only*.
234-
* `2`: Grants the `viewer` control over the **Player 2** gamepad *only*.
235-
* `3`: Grants the `viewer` control over the **Player 3** gamepad *only*.
236-
* `4`: Grants the `viewer` control over the **Player 4** gamepad *only*.
237-
238-
**Behavior:** When a valid request is received, the server replaces its entire set of active tokens with the new set provided in the payload. It then runs a reconciliation process: any connected client whose token is now invalid or has changed permissions will be disconnected and users input capabilities will be modified live.
229+
* `"controller"`: Full access. Can send keyboard, mouse, and all other input events (unless overridden by `mk_control`).
230+
* `"viewer"`: Restricted access. Primarily for viewing the stream. Can be granted specific input rights via the `slot` or `mk_control` properties.
231+
* `"slot"`: (Integer or `null`, required) Assigns an input slot, primarily for gamepads.
232+
* `null`: No specific input slot.
233+
* `1` - `4`: Grants the user control over the specific virtual gamepad slot (Player 1 through Player 4).
234+
* `"mk_control"`: (Boolean, optional) Exclusive override for Mouse & Keyboard input.
235+
* If `true` on **any** active token in the set, only that specific client processes mouse and keyboard events.
236+
* If `false` or omitted on **all** active tokens, mouse and keyboard access defaults to clients with the `"controller"` role.
237+
238+
**Behavior:** When a valid request is received, the server replaces its entire set of active tokens with the new set provided in the payload. It then runs a reconciliation process:
239+
1. Clients with tokens not present in the new set are disconnected.
240+
2. Clients with tokens that remain valid but have changed permissions (`role`, `slot`, or `mk_control`) receive an immediate state update without disconnection.
239241
240242
**Example `curl` Command:**
241243
```bash
242244
curl -X POST http://localhost:8083/tokens \
243245
-H "Authorization: Bearer my-secret-master-token" \
244246
-H "Content-Type: application/json" \
245247
-d '{
246-
"user-token-1": {"role": "controller", "slot": null},
247-
"user-token-2": {"role": "viewer", "slot": 1},
248-
"user-token-3": {"role": "viewer", "slot": null}
248+
"token-1": {"role": "controller", "slot": null, "mk_control": false},
249+
"token-2": {"role": "viewer", "slot": 1, "mk_control": true}
249250
}'
250251
```
251252

0 commit comments

Comments
 (0)