Esempio n. 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
 });
Esempio n. 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);
        }
Esempio n. 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));
Esempio n. 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
 });
Esempio n. 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);
        }