punish v6.8.18.0
This commit is contained in:
commit
cfb4dea47e
316 changed files with 554088 additions and 0 deletions
42
Questionable/Questionable.External/AutomatonIpc.cs
Normal file
42
Questionable/Questionable.External/AutomatonIpc.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Ipc;
|
||||
using Dalamud.Plugin.Ipc.Exceptions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Questionable.External;
|
||||
|
||||
internal sealed class AutomatonIpc
|
||||
{
|
||||
private readonly ILogger<AutomatonIpc> _logger;
|
||||
|
||||
private readonly ICallGateSubscriber<string, bool> _isTweakEnabled;
|
||||
|
||||
private bool _loggedIpcError;
|
||||
|
||||
public bool IsAutoSnipeEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return _isTweakEnabled.InvokeFunc("AutoSnipeQuests");
|
||||
}
|
||||
catch (IpcError exception)
|
||||
{
|
||||
if (!_loggedIpcError)
|
||||
{
|
||||
_loggedIpcError = true;
|
||||
_logger.LogWarning(exception, "Could not query automaton for tweak status, probably not installed");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AutomatonIpc(IDalamudPluginInterface pluginInterface, ILogger<AutomatonIpc> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_isTweakEnabled = pluginInterface.GetIpcSubscriber<string, bool>("Automaton.IsTweakEnabled");
|
||||
logger.LogInformation("Automaton auto-snipe enabled: {IsTweakEnabled}", IsAutoSnipeEnabled);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue