# Managing Party Players

## Initializing Players

All players including the party host will have a `KronosPartyClient` beacon created when they join the party. This is the main class that can be used to interact with the party. It's basically the equivalent of the `PlayerController` in the Unreal game framework.

* `ServerInitPlayer:` Server side player initialization. If you have a backend service this is a good place to read the player's skill rating, fetch cosmetics, etc.
* `ClientInitPlayer:` Client side player initialization.

## Party Player Data

The `KronosPartyPlayerState` 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 profile level, the banner that they are using, or the character / class they are going to play.

Use the `KronosPartyClient` class to change player data:

* `SetPlayerData`: Used to set the player data. Overrides previous player data entirely.
* `GetPlayerData`: Used to read the player data using the `KronosPartyPlayerState`.
* Player data can be initialized during the `ServerInitPlayer` and `ClientInitPlayer` events.

## Party Player Custom Variables

The `KronosPartyPlayerState` can also be extended with custom replicated variables for more advanced use cases where the **Player Data** is not enough. There is a step by step guide available for this in the [**Custom Party Player Variables**](/kronos-matchmaking/advanced/custom-party-player-variables.md) section of the documentation.

## Party Player Skill Rating

The `KronosPartyPlayerState` stores the player's skill rating.

Use the `KronosPartyClient` class to change player skill rating:

* `SetPlayerElo`: Used to set the player's skill rating.
* `GetPlayerElo`: Used to read the player's skill rating using the `KronosPartyPlayerState`.
* Skill rating can be initialized during the `ServerInitPlayer` and `ClientInitPlayer` events.

## Party Player Ready State

The party system has a built-in ready up feature. Each party player has a ready state which can be toggled using the `TogglePlayerIsReady` function of the `KronosPartyClient`. The ready state of the player is stored in the client's `KronosPartyPlayerState`.

To check whether a player is ready or not, you can use the `GetPlayerIsReady` function available in both the `KronosPartyClient` and `KronosPartyPlayerState` classes.

By default the ready state of players doesn't affect anything, however you can easily build systems on top of this (e.g. only enable the matchmaking button if all party players are ready). To do this you can get all `KronosPartyPlayerStates` from the `KronosPartyState`, loop through them and check if everyone is ready.


---

# 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/party/managing-party-players.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.
