preliminary api10 update
This commit is contained in:
@@ -12,25 +12,25 @@ namespace MareSynchronos.Interop.Ipc;
|
|||||||
public sealed class IpcCallerCustomize : IIpcCaller
|
public sealed class IpcCallerCustomize : IIpcCaller
|
||||||
{
|
{
|
||||||
private readonly ICallGateSubscriber<(int, int)> _customizePlusApiVersion;
|
private readonly ICallGateSubscriber<(int, int)> _customizePlusApiVersion;
|
||||||
private readonly ICallGateSubscriber<Character, (int, Guid?)> _customizePlusGetActiveProfile;
|
private readonly ICallGateSubscriber<ICharacter, (int, Guid?)> _customizePlusGetActiveProfile;
|
||||||
private readonly ICallGateSubscriber<Guid, (int, string?)> _customizePlusGetProfileById;
|
private readonly ICallGateSubscriber<Guid, (int, string?)> _customizePlusGetProfileById;
|
||||||
private readonly ICallGateSubscriber<Character, Guid, object> _customizePlusOnScaleUpdate;
|
private readonly ICallGateSubscriber<ICharacter, Guid, object> _customizePlusOnScaleUpdate;
|
||||||
private readonly ICallGateSubscriber<Character, int> _customizePlusRevertCharacter;
|
private readonly ICallGateSubscriber<ICharacter, int> _customizePlusRevertCharacter;
|
||||||
private readonly ICallGateSubscriber<Character, string, (int, Guid?)> _customizePlusSetBodyScaleToCharacter;
|
private readonly ICallGateSubscriber<ICharacter, string, (int, Guid?)> _customizePlusSetBodyScaleToCharacter;
|
||||||
private readonly ICallGateSubscriber<Guid, int> _customizePlusDeleteByUniqueId;
|
private readonly ICallGateSubscriber<Guid, int> _customizePlusDeleteByUniqueId;
|
||||||
private readonly ILogger<IpcCallerCustomize> _logger;
|
private readonly ILogger<IpcCallerCustomize> _logger;
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
private readonly MareMediator _mareMediator;
|
private readonly MareMediator _mareMediator;
|
||||||
|
|
||||||
public IpcCallerCustomize(ILogger<IpcCallerCustomize> logger, DalamudPluginInterface dalamudPluginInterface,
|
public IpcCallerCustomize(ILogger<IpcCallerCustomize> logger, IDalamudPluginInterface dalamudPluginInterface,
|
||||||
DalamudUtilService dalamudUtil, MareMediator mareMediator)
|
DalamudUtilService dalamudUtil, MareMediator mareMediator)
|
||||||
{
|
{
|
||||||
_customizePlusApiVersion = dalamudPluginInterface.GetIpcSubscriber<(int, int)>("CustomizePlus.General.GetApiVersion");
|
_customizePlusApiVersion = dalamudPluginInterface.GetIpcSubscriber<(int, int)>("CustomizePlus.General.GetApiVersion");
|
||||||
_customizePlusGetActiveProfile = dalamudPluginInterface.GetIpcSubscriber<Character, (int, Guid?)>("CustomizePlus.Profile.GetActiveProfileIdOnCharacter");
|
_customizePlusGetActiveProfile = dalamudPluginInterface.GetIpcSubscriber<ICharacter, (int, Guid?)>("CustomizePlus.Profile.GetActiveProfileIdOnCharacter");
|
||||||
_customizePlusGetProfileById = dalamudPluginInterface.GetIpcSubscriber<Guid, (int, string?)>("CustomizePlus.Profile.GetByUniqueId");
|
_customizePlusGetProfileById = dalamudPluginInterface.GetIpcSubscriber<Guid, (int, string?)>("CustomizePlus.Profile.GetByUniqueId");
|
||||||
_customizePlusRevertCharacter = dalamudPluginInterface.GetIpcSubscriber<Character, int>("CustomizePlus.Profile.DeleteTemporaryProfileOnCharacter");
|
_customizePlusRevertCharacter = dalamudPluginInterface.GetIpcSubscriber<ICharacter, int>("CustomizePlus.Profile.DeleteTemporaryProfileOnCharacter");
|
||||||
_customizePlusSetBodyScaleToCharacter = dalamudPluginInterface.GetIpcSubscriber<Character, string, (int, Guid?)>("CustomizePlus.Profile.SetTemporaryProfileOnCharacter");
|
_customizePlusSetBodyScaleToCharacter = dalamudPluginInterface.GetIpcSubscriber<ICharacter, string, (int, Guid?)>("CustomizePlus.Profile.SetTemporaryProfileOnCharacter");
|
||||||
_customizePlusOnScaleUpdate = dalamudPluginInterface.GetIpcSubscriber<Character, Guid, object>("CustomizePlus.Profile.OnUpdate");
|
_customizePlusOnScaleUpdate = dalamudPluginInterface.GetIpcSubscriber<ICharacter, Guid, object>("CustomizePlus.Profile.OnUpdate");
|
||||||
_customizePlusDeleteByUniqueId = dalamudPluginInterface.GetIpcSubscriber<Guid, int>("CustomizePlus.Profile.DeleteTemporaryProfileByUniqueId");
|
_customizePlusDeleteByUniqueId = dalamudPluginInterface.GetIpcSubscriber<Guid, int>("CustomizePlus.Profile.DeleteTemporaryProfileByUniqueId");
|
||||||
|
|
||||||
_customizePlusOnScaleUpdate.Subscribe(OnCustomizePlusScaleChange);
|
_customizePlusOnScaleUpdate.Subscribe(OnCustomizePlusScaleChange);
|
||||||
@@ -49,7 +49,7 @@ public sealed class IpcCallerCustomize : IIpcCaller
|
|||||||
await _dalamudUtil.RunOnFrameworkThread(() =>
|
await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
var gameObj = _dalamudUtil.CreateGameObject(character);
|
var gameObj = _dalamudUtil.CreateGameObject(character);
|
||||||
if (gameObj is Character c)
|
if (gameObj is ICharacter c)
|
||||||
{
|
{
|
||||||
_logger.LogTrace("CustomizePlus reverting for {chara}", c.Address.ToString("X"));
|
_logger.LogTrace("CustomizePlus reverting for {chara}", c.Address.ToString("X"));
|
||||||
_customizePlusRevertCharacter!.InvokeFunc(c);
|
_customizePlusRevertCharacter!.InvokeFunc(c);
|
||||||
@@ -63,7 +63,7 @@ public sealed class IpcCallerCustomize : IIpcCaller
|
|||||||
return await _dalamudUtil.RunOnFrameworkThread(() =>
|
return await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
var gameObj = _dalamudUtil.CreateGameObject(character);
|
var gameObj = _dalamudUtil.CreateGameObject(character);
|
||||||
if (gameObj is Character c)
|
if (gameObj is ICharacter c)
|
||||||
{
|
{
|
||||||
string decodedScale = Encoding.UTF8.GetString(Convert.FromBase64String(scale));
|
string decodedScale = Encoding.UTF8.GetString(Convert.FromBase64String(scale));
|
||||||
_logger.LogTrace("CustomizePlus applying for {chara}", c.Address.ToString("X"));
|
_logger.LogTrace("CustomizePlus applying for {chara}", c.Address.ToString("X"));
|
||||||
@@ -99,7 +99,7 @@ public sealed class IpcCallerCustomize : IIpcCaller
|
|||||||
var scale = await _dalamudUtil.RunOnFrameworkThread(() =>
|
var scale = await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
var gameObj = _dalamudUtil.CreateGameObject(character);
|
var gameObj = _dalamudUtil.CreateGameObject(character);
|
||||||
if (gameObj is Character c)
|
if (gameObj is ICharacter c)
|
||||||
{
|
{
|
||||||
var res = _customizePlusGetActiveProfile.InvokeFunc(c);
|
var res = _customizePlusGetActiveProfile.InvokeFunc(c);
|
||||||
_logger.LogTrace("CustomizePlus GetActiveProfile returned {err}", res.Item1);
|
_logger.LogTrace("CustomizePlus GetActiveProfile returned {err}", res.Item1);
|
||||||
@@ -126,7 +126,7 @@ public sealed class IpcCallerCustomize : IIpcCaller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCustomizePlusScaleChange(Character c, Guid g)
|
private void OnCustomizePlusScaleChange(ICharacter c, Guid g)
|
||||||
{
|
{
|
||||||
_mareMediator.Publish(new CustomizePlusMessage(c.Name.ToString() ?? string.Empty));
|
_mareMediator.Publish(new CustomizePlusMessage(c.Name.ToString() ?? string.Empty));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Glamourer.Api.Helpers;
|
using Glamourer.Api.Helpers;
|
||||||
using Glamourer.Api.IpcSubscribers;
|
using Glamourer.Api.IpcSubscribers;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.PlayerData.Handlers;
|
using MareSynchronos.PlayerData.Handlers;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
@@ -13,7 +13,7 @@ namespace MareSynchronos.Interop.Ipc;
|
|||||||
public sealed class IpcCallerGlamourer : IIpcCaller
|
public sealed class IpcCallerGlamourer : IIpcCaller
|
||||||
{
|
{
|
||||||
private readonly ILogger<IpcCallerGlamourer> _logger;
|
private readonly ILogger<IpcCallerGlamourer> _logger;
|
||||||
private readonly DalamudPluginInterface _pi;
|
private readonly IDalamudPluginInterface _pi;
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
private readonly MareMediator _mareMediator;
|
private readonly MareMediator _mareMediator;
|
||||||
private readonly RedrawManager _redrawManager;
|
private readonly RedrawManager _redrawManager;
|
||||||
@@ -30,7 +30,7 @@ public sealed class IpcCallerGlamourer : IIpcCaller
|
|||||||
private bool _shownGlamourerUnavailable = false;
|
private bool _shownGlamourerUnavailable = false;
|
||||||
private readonly uint LockCode = 0x6D617265;
|
private readonly uint LockCode = 0x6D617265;
|
||||||
|
|
||||||
public IpcCallerGlamourer(ILogger<IpcCallerGlamourer> logger, DalamudPluginInterface pi, DalamudUtilService dalamudUtil, MareMediator mareMediator,
|
public IpcCallerGlamourer(ILogger<IpcCallerGlamourer> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil, MareMediator mareMediator,
|
||||||
RedrawManager redrawManager)
|
RedrawManager redrawManager)
|
||||||
{
|
{
|
||||||
_glamourerApiVersions = new ApiVersion(pi);
|
_glamourerApiVersions = new ApiVersion(pi);
|
||||||
@@ -134,7 +134,7 @@ public sealed class IpcCallerGlamourer : IIpcCaller
|
|||||||
return await _dalamudUtil.RunOnFrameworkThread(() =>
|
return await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
var gameObj = _dalamudUtil.CreateGameObject(character);
|
var gameObj = _dalamudUtil.CreateGameObject(character);
|
||||||
if (gameObj is Character c)
|
if (gameObj is ICharacter c)
|
||||||
{
|
{
|
||||||
return _glamourerGetAllCustomization!.Invoke(c.ObjectIndex).Item2 ?? string.Empty;
|
return _glamourerGetAllCustomization!.Invoke(c.ObjectIndex).Item2 ?? string.Empty;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,18 +15,18 @@ public sealed class IpcCallerHeels : IIpcCaller
|
|||||||
private readonly ICallGateSubscriber<(int, int)> _heelsGetApiVersion;
|
private readonly ICallGateSubscriber<(int, int)> _heelsGetApiVersion;
|
||||||
private readonly ICallGateSubscriber<string> _heelsGetOffset;
|
private readonly ICallGateSubscriber<string> _heelsGetOffset;
|
||||||
private readonly ICallGateSubscriber<string, object?> _heelsOffsetUpdate;
|
private readonly ICallGateSubscriber<string, object?> _heelsOffsetUpdate;
|
||||||
private readonly ICallGateSubscriber<GameObject, string, object?> _heelsRegisterPlayer;
|
private readonly ICallGateSubscriber<IGameObject, string, object?> _heelsRegisterPlayer;
|
||||||
private readonly ICallGateSubscriber<GameObject, object?> _heelsUnregisterPlayer;
|
private readonly ICallGateSubscriber<IGameObject, object?> _heelsUnregisterPlayer;
|
||||||
|
|
||||||
public IpcCallerHeels(ILogger<IpcCallerHeels> logger, DalamudPluginInterface pi, DalamudUtilService dalamudUtil, MareMediator mareMediator)
|
public IpcCallerHeels(ILogger<IpcCallerHeels> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil, MareMediator mareMediator)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_mareMediator = mareMediator;
|
_mareMediator = mareMediator;
|
||||||
_dalamudUtil = dalamudUtil;
|
_dalamudUtil = dalamudUtil;
|
||||||
_heelsGetApiVersion = pi.GetIpcSubscriber<(int, int)>("SimpleHeels.ApiVersion");
|
_heelsGetApiVersion = pi.GetIpcSubscriber<(int, int)>("SimpleHeels.ApiVersion");
|
||||||
_heelsGetOffset = pi.GetIpcSubscriber<string>("SimpleHeels.GetLocalPlayer");
|
_heelsGetOffset = pi.GetIpcSubscriber<string>("SimpleHeels.GetLocalPlayer");
|
||||||
_heelsRegisterPlayer = pi.GetIpcSubscriber<GameObject, string, object?>("SimpleHeels.RegisterPlayer");
|
_heelsRegisterPlayer = pi.GetIpcSubscriber<IGameObject, string, object?>("SimpleHeels.RegisterPlayer");
|
||||||
_heelsUnregisterPlayer = pi.GetIpcSubscriber<GameObject, object?>("SimpleHeels.UnregisterPlayer");
|
_heelsUnregisterPlayer = pi.GetIpcSubscriber<IGameObject, object?>("SimpleHeels.UnregisterPlayer");
|
||||||
_heelsOffsetUpdate = pi.GetIpcSubscriber<string, object?>("SimpleHeels.LocalChanged");
|
_heelsOffsetUpdate = pi.GetIpcSubscriber<string, object?>("SimpleHeels.LocalChanged");
|
||||||
|
|
||||||
_heelsOffsetUpdate.Subscribe(HeelsOffsetChange);
|
_heelsOffsetUpdate.Subscribe(HeelsOffsetChange);
|
||||||
|
|||||||
@@ -12,17 +12,17 @@ namespace MareSynchronos.Interop.Ipc;
|
|||||||
public sealed class IpcCallerHonorific : IIpcCaller
|
public sealed class IpcCallerHonorific : IIpcCaller
|
||||||
{
|
{
|
||||||
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<ICharacter, object> _honorificClearCharacterTitle;
|
||||||
private readonly ICallGateSubscriber<object> _honorificDisposing;
|
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<object> _honorificReady;
|
private readonly ICallGateSubscriber<object> _honorificReady;
|
||||||
private readonly ICallGateSubscriber<Character, string, object> _honorificSetCharacterTitle;
|
private readonly ICallGateSubscriber<ICharacter, string, object> _honorificSetCharacterTitle;
|
||||||
private readonly ILogger<IpcCallerHonorific> _logger;
|
private readonly ILogger<IpcCallerHonorific> _logger;
|
||||||
private readonly MareMediator _mareMediator;
|
private readonly MareMediator _mareMediator;
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
|
|
||||||
public IpcCallerHonorific(ILogger<IpcCallerHonorific> logger, DalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
public IpcCallerHonorific(ILogger<IpcCallerHonorific> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
||||||
MareMediator mareMediator)
|
MareMediator mareMediator)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
@@ -30,8 +30,8 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
|||||||
_dalamudUtil = dalamudUtil;
|
_dalamudUtil = dalamudUtil;
|
||||||
_honorificApiVersion = pi.GetIpcSubscriber<(uint, uint)>("Honorific.ApiVersion");
|
_honorificApiVersion = pi.GetIpcSubscriber<(uint, uint)>("Honorific.ApiVersion");
|
||||||
_honorificGetLocalCharacterTitle = pi.GetIpcSubscriber<string>("Honorific.GetLocalCharacterTitle");
|
_honorificGetLocalCharacterTitle = pi.GetIpcSubscriber<string>("Honorific.GetLocalCharacterTitle");
|
||||||
_honorificClearCharacterTitle = pi.GetIpcSubscriber<Character, object>("Honorific.ClearCharacterTitle");
|
_honorificClearCharacterTitle = pi.GetIpcSubscriber<ICharacter, object>("Honorific.ClearCharacterTitle");
|
||||||
_honorificSetCharacterTitle = pi.GetIpcSubscriber<Character, string, object>("Honorific.SetCharacterTitle");
|
_honorificSetCharacterTitle = pi.GetIpcSubscriber<ICharacter, string, object>("Honorific.SetCharacterTitle");
|
||||||
_honorificLocalCharacterTitleChanged = pi.GetIpcSubscriber<string, object>("Honorific.LocalCharacterTitleChanged");
|
_honorificLocalCharacterTitleChanged = pi.GetIpcSubscriber<string, object>("Honorific.LocalCharacterTitleChanged");
|
||||||
_honorificDisposing = pi.GetIpcSubscriber<object>("Honorific.Disposing");
|
_honorificDisposing = pi.GetIpcSubscriber<object>("Honorific.Disposing");
|
||||||
_honorificReady = pi.GetIpcSubscriber<object>("Honorific.Ready");
|
_honorificReady = pi.GetIpcSubscriber<object>("Honorific.Ready");
|
||||||
@@ -70,7 +70,7 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
|||||||
await _dalamudUtil.RunOnFrameworkThread(() =>
|
await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
var gameObj = _dalamudUtil.CreateGameObject(character);
|
var gameObj = _dalamudUtil.CreateGameObject(character);
|
||||||
if (gameObj is PlayerCharacter c)
|
if (gameObj is IPlayerCharacter c)
|
||||||
{
|
{
|
||||||
_logger.LogTrace("Honorific removing for {addr}", c.Address.ToString("X"));
|
_logger.LogTrace("Honorific removing for {addr}", c.Address.ToString("X"));
|
||||||
_honorificClearCharacterTitle!.InvokeAction(c);
|
_honorificClearCharacterTitle!.InvokeAction(c);
|
||||||
@@ -94,7 +94,7 @@ public sealed class IpcCallerHonorific : IIpcCaller
|
|||||||
await _dalamudUtil.RunOnFrameworkThread(() =>
|
await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
var gameObj = _dalamudUtil.CreateGameObject(character);
|
var gameObj = _dalamudUtil.CreateGameObject(character);
|
||||||
if (gameObj is PlayerCharacter pc)
|
if (gameObj is IPlayerCharacter pc)
|
||||||
{
|
{
|
||||||
string honorificData = string.IsNullOrEmpty(honorificDataB64) ? string.Empty : Encoding.UTF8.GetString(Convert.FromBase64String(honorificDataB64));
|
string honorificData = string.IsNullOrEmpty(honorificDataB64) ? string.Empty : Encoding.UTF8.GetString(Convert.FromBase64String(honorificDataB64));
|
||||||
if (string.IsNullOrEmpty(honorificData))
|
if (string.IsNullOrEmpty(honorificData))
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace MareSynchronos.Interop.Ipc;
|
|||||||
public sealed class IpcCallerMoodles : IIpcCaller
|
public sealed class IpcCallerMoodles : IIpcCaller
|
||||||
{
|
{
|
||||||
private readonly ICallGateSubscriber<int> _moodlesApiVersion;
|
private readonly ICallGateSubscriber<int> _moodlesApiVersion;
|
||||||
private readonly ICallGateSubscriber<PlayerCharacter, object> _moodlesOnChange;
|
private readonly ICallGateSubscriber<IPlayerCharacter, object> _moodlesOnChange;
|
||||||
private readonly ICallGateSubscriber<nint, string> _moodlesGetStatus;
|
private readonly ICallGateSubscriber<nint, string> _moodlesGetStatus;
|
||||||
private readonly ICallGateSubscriber<nint, string, object> _moodlesSetStatus;
|
private readonly ICallGateSubscriber<nint, string, object> _moodlesSetStatus;
|
||||||
private readonly ICallGateSubscriber<nint, object> _moodlesRevertStatus;
|
private readonly ICallGateSubscriber<nint, object> _moodlesRevertStatus;
|
||||||
@@ -18,7 +18,7 @@ public sealed class IpcCallerMoodles : IIpcCaller
|
|||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
private readonly MareMediator _mareMediator;
|
private readonly MareMediator _mareMediator;
|
||||||
|
|
||||||
public IpcCallerMoodles(ILogger<IpcCallerMoodles> logger, DalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
public IpcCallerMoodles(ILogger<IpcCallerMoodles> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
||||||
MareMediator mareMediator)
|
MareMediator mareMediator)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
@@ -26,7 +26,7 @@ public sealed class IpcCallerMoodles : IIpcCaller
|
|||||||
_mareMediator = mareMediator;
|
_mareMediator = mareMediator;
|
||||||
|
|
||||||
_moodlesApiVersion = pi.GetIpcSubscriber<int>("Moodles.Version");
|
_moodlesApiVersion = pi.GetIpcSubscriber<int>("Moodles.Version");
|
||||||
_moodlesOnChange = pi.GetIpcSubscriber<PlayerCharacter, object>("Moodles.StatusManagerModified");
|
_moodlesOnChange = pi.GetIpcSubscriber<IPlayerCharacter, object>("Moodles.StatusManagerModified");
|
||||||
_moodlesGetStatus = pi.GetIpcSubscriber<nint, string>("Moodles.GetStatusManagerByPtr");
|
_moodlesGetStatus = pi.GetIpcSubscriber<nint, string>("Moodles.GetStatusManagerByPtr");
|
||||||
_moodlesSetStatus = pi.GetIpcSubscriber<nint, string, object>("Moodles.SetStatusManagerByPtr");
|
_moodlesSetStatus = pi.GetIpcSubscriber<nint, string, object>("Moodles.SetStatusManagerByPtr");
|
||||||
_moodlesRevertStatus = pi.GetIpcSubscriber<nint, object>("Moodles.ClearStatusManagerByPtr");
|
_moodlesRevertStatus = pi.GetIpcSubscriber<nint, object>("Moodles.ClearStatusManagerByPtr");
|
||||||
@@ -36,7 +36,7 @@ public sealed class IpcCallerMoodles : IIpcCaller
|
|||||||
CheckAPI();
|
CheckAPI();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMoodlesChange(PlayerCharacter character)
|
private void OnMoodlesChange(IPlayerCharacter character)
|
||||||
{
|
{
|
||||||
_mareMediator.Publish(new MoodlesMessage(character.Address));
|
_mareMediator.Publish(new MoodlesMessage(character.Address));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Dalamud.Interface.Internal.Notifications;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Plugin;
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.PlayerData.Handlers;
|
using MareSynchronos.PlayerData.Handlers;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
@@ -13,7 +13,7 @@ namespace MareSynchronos.Interop.Ipc;
|
|||||||
|
|
||||||
public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCaller
|
public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCaller
|
||||||
{
|
{
|
||||||
private readonly DalamudPluginInterface _pi;
|
private readonly IDalamudPluginInterface _pi;
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
private readonly MareMediator _mareMediator;
|
private readonly MareMediator _mareMediator;
|
||||||
private readonly RedrawManager _redrawManager;
|
private readonly RedrawManager _redrawManager;
|
||||||
@@ -53,7 +53,7 @@ public sealed class IpcCallerPenumbra : DisposableMediatorSubscriberBase, IIpcCa
|
|||||||
private readonly ResolvePlayerPathsAsync _penumbraResolvePaths;
|
private readonly ResolvePlayerPathsAsync _penumbraResolvePaths;
|
||||||
private readonly GetGameObjectResourcePaths _penumbraResourcePaths;
|
private readonly GetGameObjectResourcePaths _penumbraResourcePaths;
|
||||||
|
|
||||||
public IpcCallerPenumbra(ILogger<IpcCallerPenumbra> logger, DalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
public IpcCallerPenumbra(ILogger<IpcCallerPenumbra> logger, IDalamudPluginInterface pi, DalamudUtilService dalamudUtil,
|
||||||
MareMediator mareMediator, RedrawManager redrawManager) : base(logger, mareMediator)
|
MareMediator mareMediator, RedrawManager redrawManager) : base(logger, mareMediator)
|
||||||
{
|
{
|
||||||
_pi = pi;
|
_pi = pi;
|
||||||
|
|||||||
@@ -13,17 +13,17 @@ namespace MareSynchronos.Interop.Ipc;
|
|||||||
public class IpcProvider : IHostedService, IMediatorSubscriber
|
public class IpcProvider : IHostedService, IMediatorSubscriber
|
||||||
{
|
{
|
||||||
private readonly ILogger<IpcProvider> _logger;
|
private readonly ILogger<IpcProvider> _logger;
|
||||||
private readonly DalamudPluginInterface _pi;
|
private readonly IDalamudPluginInterface _pi;
|
||||||
private readonly MareCharaFileManager _mareCharaFileManager;
|
private readonly MareCharaFileManager _mareCharaFileManager;
|
||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
private ICallGateProvider<string, GameObject, bool>? _loadFileProvider;
|
private ICallGateProvider<string, IGameObject, bool>? _loadFileProvider;
|
||||||
private ICallGateProvider<string, GameObject, Task<bool>>? _loadFileAsyncProvider;
|
private ICallGateProvider<string, IGameObject, Task<bool>>? _loadFileAsyncProvider;
|
||||||
private ICallGateProvider<List<nint>>? _handledGameAddresses;
|
private ICallGateProvider<List<nint>>? _handledGameAddresses;
|
||||||
private readonly List<GameObjectHandler> _activeGameObjectHandlers = [];
|
private readonly List<GameObjectHandler> _activeGameObjectHandlers = [];
|
||||||
|
|
||||||
public MareMediator Mediator { get; init; }
|
public MareMediator Mediator { get; init; }
|
||||||
|
|
||||||
public IpcProvider(ILogger<IpcProvider> logger, DalamudPluginInterface pi,
|
public IpcProvider(ILogger<IpcProvider> logger, IDalamudPluginInterface pi,
|
||||||
MareCharaFileManager mareCharaFileManager, DalamudUtilService dalamudUtil,
|
MareCharaFileManager mareCharaFileManager, DalamudUtilService dalamudUtil,
|
||||||
MareMediator mareMediator)
|
MareMediator mareMediator)
|
||||||
{
|
{
|
||||||
@@ -48,9 +48,9 @@ public class IpcProvider : IHostedService, IMediatorSubscriber
|
|||||||
public Task StartAsync(CancellationToken cancellationToken)
|
public Task StartAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Starting IpcProviderService");
|
_logger.LogInformation("Starting IpcProviderService");
|
||||||
_loadFileProvider = _pi.GetIpcProvider<string, GameObject, bool>("MareSynchronos.LoadMcdf");
|
_loadFileProvider = _pi.GetIpcProvider<string, IGameObject, bool>("MareSynchronos.LoadMcdf");
|
||||||
_loadFileProvider.RegisterFunc(LoadMcdf);
|
_loadFileProvider.RegisterFunc(LoadMcdf);
|
||||||
_loadFileAsyncProvider = _pi.GetIpcProvider<string, GameObject, Task<bool>>("MareSynchronos.LoadMcdfAsync");
|
_loadFileAsyncProvider = _pi.GetIpcProvider<string, IGameObject, Task<bool>>("MareSynchronos.LoadMcdfAsync");
|
||||||
_loadFileAsyncProvider.RegisterFunc(LoadMcdfAsync);
|
_loadFileAsyncProvider.RegisterFunc(LoadMcdfAsync);
|
||||||
_handledGameAddresses = _pi.GetIpcProvider<List<nint>>("MareSynchronos.GetHandledAddresses");
|
_handledGameAddresses = _pi.GetIpcProvider<List<nint>>("MareSynchronos.GetHandledAddresses");
|
||||||
_handledGameAddresses.RegisterFunc(GetHandledAddresses);
|
_handledGameAddresses.RegisterFunc(GetHandledAddresses);
|
||||||
@@ -68,7 +68,7 @@ public class IpcProvider : IHostedService, IMediatorSubscriber
|
|||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> LoadMcdfAsync(string path, GameObject target)
|
private async Task<bool> LoadMcdfAsync(string path, IGameObject target)
|
||||||
{
|
{
|
||||||
if (_mareCharaFileManager.CurrentlyWorking || !_dalamudUtil.IsInGpose)
|
if (_mareCharaFileManager.CurrentlyWorking || !_dalamudUtil.IsInGpose)
|
||||||
return false;
|
return false;
|
||||||
@@ -78,7 +78,7 @@ public class IpcProvider : IHostedService, IMediatorSubscriber
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LoadMcdf(string path, GameObject target)
|
private bool LoadMcdf(string path, IGameObject target)
|
||||||
{
|
{
|
||||||
if (_mareCharaFileManager.CurrentlyWorking || !_dalamudUtil.IsInGpose)
|
if (_mareCharaFileManager.CurrentlyWorking || !_dalamudUtil.IsInGpose)
|
||||||
return false;
|
return false;
|
||||||
@@ -88,7 +88,7 @@ public class IpcProvider : IHostedService, IMediatorSubscriber
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ApplyFileAsync(string path, GameObject target)
|
private async Task ApplyFileAsync(string path, IGameObject target)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class RedrawManager
|
|||||||
_dalamudUtil = dalamudUtil;
|
_dalamudUtil = dalamudUtil;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task PenumbraRedrawInternalAsync(ILogger logger, GameObjectHandler handler, Guid applicationId, Action<Character> action)
|
public async Task PenumbraRedrawInternalAsync(ILogger logger, GameObjectHandler handler, Guid applicationId, Action<ICharacter> action)
|
||||||
{
|
{
|
||||||
_mareMediator.Publish(new PenumbraStartRedrawMessage(handler.Address));
|
_mareMediator.Publish(new PenumbraStartRedrawMessage(handler.Address));
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
namespace MareSynchronos.MareConfiguration;
|
namespace MareSynchronos.MareConfiguration;
|
||||||
|
|
||||||
public class ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, DalamudPluginInterface pi) : IHostedService
|
public class ConfigurationMigrator(ILogger<ConfigurationMigrator> logger, IDalamudPluginInterface pi) : IHostedService
|
||||||
{
|
{
|
||||||
public void Migrate()
|
public void Migrate()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,3 +7,10 @@ public enum NotificationLocation
|
|||||||
Toast,
|
Toast,
|
||||||
Both
|
Both
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum NotificationType
|
||||||
|
{
|
||||||
|
Info,
|
||||||
|
Warning,
|
||||||
|
Error
|
||||||
|
}
|
||||||
@@ -30,25 +30,25 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Dalamud.ContextMenu" Version="1.3.1" />
|
<PackageReference Include="Dalamud.ContextMenu" Version="1.3.1" />
|
||||||
<PackageReference Include="DalamudPackager" Version="2.1.12" />
|
<PackageReference Include="DalamudPackager" Version="2.1.13" />
|
||||||
<PackageReference Include="Downloader" Version="3.0.6" />
|
<PackageReference Include="Downloader" Version="3.1.2" />
|
||||||
<PackageReference Include="lz4net" Version="1.0.15.93" />
|
<PackageReference Include="lz4net" Version="1.0.15.93" />
|
||||||
<PackageReference Include="Meziantou.Analyzer" Version="2.0.152">
|
<PackageReference Include="Meziantou.Analyzer" Version="2.0.160">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.7" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.7" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||||
<PackageReference Include="Glamourer.Api" Version="2.0.0" />
|
<PackageReference Include="Glamourer.Api" Version="2.1.0" />
|
||||||
<PackageReference Include="Penumbra.Api" Version="5.0.0" />
|
<PackageReference Include="Penumbra.Api" Version="5.2.0" />
|
||||||
<PackageReference Include="Penumbra.String" Version="1.0.4" />
|
<PackageReference Include="Penumbra.String" Version="1.0.4" />
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
||||||
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.25.0.90414">
|
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.29.0.95321">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.2" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class MareCharaFileManager : DisposableMediatorSubscriberBase
|
|||||||
public bool CurrentlyWorking { get; private set; } = false;
|
public bool CurrentlyWorking { get; private set; } = false;
|
||||||
public MareCharaFileHeader? LoadedCharaFile { get; private set; }
|
public MareCharaFileHeader? LoadedCharaFile { get; private set; }
|
||||||
|
|
||||||
public async Task ApplyMareCharaFile(GameObject? charaTarget, long expectedLength)
|
public async Task ApplyMareCharaFile(IGameObject? charaTarget, long expectedLength)
|
||||||
{
|
{
|
||||||
if (charaTarget == null) return;
|
if (charaTarget == null) return;
|
||||||
Dictionary<string, string> extractedFiles = new(StringComparer.Ordinal);
|
Dictionary<string, string> extractedFiles = new(StringComparer.Ordinal);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.FileCache;
|
using MareSynchronos.FileCache;
|
||||||
using MareSynchronos.Interop.Ipc;
|
using MareSynchronos.Interop.Ipc;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.PlayerData.Data;
|
using MareSynchronos.PlayerData.Data;
|
||||||
using MareSynchronos.PlayerData.Handlers;
|
using MareSynchronos.PlayerData.Handlers;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
@@ -309,7 +310,7 @@ public class PlayerDataFactory
|
|||||||
_mareMediator.Publish(new NotificationMessage("Invalid Skeleton Setup",
|
_mareMediator.Publish(new NotificationMessage("Invalid Skeleton Setup",
|
||||||
$"Your client is attempting to send {noValidationFailed} animation files with invalid bone data. Those animation files have been removed from your sent data. " +
|
$"Your client is attempting to send {noValidationFailed} animation files with invalid bone data. Those animation files have been removed from your sent data. " +
|
||||||
$"Verify that you are using the correct skeleton for those animation files (Check /xllog for more information).",
|
$"Verify that you are using the correct skeleton for those animation files (Check /xllog for more information).",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Warning, TimeSpan.FromSeconds(10)));
|
NotificationType.Warning, TimeSpan.FromSeconds(10)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using MareSynchronos.Services;
|
|||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using MareSynchronos.Utils;
|
using MareSynchronos.Utils;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using static FFXIVClientStructs.FFXIV.Client.Game.Character.DrawDataContainer;
|
using static FFXIVClientStructs.FFXIV.Client.Game.Character.DrawDataContainer;
|
||||||
using ObjectKind = MareSynchronos.API.Data.Enum.ObjectKind;
|
using ObjectKind = MareSynchronos.API.Data.Enum.ObjectKind;
|
||||||
@@ -113,13 +114,13 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||||||
private ushort[] MainHandData { get; set; } = new ushort[3];
|
private ushort[] MainHandData { get; set; } = new ushort[3];
|
||||||
private ushort[] OffHandData { get; set; } = new ushort[3];
|
private ushort[] OffHandData { get; set; } = new ushort[3];
|
||||||
|
|
||||||
public async Task ActOnFrameworkAfterEnsureNoDrawAsync(Action<Dalamud.Game.ClientState.Objects.Types.Character> act, CancellationToken token)
|
public async Task ActOnFrameworkAfterEnsureNoDrawAsync(Action<Dalamud.Game.ClientState.Objects.Types.ICharacter> act, CancellationToken token)
|
||||||
{
|
{
|
||||||
while (await _dalamudUtil.RunOnFrameworkThread(() =>
|
while (await _dalamudUtil.RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
if (IsBeingDrawn()) return true;
|
if (IsBeingDrawn()) return true;
|
||||||
var gameObj = _dalamudUtil.CreateGameObject(Address);
|
var gameObj = _dalamudUtil.CreateGameObject(Address);
|
||||||
if (gameObj is Dalamud.Game.ClientState.Objects.Types.Character chara)
|
if (gameObj is Dalamud.Game.ClientState.Objects.Types.ICharacter chara)
|
||||||
{
|
{
|
||||||
act.Invoke(chara);
|
act.Invoke(chara);
|
||||||
}
|
}
|
||||||
@@ -148,7 +149,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||||||
return _getAddress.Invoke();
|
return _getAddress.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dalamud.Game.ClientState.Objects.Types.GameObject? GetGameObject()
|
public Dalamud.Game.ClientState.Objects.Types.IGameObject? GetGameObject()
|
||||||
{
|
{
|
||||||
return _dalamudUtil.CreateGameObject(Address);
|
return _dalamudUtil.CreateGameObject(Address);
|
||||||
}
|
}
|
||||||
@@ -209,7 +210,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||||||
_clearCts = null;
|
_clearCts = null;
|
||||||
}
|
}
|
||||||
var chara = (Character*)Address;
|
var chara = (Character*)Address;
|
||||||
MemoryHelper.ReadStringNullTerminated((nint)chara->GameObject.Name, out var name);
|
var name = chara->GameObject.NameString;
|
||||||
bool nameChange = !string.Equals(name, Name, StringComparison.Ordinal);
|
bool nameChange = !string.Equals(name, Name, StringComparison.Ordinal);
|
||||||
if (nameChange)
|
if (nameChange)
|
||||||
{
|
{
|
||||||
@@ -240,7 +241,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
equipDiff = CompareAndUpdateEquipByteData((byte*)&chara->DrawData.Head);
|
equipDiff = CompareAndUpdateEquipByteData((byte*)Unsafe.AsPointer(ref chara->DrawData.EquipmentModelIds[0]));
|
||||||
if (equipDiff)
|
if (equipDiff)
|
||||||
Logger.LogTrace("Checking [{this}] equip data from game obj, result: {diff}", this, equipDiff);
|
Logger.LogTrace("Checking [{this}] equip data from game obj, result: {diff}", this, equipDiff);
|
||||||
}
|
}
|
||||||
@@ -259,7 +260,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
var gender = ((Human*)DrawObjectAddress)->Customize.Sex;
|
var gender = ((Human*)DrawObjectAddress)->Customize.Sex;
|
||||||
var raceId = ((Human*)DrawObjectAddress)->Customize.Race;
|
var raceId = ((Human*)DrawObjectAddress)->Customize.Race;
|
||||||
var tribeId = ((Human*)DrawObjectAddress)->Customize.Clan;
|
var tribeId = ((Human*)DrawObjectAddress)->Customize.Tribe;
|
||||||
|
|
||||||
if (_isOwnedObject && ObjectKind == ObjectKind.Player
|
if (_isOwnedObject && ObjectKind == ObjectKind.Player
|
||||||
&& (gender != Gender || raceId != RaceId || tribeId != TribeId))
|
&& (gender != Gender || raceId != RaceId || tribeId != TribeId))
|
||||||
@@ -309,13 +310,13 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||||||
_clearCts = null;
|
_clearCts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private unsafe bool CompareAndUpdateCustomizeData(byte* customizeData)
|
private unsafe bool CompareAndUpdateCustomizeData(Span<byte> customizeData)
|
||||||
{
|
{
|
||||||
bool hasChanges = false;
|
bool hasChanges = false;
|
||||||
|
|
||||||
for (int i = 0; i < CustomizeData.Length; i++)
|
for (int i = 0; i < customizeData.Length; i++)
|
||||||
{
|
{
|
||||||
var data = Marshal.ReadByte((IntPtr)customizeData, i);
|
var data = customizeData[i];
|
||||||
if (CustomizeData[i] != data)
|
if (CustomizeData[i] != data)
|
||||||
{
|
{
|
||||||
CustomizeData[i] = data;
|
CustomizeData[i] = data;
|
||||||
@@ -331,7 +332,7 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase
|
|||||||
bool hasChanges = false;
|
bool hasChanges = false;
|
||||||
for (int i = 0; i < EquipSlotData.Length; i++)
|
for (int i = 0; i < EquipSlotData.Length; i++)
|
||||||
{
|
{
|
||||||
var data = Marshal.ReadByte((IntPtr)equipSlotData, i);
|
var data = equipSlotData[i];
|
||||||
if (EquipSlotData[i] != data)
|
if (EquipSlotData[i] != data)
|
||||||
{
|
{
|
||||||
EquipSlotData[i] = data;
|
EquipSlotData[i] = data;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
|
|||||||
public nint PlayerCharacter => _charaHandler?.Address ?? nint.Zero;
|
public nint PlayerCharacter => _charaHandler?.Address ?? nint.Zero;
|
||||||
public unsafe uint PlayerCharacterId => (_charaHandler?.Address ?? nint.Zero) == nint.Zero
|
public unsafe uint PlayerCharacterId => (_charaHandler?.Address ?? nint.Zero) == nint.Zero
|
||||||
? uint.MaxValue
|
? uint.MaxValue
|
||||||
: ((FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_charaHandler!.Address)->ObjectID;
|
: ((FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_charaHandler!.Address)->EntityId;
|
||||||
public string? PlayerName { get; private set; }
|
public string? PlayerName { get; private set; }
|
||||||
public string PlayerNameHash => OnlineUser.Ident;
|
public string PlayerNameHash => OnlineUser.Ident;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Dalamud.ContextMenu;
|
using Dalamud.ContextMenu;
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
|
||||||
using MareSynchronos.API.Data;
|
using MareSynchronos.API.Data;
|
||||||
using MareSynchronos.API.Data.Comparer;
|
using MareSynchronos.API.Data.Comparer;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.API.Dto.User;
|
using MareSynchronos.API.Dto.User;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.PlayerData.Factories;
|
using MareSynchronos.PlayerData.Factories;
|
||||||
using MareSynchronos.Services.Events;
|
using MareSynchronos.Services.Events;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
@@ -19,26 +19,27 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
|
|||||||
private readonly ConcurrentDictionary<UserData, Pair> _allClientPairs = new(UserDataComparer.Instance);
|
private readonly ConcurrentDictionary<UserData, Pair> _allClientPairs = new(UserDataComparer.Instance);
|
||||||
private readonly ConcurrentDictionary<GroupData, GroupFullInfoDto> _allGroups = new(GroupDataComparer.Instance);
|
private readonly ConcurrentDictionary<GroupData, GroupFullInfoDto> _allGroups = new(GroupDataComparer.Instance);
|
||||||
private readonly MareConfigService _configurationService;
|
private readonly MareConfigService _configurationService;
|
||||||
private readonly DalamudContextMenu _dalamudContextMenu;
|
//private readonly DalamudContextMenu _dalamudContextMenu;
|
||||||
private readonly PairFactory _pairFactory;
|
private readonly PairFactory _pairFactory;
|
||||||
private Lazy<List<Pair>> _directPairsInternal;
|
private Lazy<List<Pair>> _directPairsInternal;
|
||||||
private Lazy<Dictionary<GroupFullInfoDto, List<Pair>>> _groupPairsInternal;
|
private Lazy<Dictionary<GroupFullInfoDto, List<Pair>>> _groupPairsInternal;
|
||||||
private Lazy<Dictionary<Pair, List<GroupFullInfoDto>>> _pairsWithGroupsInternal;
|
private Lazy<Dictionary<Pair, List<GroupFullInfoDto>>> _pairsWithGroupsInternal;
|
||||||
|
|
||||||
public PairManager(ILogger<PairManager> logger, PairFactory pairFactory,
|
public PairManager(ILogger<PairManager> logger, PairFactory pairFactory,
|
||||||
MareConfigService configurationService, MareMediator mediator,
|
MareConfigService configurationService, MareMediator mediator
|
||||||
DalamudContextMenu dalamudContextMenu) : base(logger, mediator)
|
//DalamudContextMenu dalamudContextMenu) : base(logger, mediator)
|
||||||
|
) : base(logger, mediator)
|
||||||
{
|
{
|
||||||
_pairFactory = pairFactory;
|
_pairFactory = pairFactory;
|
||||||
_configurationService = configurationService;
|
_configurationService = configurationService;
|
||||||
_dalamudContextMenu = dalamudContextMenu;
|
//_dalamudContextMenu = dalamudContextMenu;
|
||||||
Mediator.Subscribe<DisconnectedMessage>(this, (_) => ClearPairs());
|
Mediator.Subscribe<DisconnectedMessage>(this, (_) => ClearPairs());
|
||||||
Mediator.Subscribe<CutsceneEndMessage>(this, (_) => ReapplyPairData());
|
Mediator.Subscribe<CutsceneEndMessage>(this, (_) => ReapplyPairData());
|
||||||
_directPairsInternal = DirectPairsLazy();
|
_directPairsInternal = DirectPairsLazy();
|
||||||
_groupPairsInternal = GroupPairsLazy();
|
_groupPairsInternal = GroupPairsLazy();
|
||||||
_pairsWithGroupsInternal = PairsWithGroupsLazy();
|
_pairsWithGroupsInternal = PairsWithGroupsLazy();
|
||||||
|
|
||||||
_dalamudContextMenu.OnOpenGameObjectContextMenu += DalamudContextMenuOnOnOpenGameObjectContextMenu;
|
//_dalamudContextMenu.OnOpenGameObjectContextMenu += DalamudContextMenuOnOnOpenGameObjectContextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Pair> DirectPairs => _directPairsInternal.Value;
|
public List<Pair> DirectPairs => _directPairsInternal.Value;
|
||||||
@@ -319,7 +320,7 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
|
|
||||||
_dalamudContextMenu.OnOpenGameObjectContextMenu -= DalamudContextMenuOnOnOpenGameObjectContextMenu;
|
//_dalamudContextMenu.OnOpenGameObjectContextMenu -= DalamudContextMenuOnOnOpenGameObjectContextMenu;
|
||||||
|
|
||||||
DisposePairs();
|
DisposePairs();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,10 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
{
|
{
|
||||||
private readonly IHost _host;
|
private readonly IHost _host;
|
||||||
|
|
||||||
public Plugin(DalamudPluginInterface pluginInterface, ICommandManager commandManager, IDataManager gameData,
|
public Plugin(IDalamudPluginInterface pluginInterface, ICommandManager commandManager, IDataManager gameData,
|
||||||
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
||||||
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog, ITargetManager targetManager, INotificationManager notificationManager)
|
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog, ITargetManager targetManager, INotificationManager notificationManager,
|
||||||
|
ITextureProvider textureProvider)
|
||||||
{
|
{
|
||||||
_host = new HostBuilder()
|
_host = new HostBuilder()
|
||||||
.UseContentRoot(pluginInterface.ConfigDirectory.FullName)
|
.UseContentRoot(pluginInterface.ConfigDirectory.FullName)
|
||||||
@@ -83,7 +84,7 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
collection.AddSingleton<SelectPairForTagUi>();
|
collection.AddSingleton<SelectPairForTagUi>();
|
||||||
collection.AddSingleton((s) => new EventAggregator(pluginInterface.ConfigDirectory.FullName,
|
collection.AddSingleton((s) => new EventAggregator(pluginInterface.ConfigDirectory.FullName,
|
||||||
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<MareMediator>()));
|
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<MareMediator>()));
|
||||||
collection.AddSingleton((s) => new DalamudContextMenu(pluginInterface));
|
//collection.AddSingleton((s) => new DalamudContextMenu(pluginInterface));
|
||||||
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
|
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
|
||||||
clientState, objectTable, framework, gameGui, condition, gameData, targetManager,
|
clientState, objectTable, framework, gameGui, condition, gameData, targetManager,
|
||||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<PerformanceCollectorService>()));
|
s.GetRequiredService<MareMediator>(), s.GetRequiredService<PerformanceCollectorService>()));
|
||||||
@@ -134,8 +135,8 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
collection.AddScoped<WindowMediatorSubscriberBase, EventViewerUI>();
|
collection.AddScoped<WindowMediatorSubscriberBase, EventViewerUI>();
|
||||||
|
|
||||||
collection.AddScoped<WindowMediatorSubscriberBase, EditProfileUi>((s) => new EditProfileUi(s.GetRequiredService<ILogger<EditProfileUi>>(),
|
collection.AddScoped<WindowMediatorSubscriberBase, EditProfileUi>((s) => new EditProfileUi(s.GetRequiredService<ILogger<EditProfileUi>>(),
|
||||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<ApiController>(), pluginInterface.UiBuilder, s.GetRequiredService<UiSharedService>(),
|
s.GetRequiredService<MareMediator>(), s.GetRequiredService<ApiController>(), s.GetRequiredService<UiSharedService>(), s.GetRequiredService<FileDialogManager>(),
|
||||||
s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<MareProfileManager>(), s.GetRequiredService<PerformanceCollectorService>()));
|
s.GetRequiredService<MareProfileManager>(), s.GetRequiredService<PerformanceCollectorService>()));
|
||||||
collection.AddScoped<WindowMediatorSubscriberBase, PopupHandler>();
|
collection.AddScoped<WindowMediatorSubscriberBase, PopupHandler>();
|
||||||
collection.AddScoped<IPopupHandler, ReportPopupHandler>();
|
collection.AddScoped<IPopupHandler, ReportPopupHandler>();
|
||||||
collection.AddScoped<IPopupHandler, BanUserPopupHandler>();
|
collection.AddScoped<IPopupHandler, BanUserPopupHandler>();
|
||||||
@@ -155,7 +156,7 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
s.GetRequiredService<MareMediator>(), notificationManager, chatGui, s.GetRequiredService<MareConfigService>()));
|
s.GetRequiredService<MareMediator>(), notificationManager, chatGui, s.GetRequiredService<MareConfigService>()));
|
||||||
collection.AddScoped((s) => new UiSharedService(s.GetRequiredService<ILogger<UiSharedService>>(), s.GetRequiredService<IpcManager>(), s.GetRequiredService<ApiController>(),
|
collection.AddScoped((s) => new UiSharedService(s.GetRequiredService<ILogger<UiSharedService>>(), s.GetRequiredService<IpcManager>(), s.GetRequiredService<ApiController>(),
|
||||||
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<MareConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<MareConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
||||||
pluginInterface, s.GetRequiredService<Dalamud.Localization>(), s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<MareMediator>()));
|
pluginInterface, textureProvider, s.GetRequiredService<Dalamud.Localization>(), s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<MareMediator>()));
|
||||||
|
|
||||||
collection.AddHostedService(p => p.GetRequiredService<FileCacheManager>());
|
collection.AddHostedService(p => p.GetRequiredService<FileCacheManager>());
|
||||||
collection.AddHostedService(p => p.GetRequiredService<MareMediator>());
|
collection.AddHostedService(p => p.GetRequiredService<MareMediator>());
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using MareSynchronos.FileCache;
|
using MareSynchronos.FileCache;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using MareSynchronos.Services.ServerConfiguration;
|
using MareSynchronos.Services.ServerConfiguration;
|
||||||
using MareSynchronos.UI;
|
using MareSynchronos.UI;
|
||||||
@@ -63,7 +64,7 @@ public sealed class CommandManagerService : IDisposable
|
|||||||
if (_apiController.ServerState == WebAPI.SignalR.Utils.ServerState.Disconnecting)
|
if (_apiController.ServerState == WebAPI.SignalR.Utils.ServerState.Disconnecting)
|
||||||
{
|
{
|
||||||
_mediator.Publish(new NotificationMessage("Mare disconnecting", "Cannot use /toggle while Mare Synchronos is still disconnecting",
|
_mediator.Publish(new NotificationMessage("Mare disconnecting", "Cannot use /toggle while Mare Synchronos is still disconnecting",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
|
NotificationType.Error));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_serverConfigurationManager.CurrentServer == null) return;
|
if (_serverConfigurationManager.CurrentServer == null) return;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
_performanceCollector = performanceCollector;
|
_performanceCollector = performanceCollector;
|
||||||
WorldData = new(() =>
|
WorldData = new(() =>
|
||||||
{
|
{
|
||||||
return gameData.GetExcelSheet<Lumina.Excel.GeneratedSheets.World>(Dalamud.ClientLanguage.English)!
|
return gameData.GetExcelSheet<Lumina.Excel.GeneratedSheets.World>(Dalamud.Game.ClientLanguage.English)!
|
||||||
.Where(w => !w.Name.RawData.IsEmpty && w.DataCenter.Row != 0 && (w.IsPublic || char.IsUpper((char)w.Name.RawData[0])))
|
.Where(w => !w.Name.RawData.IsEmpty && w.DataCenter.Row != 0 && (w.IsPublic || char.IsUpper((char)w.Name.RawData[0])))
|
||||||
.ToDictionary(w => (ushort)w.RowId, w => w.Name.ToString());
|
.ToDictionary(w => (ushort)w.RowId, w => w.Name.ToString());
|
||||||
});
|
});
|
||||||
@@ -74,7 +74,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
|
|
||||||
public bool IsWine { get; init; }
|
public bool IsWine { get; init; }
|
||||||
public unsafe GameObject* GposeTarget => TargetSystem.Instance()->GPoseTarget;
|
public unsafe GameObject* GposeTarget => TargetSystem.Instance()->GPoseTarget;
|
||||||
public unsafe Dalamud.Game.ClientState.Objects.Types.GameObject? GposeTargetGameObject => GposeTarget == null ? null : _objectTable[GposeTarget->ObjectIndex];
|
public unsafe Dalamud.Game.ClientState.Objects.Types.IGameObject? GposeTargetGameObject => GposeTarget == null ? null : _objectTable[GposeTarget->ObjectIndex];
|
||||||
public bool IsAnythingDrawing { get; private set; } = false;
|
public bool IsAnythingDrawing { get; private set; } = false;
|
||||||
public bool IsInCutscene { get; private set; } = false;
|
public bool IsInCutscene { get; private set; } = false;
|
||||||
public bool IsInGpose { get; private set; } = false;
|
public bool IsInGpose { get; private set; } = false;
|
||||||
@@ -88,13 +88,13 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
|
|
||||||
public MareMediator Mediator { get; }
|
public MareMediator Mediator { get; }
|
||||||
|
|
||||||
public Dalamud.Game.ClientState.Objects.Types.GameObject? CreateGameObject(IntPtr reference)
|
public Dalamud.Game.ClientState.Objects.Types.IGameObject? CreateGameObject(IntPtr reference)
|
||||||
{
|
{
|
||||||
EnsureIsOnFramework();
|
EnsureIsOnFramework();
|
||||||
return _objectTable.CreateObjectReference(reference);
|
return _objectTable.CreateObjectReference(reference);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Dalamud.Game.ClientState.Objects.Types.GameObject?> CreateGameObjectAsync(IntPtr reference)
|
public async Task<Dalamud.Game.ClientState.Objects.Types.IGameObject?> CreateGameObjectAsync(IntPtr reference)
|
||||||
{
|
{
|
||||||
return await RunOnFrameworkThread(() => _objectTable.CreateObjectReference(reference)).ConfigureAwait(false);
|
return await RunOnFrameworkThread(() => _objectTable.CreateObjectReference(reference)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -104,12 +104,12 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
if (!_framework.IsInFrameworkUpdateThread) throw new InvalidOperationException("Can only be run on Framework");
|
if (!_framework.IsInFrameworkUpdateThread) throw new InvalidOperationException("Can only be run on Framework");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dalamud.Game.ClientState.Objects.Types.Character? GetCharacterFromObjectTableByIndex(int index)
|
public Dalamud.Game.ClientState.Objects.Types.ICharacter? GetCharacterFromObjectTableByIndex(int index)
|
||||||
{
|
{
|
||||||
EnsureIsOnFramework();
|
EnsureIsOnFramework();
|
||||||
var objTableObj = _objectTable[index];
|
var objTableObj = _objectTable[index];
|
||||||
if (objTableObj!.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player) return null;
|
if (objTableObj!.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player) return null;
|
||||||
return (Dalamud.Game.ClientState.Objects.Types.Character)objTableObj;
|
return (Dalamud.Game.ClientState.Objects.Types.ICharacter)objTableObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe IntPtr GetCompanion(IntPtr? playerPointer = null)
|
public unsafe IntPtr GetCompanion(IntPtr? playerPointer = null)
|
||||||
@@ -126,10 +126,10 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
return await RunOnFrameworkThread(() => GetCompanion(playerPointer)).ConfigureAwait(false);
|
return await RunOnFrameworkThread(() => GetCompanion(playerPointer)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dalamud.Game.ClientState.Objects.Types.Character? GetGposeCharacterFromObjectTableByName(string name, bool onlyGposeCharacters = false)
|
public Dalamud.Game.ClientState.Objects.Types.ICharacter? GetGposeCharacterFromObjectTableByName(string name, bool onlyGposeCharacters = false)
|
||||||
{
|
{
|
||||||
EnsureIsOnFramework();
|
EnsureIsOnFramework();
|
||||||
return (Dalamud.Game.ClientState.Objects.Types.Character?)_objectTable
|
return (Dalamud.Game.ClientState.Objects.Types.ICharacter?)_objectTable
|
||||||
.FirstOrDefault(i => (!onlyGposeCharacters || i.ObjectIndex >= 200) && string.Equals(i.Name.ToString(), name, StringComparison.Ordinal));
|
.FirstOrDefault(i => (!onlyGposeCharacters || i.ObjectIndex >= 200) && string.Equals(i.Name.ToString(), name, StringComparison.Ordinal));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
return await RunOnFrameworkThread(() => GetPet(playerPointer)).ConfigureAwait(false);
|
return await RunOnFrameworkThread(() => GetPet(playerPointer)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerCharacter GetPlayerCharacter()
|
public IPlayerCharacter GetPlayerCharacter()
|
||||||
{
|
{
|
||||||
EnsureIsOnFramework();
|
EnsureIsOnFramework();
|
||||||
return _clientState.LocalPlayer!;
|
return _clientState.LocalPlayer!;
|
||||||
@@ -238,13 +238,13 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
return _objectTable.Any(f => f.Address == key);
|
return _objectTable.Any(f => f.Address == key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsObjectPresent(Dalamud.Game.ClientState.Objects.Types.GameObject? obj)
|
public bool IsObjectPresent(Dalamud.Game.ClientState.Objects.Types.IGameObject? obj)
|
||||||
{
|
{
|
||||||
EnsureIsOnFramework();
|
EnsureIsOnFramework();
|
||||||
return obj != null && obj.IsValid();
|
return obj != null && obj.IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> IsObjectPresentAsync(Dalamud.Game.ClientState.Objects.Types.GameObject? obj)
|
public async Task<bool> IsObjectPresentAsync(Dalamud.Game.ClientState.Objects.Types.IGameObject? obj)
|
||||||
{
|
{
|
||||||
return await RunOnFrameworkThread(() => IsObjectPresent(obj)).ConfigureAwait(false);
|
return await RunOnFrameworkThread(() => IsObjectPresent(obj)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
Thread.Sleep(tick * 2);
|
Thread.Sleep(tick * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector2 WorldToScreen(Dalamud.Game.ClientState.Objects.Types.GameObject? obj)
|
public Vector2 WorldToScreen(Dalamud.Game.ClientState.Objects.Types.IGameObject? obj)
|
||||||
{
|
{
|
||||||
if (obj == null) return Vector2.Zero;
|
if (obj == null) return Vector2.Zero;
|
||||||
return _gameGui.WorldToScreen(obj.Position, out var screenPos) ? screenPos : Vector2.Zero;
|
return _gameGui.WorldToScreen(obj.Position, out var screenPos) ? screenPos : Vector2.Zero;
|
||||||
@@ -452,7 +452,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
if (chara == null || chara.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player)
|
if (chara == null || chara.ObjectKind != Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
MemoryHelper.ReadStringNullTerminated((nint)((GameObject*)chara.Address)->Name, out string charaName);
|
var charaName = ((GameObject*)chara.Address)->NameString;
|
||||||
var hash = (charaName, ((BattleChara*)chara.Address)->Character.HomeWorld).GetHash256();
|
var hash = (charaName, ((BattleChara*)chara.Address)->Character.HomeWorld).GetHash256();
|
||||||
if (!IsAnythingDrawing)
|
if (!IsAnythingDrawing)
|
||||||
CheckCharacterForDrawing(chara.Address, charaName);
|
CheckCharacterForDrawing(chara.Address, charaName);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
|
||||||
using MareSynchronos.API.Data;
|
using MareSynchronos.API.Data;
|
||||||
using MareSynchronos.API.Dto;
|
using MareSynchronos.API.Dto;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.PlayerData.Handlers;
|
using MareSynchronos.PlayerData.Handlers;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.Services.Events;
|
using MareSynchronos.Services.Events;
|
||||||
@@ -83,7 +83,7 @@ public record CombatOrPerformanceStartMessage : MessageBase;
|
|||||||
public record CombatOrPerformanceEndMessage : MessageBase;
|
public record CombatOrPerformanceEndMessage : MessageBase;
|
||||||
public record EventMessage(Event Event) : MessageBase;
|
public record EventMessage(Event Event) : MessageBase;
|
||||||
public record PenumbraDirectoryChangedMessage(string? ModDirectory) : MessageBase;
|
public record PenumbraDirectoryChangedMessage(string? ModDirectory) : MessageBase;
|
||||||
public record PenumbraRedrawCharacterMessage(Character Character) : SameThreadMessage;
|
public record PenumbraRedrawCharacterMessage(ICharacter Character) : SameThreadMessage;
|
||||||
public record GameObjectHandlerCreatedMessage(GameObjectHandler GameObjectHandler, bool OwnedObject) : MessageBase;
|
public record GameObjectHandlerCreatedMessage(GameObjectHandler GameObjectHandler, bool OwnedObject) : MessageBase;
|
||||||
public record GameObjectHandlerDestroyedMessage(GameObjectHandler GameObjectHandler, bool OwnedObject) : MessageBase;
|
public record GameObjectHandlerDestroyedMessage(GameObjectHandler GameObjectHandler, bool OwnedObject) : MessageBase;
|
||||||
#pragma warning restore S2094
|
#pragma warning restore S2094
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
using MareSynchronos.MareConfiguration.Models;
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using NotificationType = MareSynchronos.MareConfiguration.Models.NotificationType;
|
||||||
|
|
||||||
namespace MareSynchronos.Services;
|
namespace MareSynchronos.Services;
|
||||||
|
|
||||||
@@ -15,7 +15,8 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||||||
private readonly IChatGui _chatGui;
|
private readonly IChatGui _chatGui;
|
||||||
private readonly MareConfigService _configurationService;
|
private readonly MareConfigService _configurationService;
|
||||||
|
|
||||||
public NotificationService(ILogger<NotificationService> logger, MareMediator mediator, INotificationManager notificationManager, IChatGui chatGui, MareConfigService configurationService) : base(logger, mediator)
|
public NotificationService(ILogger<NotificationService> logger, MareMediator mediator, INotificationManager notificationManager,
|
||||||
|
IChatGui chatGui, MareConfigService configurationService) : base(logger, mediator)
|
||||||
{
|
{
|
||||||
_notificationManager = notificationManager;
|
_notificationManager = notificationManager;
|
||||||
_chatGui = chatGui;
|
_chatGui = chatGui;
|
||||||
@@ -47,8 +48,6 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||||||
switch (msg.Type)
|
switch (msg.Type)
|
||||||
{
|
{
|
||||||
case NotificationType.Info:
|
case NotificationType.Info:
|
||||||
case NotificationType.Success:
|
|
||||||
case NotificationType.None:
|
|
||||||
PrintInfoChat(msg.Message);
|
PrintInfoChat(msg.Message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -69,8 +68,6 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||||||
switch (msg.Type)
|
switch (msg.Type)
|
||||||
{
|
{
|
||||||
case NotificationType.Info:
|
case NotificationType.Info:
|
||||||
case NotificationType.Success:
|
|
||||||
case NotificationType.None:
|
|
||||||
ShowNotificationLocationBased(msg, _configurationService.Current.InfoNotification);
|
ShowNotificationLocationBased(msg, _configurationService.Current.InfoNotification);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -108,11 +105,19 @@ public class NotificationService : DisposableMediatorSubscriberBase
|
|||||||
|
|
||||||
private void ShowToast(NotificationMessage msg)
|
private void ShowToast(NotificationMessage msg)
|
||||||
{
|
{
|
||||||
_notificationManager.AddNotification(new Dalamud.Interface.ImGuiNotification.Notification()
|
Dalamud.Interface.ImGuiNotification.NotificationType dalamudType = msg.Type switch
|
||||||
|
{
|
||||||
|
MareConfiguration.Models.NotificationType.Error => Dalamud.Interface.ImGuiNotification.NotificationType.Error,
|
||||||
|
MareConfiguration.Models.NotificationType.Warning => Dalamud.Interface.ImGuiNotification.NotificationType.Warning,
|
||||||
|
MareConfiguration.Models.NotificationType.Info => Dalamud.Interface.ImGuiNotification.NotificationType.Info,
|
||||||
|
_ => Dalamud.Interface.ImGuiNotification.NotificationType.Info
|
||||||
|
};
|
||||||
|
|
||||||
|
_notificationManager.AddNotification(new Notification()
|
||||||
{
|
{
|
||||||
Content = msg.Message ?? string.Empty,
|
Content = msg.Message ?? string.Empty,
|
||||||
Title = msg.Title,
|
Title = msg.Title,
|
||||||
Type = msg.Type,
|
Type = dalamudType,
|
||||||
Minimized = false,
|
Minimized = false,
|
||||||
InitialDuration = msg.TimeShownOnScreen ?? TimeSpan.FromSeconds(3)
|
InitialDuration = msg.TimeShownOnScreen ?? TimeSpan.FromSeconds(3)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface.Internal.Notifications;
|
using MareSynchronos.API.Data;
|
||||||
using MareSynchronos.API.Data;
|
|
||||||
using MareSynchronos.API.Data.Comparer;
|
using MareSynchronos.API.Data.Comparer;
|
||||||
using MareSynchronos.Interop.Ipc;
|
using MareSynchronos.Interop.Ipc;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ namespace MareSynchronos.Services;
|
|||||||
public sealed class UiService : DisposableMediatorSubscriberBase
|
public sealed class UiService : DisposableMediatorSubscriberBase
|
||||||
{
|
{
|
||||||
private readonly List<WindowMediatorSubscriberBase> _createdWindows = [];
|
private readonly List<WindowMediatorSubscriberBase> _createdWindows = [];
|
||||||
private readonly UiBuilder _uiBuilder;
|
private readonly IUiBuilder _uiBuilder;
|
||||||
private readonly FileDialogManager _fileDialogManager;
|
private readonly FileDialogManager _fileDialogManager;
|
||||||
private readonly ILogger<UiService> _logger;
|
private readonly ILogger<UiService> _logger;
|
||||||
private readonly MareConfigService _mareConfigService;
|
private readonly MareConfigService _mareConfigService;
|
||||||
private readonly WindowSystem _windowSystem;
|
private readonly WindowSystem _windowSystem;
|
||||||
private readonly UiFactory _uiFactory;
|
private readonly UiFactory _uiFactory;
|
||||||
|
|
||||||
public UiService(ILogger<UiService> logger, UiBuilder uiBuilder,
|
public UiService(ILogger<UiService> logger, IUiBuilder uiBuilder,
|
||||||
MareConfigService mareConfigService, WindowSystem windowSystem,
|
MareConfigService mareConfigService, WindowSystem windowSystem,
|
||||||
IEnumerable<WindowMediatorSubscriberBase> windows,
|
IEnumerable<WindowMediatorSubscriberBase> windows,
|
||||||
UiFactory uiFactory, FileDialogManager fileDialogManager,
|
UiFactory uiFactory, FileDialogManager fileDialogManager,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||||
using FFXIVClientStructs.Havok;
|
using FFXIVClientStructs.Havok.Animation;
|
||||||
|
using FFXIVClientStructs.Havok.Common.Base.Types;
|
||||||
|
using FFXIVClientStructs.Havok.Common.Serialize.Util;
|
||||||
using Lumina;
|
using Lumina;
|
||||||
using Lumina.Data.Files;
|
using Lumina.Data.Files;
|
||||||
using MareSynchronos.FileCache;
|
using MareSynchronos.FileCache;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public sealed class DtrEntry : IDisposable, IHostedService
|
|||||||
private readonly CancellationTokenSource _cancellationTokenSource = new();
|
private readonly CancellationTokenSource _cancellationTokenSource = new();
|
||||||
private readonly ConfigurationServiceBase<MareConfig> _configService;
|
private readonly ConfigurationServiceBase<MareConfig> _configService;
|
||||||
private readonly IDtrBar _dtrBar;
|
private readonly IDtrBar _dtrBar;
|
||||||
private readonly Lazy<DtrBarEntry> _entry;
|
private readonly Lazy<IDtrBarEntry> _entry;
|
||||||
private readonly ILogger<DtrEntry> _logger;
|
private readonly ILogger<DtrEntry> _logger;
|
||||||
private readonly MareMediator _mareMediator;
|
private readonly MareMediator _mareMediator;
|
||||||
private readonly PairManager _pairManager;
|
private readonly PairManager _pairManager;
|
||||||
@@ -40,7 +40,7 @@ public sealed class DtrEntry : IDisposable, IHostedService
|
|||||||
{
|
{
|
||||||
_logger.LogDebug("Disposing DtrEntry");
|
_logger.LogDebug("Disposing DtrEntry");
|
||||||
Clear();
|
Clear();
|
||||||
_entry.Value.Dispose();
|
_entry.Value.Remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ public sealed class DtrEntry : IDisposable, IHostedService
|
|||||||
_entry.Value.Shown = false;
|
_entry.Value.Shown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DtrBarEntry CreateEntry()
|
private IDtrBarEntry CreateEntry()
|
||||||
{
|
{
|
||||||
_logger.LogTrace("Creating new DtrBar entry");
|
_logger.LogTrace("Creating new DtrBar entry");
|
||||||
var entry = _dtrBar.Get("Mare Synchronos");
|
var entry = _dtrBar.Get("Mare Synchronos");
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using MareSynchronos.API.Data;
|
using MareSynchronos.API.Data;
|
||||||
@@ -20,7 +21,6 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||||||
private readonly ApiController _apiController;
|
private readonly ApiController _apiController;
|
||||||
private readonly FileDialogManager _fileDialogManager;
|
private readonly FileDialogManager _fileDialogManager;
|
||||||
private readonly MareProfileManager _mareProfileManager;
|
private readonly MareProfileManager _mareProfileManager;
|
||||||
private readonly UiBuilder _uiBuilder;
|
|
||||||
private readonly UiSharedService _uiSharedService;
|
private readonly UiSharedService _uiSharedService;
|
||||||
private bool _adjustedForScollBarsLocalProfile = false;
|
private bool _adjustedForScollBarsLocalProfile = false;
|
||||||
private bool _adjustedForScollBarsOnlineProfile = false;
|
private bool _adjustedForScollBarsOnlineProfile = false;
|
||||||
@@ -32,9 +32,8 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||||||
private bool _wasOpen;
|
private bool _wasOpen;
|
||||||
|
|
||||||
public EditProfileUi(ILogger<EditProfileUi> logger, MareMediator mediator,
|
public EditProfileUi(ILogger<EditProfileUi> logger, MareMediator mediator,
|
||||||
ApiController apiController, UiBuilder uiBuilder, UiSharedService uiSharedService,
|
ApiController apiController, UiSharedService uiSharedService, FileDialogManager fileDialogManager,
|
||||||
FileDialogManager fileDialogManager, MareProfileManager mareProfileManager,
|
MareProfileManager mareProfileManager, PerformanceCollectorService performanceCollectorService)
|
||||||
PerformanceCollectorService performanceCollectorService)
|
|
||||||
: base(logger, mediator, "Mare Synchronos Edit Profile###MareSynchronosEditProfileUI", performanceCollectorService)
|
: base(logger, mediator, "Mare Synchronos Edit Profile###MareSynchronosEditProfileUI", performanceCollectorService)
|
||||||
{
|
{
|
||||||
IsOpen = false;
|
IsOpen = false;
|
||||||
@@ -44,7 +43,6 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||||||
MaximumSize = new(768, 2000)
|
MaximumSize = new(768, 2000)
|
||||||
};
|
};
|
||||||
_apiController = apiController;
|
_apiController = apiController;
|
||||||
_uiBuilder = uiBuilder;
|
|
||||||
_uiSharedService = uiSharedService;
|
_uiSharedService = uiSharedService;
|
||||||
_fileDialogManager = fileDialogManager;
|
_fileDialogManager = fileDialogManager;
|
||||||
_mareProfileManager = mareProfileManager;
|
_mareProfileManager = mareProfileManager;
|
||||||
@@ -78,7 +76,7 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
_profileImage = profile.ImageData.Value;
|
_profileImage = profile.ImageData.Value;
|
||||||
_pfpTextureWrap?.Dispose();
|
_pfpTextureWrap?.Dispose();
|
||||||
_pfpTextureWrap = _uiBuilder.LoadImage(_profileImage);
|
_pfpTextureWrap = _uiSharedService.LoadImage(_profileImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.Equals(_profileDescription, profile.Description, StringComparison.OrdinalIgnoreCase))
|
if (!string.Equals(_profileDescription, profile.Description, StringComparison.OrdinalIgnoreCase))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
|
|||||||
@@ -5,9 +5,12 @@ using Dalamud.Interface.GameFonts;
|
|||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
using Dalamud.Interface.ManagedFontAtlas;
|
using Dalamud.Interface.ManagedFontAtlas;
|
||||||
|
using Dalamud.Interface.Textures;
|
||||||
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using MareSynchronos.FileCache;
|
using MareSynchronos.FileCache;
|
||||||
@@ -51,7 +54,8 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
private readonly DalamudUtilService _dalamudUtil;
|
private readonly DalamudUtilService _dalamudUtil;
|
||||||
private readonly IpcManager _ipcManager;
|
private readonly IpcManager _ipcManager;
|
||||||
private readonly Dalamud.Localization _localization;
|
private readonly Dalamud.Localization _localization;
|
||||||
private readonly DalamudPluginInterface _pluginInterface;
|
private readonly IDalamudPluginInterface _pluginInterface;
|
||||||
|
private readonly ITextureProvider _textureProvider;
|
||||||
private readonly Dictionary<string, object> _selectedComboItems = new(StringComparer.Ordinal);
|
private readonly Dictionary<string, object> _selectedComboItems = new(StringComparer.Ordinal);
|
||||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||||
private bool _cacheDirectoryHasOtherFilesThanCache = false;
|
private bool _cacheDirectoryHasOtherFilesThanCache = false;
|
||||||
@@ -79,7 +83,9 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
|
|
||||||
public UiSharedService(ILogger<UiSharedService> logger, IpcManager ipcManager, ApiController apiController,
|
public UiSharedService(ILogger<UiSharedService> logger, IpcManager ipcManager, ApiController apiController,
|
||||||
CacheMonitor cacheMonitor, FileDialogManager fileDialogManager,
|
CacheMonitor cacheMonitor, FileDialogManager fileDialogManager,
|
||||||
MareConfigService configService, DalamudUtilService dalamudUtil, DalamudPluginInterface pluginInterface, Dalamud.Localization localization,
|
MareConfigService configService, DalamudUtilService dalamudUtil, IDalamudPluginInterface pluginInterface,
|
||||||
|
ITextureProvider textureProvider,
|
||||||
|
Dalamud.Localization localization,
|
||||||
ServerConfigurationManager serverManager, MareMediator mediator) : base(logger, mediator)
|
ServerConfigurationManager serverManager, MareMediator mediator) : base(logger, mediator)
|
||||||
{
|
{
|
||||||
_ipcManager = ipcManager;
|
_ipcManager = ipcManager;
|
||||||
@@ -89,6 +95,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
_configService = configService;
|
_configService = configService;
|
||||||
_dalamudUtil = dalamudUtil;
|
_dalamudUtil = dalamudUtil;
|
||||||
_pluginInterface = pluginInterface;
|
_pluginInterface = pluginInterface;
|
||||||
|
_textureProvider = textureProvider;
|
||||||
_localization = localization;
|
_localization = localization;
|
||||||
_serverConfigurationManager = serverManager;
|
_serverConfigurationManager = serverManager;
|
||||||
_localization.SetupWithLangCode("en");
|
_localization.SetupWithLangCode("en");
|
||||||
@@ -800,7 +807,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
|
|
||||||
public IDalamudTextureWrap LoadImage(byte[] imageData)
|
public IDalamudTextureWrap LoadImage(byte[] imageData)
|
||||||
{
|
{
|
||||||
return _pluginInterface.UiBuilder.LoadImage(imageData);
|
return _textureProvider.CreateFromImageAsync(imageData).Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadLocalization(string languageCode)
|
public void LoadLocalization(string languageCode)
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ public static class VariousExtensions
|
|||||||
return JsonSerializer.Deserialize<T>(JsonSerializer.Serialize(obj))!;
|
return JsonSerializer.Deserialize<T>(JsonSerializer.Serialize(obj))!;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static unsafe int? ObjectTableIndex(this GameObject? gameObject)
|
public static unsafe int? ObjectTableIndex(this IGameObject? gameObject)
|
||||||
{
|
{
|
||||||
if (gameObject == null || gameObject.Address == IntPtr.Zero)
|
if (gameObject == null || gameObject.Address == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface.Internal.Notifications;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.API.Data.Enum;
|
|
||||||
using MareSynchronos.API.Dto;
|
using MareSynchronos.API.Dto;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.API.Dto.User;
|
using MareSynchronos.API.Dto.User;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using MareSynchronos.API.Dto;
|
|||||||
using MareSynchronos.API.Dto.User;
|
using MareSynchronos.API.Dto.User;
|
||||||
using MareSynchronos.API.SignalR;
|
using MareSynchronos.API.SignalR;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
@@ -193,7 +194,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
|
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
|
||||||
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
|
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
|
||||||
$"This client version is incompatible and will not be able to connect. Please update your Mare Synchronos client.",
|
$"This client version is incompatible and will not be able to connect. Please update your Mare Synchronos client.",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
|
NotificationType.Error));
|
||||||
}
|
}
|
||||||
await StopConnection(ServerState.VersionMisMatch).ConfigureAwait(false);
|
await StopConnection(ServerState.VersionMisMatch).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
@@ -205,7 +206,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
|
$"Your client is outdated ({currentClientVer.Major}.{currentClientVer.Minor}.{currentClientVer.Build}), current is: " +
|
||||||
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
|
$"{_connectionDto.CurrentClientVersion.Major}.{_connectionDto.CurrentClientVersion.Minor}.{_connectionDto.CurrentClientVersion.Build}. " +
|
||||||
$"Please keep your Mare Synchronos client up-to-date.",
|
$"Please keep your Mare Synchronos client up-to-date.",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Warning));
|
NotificationType.Warning));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_dalamudUtil.HasModifiedGameFiles)
|
if (_dalamudUtil.HasModifiedGameFiles)
|
||||||
@@ -215,7 +216,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||||||
Mediator.Publish(new NotificationMessage("Modified Game Files detected",
|
Mediator.Publish(new NotificationMessage("Modified Game Files detected",
|
||||||
"Mare has detected modified game files in your FFXIV installation. You will be able to connect, but the synchronization functionality might be (partially) broken. " +
|
"Mare has detected modified game files in your FFXIV installation. You will be able to connect, but the synchronization functionality might be (partially) broken. " +
|
||||||
"Exit the game and repair it through XIVLauncher to get rid of this message.",
|
"Exit the game and repair it through XIVLauncher to get rid of this message.",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Error, TimeSpan.FromSeconds(15)));
|
NotificationType.Error, TimeSpan.FromSeconds(15)));
|
||||||
}
|
}
|
||||||
|
|
||||||
await LoadIninitialPairs().ConfigureAwait(false);
|
await LoadIninitialPairs().ConfigureAwait(false);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using MareSynchronos.API.Routes;
|
using MareSynchronos.API.Routes;
|
||||||
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using MareSynchronos.Services.ServerConfiguration;
|
using MareSynchronos.Services.ServerConfiguration;
|
||||||
@@ -99,10 +100,10 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
|
|||||||
{
|
{
|
||||||
if (isRenewal)
|
if (isRenewal)
|
||||||
Mediator.Publish(new NotificationMessage("Error refreshing token", "Your authentication token could not be renewed. Try reconnecting to Mare manually.",
|
Mediator.Publish(new NotificationMessage("Error refreshing token", "Your authentication token could not be renewed. Try reconnecting to Mare manually.",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
|
NotificationType.Error));
|
||||||
else
|
else
|
||||||
Mediator.Publish(new NotificationMessage("Error generating token", "Your authentication token could not be generated. Check Mares main UI to see the error message.",
|
Mediator.Publish(new NotificationMessage("Error generating token", "Your authentication token could not be generated. Check Mares main UI to see the error message.",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
|
NotificationType.Error));
|
||||||
Mediator.Publish(new DisconnectedMessage());
|
Mediator.Publish(new DisconnectedMessage());
|
||||||
throw new MareAuthFailureException(response);
|
throw new MareAuthFailureException(response);
|
||||||
}
|
}
|
||||||
@@ -124,7 +125,7 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
|
|||||||
Mediator.Publish(new NotificationMessage("Invalid system clock", "The clock of your computer is invalid. " +
|
Mediator.Publish(new NotificationMessage("Invalid system clock", "The clock of your computer is invalid. " +
|
||||||
"Mare will not function properly if the time zone is not set correctly. " +
|
"Mare will not function properly if the time zone is not set correctly. " +
|
||||||
"Please set your computers time zone correctly and keep your clock synchronized with the internet.",
|
"Please set your computers time zone correctly and keep your clock synchronized with the internet.",
|
||||||
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
|
NotificationType.Error));
|
||||||
throw new InvalidOperationException($"JwtToken is behind DateTime.UtcNow, DateTime.UtcNow is possibly wrong. DateTime.UtcNow is {DateTime.UtcNow}, JwtToken.ValidTo is {jwtToken.ValidTo}");
|
throw new InvalidOperationException($"JwtToken is behind DateTime.UtcNow, DateTime.UtcNow is possibly wrong. DateTime.UtcNow is {DateTime.UtcNow}, JwtToken.ValidTo is {jwtToken.ValidTo}");
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Dalamud.Interface.Internal.Notifications;
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user