mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 21:17:22 +01:00
fix potential cancelaltion on updateshareddata
This commit is contained in:
parent
4a2cd80def
commit
722f3ec338
1 changed files with 17 additions and 8 deletions
|
|
@ -28,6 +28,7 @@ public sealed class CharaDataNearbyManager : DisposableMediatorSubscriberBase
|
|||
private Task? _filterEntriesRunningTask;
|
||||
private (Guid VfxId, PoseEntryExtended Pose)? _hoveredVfx = null;
|
||||
private DateTime _lastExecutionTime = DateTime.UtcNow;
|
||||
private SemaphoreSlim _sharedDataUpdateSemaphore = new(1, 1);
|
||||
public CharaDataNearbyManager(ILogger<CharaDataNearbyManager> logger, MareMediator mediator,
|
||||
DalamudUtilService dalamudUtilService, VfxSpawnManager vfxSpawnManager,
|
||||
ServerConfigurationManager serverConfigurationManager,
|
||||
|
|
@ -49,6 +50,9 @@ public sealed class CharaDataNearbyManager : DisposableMediatorSubscriberBase
|
|||
public string UserNoteFilter { get; set; } = string.Empty;
|
||||
|
||||
public void UpdateSharedData(Dictionary<string, CharaDataMetaInfoExtendedDto?> newData)
|
||||
{
|
||||
_sharedDataUpdateSemaphore.Wait();
|
||||
try
|
||||
{
|
||||
_metaInfoCache.Clear();
|
||||
foreach (var kvp in newData)
|
||||
|
|
@ -63,6 +67,11 @@ public sealed class CharaDataNearbyManager : DisposableMediatorSubscriberBase
|
|||
list.Add(kvp.Value);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_sharedDataUpdateSemaphore.Release();
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetHoveredVfx(PoseEntryExtended? hoveredPose)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue