Table of Contents

Class CooldownManager

Namespace
Uncreated.Warfare.Players.Cooldowns
Assembly
Uncreated.Warfare.dll
public sealed class CooldownManager : BaseAlternateConfigurationFile, IConfiguration, IDisposable, ILayoutHostedService
Inheritance
CooldownManager
Implements
Inherited Members
Extension Methods

Constructors

CooldownManager(IPlayerService)

public CooldownManager(IPlayerService playerService)

Parameters

playerService IPlayerService

Properties

Cooldowns

All available cooldown types.

public IReadOnlyList<CooldownTypeConfiguration> Cooldowns { get; }

Property Value

IReadOnlyList<CooldownTypeConfiguration>

Methods

FindConfiguration(string)

public CooldownTypeConfiguration? FindConfiguration(string type)

Parameters

type string

Returns

CooldownTypeConfiguration

GetFOBDeployCooldown()

public float GetFOBDeployCooldown()

Returns

float

The deploy cooldown based on current player count.

Remarks

Equation: CooldownMin + (CooldownMax - CooldownMin) * (1 - Pow(1 - (PlayerCount - PlayersMin) * (1 / (PlayersMax - PlayersMin)), Alpha).

GetFOBDeployCooldown(int)

public float GetFOBDeployCooldown(int players)

Parameters

players int

Returns

float

The deploy cooldown based on current player count.

Remarks

Equation: CooldownMin + (CooldownMax - CooldownMin) * (1 - Pow(1 - (PlayerCount - PlayersMin) * (1 / (PlayersMax - PlayersMin)), Alpha).

HandleChange()

Invoked by the base class when a change occurs.

protected override void HandleChange()

HasCooldown(CSteamID, string, object?)

Check if a player has an active cooldown.

public bool HasCooldown(CSteamID player, string type, object? data = null)

Parameters

player CSteamID
type string
data object

Returns

bool

HasCooldown(CSteamID, string, out Cooldown, object?)

Check if a player has an active cooldown.

public bool HasCooldown(CSteamID player, string type, out Cooldown cooldown, object? data = null)

Parameters

player CSteamID
type string
cooldown Cooldown
data object

Returns

bool

HasCooldown(WarfarePlayer, string, object?)

Check if a player has an active cooldown.

public bool HasCooldown(WarfarePlayer player, string type, object? data = null)

Parameters

player WarfarePlayer
type string
data object

Returns

bool

HasCooldown(WarfarePlayer, string, out Cooldown, object?)

Check if a player has an active cooldown.

public bool HasCooldown(WarfarePlayer player, string type, out Cooldown cooldown, object? data = null)

Parameters

player WarfarePlayer
type string
cooldown Cooldown
data object

Returns

bool

RemoveCooldown(CSteamID)

Remove all cooldowns for the given player.

public void RemoveCooldown(CSteamID player)

Parameters

player CSteamID

RemoveCooldown(CSteamID, string, object?)

Remove all cooldowns of a type for the given player.

public void RemoveCooldown(CSteamID player, string type, object? data = null)

Parameters

player CSteamID
type string
data object

RemoveCooldown(string, object?)

Remove all cooldowns of the given type.

public void RemoveCooldown(string type, object? data = null)

Parameters

type string
data object

RemoveCooldown(WarfarePlayer)

Remove all cooldowns for the given player.

public void RemoveCooldown(WarfarePlayer player)

Parameters

player WarfarePlayer

RemoveCooldown(WarfarePlayer, string, object?)

Remove all cooldowns of a type for the given player.

public void RemoveCooldown(WarfarePlayer player, string type, object? data = null)

Parameters

player WarfarePlayer
type string
data object

StartCooldown(CSteamID, string, object?)

Start a cooldown on a player with a configured duration.

public void StartCooldown(CSteamID player, string type, object? data = null)

Parameters

player CSteamID
type string
data object

Exceptions

CooldownNotFoundException

StartCooldown(CSteamID, string, TimeSpan, object?)

Start a cooldown on a player with a custom duration.

public void StartCooldown(CSteamID player, string type, TimeSpan duration, object? data = null)

Parameters

player CSteamID
type string
duration TimeSpan
data object

StartCooldown(CSteamID, Cooldown)

Start a cooldown on a player with custom information.

public void StartCooldown(CSteamID player, Cooldown cooldown)

Parameters

player CSteamID
cooldown Cooldown

StartCooldown(WarfarePlayer, string, object?)

Start a cooldown on a player with a configured duration.

public void StartCooldown(WarfarePlayer player, string type, object? data = null)

Parameters

player WarfarePlayer
type string
data object

Exceptions

CooldownNotFoundException

StartCooldown(WarfarePlayer, string, TimeSpan, object?)

Start a cooldown on a player with a custom duration.

public void StartCooldown(WarfarePlayer player, string type, TimeSpan duration, object? data = null)

Parameters

player WarfarePlayer
type string
duration TimeSpan
data object

StartCooldown(WarfarePlayer, Cooldown)

Start a cooldown on a player with custom information.

public void StartCooldown(WarfarePlayer player, Cooldown cooldown)

Parameters

player WarfarePlayer
cooldown Cooldown