rebuild PlayerManager to CacheCreationService and optimize creation of the local file cache

This commit is contained in:
rootdarkarchon
2023-02-02 15:25:58 +01:00
parent 86549b2d3f
commit ede62fabae
23 changed files with 461 additions and 737 deletions

View File

@@ -226,11 +226,13 @@ public class DalamudUtil : IDisposable
{
if (!_clientState.IsLoggedIn || characterAddress == IntPtr.Zero) return;
Logger.Verbose($"Starting wait for {name} to draw");
var obj = (GameObject*)characterAddress;
const int tick = 250;
int curWaitTime = 0;
// ReSharper disable once LoopVariableIsNeverChangedInsideLoop
while ((obj->RenderFlags & 0b100000000000) == 0b100000000000 && (!ct?.IsCancellationRequested ?? true) && curWaitTime < timeOut) // 0b100000000000 is "still rendering" or something
while ((obj->DrawObject == null || (obj->RenderFlags & 0b100000000000) == 0b100000000000) && (!ct?.IsCancellationRequested ?? true) && curWaitTime < timeOut) // 0b100000000000 is "still rendering" or something
{
Logger.Verbose($"Waiting for {name} to finish drawing");
curWaitTime += tick;