mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 16:47:22 +01:00
debounce, ignore processing when dead only in duty
This commit is contained in:
parent
85058379e7
commit
11535caf7e
2 changed files with 5 additions and 3 deletions
|
|
@ -195,7 +195,7 @@ public sealed class CacheCreationService : DisposableMediatorSubscriberBase
|
||||||
_creationCts.Cancel();
|
_creationCts.Cancel();
|
||||||
_creationCts.Dispose();
|
_creationCts.Dispose();
|
||||||
_creationCts = new();
|
_creationCts = new();
|
||||||
_cacheCreateLock.Wait();
|
_cacheCreateLock.Wait(_creationCts.Token);
|
||||||
var objectKindsToCreate = _cachesToCreate.ToList();
|
var objectKindsToCreate = _cachesToCreate.ToList();
|
||||||
foreach (var creationObj in objectKindsToCreate)
|
foreach (var creationObj in objectKindsToCreate)
|
||||||
{
|
{
|
||||||
|
|
@ -208,12 +208,14 @@ public sealed class CacheCreationService : DisposableMediatorSubscriberBase
|
||||||
{
|
{
|
||||||
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_creationCts.Token, _runtimeCts.Token);
|
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_creationCts.Token, _runtimeCts.Token);
|
||||||
|
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(1), linkedCts.Token).ConfigureAwait(false);
|
||||||
|
|
||||||
Logger.LogDebug("Creating Caches for {objectKinds}", string.Join(", ", objectKindsToCreate));
|
Logger.LogDebug("Creating Caches for {objectKinds}", string.Join(", ", objectKindsToCreate));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Dictionary<ObjectKind, CharacterDataFragment?> createdData = [];
|
Dictionary<ObjectKind, CharacterDataFragment?> createdData = [];
|
||||||
foreach (var objectKind in objectKindsToCreate)
|
foreach (var objectKind in _currentlyCreating)
|
||||||
{
|
{
|
||||||
createdData[objectKind] = await _characterDataFactory.BuildCharacterData(_playerRelatedObjects[objectKind], linkedCts.Token).ConfigureAwait(false);
|
createdData[objectKind] = await _characterDataFactory.BuildCharacterData(_playerRelatedObjects[objectKind], linkedCts.Token).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -614,7 +614,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||||
|
|
||||||
private unsafe void FrameworkOnUpdateInternal()
|
private unsafe void FrameworkOnUpdateInternal()
|
||||||
{
|
{
|
||||||
if (_clientState.LocalPlayer?.IsDead ?? false)
|
if ((_clientState.LocalPlayer?.IsDead ?? false) && _condition[ConditionFlag.BoundByDuty])
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue