# PlayerId record struct

> One player in a session, as the host knows them for as long as they're connected. A Plugin gets one from the API that hands out players and passes it back to name that player, as ICrosshairs.Of takes one.

Namespace `EvilEngine.Api`, assembly `EvilEngine.Api`. Engine commit 4ff877b1.

```csharp
public readonly record struct PlayerId
```

One player in a session, as the host knows them for as long as they're connected. A Plugin gets one from the API that hands out players and passes it back to name that player, as [ICrosshairs.Of](/docs/api/icrosshairs#of) takes one.

Two ids are the same player only while that player is connected. When they leave, their slot is free for the next to join, who gets a new [Serial](#serial), so an id kept past a player leaving never reaches someone else.

## Members

### PlayerId (constructor)

```csharp
public PlayerId(int Slot, int Serial)
```

Makes an id from a slot and a serial. A Plugin only needs this to keep an id somewhere and rebuild it.

### Slot (property)

```csharp
public int Slot { get; init; }
```

The player's slot in the session, from 0 up to one less than its most players.

### Serial (property)

```csharp
public int Serial { get; init; }
```

How many times the slot has been taken, so a new player in an old slot is a new id.
