why did I start writing this plugin

This commit is contained in:
Stanley Dimant
2022-06-27 12:31:41 +02:00
parent 61b178e2c0
commit c7439ac769
7 changed files with 53 additions and 39 deletions

View File

@@ -70,12 +70,12 @@ public class CachedPlayer
{
Logger.Debug("Received total " + e.CharacterData.FileReplacements.Count + " file replacement data");
_cache[e.CharacterData.Hash] = e.CharacterData;
_lastAppliedEquipmentHash = e.CharacterData.Hash;
}
else
{
Logger.Debug("Had valid local cache for " + PlayerName);
}
_lastAppliedEquipmentHash = e.CharacterData.Hash;
DownloadAndApplyCharacter();
}
@@ -158,15 +158,19 @@ public class CachedPlayer
try
{
Logger.Debug("Restoring state for " + PlayerName);
IsVisible = false;
_downloadCancellationTokenSource?.Cancel();
_downloadCancellationTokenSource?.Dispose();
_downloadCancellationTokenSource = null;
_dalamudUtil.RemovePlayerFromWatch(PlayerName);
_ipcManager.PenumbraRemoveTemporaryCollection(PlayerName);
_ipcManager.GlamourerRevertCharacterCustomization(PlayerName);
_ipcManager.GlamourerApplyOnlyCustomization(_originalGlamourerData, PlayerName);
_ipcManager.GlamourerApplyOnlyEquipment(_lastGlamourerData, PlayerName);
if (IsVisible)
{
_ipcManager.GlamourerRevertCharacterCustomization(PlayerName);
_ipcManager.GlamourerApplyOnlyCustomization(_originalGlamourerData, PlayerName);
_ipcManager.GlamourerApplyOnlyEquipment(_lastGlamourerData, PlayerName);
}
IsVisible = false;
}
catch (Exception ex)
{
@@ -215,6 +219,7 @@ public class CachedPlayer
if (RequestedPenumbraRedraw == false && !string.IsNullOrEmpty(_lastAppliedEquipmentHash))
{
Logger.Warn("Unauthorized character change detected");
DownloadAndApplyCharacter();
}
else