async waitwhilecharacterisdrawing

This commit is contained in:
rootdarkarchon
2023-02-27 02:30:50 +01:00
parent 1aef3b1d2e
commit d1514472c1
6 changed files with 50 additions and 20 deletions

View File

@@ -310,7 +310,7 @@ public class CachedPlayer : MediatorSubscriberBase, IDisposable
}
_logger.LogDebug("[{applicationId}] Applying Customization Data for {handler}", applicationId, handler);
_dalamudUtil.WaitWhileCharacterIsDrawing(_logger, handler, applicationId, 30000);
await _dalamudUtil.WaitWhileCharacterIsDrawing(_logger, handler, applicationId, 30000).ConfigureAwait(false);
foreach (var change in changes.Value)
{
_logger.LogDebug("[{applicationId}] Processing {change} for {handler}", applicationId, change, handler);
@@ -445,7 +445,7 @@ public class CachedPlayer : MediatorSubscriberBase, IDisposable
Task.Run(async () =>
{
var applicationId = Guid.NewGuid();
_dalamudUtil.WaitWhileCharacterIsDrawing(_logger, _currentOtherChara!, applicationId, ct: token);
await _dalamudUtil.WaitWhileCharacterIsDrawing(_logger, _currentOtherChara!, applicationId, ct: token).ConfigureAwait(false);
_logger.LogDebug("Unauthorized character change detected");
await ApplyCustomizationData(applicationId, new(ObjectKind.Player,
new HashSet<PlayerChanges>(new[] { PlayerChanges.Palette, PlayerChanges.Customize, PlayerChanges.Heels, PlayerChanges.Mods })),

View File

@@ -414,7 +414,7 @@ public class IpcManager : MediatorSubscriberBase, IDisposable
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
if (!combinedToken.IsCancellationRequested)
_dalamudUtil.WaitWhileCharacterIsDrawing(logger, obj, applicationId, 30000, combinedToken);
await _dalamudUtil.WaitWhileCharacterIsDrawing(logger, obj, applicationId, 30000, combinedToken).ConfigureAwait(false);
_penumbraRedrawRequests[obj.Address] = false;
}