Class HarvesterProxy
Proxy that communicates with the harvester
public sealed class HarvesterProxy : ServiceProxy, IServiceProxy
- Inheritance
-
HarvesterProxy
- Implements
- Inherited Members
- Extension Methods
Remarks
ctor
Constructors
HarvesterProxy(IRpcClient, string)
Proxy that communicates with the harvester
public HarvesterProxy(IRpcClient rpcClient, string originService)
Parameters
rpcClientIRpcClientIRpcClient instance to use for rpc communication
originServicestring
Remarks
ctor
Methods
AddPlotDirectory(string, CancellationToken)
Add a plot directory to the harvester configuration
public Task AddPlotDirectory(string dirname, CancellationToken cancellationToken = default)
Parameters
dirnamestringThe plot directory to add
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
DeletePlot(string, CancellationToken)
Permanently delete a plot file
public Task DeletePlot(string filename, CancellationToken cancellationToken = default)
Parameters
filenamestringthe file name of the plot
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
Remarks
Calling this DELETES the plot file. Proceed with caution.
GetHarvesterConfig(CancellationToken)
Gets harvester configuration.
public Task<HarvesterConfig> GetHarvesterConfig(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetPlotDirectories(CancellationToken)
Get the list of plot directories from the harvester configuration
public Task<IEnumerable<string>> GetPlotDirectories(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<string>>
List of directories
GetPlots(CancellationToken)
Get the list of plot files
public Task<(IEnumerable<string> FailedToOpenFilenames, IEnumerable<string> NotFoundFileNames, IEnumerable<PlotInfo> Plots)> GetPlots(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<string> FailedToOpenFilenames, IEnumerable<string> NotFoundFileNames, IEnumerable<PlotInfo> Plots)>
A list of plots
OnEventMessage(Message)
protected override void OnEventMessage(Message msg)
Parameters
msgMessage
RefreshPlots(CancellationToken)
Refresh the list of plots
public Task RefreshPlots(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
RemovePlotDirectory(string, CancellationToken)
Removes a plot directory from the harvester configuration
public Task RemovePlotDirectory(string dirname, CancellationToken cancellationToken = default)
Parameters
dirnamestringThe plot directory to remove
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
UpdateHarvesterConfig(bool?, int?, bool?, bool?, int?, int?, bool?, uint?, CancellationToken)
Sets harvester configuration.
public Task UpdateHarvesterConfig(bool? useGpuHarvesting = null, int? gpuIndex = null, bool? enforceGpuIndex = null, bool? disableCpuAffinity = null, int? parallelDecompressorCount = null, int? decompressorThreadCount = null, bool? recursivePlotScan = null, uint? refreshParameterIntervalSeconds = null, CancellationToken cancellationToken = default)
Parameters
useGpuHarvestingbool?gpuIndexint?enforceGpuIndexbool?disableCpuAffinitybool?parallelDecompressorCountint?decompressorThreadCountint?recursivePlotScanbool?refreshParameterIntervalSecondsuint?cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable task>
Events
FarmingInfoChanged
Event raised when the farming info changes
public event EventHandler<dynamic>? FarmingInfoChanged
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the harvester
PlotsChanged
Event raised when the plots change
public event EventHandler<dynamic>? PlotsChanged
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the harvester