fully switch to mediator from events
This commit is contained in:
@@ -6,6 +6,7 @@ namespace MareSynchronos.Utils;
|
||||
|
||||
public static class Crypto
|
||||
{
|
||||
#pragma warning disable SYSLIB0021 // Type or member is obsolete
|
||||
public static string GetFileHash(this string filePath)
|
||||
{
|
||||
using SHA1CryptoServiceProvider cryptoProvider = new();
|
||||
@@ -29,4 +30,5 @@ public static class Crypto
|
||||
using SHA256CryptoServiceProvider cryptoProvider = new();
|
||||
return BitConverter.ToString(cryptoProvider.ComputeHash(Encoding.UTF8.GetBytes(character.Name + character.HomeWorld.Id.ToString()))).Replace("-", "", StringComparison.Ordinal);
|
||||
}
|
||||
#pragma warning restore SYSLIB0021 // Type or member is obsolete
|
||||
}
|
||||
|
||||
@@ -107,6 +107,7 @@ public class DalamudUtil : IDisposable
|
||||
Logger.Debug("Zone switch/Gpose start");
|
||||
_sentBetweenAreas = true;
|
||||
_mediator.Publish(new ZoneSwitchStartMessage());
|
||||
_mediator.Publish(new HaltScanMessage("Zone switch"));
|
||||
}
|
||||
|
||||
if (IsInGpose) _mediator.Publish(new GposeFrameworkUpdateMessage());
|
||||
@@ -119,6 +120,7 @@ public class DalamudUtil : IDisposable
|
||||
Logger.Debug("Zone switch/Gpose end");
|
||||
_sentBetweenAreas = false;
|
||||
_mediator.Publish(new ZoneSwitchEndMessage());
|
||||
_mediator.Publish(new ResumeScanMessage("Zone switch"));
|
||||
}
|
||||
|
||||
_mediator.Publish(new FrameworkUpdateMessage());
|
||||
|
||||
18
MareSynchronos/Utils/MediatorSubscriberBase.cs
Normal file
18
MareSynchronos/Utils/MediatorSubscriberBase.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using MareSynchronos.Mediator;
|
||||
|
||||
namespace MareSynchronos.Utils;
|
||||
|
||||
public abstract class MediatorSubscriberBase : IDisposable
|
||||
{
|
||||
protected MediatorSubscriberBase(MareMediator mediator)
|
||||
{
|
||||
Mediator = mediator;
|
||||
}
|
||||
|
||||
protected MareMediator Mediator;
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
Mediator.UnsubscribeAll(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user