forked from aly/qstbak
muffin v7.5.12
This commit is contained in:
parent
3102923ce2
commit
911ed68baa
65 changed files with 2356 additions and 1539 deletions
|
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Ipc;
|
||||
using Dalamud.Plugin.Ipc.Exceptions;
|
||||
|
|
@ -17,6 +19,8 @@ internal sealed class AutoDutyIpc
|
|||
UnsyncRegular
|
||||
}
|
||||
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly TerritoryData _territoryData;
|
||||
|
|
@ -45,6 +49,7 @@ internal sealed class AutoDutyIpc
|
|||
|
||||
public AutoDutyIpc(IDalamudPluginInterface pluginInterface, Configuration configuration, TerritoryData territoryData, ILogger<AutoDutyIpc> logger)
|
||||
{
|
||||
_pluginInterface = pluginInterface;
|
||||
_configuration = configuration;
|
||||
_territoryData = territoryData;
|
||||
_logger = logger;
|
||||
|
|
@ -210,6 +215,41 @@ internal sealed class AutoDutyIpc
|
|||
}
|
||||
}
|
||||
|
||||
public string DescribeInstallation()
|
||||
{
|
||||
List<string> list = (from p in _pluginInterface.InstalledPlugins
|
||||
where p.InternalName.Contains("AutoDuty", StringComparison.OrdinalIgnoreCase) || p.Name.Contains("AutoDuty", StringComparison.OrdinalIgnoreCase)
|
||||
select $"{p.InternalName} {p.Version} from '{p.Manifest.InstalledFromUrl}' (loaded: {p.IsLoaded}, dev: {p.IsDev})").ToList();
|
||||
string value = ((list.Count > 0) ? string.Join("; ", list) : "no AutoDuty plugin installed");
|
||||
string value2 = "IPC Run: " + (_run.HasAction ? "registered" : "missing") + ", IsStopped: " + (_isStopped.HasFunction ? "registered" : "missing");
|
||||
string value3 = $"GetConfig probe: {ProbeConfig("Questionable.Probe")}, dutyModeEnum: {ProbeConfig("dutyModeEnum")}, LoopTimes: {ProbeConfig("LoopTimes")}, IsStopped: {ProbeIsStopped()}";
|
||||
return $"{value}; {value2}; {value3}";
|
||||
}
|
||||
|
||||
private string ProbeConfig(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
return "'" + _getConfig.InvokeFunc(key) + "'";
|
||||
}
|
||||
catch (IpcError ipcError)
|
||||
{
|
||||
return $"<{ipcError.GetType().Name}: {ipcError.Message}>";
|
||||
}
|
||||
}
|
||||
|
||||
private string ProbeIsStopped()
|
||||
{
|
||||
try
|
||||
{
|
||||
return _isStopped.InvokeFunc().ToString();
|
||||
}
|
||||
catch (IpcError ipcError)
|
||||
{
|
||||
return $"<{ipcError.GetType().Name}: {ipcError.Message}>";
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsStopped()
|
||||
{
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue