forked from julianperrott/WowClassicGrindBot
-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark: Added a way to mass load all available profiles -- current…
…ly not working. HeadlessServer: Added --loadonly flag to only attempt to load the class profile then exit. Core: FrameConfig: Added a way to just Load the config. Core: DependencyInjection: When loading the FrameConfig be more verbose about the error messages.
- Loading branch information
Showing
11 changed files
with
183 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Define the folder path | ||
$folderPath = "..\JSON\class" | ||
|
||
# Initialize a variable to store the result | ||
$maxCount = 0 | ||
$maxFile = "" | ||
|
||
# Get all files in the folder | ||
$files = Get-ChildItem -Path $folderPath -File | ||
|
||
# Iterate through each file | ||
foreach ($file in $files) { | ||
# Read the file content | ||
$content = Get-Content -Path $file.FullName | ||
|
||
# Count occurrences of the word "Requirement" | ||
$count = [regex]::Matches($content, "Requirement", [System.Text.RegularExpressions.RegexOptions]::IgnoreCase).Count | ||
|
||
# Check if this file has more occurrences than the current maximum | ||
if ($count -gt $maxCount) { | ||
$maxCount = $count | ||
$maxFile = $file.FullName | ||
} | ||
} | ||
|
||
# Output the result | ||
if ($maxFile -ne "") { | ||
Write-Output "File with the most occurrences of 'Requirement': $maxFile" | ||
Write-Output "Occurrences count: $maxCount" | ||
} else { | ||
Write-Output "No files found in the specified folder." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mklink /J "..\Benchmarks\bin\Release\Json" "..\Json" | ||
PAUSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using BenchmarkDotNet.Attributes; | ||
|
||
using HeadlessServer; | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using WinAPI; | ||
|
||
namespace Benchmarks.ClassProfile; | ||
|
||
public class LoadAllProfiles | ||
{ | ||
[Benchmark] | ||
[ArgumentsSource(nameof(GetProfileNames))] | ||
public void LoadProfile(string profileName) | ||
{ | ||
// TODO: fix loading error frame_config.json not exists | ||
HeadlessServer.Program.Main([$"{profileName}", "-m Local", "--loadonly"]); | ||
} | ||
|
||
public static IEnumerable<string> GetProfileNames() | ||
{ | ||
var dataConfig = DataConfig.Load(); | ||
|
||
Directory.SetCurrentDirectory("..\\..\\..\\..\\HeadlessServer"); | ||
|
||
var root = Path.Join(dataConfig.Class, Path.DirectorySeparatorChar.ToString()); | ||
var files = Directory.EnumerateFiles(root, "*.json*", SearchOption.AllDirectories) | ||
.Select(path => path.Replace(root, string.Empty)) | ||
.OrderBy(x => x, new NaturalStringComparer()); | ||
|
||
yield return files.First(); | ||
|
||
//foreach (var fileName in files) | ||
//{ | ||
// yield return fileName; | ||
//} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,62 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
<Platforms>AnyCPU;x64;x86</Platforms> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
<Platforms>AnyCPU;x64;x86</Platforms> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="headless_appsettings.Development.json" /> | ||
<None Remove="headless_appsettings.json" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Remove="headless_appsettings.Development.json" /> | ||
<None Remove="headless_appsettings.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="headless_appsettings.Development.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</Content> | ||
<Content Include="headless_appsettings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="headless_appsettings.Development.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</Content> | ||
<Content Include="headless_appsettings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile> | ||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CommandLineParser" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" /> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" /> | ||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" /> | ||
<PackageReference Include="Serilog.Expressions" /> | ||
<PackageReference Include="Serilog.Extensions.Logging" /> | ||
<PackageReference Include="Serilog.Settings.Configuration" /> | ||
<PackageReference Include="Serilog.Sinks.Console" /> | ||
<PackageReference Include="Serilog.Sinks.Debug" /> | ||
<PackageReference Include="Serilog.Sinks.File" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="CommandLineParser" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" /> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" /> | ||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" /> | ||
<PackageReference Include="Serilog.Expressions" /> | ||
<PackageReference Include="Serilog.Extensions.Logging" /> | ||
<PackageReference Include="Serilog.Settings.Configuration" /> | ||
<PackageReference Include="Serilog.Sinks.Console" /> | ||
<PackageReference Include="Serilog.Sinks.Debug" /> | ||
<PackageReference Include="Serilog.Sinks.File" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Core\Core.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Core\Core.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="addon_config.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Update="data_config.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Update="addon_config.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Update="data_config.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Update="frame_config.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters