# games.cavu.tier-madness.lobby

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

## Definitions

### `games.cavu.tier-madness.lobby`

**Type**: `record`

Announces that a game exists and is taking players. Written by the host, from their own PDS, to their public repo (rkey = game id). Players join by giving the game server the game's 4-character code; the code itself is never published. codeHash is an HMAC of the code under the space host's secret key: unkeyed, all ~1M codes could be hashed in about a second. The server indexes lobbies by codeHash and hashes the code a player gives it.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `codeHash` | `string` | Yes | HMAC-SHA256 of the normalized code under the space host's secret key (base64url). |
| `createdAt` | `string` (datetime) | Yes |  |
| `expiresAt` | `string` (datetime) | Yes | After this the code no longer admits anyone. |
| `game` | `string` | Yes |  |
| `spaceHost` | `string` (did) | Yes | The game server hosting the game's spaces; the only party that can check codes. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Announces that a game exists and is taking players. Written by the host, from their own PDS, to their public repo (rkey = game id). Players join by giving the game server the game's 4-character code; the code itself is never published. codeHash is an HMAC of the code under the space host's secret key: unkeyed, all ~1M codes could be hashed in about a second. The server indexes lobbies by codeHash and hashes the code a player gives it.",
      "key": "any",
      "record": {
        "properties": {
          "codeHash": {
            "description": "HMAC-SHA256 of the normalized code under the space host's secret key (base64url).",
            "maxLength": 128,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "expiresAt": {
            "description": "After this the code no longer admits anyone.",
            "format": "datetime",
            "type": "string"
          },
          "game": {
            "maxLength": 64,
            "type": "string"
          },
          "spaceHost": {
            "description": "The game server hosting the game's spaces; the only party that can check codes.",
            "format": "did",
            "type": "string"
          }
        },
        "required": [
          "game",
          "spaceHost",
          "codeHash",
          "createdAt",
          "expiresAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "games.cavu.tier-madness.lobby",
  "lexicon": 1
}
```
