/// <summary>
        /// Invokes a heatmap generator instance on the specific files creating heatmap images
        /// </summary>
        /// <param name="listFile">File containing full paths to JSON data of a parsed demo</param>
        /// <param name="radarFilesFolder">Folder containing radar files</param>
        /// <param name="pastGameDataFolder">Folder that contains data from past game parses, should be per-season</param>
        /// <param name="outputFolder">Folder to output images in</param>
        /// <returns>List of file info of output images</returns>
        public static async Task <List <FileInfo> > GenerateHeatMapsByListFile(string listFile, string radarFilesFolder, string pastGameDataFolder, string outputFolder)
        {
            //Make paths full because jimwood.
            string output           = new DirectoryInfo(outputDir + "\\" + outputFolder).FullName;
            string overviewFilesDir = new DirectoryInfo(radarFilesFolder).FullName;
            string heatmapJasonDir  = new DirectoryInfo($"{pastGameDataRoot}\\{pastGameDataFolder}").FullName;

            //Start the process
            var processStartInfo = new ProcessStartInfo(exeFolderName + fileName,
                                                        $"-inputdatafilepathsfile \"{listFile}\" " +
                                                        $"-overviewfilesdirectory \"{overviewFilesDir}\\\\\" " +
                                                        $"-heatmapjsondirectory \"{heatmapJasonDir}\\\\\" " +
                                                        $"-outputheatmapdirectory \"{output}\\\\\" " +
                                                        $"-heatmapstogenerate all");

            processStartInfo.WorkingDirectory = exeFolderName;

            //Start generator with a 60m timeout
            try
            {
                await AsyncProcessRunner.RunAsync(processStartInfo, 60 * 60 * 1000);
            }
            catch (Exception e)
            {
                await _log.LogMessage($"Error generating heatmaps for directory:`{overviewFilesDir}`" +
                                      $"\nJasonDir:`{heatmapJasonDir}`" +
                                      $"\nException:" +
                                      $"\n{e}", color : LOG_COLOR);
            }

            return(GeneralUtil.GetFilesInDirectory(output));
        }
Beispiel #2
0
        /// <summary>
        ///     Parses FaceIt Demos in bulk.
        /// </summary>
        /// <param name="sourcePath"></param>
        /// <param name="destinationPath"></param>
        /// <returns></returns>
        public static async Task ParseFaceitDemos(string sourcePath, string destinationPath)
        {
            //Start the process
            var processStartInfo = new ProcessStartInfo(exeFolderName + fileName,
                                                        $"-folders \"{sourcePath}\" -output \"{destinationPath}\" -nochickens -samefilename -lowoutputmode");

            processStartInfo.WorkingDirectory = "IDemO";

            //Start demo parser with a 20m timeout
            await AsyncProcessRunner.RunAsync(processStartInfo, 20 * 60 * 1000);
        }