# games.cavu.clientFrame

> Published by [chris.pardy.family](https://lexicon.garden/identity/did:plc:dp7v5b5kejmmzzpwmqyf5wj6)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.clientFrame)
- [Documentation](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.clientFrame/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.clientFrame/examples)

## Definitions

### `games.cavu.clientFrame#intent`

**Type**: `object`

A game intent. The host stamps `viewer` and `serverTime` before the game's reduce() sees it; any client-sent values for those are overwritten.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `intent` | `unknown` | Yes | Typed by the game: games.cavu.<game>.defs#intent. |
| `seq` | `integer` | Yes | Client sequence number; echoed back as `ack` in snapshots so the client can drop confirmed predictions. |

### `games.cavu.clientFrame#join`

**Type**: `object`

Enter a game room. Rooms are chosen by the server for games that declare them (e.g. one room per UTC day).

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `game` | `string` | Yes | Pack id, e.g. 'haiku-day'. |
| `room` | `string` | No |  |
| `viewer` | `string` | Yes | Guest id. Superseded by the authenticated DID once atproto OAuth lands. |

### `games.cavu.clientFrame`

**Type**: `object`

Frames a client sends up the games.cavu.subscribeSession socket (DAG-CBOR event-stream framing: header {op:1, t:'#join'|'#intent'|'#ping'} + body).

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `frame` | `union` | Yes |  |

### `games.cavu.clientFrame#ping`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "intent": {
      "description": "A game intent. The host stamps `viewer` and `serverTime` before the game's reduce() sees it; any client-sent values for those are overwritten.",
      "properties": {
        "intent": {
          "description": "Typed by the game: games.cavu.<game>.defs#intent.",
          "type": "unknown"
        },
        "seq": {
          "description": "Client sequence number; echoed back as `ack` in snapshots so the client can drop confirmed predictions.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "seq",
        "intent"
      ],
      "type": "object"
    },
    "join": {
      "description": "Enter a game room. Rooms are chosen by the server for games that declare them (e.g. one room per UTC day).",
      "properties": {
        "game": {
          "description": "Pack id, e.g. 'haiku-day'.",
          "maxLength": 64,
          "type": "string"
        },
        "room": {
          "maxLength": 128,
          "type": "string"
        },
        "viewer": {
          "description": "Guest id. Superseded by the authenticated DID once atproto OAuth lands.",
          "maxLength": 256,
          "type": "string"
        }
      },
      "required": [
        "game",
        "viewer"
      ],
      "type": "object"
    },
    "main": {
      "description": "Frames a client sends up the games.cavu.subscribeSession socket (DAG-CBOR event-stream framing: header {op:1, t:'#join'|'#intent'|'#ping'} + body).",
      "properties": {
        "frame": {
          "refs": [
            "#join",
            "#intent",
            "#ping"
          ],
          "type": "union"
        }
      },
      "required": [
        "frame"
      ],
      "type": "object"
    },
    "ping": {
      "properties": {},
      "type": "object"
    }
  },
  "id": "games.cavu.clientFrame",
  "lexicon": 1
}
```
