dispose all players on zoning

This commit is contained in:
Stanley Dimant
2022-09-17 03:40:40 +02:00
parent 574cdb0b24
commit a27fa1a13d
5 changed files with 27 additions and 13 deletions

View File

@@ -20,6 +20,7 @@ namespace MareSynchronos.Utils
public delegate void ClassJobChanged();
public delegate void FrameworkUpdate();
public delegate void VoidDelegate();
public class DalamudUtil : IDisposable
{
@@ -34,7 +35,9 @@ namespace MareSynchronos.Utils
public event ClassJobChanged? ClassJobChanged;
private uint? classJobId = 0;
public event FrameworkUpdate? DelayedFrameworkUpdate;
public event VoidDelegate? ZoneSwitched;
private DateTime _delayedFrameworkUpdateCheck = DateTime.Now;
private bool _sentBetweenAreas = false;
public unsafe bool IsGameObjectPresent(IntPtr key)
{
@@ -69,9 +72,18 @@ namespace MareSynchronos.Utils
{
if (_condition[ConditionFlag.BetweenAreas] || _condition[ConditionFlag.BetweenAreas51] || IsInGpose)
{
if (!_sentBetweenAreas)
{
Logger.Debug("Invoking between areas");
_sentBetweenAreas = true;
ZoneSwitched?.Invoke();
}
return;
}
_sentBetweenAreas = false;
foreach (FrameworkUpdate? frameworkInvocation in (FrameworkUpdate?.GetInvocationList() ?? Array.Empty<FrameworkUpdate>()).Cast<FrameworkUpdate>())
{
try