Table of Contents

Class MySqlKitAccessService

Namespace
Uncreated.Warfare.Kits
Assembly
Uncreated.Warfare.dll
[GenerateRpcSource]
[RpcGeneratedProxyType(TypeSetupMethodName = "__ModularRpcsGeneratedSetupStaticGeneratedProxy")]
public class MySqlKitAccessService : IKitAccessService, IDisposable
Inheritance
MySqlKitAccessService
Implements
Inherited Members

Constructors

MySqlKitAccessService(IServiceProvider, ILogger<MySqlKitAccessService>)

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

Parameters

serviceProvider IServiceProvider
logger ILogger<MySqlKitAccessService>

Methods

GetAccessAsync(CSteamID, uint, CancellationToken)

Get the access type a player has for a kit.

public Task<KitAccessType?> GetAccessAsync(CSteamID steam64, uint primaryKey, CancellationToken token = default)

Parameters

steam64 CSteamID

The player's Steam64 ID.

primaryKey uint

The primary key of the kit.

token CancellationToken

Returns

Task<KitAccessType?>

The type of access if they have access, otherwise null.

GetOwnedKitKeysAsync(CSteamID, CancellationToken)

Get a list of the primary keys of all kits a player owns.

public Task<IList<uint>> GetOwnedKitKeysAsync(CSteamID steam64, CancellationToken token = default)

Parameters

steam64 CSteamID

The player's Steam64 ID.

token CancellationToken

Returns

Task<IList<uint>>

HasAccessAsync(CSteamID, uint, CancellationToken)

Check if a player has access to a kit.

public Task<bool> HasAccessAsync(CSteamID steam64, uint primaryKey, CancellationToken token = default)

Parameters

steam64 CSteamID

The player's Steam64 ID.

primaryKey uint

The primary key of the kit.

token CancellationToken

Returns

Task<bool>

true if they have access to the kit, otherwise false.

ReceiveAccessUpdated(ulong, uint, ulong, KitAccessType?)

[RpcReceive]
public void ReceiveAccessUpdated(ulong player, uint primaryKey, ulong instigator, KitAccessType? newAccess)

Parameters

player ulong
primaryKey uint
instigator ulong
newAccess KitAccessType?

ReceiveAccessUpdatedBulk(ulong, uint[], ulong, KitAccessType?)

[RpcReceive]
public void ReceiveAccessUpdatedBulk(ulong player, uint[] primaryKeys, ulong instigator, KitAccessType? newAccess)

Parameters

player ulong
primaryKeys uint[]
instigator ulong
newAccess KitAccessType?

SendAccessUpdated(ulong, uint, ulong, KitAccessType?)

[RpcSend("ReceiveAccessUpdated")]
[RpcTimeout(3000)]
[RpcFireAndForget]
protected RpcTask SendAccessUpdated(ulong player, uint primaryKey, ulong instigator, KitAccessType? newAccess)

Parameters

player ulong
primaryKey uint
instigator ulong
newAccess KitAccessType?

Returns

RpcTask

SendAccessUpdatedBulk(ulong, uint[], ulong, KitAccessType?)

[RpcSend("ReceiveAccessUpdatedBulk")]
[RpcTimeout(5000)]
[RpcFireAndForget]
protected RpcTask SendAccessUpdatedBulk(ulong player, uint[] primaryKeys, ulong instigator, KitAccessType? newAccess)

Parameters

player ulong
primaryKeys uint[]
instigator ulong
newAccess KitAccessType?

Returns

RpcTask

SendUpdateAccess(IModularRpcRemoteConnection, ulong, uint, KitAccessType?, CancellationToken)

[RpcSend("ReceiveUpdateAccess")]
protected RpcTask<bool> SendUpdateAccess(IModularRpcRemoteConnection connection, ulong player, uint primaryKey, KitAccessType? newAccess, CancellationToken token = default)

Parameters

connection IModularRpcRemoteConnection
player ulong
primaryKey uint
newAccess KitAccessType?
token CancellationToken

Returns

RpcTask<bool>

SendUpdateAccessBulk(IModularRpcRemoteConnection, ulong, uint[], KitAccessType?, CancellationToken)

[RpcSend("ReceiveUpdateAccessBulk")]
[RpcTimeout(60000)]
protected RpcTask<bool[]> SendUpdateAccessBulk(IModularRpcRemoteConnection connection, ulong player, uint[] primaryKeys, KitAccessType? newAccess, CancellationToken token = default)

Parameters

connection IModularRpcRemoteConnection
player ulong
primaryKeys uint[]
newAccess KitAccessType?
token CancellationToken

Returns

RpcTask<bool[]>

UpdateAccessAsync(CSteamID, uint, KitAccessType?, CSteamID, CancellationToken)

Set the access type a player has for a kit.

public Task<bool> UpdateAccessAsync(CSteamID steam64, uint primaryKey, KitAccessType? access, CSteamID instigator, CancellationToken token = default)

Parameters

steam64 CSteamID

The player's Steam64 ID.

primaryKey uint

The primary key of the kit.

access KitAccessType?

The access to give the player. If this is null, the player's access will be removed

instigator CSteamID
token CancellationToken

Returns

Task<bool>

true if the player's access was updated, otherwise false if no changes were made.

UpdateAccessBulkAsync(CSteamID, uint[], KitAccessType?, CSteamID, CancellationToken)

Set the access type a player has for multiple kits at once.

public Task<bool[]> UpdateAccessBulkAsync(CSteamID steam64, uint[] primaryKeys, KitAccessType? access, CSteamID instigator, CancellationToken token = default)

Parameters

steam64 CSteamID

The player's Steam64 ID.

primaryKeys uint[]

List of primary keys to apply changes to.

access KitAccessType?

The access to give the player. If this is null, the player's access will be removed

instigator CSteamID
token CancellationToken

Returns

Task<bool[]>

true if the player's access was updated for at least one kit, otherwise false if no changes were made.

Events

PlayerAccessUpdated

Invoked when a player's kit access is updated remotely or locally.

public event KitAccessUpdatedHandler? PlayerAccessUpdated

Event Type

KitAccessUpdatedHandler