Class PlayerNitroBoostService
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
serviceProviderIServiceProviderloggerILogger<PlayerNitroBoostService>
Methods
CheckNitroBoostStatus(ulong)
protected virtual Task<bool?> CheckNitroBoostStatus(ulong discordId)
Parameters
discordIdulong
Returns
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
steam64CSteamIDforceRecheckboolCheck again with the bot if the player's already online.
tokenCancellationToken
Returns
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
steam64CSteamID
Returns
- bool?
Exceptions
- NotSupportedException
Not ran on warfare.
ReceiveNitroBoostStatusUpdate(CSteamID, bool)
[RpcReceive]
protected void ReceiveNitroBoostStatusUpdate(CSteamID steam64, bool isNitroBoosting)
Parameters
steam64CSteamIDisNitroBoostingbool
SendCheckNitroBoostStatus(ulong)
[RpcSend("CheckNitroBoostStatusRpc")]
[RpcTimeout(3000)]
protected RpcTask<bool?> SendCheckNitroBoostStatus(ulong discordId)
Parameters
discordIdulong
Returns
- RpcTask<bool?>
SendNitroBoostStatusUpdate(CSteamID, bool)
[RpcSend("ReceiveNitroBoostStatusUpdate")]
[RpcFireAndForget]
public void SendNitroBoostStatusUpdate(CSteamID steam64, bool isNitroBoosting)
Parameters
steam64CSteamIDisNitroBoostingbool