fixes for pet handling, uploads, clear storage button, remove button while reconnecting, put paused to online/paused, put visible to online

This commit is contained in:
rootdarkarchon
2023-02-05 15:52:27 +01:00
parent 673d098827
commit 3634c06ee5
17 changed files with 241 additions and 179 deletions

View File

@@ -237,7 +237,7 @@ public class DalamudUtil : IDisposable
while ((!ct?.IsCancellationRequested ?? true)
&& curWaitTime < timeOut
&& (((obj->GetDrawObject() == null
|| ((CharacterBase*)obj->GetDrawObject())->HasModelFilesInSlotLoaded != 0
|| ((CharacterBase*)obj->GetDrawObject())->HasModelInSlotLoaded != 0
|| ((CharacterBase*)obj->GetDrawObject())->HasModelFilesInSlotLoaded != 0))
|| ((obj->RenderFlags & 0b100000000000) == 0b100000000000))) // 0b100000000000 is "still rendering" or something
{
@@ -246,6 +246,10 @@ public class DalamudUtil : IDisposable
Thread.Sleep(tick);
}
}
catch (NullReferenceException ex)
{
Logger.Warn("Error accessing " + characterAddress.ToString("X") + ", object does not exist anymore?", ex);
}
catch (AccessViolationException ex)
{
Logger.Warn("Error accessing " + characterAddress.ToString("X") + ", object does not exist anymore?", ex);

View File

@@ -29,14 +29,14 @@ public class FileReplacementComparer : IEqualityComparer<FileReplacement>
return hash;
}
private bool CompareLists(List<string> list1, List<string> list2)
private bool CompareLists(HashSet<string> list1, HashSet<string> list2)
{
if (list1.Count != list2.Count)
return false;
for (int i = 0; i < list1.Count; i++)
{
if (!string.Equals(list1[i], list2[i], StringComparison.OrdinalIgnoreCase))
if (!string.Equals(list1.ElementAt(i), list2.ElementAt(i), StringComparison.OrdinalIgnoreCase))
return false;
}

View File

@@ -74,17 +74,17 @@ internal class Logger : ILogger
switch (logLevel)
{
case LogLevel.Debug:
PluginLog.Debug($"[{_name}] [{eventId}] {formatter(state, exception)}");
Debug($"[{_name}] [{eventId}] {formatter(state, exception)}");
break;
case LogLevel.Error:
case LogLevel.Critical:
PluginLog.Error($"[{_name}] [{eventId}] {formatter(state, exception)}");
Error($"[{_name}] [{eventId}] {formatter(state, exception)}", exception);
break;
case LogLevel.Information:
PluginLog.Information($"[{_name}] [{eventId}] {formatter(state, exception)}");
Info($"[{_name}] [{eventId}] {formatter(state, exception)}");
break;
case LogLevel.Warning:
PluginLog.Warning($"[{_name}] [{eventId}] {formatter(state, exception)}");
Warn($"[{_name}] [{eventId}] {formatter(state, exception)}", exception);
break;
case LogLevel.Trace:
default: