add more functionality for future features.

This commit is contained in:
defnotken
2026-01-04 00:54:40 -06:00
parent df33a0f0a2
commit de9c9955ef
2 changed files with 38 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
public enum ResidentialAetheryteKind public enum ResidentialAetheryteKind
{ {
None = -1,
Uldah = 9, Uldah = 9,
Gridania = 2, Gridania = 2,
Limsa = 8, Limsa = 8,

View File

@@ -1,5 +1,6 @@
using Dalamud.Plugin; using Dalamud.Plugin;
using Dalamud.Plugin.Ipc; using Dalamud.Plugin.Ipc;
using Lifestream.Enums;
using LightlessSync.Interop.Ipc.Framework; using LightlessSync.Interop.Ipc.Framework;
using LightlessSync.Services.Mediator; using LightlessSync.Services.Mediator;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@@ -20,6 +21,11 @@ public sealed class IpcCallerLifestream : IpcServiceBase
private readonly ICallGateSubscriber<uint, bool> _changeWorldById; private readonly ICallGateSubscriber<uint, bool> _changeWorldById;
private readonly ICallGateSubscriber<string, bool> _aetheryteTeleport; private readonly ICallGateSubscriber<string, bool> _aetheryteTeleport;
private readonly ICallGateSubscriber<uint, bool> _aetheryteTeleportById; private readonly ICallGateSubscriber<uint, bool> _aetheryteTeleportById;
private readonly ICallGateSubscriber<bool> _canChangeInstance;
private readonly ICallGateSubscriber<int> _getCurrentInstance;
private readonly ICallGateSubscriber<int> _getNumberOfInstances;
private readonly ICallGateSubscriber<int, object> _changeInstance;
private readonly ICallGateSubscriber<(ResidentialAetheryteKind, int, int)> _getCurrentPlotInfo;
public IpcCallerLifestream(IDalamudPluginInterface pi, LightlessMediator lightlessMediator, ILogger<IpcCallerLifestream> logger) public IpcCallerLifestream(IDalamudPluginInterface pi, LightlessMediator lightlessMediator, ILogger<IpcCallerLifestream> logger)
: base(logger, lightlessMediator, pi, LifestreamDescriptor) : base(logger, lightlessMediator, pi, LifestreamDescriptor)
@@ -33,6 +39,11 @@ public sealed class IpcCallerLifestream : IpcServiceBase
_changeWorldById = pi.GetIpcSubscriber<uint, bool>("Lifestream.ChangeWorldById"); _changeWorldById = pi.GetIpcSubscriber<uint, bool>("Lifestream.ChangeWorldById");
_aetheryteTeleport = pi.GetIpcSubscriber<string, bool>("Lifestream.AetheryteTeleport"); _aetheryteTeleport = pi.GetIpcSubscriber<string, bool>("Lifestream.AetheryteTeleport");
_aetheryteTeleportById = pi.GetIpcSubscriber<uint, bool>("Lifestream.AetheryteTeleportById"); _aetheryteTeleportById = pi.GetIpcSubscriber<uint, bool>("Lifestream.AetheryteTeleportById");
_canChangeInstance = pi.GetIpcSubscriber<bool>("Lifestream.CanChangeInstance");
_getCurrentInstance = pi.GetIpcSubscriber<int>("Lifestream.GetCurrentInstance");
_getNumberOfInstances = pi.GetIpcSubscriber<int>("Lifestream.GetNumberOfInstances");
_changeInstance = pi.GetIpcSubscriber<int, object>("Lifestream.ChangeInstance");
_getCurrentPlotInfo = pi.GetIpcSubscriber<(ResidentialAetheryteKind, int, int)>("Lifestream.GetCurrentPlotInfo");
CheckAPI(); CheckAPI();
} }
@@ -84,10 +95,35 @@ public sealed class IpcCallerLifestream : IpcServiceBase
return _changeWorldById.InvokeFunc(worldId); return _changeWorldById.InvokeFunc(worldId);
} }
public bool AetheryteTeleportById(uint aetheryteId) public bool AetheryteTeleportById(uint aetheryteId)
{ {
if (!APIAvailable) return false; if (!APIAvailable) return false;
return _aetheryteTeleportById.InvokeFunc(aetheryteId); return _aetheryteTeleportById.InvokeFunc(aetheryteId);
} }
public bool CanChangeInstance()
{
if (!APIAvailable) return false;
return _canChangeInstance.InvokeFunc();
}
public int GetCurrentInstance()
{
if (!APIAvailable) return -1;
return _getCurrentInstance.InvokeFunc();
}
public int GetNumberOfInstances()
{
if (!APIAvailable) return -1;
return _getNumberOfInstances.InvokeFunc();
}
public void ChangeInstance(int instanceNumber)
{
if (!APIAvailable) return;
_changeInstance.InvokeAction(instanceNumber);
}
public (ResidentialAetheryteKind, int, int)? GetCurrentPlotInfo()
{
if (!APIAvailable) return (ResidentialAetheryteKind.None, -1, -1);
return _getCurrentPlotInfo.InvokeFunc();
}
} }