Compare commits
No commits in common. "master" and "ipc" have entirely different histories.
@ -1,5 +1,5 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup Condition="$(MSBuildProjectName) != 'GatheringPathRenderer'">
|
<PropertyGroup Condition="$(MSBuildProjectName) != 'GatheringPathRenderer'">
|
||||||
<Version>4.19</Version>
|
<Version>4.18</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
root = true
|
|
||||||
|
|
||||||
[*.json]
|
|
||||||
indent_size = 2
|
|
||||||
indent_style = space
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
charset = utf-8
|
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
|
"$id": "https://git.carvel.li/liza/Questionable/raw/branch/master/GatheringPaths/gatheringlocation-v1.json",
|
||||||
"title": "Gathering Location V1",
|
"title": "Gathering Location V1",
|
||||||
|
@ -4,5 +4,3 @@
|
|||||||
indent_size = 2
|
indent_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
|
||||||
charset = utf-8
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<LangVersion>12</LangVersion>
|
<LangVersion>12</LangVersion>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-aethernetshard.json",
|
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-aethernetshard.json",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-aetheryte.json",
|
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-aetheryte.json",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-classjob.json",
|
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-classjob.json",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-vector3.json",
|
"$id": "/liza/Questionable/raw/branch/master/Questionable.Model/common-vector3.json",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -1,26 +1,16 @@
|
|||||||
{
|
{
|
||||||
"Name": "Questionable",
|
"Name": "Questionable",
|
||||||
"Modules": {
|
"Modules": {
|
||||||
"BossMod.Autorotation.MiscAI.AutoFarm": [],
|
|
||||||
"BossMod.Autorotation.MiscAI.AutoPull": [
|
|
||||||
{
|
|
||||||
"Track": "Automatically attack hunt marks once they are below 95% HP",
|
|
||||||
"Option": "Disabled"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Track": "Automatically attack deep dungeon bosses when solo",
|
|
||||||
"Option": "Disabled"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Track": "Automatically attack all targets if the Epic Echo status is present (i.e. when unsynced)",
|
|
||||||
"Option": "Disabled"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"BossMod.Autorotation.xan.DNC": [
|
"BossMod.Autorotation.xan.DNC": [
|
||||||
{
|
{
|
||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -35,6 +25,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -59,6 +54,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -77,6 +77,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -91,6 +96,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -115,6 +125,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -129,6 +144,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -143,6 +163,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -157,6 +182,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -171,6 +201,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -185,6 +220,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -199,6 +239,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -213,6 +258,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -227,6 +277,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -241,6 +296,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -255,6 +315,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -264,11 +329,22 @@
|
|||||||
"Option": "Manual"
|
"Option": "Manual"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"BossMod.Autorotation.StandardWAR": [
|
||||||
|
{
|
||||||
|
"Track": "AOE",
|
||||||
|
"Option": "AutoFinishCombo"
|
||||||
|
}
|
||||||
|
],
|
||||||
"BossMod.Autorotation.xan.RDM": [
|
"BossMod.Autorotation.xan.RDM": [
|
||||||
{
|
{
|
||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -283,6 +359,11 @@
|
|||||||
"Track": "Buffs",
|
"Track": "Buffs",
|
||||||
"Option": "Auto"
|
"Option": "Auto"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Track": "Buffs",
|
||||||
|
"Option": "Delay",
|
||||||
|
"Mod": "Shift, Ctrl"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Track": "AOE",
|
"Track": "AOE",
|
||||||
"Option": "AOE"
|
"Option": "AOE"
|
||||||
@ -291,18 +372,6 @@
|
|||||||
"Track": "Targeting",
|
"Track": "Targeting",
|
||||||
"Option": "Manual"
|
"Option": "Manual"
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"BossMod.Autorotation.VeynWAR": [
|
|
||||||
{
|
|
||||||
"Track": "AOE",
|
|
||||||
"Option": "AutoFinishCombo"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"BossMod.Autorotation.MiscAI.NormalMovement": [
|
|
||||||
{
|
|
||||||
"Track": "Destination",
|
|
||||||
"Option": "Pathfind"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -473,9 +473,6 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||||||
private void ClearTasksInternal()
|
private void ClearTasksInternal()
|
||||||
{
|
{
|
||||||
//_logger.LogDebug("Clearing task (internally)");
|
//_logger.LogDebug("Clearing task (internally)");
|
||||||
if (_taskQueue.CurrentTaskExecutor is IStoppableTaskExecutor stoppableTaskExecutor)
|
|
||||||
stoppableTaskExecutor.StopNow();
|
|
||||||
|
|
||||||
_taskQueue.Reset();
|
_taskQueue.Reset();
|
||||||
|
|
||||||
_yesAlreadyIpc.RestoreYesAlready();
|
_yesAlreadyIpc.RestoreYesAlready();
|
||||||
|
@ -49,7 +49,7 @@ internal static class Duty
|
|||||||
TerritoryData territoryData,
|
TerritoryData territoryData,
|
||||||
IClientState clientState,
|
IClientState clientState,
|
||||||
IChatGui chatGui,
|
IChatGui chatGui,
|
||||||
SendNotification.Executor sendNotificationExecutor) : TaskExecutor<StartAutoDutyTask>, IStoppableTaskExecutor
|
SendNotification.Executor sendNotificationExecutor) : TaskExecutor<StartAutoDutyTask>
|
||||||
{
|
{
|
||||||
protected override bool Start()
|
protected override bool Start()
|
||||||
{
|
{
|
||||||
@ -94,8 +94,6 @@ internal static class Duty
|
|||||||
: ETaskResult.StillRunning;
|
: ETaskResult.StillRunning;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopNow() => autoDutyIpc.Stop();
|
|
||||||
|
|
||||||
public override bool ShouldInterruptOnDamage() => false;
|
public override bool ShouldInterruptOnDamage() => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +105,7 @@ internal static class Duty
|
|||||||
internal sealed class WaitAutoDutyExecutor(
|
internal sealed class WaitAutoDutyExecutor(
|
||||||
AutoDutyIpc autoDutyIpc,
|
AutoDutyIpc autoDutyIpc,
|
||||||
TerritoryData territoryData,
|
TerritoryData territoryData,
|
||||||
IClientState clientState) : TaskExecutor<WaitAutoDutyTask>, IStoppableTaskExecutor
|
IClientState clientState) : TaskExecutor<WaitAutoDutyTask>
|
||||||
{
|
{
|
||||||
protected override bool Start() => true;
|
protected override bool Start() => true;
|
||||||
|
|
||||||
@ -122,8 +120,6 @@ internal static class Duty
|
|||||||
: ETaskResult.StillRunning;
|
: ETaskResult.StillRunning;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopNow() => autoDutyIpc.Stop();
|
|
||||||
|
|
||||||
public override bool ShouldInterruptOnDamage() => false;
|
public override bool ShouldInterruptOnDamage() => false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,11 +25,6 @@ internal interface IExtraTaskCreator : ITaskExecutor
|
|||||||
IEnumerable<ITask> CreateExtraTasks();
|
IEnumerable<ITask> CreateExtraTasks();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal interface IStoppableTaskExecutor : ITaskExecutor
|
|
||||||
{
|
|
||||||
void StopNow();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal abstract class TaskExecutor<T> : ITaskExecutor
|
internal abstract class TaskExecutor<T> : ITaskExecutor
|
||||||
where T : class, ITask
|
where T : class, ITask
|
||||||
{
|
{
|
||||||
|
28
Questionable/External/AutoDutyIpc.cs
vendored
28
Questionable/External/AutoDutyIpc.cs
vendored
@ -12,23 +12,18 @@ internal sealed class AutoDutyIpc
|
|||||||
private readonly Configuration _configuration;
|
private readonly Configuration _configuration;
|
||||||
private readonly TerritoryData _territoryData;
|
private readonly TerritoryData _territoryData;
|
||||||
private readonly ILogger<AutoDutyIpc> _logger;
|
private readonly ILogger<AutoDutyIpc> _logger;
|
||||||
private readonly ICallGateSubscriber<uint, bool> _contentHasPath;
|
private readonly ICallGateSubscriber<uint,bool> _contentHasPath;
|
||||||
private readonly ICallGateSubscriber<string, string, object> _setConfig;
|
private readonly ICallGateSubscriber<uint,int,bool,object> _run;
|
||||||
private readonly ICallGateSubscriber<uint, int, bool, object> _run;
|
|
||||||
private readonly ICallGateSubscriber<bool> _isStopped;
|
private readonly ICallGateSubscriber<bool> _isStopped;
|
||||||
private readonly ICallGateSubscriber<object> _stop;
|
|
||||||
|
|
||||||
public AutoDutyIpc(IDalamudPluginInterface pluginInterface, Configuration configuration,
|
public AutoDutyIpc(IDalamudPluginInterface pluginInterface, Configuration configuration, TerritoryData territoryData, ILogger<AutoDutyIpc> logger)
|
||||||
TerritoryData territoryData, ILogger<AutoDutyIpc> logger)
|
|
||||||
{
|
{
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
_territoryData = territoryData;
|
_territoryData = territoryData;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_contentHasPath = pluginInterface.GetIpcSubscriber<uint, bool>("AutoDuty.ContentHasPath");
|
_contentHasPath = pluginInterface.GetIpcSubscriber<uint, bool>("AutoDuty.ContentHasPath");
|
||||||
_setConfig = pluginInterface.GetIpcSubscriber<string, string, object>("AutoDuty.SetConfig");
|
|
||||||
_run = pluginInterface.GetIpcSubscriber<uint, int, bool, object>("AutoDuty.Run");
|
_run = pluginInterface.GetIpcSubscriber<uint, int, bool, object>("AutoDuty.Run");
|
||||||
_isStopped = pluginInterface.GetIpcSubscriber<bool>("AutoDuty.IsStopped");
|
_isStopped = pluginInterface.GetIpcSubscriber<bool>("AutoDuty.IsStopped");
|
||||||
_stop = pluginInterface.GetIpcSubscriber<object>("AutoDuty.Stop");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsConfiguredToRunContent(uint? cfcId, bool autoDutyEnabled)
|
public bool IsConfiguredToRunContent(uint? cfcId, bool autoDutyEnabled)
|
||||||
@ -60,8 +55,7 @@ internal sealed class AutoDutyIpc
|
|||||||
}
|
}
|
||||||
catch (IpcError e)
|
catch (IpcError e)
|
||||||
{
|
{
|
||||||
_logger.LogWarning("Unable to query AutoDuty for path in territory {TerritoryType}: {Message}",
|
_logger.LogWarning("Unable to query AutoDuty for path in territory {TerritoryType}: {Message}", cfcData.TerritoryId, e.Message);
|
||||||
cfcData.TerritoryId, e.Message);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,7 +67,6 @@ internal sealed class AutoDutyIpc
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_setConfig.InvokeAction("dutyModeEnum", "Support");
|
|
||||||
_run.InvokeAction(cfcData.TerritoryId, 1, true);
|
_run.InvokeAction(cfcData.TerritoryId, 1, true);
|
||||||
}
|
}
|
||||||
catch (IpcError e)
|
catch (IpcError e)
|
||||||
@ -93,17 +86,4 @@ internal sealed class AutoDutyIpc
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_logger.LogInformation("Calling AutoDuty.Stop");
|
|
||||||
_stop.InvokeAction();
|
|
||||||
}
|
|
||||||
catch (IpcError e)
|
|
||||||
{
|
|
||||||
throw new TaskException($"Unable to stop AutoDuty: {e.Message}", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
14
Questionable/External/QuestionableIpc.cs
vendored
14
Questionable/External/QuestionableIpc.cs
vendored
@ -15,13 +15,11 @@ internal sealed class QuestionableIpc : IDisposable
|
|||||||
private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId";
|
private const string IpcGetCurrentQuestId = "Questionable.GetCurrentQuestId";
|
||||||
private const string IpcGetCurrentlyActiveEventQuests = "Questionable.GetCurrentlyActiveEventQuests";
|
private const string IpcGetCurrentlyActiveEventQuests = "Questionable.GetCurrentlyActiveEventQuests";
|
||||||
private const string IpcStartQuest = "Questionable.StartQuest";
|
private const string IpcStartQuest = "Questionable.StartQuest";
|
||||||
private const string IpcStartSingleQuest = "Questionable.StartSingleQuest";
|
|
||||||
|
|
||||||
private readonly ICallGateProvider<bool> _isRunning;
|
private readonly ICallGateProvider<bool> _isRunning;
|
||||||
private readonly ICallGateProvider<string?> _getCurrentQuestId;
|
private readonly ICallGateProvider<string?> _getCurrentQuestId;
|
||||||
private readonly ICallGateProvider<List<string>> _getCurrentlyActiveEventQuests;
|
private readonly ICallGateProvider<List<string>> _getCurrentlyActiveEventQuests;
|
||||||
private readonly ICallGateProvider<string, bool> _startQuest;
|
private readonly ICallGateProvider<string, bool> _startQuest;
|
||||||
private readonly ICallGateProvider<string, bool> _startSingleQuest;
|
|
||||||
|
|
||||||
public QuestionableIpc(
|
public QuestionableIpc(
|
||||||
QuestController questController,
|
QuestController questController,
|
||||||
@ -41,21 +39,15 @@ internal sealed class QuestionableIpc : IDisposable
|
|||||||
eventInfoComponent.GetCurrentlyActiveEventQuests().Select(q => q.ToString()).ToList());
|
eventInfoComponent.GetCurrentlyActiveEventQuests().Select(q => q.ToString()).ToList());
|
||||||
|
|
||||||
_startQuest = pluginInterface.GetIpcProvider<string, bool>(IpcStartQuest);
|
_startQuest = pluginInterface.GetIpcProvider<string, bool>(IpcStartQuest);
|
||||||
_startQuest.RegisterFunc((string questId) => StartQuest(questController, questRegistry, questId, false));
|
_startQuest.RegisterFunc((string questId) => StartQuest(questController, questRegistry, questId));
|
||||||
|
|
||||||
_startSingleQuest = pluginInterface.GetIpcProvider<string, bool>(IpcStartSingleQuest);
|
|
||||||
_startSingleQuest.RegisterFunc((string questId) => StartQuest(questController, questRegistry, questId, true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool StartQuest(QuestController qc, QuestRegistry qr, string questId, bool single)
|
private static bool StartQuest(QuestController qc, QuestRegistry qr, string questId)
|
||||||
{
|
{
|
||||||
if (ElementId.TryFromString(questId, out var elementId) && elementId != null && qr.TryGetQuest(elementId, out var quest))
|
if (ElementId.TryFromString(questId, out var elementId) && elementId != null && qr.TryGetQuest(elementId, out var quest))
|
||||||
{
|
{
|
||||||
qc.SetNextQuest(quest);
|
qc.SetNextQuest(quest);
|
||||||
if (single)
|
qc.Start("IPCQuestSelection");
|
||||||
qc.StartSingleQuest("IPCQuestSelection");
|
|
||||||
else
|
|
||||||
qc.Start("IPCQuestSelection");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -139,7 +139,7 @@ internal sealed class EventInfoComponent
|
|||||||
public IEnumerable<QuestId> GetCurrentlyActiveEventQuests()
|
public IEnumerable<QuestId> GetCurrentlyActiveEventQuests()
|
||||||
{
|
{
|
||||||
return _eventQuests
|
return _eventQuests
|
||||||
.Where(x => x.EndsAtUtc >= DateTime.UtcNow)
|
.Where(x => x.EndsAtUtc <= DateTime.UtcNow)
|
||||||
.SelectMany(x => x.QuestIds);
|
.SelectMany(x => x.QuestIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user