# Lobby Player Data

The `KronosLobbyPlayerState` includes a **Player Data** framework that automatically replicates an integer array to all players. This makes it very easy to advertise data about each player, such as their level, or the character / class they are going to play.

## Using The Lobby Player Data

* `SetPlayerData`: Used to set the player data. Overrides previous player data entirely.
* `GetPlayerData`: Used to read the player data.
* `InitPlayerData`: Can be used to set initial player data. Called when the player is initializing.

For example, lets say that players have to select a character in the lobby. You can make it so that each character is represented by an index, and the first element of the player data array is reserved for the character index. E.g. "Character A" = 1,  "Character B" = 2, "Character C" = 3. If the player selects "Character B", set the first element of the player data array to 2. Later if you want to check which character the player is playing, you can get the first element of the player data array.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://horizongames.gitbook.io/kronos-matchmaking/usage/lobby/lobby-player-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
