safeguard pose/world data generation loops

This commit is contained in:
Stanley Dimant
2025-01-20 10:29:51 +01:00
parent 59bbfcff27
commit aeb582d61e

View File

@@ -370,6 +370,8 @@ public class CharaDataGposeTogetherManager : DisposableMediatorSubscriberBase
if (!_dalamudUtil.IsInGpose) continue; if (!_dalamudUtil.IsInGpose) continue;
if (_usersInLobby.Count == 0) continue; if (_usersInLobby.Count == 0) continue;
try
{
var chara = await _dalamudUtil.GetPlayerCharacterAsync().ConfigureAwait(false); var chara = await _dalamudUtil.GetPlayerCharacterAsync().ConfigureAwait(false);
if (_dalamudUtil.IsInGpose) if (_dalamudUtil.IsInGpose)
{ {
@@ -399,6 +401,11 @@ public class CharaDataGposeTogetherManager : DisposableMediatorSubscriberBase
if (poseData.IsDelta) if (poseData.IsDelta)
_lastDeltaPoseData = poseData; _lastDeltaPoseData = poseData;
} }
catch (Exception ex)
{
Logger.LogWarning(ex, "Error during Pose Data Generation");
}
}
} }
private async Task GposeWorldPositionBackgroundTask(CancellationToken ct) private async Task GposeWorldPositionBackgroundTask(CancellationToken ct)
@@ -410,6 +417,8 @@ public class CharaDataGposeTogetherManager : DisposableMediatorSubscriberBase
// if there are no players in lobby, don't do anything // if there are no players in lobby, don't do anything
if (_usersInLobby.Count == 0) continue; if (_usersInLobby.Count == 0) continue;
try
{
// get own player data // get own player data
var player = (Dalamud.Game.ClientState.Objects.Types.ICharacter?)(await _dalamudUtil.GetPlayerCharacterAsync().ConfigureAwait(false)); var player = (Dalamud.Game.ClientState.Objects.Types.ICharacter?)(await _dalamudUtil.GetPlayerCharacterAsync().ConfigureAwait(false));
if (player == null) continue; if (player == null) continue;
@@ -484,6 +493,11 @@ public class CharaDataGposeTogetherManager : DisposableMediatorSubscriberBase
} }
} }
} }
catch (Exception ex)
{
Logger.LogWarning(ex, "Error during World Data Generation");
}
}
} }
private void OnCutsceneFrameworkUpdate() private void OnCutsceneFrameworkUpdate()