minor fixes
This commit is contained in:
		| @@ -36,11 +36,11 @@ public sealed class IpcManager : DisposableMediatorSubscriberBase | |||||||
|     private readonly ICallGateSubscriber<GameObject, object?> _heelsUnregisterPlayer; |     private readonly ICallGateSubscriber<GameObject, object?> _heelsUnregisterPlayer; | ||||||
|     private readonly ICallGateSubscriber<(uint major, uint minor)> _honorificApiVersion; |     private readonly ICallGateSubscriber<(uint major, uint minor)> _honorificApiVersion; | ||||||
|     private readonly ICallGateSubscriber<Character, object> _honorificClearCharacterTitle; |     private readonly ICallGateSubscriber<Character, object> _honorificClearCharacterTitle; | ||||||
|  |     private readonly ICallGateSubscriber<object> _honorificDisposing; | ||||||
|     private readonly ICallGateSubscriber<string> _honorificGetLocalCharacterTitle; |     private readonly ICallGateSubscriber<string> _honorificGetLocalCharacterTitle; | ||||||
|     private readonly ICallGateSubscriber<string, object> _honorificLocalCharacterTitleChanged; |     private readonly ICallGateSubscriber<string, object> _honorificLocalCharacterTitleChanged; | ||||||
|     private readonly ICallGateSubscriber<Character, string, object> _honorificSetCharacterTitle; |  | ||||||
|     private readonly ICallGateSubscriber<object> _honorificDisposing; |  | ||||||
|     private readonly ICallGateSubscriber<object> _honorificReady; |     private readonly ICallGateSubscriber<object> _honorificReady; | ||||||
|  |     private readonly ICallGateSubscriber<Character, string, object> _honorificSetCharacterTitle; | ||||||
|     private readonly ConcurrentQueue<Action> _normalQueue = new(); |     private readonly ConcurrentQueue<Action> _normalQueue = new(); | ||||||
|     private readonly ICallGateSubscriber<string> _palettePlusApiVersion; |     private readonly ICallGateSubscriber<string> _palettePlusApiVersion; | ||||||
|     private readonly ICallGateSubscriber<Character, string> _palettePlusBuildCharaPalette; |     private readonly ICallGateSubscriber<Character, string> _palettePlusBuildCharaPalette; | ||||||
| @@ -155,6 +155,8 @@ public sealed class IpcManager : DisposableMediatorSubscriberBase | |||||||
|         Mediator.Subscribe<CutsceneFrameworkUpdateMessage>(this, (_) => HandleGposeActionQueue()); |         Mediator.Subscribe<CutsceneFrameworkUpdateMessage>(this, (_) => HandleGposeActionQueue()); | ||||||
|         Mediator.Subscribe<ZoneSwitchEndMessage>(this, (_) => ClearActionQueue()); |         Mediator.Subscribe<ZoneSwitchEndMessage>(this, (_) => ClearActionQueue()); | ||||||
|         Mediator.Subscribe<DelayedFrameworkUpdateMessage>(this, (_) => PeriodicApiStateCheck()); |         Mediator.Subscribe<DelayedFrameworkUpdateMessage>(this, (_) => PeriodicApiStateCheck()); | ||||||
|  |  | ||||||
|  |         PeriodicApiStateCheck(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public bool Initialized => CheckPenumbraApiInternal() && CheckGlamourerApiInternal(); |     public bool Initialized => CheckPenumbraApiInternal() && CheckGlamourerApiInternal(); | ||||||
| @@ -337,22 +339,29 @@ public sealed class IpcManager : DisposableMediatorSubscriberBase | |||||||
|     { |     { | ||||||
|         if (!CheckHonorificApi()) return; |         if (!CheckHonorificApi()) return; | ||||||
|         Logger.LogTrace("Applying Honorific data to {chara}", character.ToString("X")); |         Logger.LogTrace("Applying Honorific data to {chara}", character.ToString("X")); | ||||||
|         await _dalamudUtil.RunOnFrameworkThread(() => |         try | ||||||
|         { |         { | ||||||
|             var gameObj = _dalamudUtil.CreateGameObject(character); |             await _dalamudUtil.RunOnFrameworkThread(() => | ||||||
|             if (gameObj is PlayerCharacter pc) |  | ||||||
|             { |             { | ||||||
|                 string honorificData = string.IsNullOrEmpty(honorificDataB64) ? string.Empty : Encoding.UTF8.GetString(Convert.FromBase64String(honorificDataB64)); |                 var gameObj = _dalamudUtil.CreateGameObject(character); | ||||||
|                 if (string.IsNullOrEmpty(honorificData)) |                 if (gameObj is PlayerCharacter pc) | ||||||
|                 { |                 { | ||||||
|                     _honorificClearCharacterTitle!.InvokeAction(pc); |                     string honorificData = string.IsNullOrEmpty(honorificDataB64) ? string.Empty : Encoding.UTF8.GetString(Convert.FromBase64String(honorificDataB64)); | ||||||
|  |                     if (string.IsNullOrEmpty(honorificData)) | ||||||
|  |                     { | ||||||
|  |                         _honorificClearCharacterTitle!.InvokeAction(pc); | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         _honorificSetCharacterTitle!.InvokeAction(pc, honorificData); | ||||||
|  |                     } | ||||||
|                 } |                 } | ||||||
|                 else |             }).ConfigureAwait(false); | ||||||
|                 { |         } | ||||||
|                     _honorificSetCharacterTitle!.InvokeAction(pc, honorificData); |         catch (Exception e) | ||||||
|                 } |         { | ||||||
|             } |             Logger.LogWarning(e, "Could not apply Honorific data"); | ||||||
|         }).ConfigureAwait(false); |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public async Task<string> PalettePlusBuildPaletteAsync() |     public async Task<string> PalettePlusBuildPaletteAsync() | ||||||
| @@ -645,17 +654,17 @@ public sealed class IpcManager : DisposableMediatorSubscriberBase | |||||||
|         Mediator.Publish(new CustomizePlusMessage()); |         Mediator.Publish(new CustomizePlusMessage()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     private void OnHonorificDisposing() | ||||||
|  |     { | ||||||
|  |         Mediator.Publish(new HonorificMessage(string.Empty)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     private void OnHonorificLocalCharacterTitleChanged(string titleJson) |     private void OnHonorificLocalCharacterTitleChanged(string titleJson) | ||||||
|     { |     { | ||||||
|         string titleData = string.IsNullOrEmpty(titleJson) ? string.Empty : Convert.ToBase64String(Encoding.UTF8.GetBytes(titleJson)); |         string titleData = string.IsNullOrEmpty(titleJson) ? string.Empty : Convert.ToBase64String(Encoding.UTF8.GetBytes(titleJson)); | ||||||
|         Mediator.Publish(new HonorificMessage(titleData)); |         Mediator.Publish(new HonorificMessage(titleData)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void OnHonorificDisposing() |  | ||||||
|     { |  | ||||||
|         Mediator.Publish(new HonorificMessage(string.Empty)); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     private void OnHonorificReady() |     private void OnHonorificReady() | ||||||
|     { |     { | ||||||
|         _honorificAvailable = CheckHonorificApiInternal(); |         _honorificAvailable = CheckHonorificApiInternal(); | ||||||
|   | |||||||
| @@ -535,11 +535,11 @@ public sealed class CachedPlayer : DisposableMediatorSubscriberBase | |||||||
|                 _lastGlamourerData = await _ipcManager.GlamourerGetCharacterCustomizationAsync(PlayerCharacter).ConfigureAwait(false); |                 _lastGlamourerData = await _ipcManager.GlamourerGetCharacterCustomizationAsync(PlayerCharacter).ConfigureAwait(false); | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|         Mediator.Subscribe<HonorificReadyMessage>(this,  async (_) => |         Mediator.Subscribe<HonorificReadyMessage>(this, async (_) => | ||||||
|         { |         { | ||||||
|             if (string.IsNullOrEmpty(_cachedData?.HonorificData)) return; |             if (string.IsNullOrEmpty(_cachedData?.HonorificData)) return; | ||||||
|             Logger.LogTrace("Reapplying Honorific data for {this}", this); |             Logger.LogTrace("Reapplying Honorific data for {this}", this); | ||||||
|            await _ipcManager.HonorificSetTitleAsync(PlayerCharacter, _cachedData.HonorificData).ConfigureAwait(false); |             await _ipcManager.HonorificSetTitleAsync(PlayerCharacter, _cachedData.HonorificData).ConfigureAwait(false); | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|         _downloadManager.Initialize(); |         _downloadManager.Initialize(); | ||||||
|   | |||||||
| @@ -332,7 +332,15 @@ public class DalamudUtilService : IHostedService | |||||||
|  |  | ||||||
|     private unsafe void FrameworkOnUpdateInternal() |     private unsafe void FrameworkOnUpdateInternal() | ||||||
|     { |     { | ||||||
|         if (_clientState.LocalPlayer?.IsDead ?? false) return; |         if (_clientState.LocalPlayer == null) | ||||||
|  |         { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         if (_clientState.LocalPlayer?.IsDead ?? false) | ||||||
|  |         { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         IsAnythingDrawing = false; |         IsAnythingDrawing = false; | ||||||
|         _playerCharas = _performanceCollector.LogPerformance(this, "ObjTableToCharas", |         _playerCharas = _performanceCollector.LogPerformance(this, "ObjTableToCharas", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 rootdarkarchon
					rootdarkarchon