Beispiel #1
0
 /// <summary>
 /// Removes a plot directory from the config, does not actually delete the directory.
 /// </summary>
 /// <returns></returns>
 public Task RemovePlotDirectoryAsync(string dirPath)
 => PostAsync(HarvesterRoutes.RemovePlotDirectory(ApiUrl), new Dictionary <string, string>()
 {
     ["dirname"] = dirPath
 });
Beispiel #2
0
        /// <summary>
        /// Returns all of the plot directoried being farmed.
        /// </summary>
        /// <returns></returns>
        public async Task <string[]> GetPlotDirectoriesAsync()
        {
            var result = await PostAsync <GetPlotDirectoriesResult>(HarvesterRoutes.GetPlotDirectories(ApiUrl));

            return(result.Directories);
        }
Beispiel #3
0
 /// <summary>
 /// Refreshes the plots, forces the harvester to search for and load new plots.
 /// </summary>
 /// <returns></returns>
 public Task RefreshPlotsAsync()
 => PostAsync(HarvesterRoutes.RefreshPlots(ApiUrl));
Beispiel #4
0
 /// <summary>
 /// Deletes a plot file and removes it from the harvester.
 /// </summary>
 /// <returns></returns>
 public Task DeletePlotAsync(string fileName)
 => PostAsync(HarvesterRoutes.DeletePlot(ApiUrl), new Dictionary <string, string>()
 {
     ["filename"] = fileName
 });
Beispiel #5
0
        /// <summary>
        /// Gets a list of plots being farmed on this harvester.
        /// </summary>
        /// <returns></returns>
        public async Task <Plot[]> GetPlotsAsync()
        {
            var result = await PostAsync <GetPlotsResult>(HarvesterRoutes.GetPlots(ApiUrl));

            return(result.Plots);
        }