playerCapacity

open suspend override fun playerCapacity(): Long(source)

Retrieves the current capacity for the number of players that can be connected to this instance simultaneously. Once this capacity is reached, no further players can be added to this instance. The return value is guaranteed to match the value set within the SDK, even if this value was not yet synchronized with the Kubernetes resource.

The specific player tracking APIs of the AgonesSdk will eventually be superseded by the arbitrary Counts and Lists that cover a broader use-case and offer similar interfaces for tracking.

Return

The current capacity for the number of players that can be connected to this instance simultaneously. The value 0 represents that no player should be allowed on this instance at all.

See also


open suspend override fun playerCapacity(capacity: Long)(source)

Sets a new capacity for the number of players that can be connected to this instance simultaneously. The limit will not be enforced retroactively. That means, if there are currently more players on this instance, than the new capacity would allow, no new players will be allowed to connect on this instance, but existing players will not be disconnected from this instance.

The specific player tracking APIs of the AgonesSdk will eventually be superseded by the arbitrary Counts and Lists that cover a broader use-case and offer similar interfaces for tracking.

Parameters

capacity

The new capacity for the number of simultaneously connected players for this instance. The value 0 represents that no player should be allowed on this instance at all.

See also

Throws

If a negative number is provided as the new player capacity.