Table of Contents

Class KitRequestService

Namespace
Uncreated.Warfare.Kits.Requests
Assembly
Uncreated.Warfare.dll
public class KitRequestService : IRequestHandler<KitSignInstanceProvider, Kit>, IRequestHandler<Kit, Kit>, IDisposable
Inheritance
KitRequestService
Implements
Inherited Members

Constructors

KitRequestService(IKitDataStore, ITranslationValueFormatter, IPlayerService, LoadoutService, TranslationInjection<RequestKitsTranslations>, MapScheduler, CooldownManager, PlayerNitroBoostService, IKitAccessService, KitBestowService, IKitsDbContext, IKitItemResolver, EventDispatcher, DroppedItemTracker, SquadConfiguration, AssetRedirectService, PointsService, SquadMenuUI, ChatService, ZoneStore, ILogger<KitRequestService>)

public KitRequestService(IKitDataStore kitDataStore, ITranslationValueFormatter valueFormatter, IPlayerService playerService, LoadoutService loadoutService, TranslationInjection<RequestKitsTranslations> translations, MapScheduler mapScheduler, CooldownManager cooldownManager, PlayerNitroBoostService boostService, IKitAccessService kitAccessService, KitBestowService kitBestowService, IKitsDbContext kitDbContext, IKitItemResolver kitItemResolver, EventDispatcher eventDispatcher, DroppedItemTracker droppedItemTracker, SquadConfiguration squadConfiguration, AssetRedirectService assetRedirectService, PointsService pointsService, SquadMenuUI squadMenuUI, ChatService chatService, ZoneStore zoneStore, ILogger<KitRequestService> logger)

Parameters

kitDataStore IKitDataStore
valueFormatter ITranslationValueFormatter
playerService IPlayerService
loadoutService LoadoutService
translations TranslationInjection<RequestKitsTranslations>
mapScheduler MapScheduler
cooldownManager CooldownManager
boostService PlayerNitroBoostService
kitAccessService IKitAccessService
kitBestowService KitBestowService
kitDbContext IKitsDbContext
kitItemResolver IKitItemResolver
eventDispatcher EventDispatcher
droppedItemTracker DroppedItemTracker
squadConfiguration SquadConfiguration
assetRedirectService AssetRedirectService
pointsService PointsService
squadMenuUI SquadMenuUI
chatService ChatService
zoneStore ZoneStore
logger ILogger<KitRequestService>

Fields

DefaultKitId

public const string DefaultKitId = "default"

Field Value

string

Methods

BuyKitAsync(WarfarePlayer, Kit, Vector3?, CancellationToken)

Purchase a kit for a player.

public Task<bool> BuyKitAsync(WarfarePlayer player, Kit kit, Vector3? target = null, CancellationToken token = default)

Parameters

player WarfarePlayer
kit Kit
target Vector3?

Where to play the purchase SFX. If null the effect will be played at the player's position.

token CancellationToken

Returns

Task<bool>

false if the kit's credit cost is 0 or if the kit can't be found, otherwise true.

GiveAvailableFreeKitAsync(WarfarePlayer, bool, bool, CancellationToken)

public Task<bool> GiveAvailableFreeKitAsync(WarfarePlayer player, bool silent = false, bool isLowAmmo = false, CancellationToken token = default)

Parameters

player WarfarePlayer
silent bool
isLowAmmo bool
token CancellationToken

Returns

Task<bool>

GiveKitAsync(WarfarePlayer, KitBestowData, CancellationToken)

public Task GiveKitAsync(WarfarePlayer player, KitBestowData kitBestowData, CancellationToken token = default)

Parameters

player WarfarePlayer
kitBestowData KitBestowData
token CancellationToken

Returns

Task

GiveKitMainThread(WarfarePlayer, KitBestowData)

Used to give all players the unarmed kit when the game is over. It doesn't check layouts or hotkeys.

public void GiveKitMainThread(WarfarePlayer player, KitBestowData kitBestowData)

Parameters

player WarfarePlayer
kitBestowData KitBestowData

GiveUnarmedKitAsync(WarfarePlayer, bool, CancellationToken)

public Task<bool> GiveUnarmedKitAsync(WarfarePlayer player, bool silent = false, CancellationToken token = default)

Parameters

player WarfarePlayer
silent bool
token CancellationToken

Returns

Task<bool>

RemoveKitAsync(WarfarePlayer, CancellationToken)

public UniTask RemoveKitAsync(WarfarePlayer player, CancellationToken token = default)

Parameters

player WarfarePlayer
token CancellationToken

Returns

UniTask

RequestAsync(WarfarePlayer, Kit?, IRequestResultHandler, CancellationToken)

Handles a request for anything implementing IRequestable.

public Task<bool> RequestAsync(WarfarePlayer player, Kit? kit, IRequestResultHandler resultHandler, CancellationToken token = default)

Parameters

player WarfarePlayer
kit Kit
resultHandler IRequestResultHandler
token CancellationToken

Returns

Task<bool>

true if the request was granted, otherwise false.

RequestAsync(WarfarePlayer, KitSignInstanceProvider?, IRequestResultHandler, CancellationToken)

Handles a request for anything implementing IRequestable.

public Task<bool> RequestAsync(WarfarePlayer player, KitSignInstanceProvider? sign, IRequestResultHandler resultHandler, CancellationToken token = default)

Parameters

player WarfarePlayer
sign KitSignInstanceProvider
resultHandler IRequestResultHandler
token CancellationToken

Returns

Task<bool>

true if the request was granted, otherwise false.

RestockKitAsync(WarfarePlayer, bool, CancellationToken)

public Task RestockKitAsync(WarfarePlayer player, bool resupplyAmmoBags = false, CancellationToken token = default)

Parameters

player WarfarePlayer
resupplyAmmoBags bool
token CancellationToken

Returns

Task