decrementCounter

open suspend override fun decrementCounter(name: String)(source)

Decreases the current count for the counter with the supplied name. If no counter with this name exists or this operation would decrease the corresponding counter below 0 (would get negative), an appropriate exception will be thrown.

The Counts and Lists API will eventually supersede the specific player tracking APIs of the AgonesSdk, as these cover a broader use-case and offer similar interfaces for tracking. Therefore, this method should be preferred.

Parameters

name

The unique identifier of this instance's counter whose count should be decremented.

See also

Throws

If null is supplied as the counter identifier and therefore no counter can be derived from it.