Skip to main content

CosmeticPackScheduler

A class in Root.Township, Alta.Customization.

Queue that runs character cosmetic packing one CosmeticPacker at a time. Client side; use the static Instance.

Constructors​

MemberWhat it is
CosmeticPackScheduler()Creates a CosmeticPackScheduler with default values.

Fields​

7 private and internal fields
MemberWhat it is
private CancellationTokenSource cancelCurrentCancellation source for the pack in progress.
private CosmeticPacker currentThe packer being packed now, or null when idle.
private HashSet<CosmeticPacker> inQueueSet of queued packers, used to skip duplicates and cancelled entries.
private static Logger loggerNLog logger for this class.
private AddressableSession packSessionAddressable session shared by all packs in one run of the queue; disposed when the queue empties.
private IPlatformDevice platformDevicePlatform device service, used to switch the CharacterPaking FFV source while packing.
private Queue<CosmeticPacker> queuePackers waiting to be packed, in order.

Properties​

MemberWhat it is
static CosmeticPackScheduler Instance { get; }The single shared scheduler.

Methods​

MemberWhat it is
void Cancel(CosmeticPacker packer)Cancels the packer if it is packing now, or drops it from the queue.
void Enqueue(CosmeticPacker packer)Queues a packer. If that packer is already packing, its current pack is cancelled and it is queued again.
1 private and internal method
MemberWhat it is
private async void StartProcessing()Works through the queue, calling each packer's PackFromScheduler with one shared addressable session, and logs errors instead of stopping.