# games.cavu.subscribeSession

> 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.subscribeSession)
- [Documentation](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.subscribeSession/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.subscribeSession/examples)

## Definitions

### `games.cavu.subscribeSession`

**Type**: `subscription`

Bidirectional game session. Server->client messages are below; client->server frames are games.cavu.clientFrame.

```json
{
  "description": "Bidirectional game session. Server->client messages are below; client->server frames are games.cavu.clientFrame.",
  "errors": [
    {
      "name": "UnknownGame"
    },
    {
      "name": "InvalidJoin"
    },
    {
      "name": "RoomInitFailed"
    },
    {
      "name": "ReduceFailed"
    },
    {
      "name": "InvalidFrame"
    },
    {
      "name": "UnknownFrame"
    }
  ],
  "message": {
    "schema": {
      "refs": [
        "#snapshot"
      ],
      "type": "union"
    }
  },
  "parameters": {
    "properties": {},
    "type": "params"
  },
  "type": "subscription"
}
```

### `games.cavu.subscribeSession#snapshot`

**Type**: `object`

This viewer's projection of the room state: project(state, viewer). Sent on join and whenever it changes. Never contains other players' secrets.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ack` | `integer` | Yes | Highest intent seq from this viewer that the state reflects. |
| `view` | `unknown` | Yes | Typed by the game: games.cavu.<game>.defs#view. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Bidirectional game session. Server->client messages are below; client->server frames are games.cavu.clientFrame.",
      "errors": [
        {
          "name": "UnknownGame"
        },
        {
          "name": "InvalidJoin"
        },
        {
          "name": "RoomInitFailed"
        },
        {
          "name": "ReduceFailed"
        },
        {
          "name": "InvalidFrame"
        },
        {
          "name": "UnknownFrame"
        }
      ],
      "message": {
        "schema": {
          "refs": [
            "#snapshot"
          ],
          "type": "union"
        }
      },
      "parameters": {
        "properties": {},
        "type": "params"
      },
      "type": "subscription"
    },
    "snapshot": {
      "description": "This viewer's projection of the room state: project(state, viewer). Sent on join and whenever it changes. Never contains other players' secrets.",
      "properties": {
        "ack": {
          "description": "Highest intent seq from this viewer that the state reflects.",
          "minimum": 0,
          "type": "integer"
        },
        "view": {
          "description": "Typed by the game: games.cavu.<game>.defs#view.",
          "type": "unknown"
        }
      },
      "required": [
        "ack",
        "view"
      ],
      "type": "object"
    }
  },
  "id": "games.cavu.subscribeSession",
  "lexicon": 1
}
```
