Table of Contents

Class PlayerNitroBoostService

Namespace
Uncreated.Warfare.Players
Assembly
Uncreated.Warfare.dll

Allows checking if players are Server Boosting in Discord.

[GenerateRpcSource]
[RpcGeneratedProxyType(TypeSetupMethodName = "__ModularRpcsGeneratedSetupStaticGeneratedProxy")]
public class PlayerNitroBoostService : IEventListener<PlayerJoined>
Inheritance
PlayerNitroBoostService
Implements
Inherited Members

Constructors

PlayerNitroBoostService(IServiceProvider, ILogger<PlayerNitroBoostService>)

public PlayerNitroBoostService(IServiceProvider serviceProvider, ILogger<PlayerNitroBoostService> logger)

Parameters

serviceProvider IServiceProvider
logger ILogger<PlayerNitroBoostService>

Methods

CheckNitroBoostStatus(ulong)

protected virtual Task<bool?> CheckNitroBoostStatus(ulong discordId)

Parameters

discordId ulong

Returns

Task<bool?>

IsBoosting(CSteamID, bool, CancellationToken)

Check if a player is nitro boosting. Defaults to the last known value if the bot can't be contacted.

public ValueTask<bool> IsBoosting(CSteamID steam64, bool forceRecheck = false, CancellationToken token = default)

Parameters

steam64 CSteamID
forceRecheck bool

Check again with the bot if the player's already online.

token CancellationToken

Returns

ValueTask<bool>

Exceptions

NotSupportedException

Not ran on warfare.

IsBoostingQuick(CSteamID)

Check if a player is nitro boosting, returning the last known value without contacting the bot.

public bool? IsBoostingQuick(CSteamID steam64)

Parameters

steam64 CSteamID

Returns

bool?

Exceptions

NotSupportedException

Not ran on warfare.

ReceiveNitroBoostStatusUpdate(CSteamID, bool)

[RpcReceive]
protected void ReceiveNitroBoostStatusUpdate(CSteamID steam64, bool isNitroBoosting)

Parameters

steam64 CSteamID
isNitroBoosting bool

SendCheckNitroBoostStatus(ulong)

[RpcSend("CheckNitroBoostStatusRpc")]
[RpcTimeout(3000)]
protected RpcTask<bool?> SendCheckNitroBoostStatus(ulong discordId)

Parameters

discordId ulong

Returns

RpcTask<bool?>

SendNitroBoostStatusUpdate(CSteamID, bool)

[RpcSend("ReceiveNitroBoostStatusUpdate")]
[RpcFireAndForget]
public void SendNitroBoostStatusUpdate(CSteamID steam64, bool isNitroBoosting)

Parameters

steam64 CSteamID
isNitroBoosting bool