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
rpcClient
IRpcClientIRpcClient instance to use for rpc communication
originService
string
Remarks
ctor
Methods
AddPlotDirectory(string, CancellationToken)
Add a plot directory to the harvester configuration
public Task AddPlotDirectory(string dirname, CancellationToken cancellationToken = default)
Parameters
dirname
stringThe plot directory to add
cancellationToken
CancellationTokenA 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
filename
stringthe file name of the plot
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
msg
Message
RefreshPlots(CancellationToken)
Refresh the list of plots
public Task RefreshPlots(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA 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
dirname
stringThe plot directory to remove
cancellationToken
CancellationTokenA 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
useGpuHarvesting
bool?gpuIndex
int?enforceGpuIndex
bool?disableCpuAffinity
bool?parallelDecompressorCount
int?decompressorThreadCount
int?recursivePlotScan
bool?refreshParameterIntervalSeconds
uint?cancellationToken
CancellationTokenA 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