# games.cavu.pack

> One version of a game's code and assets: every file the game runs (its manifest.json, Lua modules, data files, assets/ and og.png), each a blob. A pack is never edited: a new version is a new record, and it goes live when the game's games.cavu.game record (same repo) points `pack` at it, so rolling back is pointing it at an older one. Game servers fetch the pack and check every blob against its CID.

- Kind: record
- Record key: tid
- Authority: cavu.games
- Lexicon: 1
- Published by [pardy.at](https://lexicon.garden/identity/did:plc:dp7v5b5kejmmzzpwmqyf5wj6), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.pack)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.pack/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:dp7v5b5kejmmzzpwmqyf5wj6/games.cavu.pack/analytics)

## Record (`games.cavu.pack`)

Type: record · key tid

### Properties

- `createdAt` (string · datetime, required)
- `files` (array, required)
  - Constraints: maxLength: 4096
  - `items` (ref)
    - Reference: `#file`
- `game` (ref, required): The game this is a version of (the games.cavu.game rkey).
  - Reference: `games.cavu.defs#slug`
- `version` (string): A label for people (e.g. '1.4.0'); servers go by the record's CID.
  - Constraints: maxLength: 64

## #file (`games.cavu.pack#file`)

Type: object

### Properties

- `blob` (blob, required)
  - Constraints: maxSize: 100000000, accept: */*
- `path` (string, required): Where the file sits in the pack: relative, '/'-separated, no '..' and no segment starting with '.'.
  - Constraints: maxLength: 256

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "file": {
      "properties": {
        "blob": {
          "accept": [
            "*/*"
          ],
          "maxSize": 100000000,
          "type": "blob"
        },
        "path": {
          "description": "Where the file sits in the pack: relative, '/'-separated, no '..' and no segment starting with '.'.",
          "maxLength": 256,
          "type": "string"
        }
      },
      "required": [
        "path",
        "blob"
      ],
      "type": "object"
    },
    "main": {
      "description": "One version of a game's code and assets: every file the game runs (its manifest.json, Lua modules, data files, assets/ and og.png), each a blob. A pack is never edited: a new version is a new record, and it goes live when the game's games.cavu.game record (same repo) points `pack` at it, so rolling back is pointing it at an older one. Game servers fetch the pack and check every blob against its CID.",
      "key": "tid",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "files": {
            "items": {
              "ref": "#file",
              "type": "ref"
            },
            "maxLength": 4096,
            "type": "array"
          },
          "game": {
            "description": "The game this is a version of (the games.cavu.game rkey).",
            "ref": "games.cavu.defs#slug",
            "type": "ref"
          },
          "version": {
            "description": "A label for people (e.g. '1.4.0'); servers go by the record's CID.",
            "maxLength": 64,
            "type": "string"
          }
        },
        "required": [
          "game",
          "files",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "games.cavu.pack",
  "lexicon": 1
}
```
