├── HsmodConfiguration ├── Resources │ ├── Raw │ │ ├── Addins │ │ │ ├── .doorstop_version │ │ │ ├── winhttp.dll │ │ │ ├── BepInEx │ │ │ │ ├── core │ │ │ │ │ ├── BepInEx.dll │ │ │ │ │ ├── 0Harmony.dll │ │ │ │ │ ├── 0Harmony20.dll │ │ │ │ │ ├── Mono.Cecil.dll │ │ │ │ │ ├── BepInEx.Harmony.dll │ │ │ │ │ ├── HarmonyXInterop.dll │ │ │ │ │ ├── Mono.Cecil.Mdb.dll │ │ │ │ │ ├── Mono.Cecil.Pdb.dll │ │ │ │ │ ├── MonoMod.Utils.dll │ │ │ │ │ ├── BepInEx.Preloader.dll │ │ │ │ │ ├── Mono.Cecil.Rocks.dll │ │ │ │ │ ├── MonoMod.RuntimeDetour.dll │ │ │ │ │ ├── BepInEx.Harmony.xml │ │ │ │ │ ├── BepInEx.Preloader.xml │ │ │ │ │ └── MonoMod.RuntimeDetour.xml │ │ │ │ └── unstripped_corlib │ │ │ │ │ ├── System.dll │ │ │ │ │ ├── UniTask.dll │ │ │ │ │ ├── mscorlib.dll │ │ │ │ │ ├── Mono.Posix.dll │ │ │ │ │ ├── System.Core.dll │ │ │ │ │ ├── System.Data.dll │ │ │ │ │ ├── System.Xml.dll │ │ │ │ │ ├── UniTask.Linq.dll │ │ │ │ │ ├── netstandard.dll │ │ │ │ │ ├── Mono.Security.dll │ │ │ │ │ ├── Microsoft.CSharp.dll │ │ │ │ │ ├── System.Net.Http.dll │ │ │ │ │ ├── System.Numerics.dll │ │ │ │ │ ├── System.Security.dll │ │ │ │ │ ├── System.Xml.Linq.dll │ │ │ │ │ ├── System.Configuration.dll │ │ │ │ │ └── System.Runtime.Serialization.dll │ │ │ ├── changelog.txt │ │ │ └── doorstop_config.ini │ │ └── AboutAssets.txt │ ├── AppIcon │ │ ├── appicon.png │ │ ├── appicon.svg │ │ └── appiconfg.svg │ ├── Fonts │ │ └── OpenSans-Regular.ttf │ ├── Splash │ │ └── splash.svg │ └── Images │ │ └── dotnet_bot.svg ├── wwwroot │ ├── favicon.png │ ├── index.html │ └── css │ │ └── app.css ├── Properties │ └── launchSettings.json ├── MainPage.xaml.cs ├── Platforms │ ├── Android │ │ ├── Resources │ │ │ └── values │ │ │ │ └── colors.xml │ │ ├── AndroidManifest.xml │ │ ├── MainApplication.cs │ │ └── MainActivity.cs │ ├── iOS │ │ ├── AppDelegate.cs │ │ ├── Program.cs │ │ ├── Info.plist │ │ └── Resources │ │ │ └── PrivacyInfo.xcprivacy │ ├── MacCatalyst │ │ ├── AppDelegate.cs │ │ ├── Program.cs │ │ ├── Entitlements.plist │ │ └── Info.plist │ ├── Windows │ │ ├── App.xaml │ │ ├── app.manifest │ │ ├── App.xaml.cs │ │ └── Package.appxmanifest │ └── Tizen │ │ ├── Main.cs │ │ └── tizen-manifest.xml ├── Components │ ├── Routes.razor │ ├── _Imports.razor │ ├── Dialog │ │ └── Onlysubmit.razor │ ├── Layout │ │ ├── NavMenu.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor.css │ │ └── MainLayout.razor │ ├── Pages │ │ ├── Skin.razor │ │ ├── Simulation.razor │ │ ├── Developer.razor │ │ ├── Battle.razor │ │ ├── ShortCut.razor │ │ └── Home.razor │ ├── FileIO.cs │ ├── GitHub.cs │ └── Configuration.cs ├── MainPage.xaml ├── App.xaml ├── App.xaml.cs ├── MauiProgram.cs └── HsmodConfiguration.csproj ├── img ├── Home.png ├── skin.png └── battle.png ├── README.md ├── HsmodConfiguration.sln ├── .gitattributes ├── .github └── workflows │ └── build.yml ├── .gitignore └── LICENSE.txt /HsmodConfiguration/Resources/Raw/Addins/.doorstop_version: -------------------------------------------------------------------------------- 1 | 4.4.1 -------------------------------------------------------------------------------- /img/Home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/img/Home.png -------------------------------------------------------------------------------- /img/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/img/skin.png -------------------------------------------------------------------------------- /img/battle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/img/battle.png -------------------------------------------------------------------------------- /HsmodConfiguration/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/wwwroot/favicon.png -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/AppIcon/appicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/AppIcon/appicon.png -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/winhttp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/winhttp.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Windows Machine": { 4 | "commandName": "Project", 5 | "nativeDebugging": false 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/0Harmony.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/0Harmony.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/0Harmony20.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/0Harmony20.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.Harmony.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.Harmony.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/HarmonyXInterop.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/HarmonyXInterop.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.Mdb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.Mdb.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.Pdb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.Pdb.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/MonoMod.Utils.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/MonoMod.Utils.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.Preloader.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.Preloader.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.Rocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/Mono.Cecil.Rocks.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/UniTask.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/UniTask.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/MonoMod.RuntimeDetour.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/MonoMod.RuntimeDetour.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/mscorlib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/mscorlib.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/Mono.Posix.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/Mono.Posix.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Core.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Data.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Data.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Xml.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Xml.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/UniTask.Linq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/UniTask.Linq.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/netstandard.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/netstandard.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/Mono.Security.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/Mono.Security.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/Microsoft.CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/Microsoft.CSharp.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Net.Http.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Net.Http.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Numerics.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Numerics.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Security.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Security.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Xml.Linq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Xml.Linq.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Configuration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Configuration.dll -------------------------------------------------------------------------------- /HsmodConfiguration/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace HsmodConfiguration 2 | { 3 | public partial class MainPage : ContentPage 4 | { 5 | public MainPage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Runtime.Serialization.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cliencer/HsMod-Configuration/HEAD/HsmodConfiguration/Resources/Raw/Addins/BepInEx/unstripped_corlib/System.Runtime.Serialization.dll -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/AppIcon/appicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Android/Resources/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #512BD4 4 | #2B0B98 5 | #2B0B98 6 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/changelog.txt: -------------------------------------------------------------------------------- 1 | 3 commits since v5.4.23.3 2 | 3 | Changelog (excluding merges): 4 | * (02413dd) [ManlyMarco] Bump version number 5 | * (176a97e) [Chris Yeninas] Fix incorrect instructions in BUILDING.md (#1175) 6 | * (8ad052a) [Arrowmaster] Upgrade Doorstop to version 4.4.1 (#1156) -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Routes.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace HsmodConfiguration 4 | { 5 | [Register("AppDelegate")] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/MacCatalyst/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using Foundation; 2 | 3 | namespace HsmodConfiguration 4 | { 5 | [Register("AppDelegate")] 6 | public class AppDelegate : MauiUIApplicationDelegate 7 | { 8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Windows/App.xaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.JSInterop 8 | @using HsmodConfiguration 9 | @using HsmodConfiguration.Components 10 | @using MudBlazor -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Tizen/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Maui; 3 | using Microsoft.Maui.Hosting; 4 | 5 | namespace HsmodConfiguration 6 | { 7 | internal class Program : MauiApplication 8 | { 9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 10 | 11 | static void Main(string[] args) 12 | { 13 | var app = new Program(); 14 | app.Run(args); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Android/MainApplication.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Runtime; 3 | 4 | namespace HsmodConfiguration 5 | { 6 | [Application] 7 | public class MainApplication : MauiApplication 8 | { 9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership) 10 | : base(handle, ownership) 11 | { 12 | } 13 | 14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Content.PM; 3 | using Android.OS; 4 | 5 | namespace HsmodConfiguration 6 | { 7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] 8 | public class MainActivity : MauiAppCompatActivity 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/MacCatalyst/Program.cs: -------------------------------------------------------------------------------- 1 | using ObjCRuntime; 2 | using UIKit; 3 | 4 | namespace HsmodConfiguration 5 | { 6 | public class Program 7 | { 8 | // This is the main entry point of the application. 9 | static void Main(string[] args) 10 | { 11 | // if you want to use a different Application Delegate class from "AppDelegate" 12 | // you can specify it here. 13 | UIApplication.Main(args, null, typeof(AppDelegate)); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/iOS/Program.cs: -------------------------------------------------------------------------------- 1 | using ObjCRuntime; 2 | using UIKit; 3 | 4 | namespace HsmodConfiguration 5 | { 6 | public class Program 7 | { 8 | // This is the main entry point of the application. 9 | static void Main(string[] args) 10 | { 11 | // if you want to use a different Application Delegate class from "AppDelegate" 12 | // you can specify it here. 13 | UIApplication.Main(args, null, typeof(AppDelegate)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /HsmodConfiguration/MainPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /HsmodConfiguration/App.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /HsmodConfiguration/App.xaml.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace HsmodConfiguration 3 | { 4 | public partial class App : Application 5 | { 6 | public App() 7 | { 8 | InitializeComponent(); 9 | 10 | MainPage = new MainPage(); 11 | } 12 | 13 | protected override Window CreateWindow(IActivationState activationState) 14 | { 15 | var window = base.CreateWindow(activationState); 16 | if (DeviceInfo.Current.Platform == DevicePlatform.WinUI) 17 | { 18 | window.Title = "HsMod 插件管理器";// System.Reflection.Assembly.GetEntryAssembly().GetName().Name; 19 | } 20 | 21 | return window; 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/MacCatalyst/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.apple.security.app-sandbox 8 | 9 | 10 | com.apple.security.network.client 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories). Deployment of the asset to your application 3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. 4 | 5 | 6 | 7 | These files will be deployed with your package and will be accessible using Essentials: 8 | 9 | async Task LoadMauiAsset() 10 | { 11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); 12 | using var reader = new StreamReader(stream); 13 | 14 | var contents = reader.ReadToEnd(); 15 | } 16 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Dialog/Onlysubmit.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | @ContentText 4 | 5 | 6 | @ButtonText 7 | 8 | 9 | 10 | @code { 11 | [CascadingParameter] 12 | private IMudDialogInstance MudDialog { get; set; } 13 | 14 | [Parameter] 15 | public string ContentText { get; set; } 16 | 17 | [Parameter] 18 | public string ButtonText { get; set; } 19 | 20 | [Parameter] 21 | public Color Color { get; set; } 22 | 23 | private void Submit() => MudDialog.Close(DialogResult.Ok(true)); 24 | 25 | private void Cancel() => MudDialog.Cancel(); 26 | } 27 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Windows/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | true/PM 12 | PerMonitorV2, PerMonitor 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Tizen/tizen-manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | maui-appicon-placeholder 7 | 8 | 9 | 10 | 11 | http://tizen.org/privilege/internet 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Hsmod 配置管理器 2 | ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/Cliencer/HsMod-Configuration/total?style=for-the-badge&label=Github%20Download) 3 | 4 | 本项目基于MAUI,用于[HsMod](https://github.com/Pik-4/HsMod)插件配置管理。 5 | ### 界面 6 | ![Home](/img/Home.png) 7 | ![Home](/img/battle.png) 8 | ![Home](/img/skin.png) 9 | ### 使用方法 10 | 第一次运行时,可以使用**Hsmod配置管理器**自动安装[HsMod](https://github.com/Pik-4/HsMod)插件(会自动从github拉取最新Release)。启动游戏正常后点击重连按钮,会连接至插件内置本地服务器进行管理。 11 | ### 为什么使用MAUI 12 | 仅仅是为了练手和熟悉MAUI.... 13 | ### 引用 14 | 1. [HsMod Web Api](https://github.com/Pik-4/HsMod/discussions/122) 15 | 2. [Blazor Template](https://github.com/MudBlazor/Templates) 16 | 3. [.NET MAUI Document](https://learn.microsoft.com/zh-cn/dotnet/maui/) 17 | -------------------------------------------------------------------------------- /HsmodConfiguration/MauiProgram.cs: -------------------------------------------------------------------------------- 1 | using MudBlazor.Services; 2 | namespace HsmodConfiguration 3 | { 4 | public static class MauiProgram 5 | { 6 | public static MauiApp CreateMauiApp() 7 | { 8 | var builder = MauiApp.CreateBuilder(); 9 | builder 10 | .UseMauiApp() 11 | .ConfigureFonts(fonts => 12 | { 13 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); 14 | }); 15 | builder.Services.AddSingleton(); 16 | builder.Services.AddMauiBlazorWebView(); 17 | 18 | #if DEBUG 19 | builder.Services.AddBlazorWebViewDeveloperTools(); 20 | builder.Logging.AddDebug(); 21 | #endif 22 | builder.Services.AddMudServices(); 23 | return builder.Build(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Windows/App.xaml.cs: -------------------------------------------------------------------------------- 1 | // To learn more about WinUI, the WinUI project structure, 2 | // and more about our project templates, see: http://aka.ms/winui-project-info. 3 | 4 | namespace HsmodConfiguration.WinUI 5 | { 6 | /// 7 | /// Provides application-specific behavior to supplement the default Application class. 8 | /// 9 | public partial class App : MauiWinUIApplication 10 | { 11 | /// 12 | /// Initializes the singleton application object. This is the first line of authored code 13 | /// executed, and as such is the logical equivalent of main() or WinMain(). 14 | /// 15 | public App() 16 | { 17 | this.InitializeComponent(); 18 | } 19 | 20 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /HsmodConfiguration/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | HsmodConfiguration 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 | An unhandled error has occurred. 23 | Reload 24 | 🗙 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSRequiresIPhoneOS 6 | 7 | UIDeviceFamily 8 | 9 | 1 10 | 2 11 | 12 | UIRequiredDeviceCapabilities 13 | 14 | arm64 15 | 16 | UISupportedInterfaceOrientations 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationLandscapeLeft 20 | UIInterfaceOrientationLandscapeRight 21 | 22 | UISupportedInterfaceOrientations~ipad 23 | 24 | UIInterfaceOrientationPortrait 25 | UIInterfaceOrientationPortraitUpsideDown 26 | UIInterfaceOrientationLandscapeLeft 27 | UIInterfaceOrientationLandscapeRight 28 | 29 | XSAppIconAssets 30 | Assets.xcassets/appicon.appiconset 31 | 32 | 33 | -------------------------------------------------------------------------------- /HsmodConfiguration.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35707.178 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HsmodConfiguration", "HsmodConfiguration\HsmodConfiguration.csproj", "{50370EDA-B356-4FE8-9272-1125747D03DC}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {50370EDA-B356-4FE8-9272-1125747D03DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {50370EDA-B356-4FE8-9272-1125747D03DC}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {50370EDA-B356-4FE8-9272-1125747D03DC}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 17 | {50370EDA-B356-4FE8-9272-1125747D03DC}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {50370EDA-B356-4FE8-9272-1125747D03DC}.Release|Any CPU.Build.0 = Release|Any CPU 19 | {50370EDA-B356-4FE8-9272-1125747D03DC}.Release|Any CPU.Deploy.0 = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(SolutionProperties) = preSolution 22 | HideSolutionNode = FALSE 23 | EndGlobalSection 24 | GlobalSection(ExtensibilityGlobals) = postSolution 25 | SolutionGuid = {98AC37A4-DBFB-40AD-A1EA-305006FA18AE} 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/doorstop_config.ini: -------------------------------------------------------------------------------- 1 | # General options for Unity Doorstop 2 | [General] 3 | 4 | # Enable Doorstop? 5 | enabled = true 6 | 7 | # Path to the assembly to load and execute 8 | # NOTE: The entrypoint must be of format `static void Doorstop.Entrypoint.Start()` 9 | target_assembly=BepInEx\core\BepInEx.Preloader.dll 10 | 11 | # If true, Unity's output log is redirected to \output_log.txt 12 | redirect_output_log = false 13 | 14 | # Overrides the default boot.config file path 15 | boot_config_override = 16 | 17 | # If enabled, DOORSTOP_DISABLE env var value is ignored 18 | # USE THIS ONLY WHEN ASKED TO OR YOU KNOW WHAT THIS MEANS 19 | ignore_disable_switch = false 20 | 21 | # Options specific to running under Unity Mono runtime 22 | [UnityMono] 23 | 24 | # Overrides default Mono DLL search path 25 | # Sometimes it is needed to instruct Mono to seek its assemblies from a different path 26 | # (e.g. mscorlib is stripped in original game) 27 | # This option causes Mono to seek mscorlib and core libraries from a different folder before Managed 28 | # Original Managed folder is added as a secondary folder in the search path 29 | # To specify multiple paths, separate them with semicolons (;) 30 | dll_search_path_override = BepInEx\unstripped_corlib 31 | 32 | # If true, Mono debugger server will be enabled 33 | debug_enabled = false 34 | 35 | # When debug_enabled is true, specifies the address to use for the debugger server 36 | debug_address = 127.0.0.1:10000 37 | 38 | # If true and debug_enabled is true, Mono debugger server will suspend the game execution until a debugger is attached 39 | debug_suspend = false -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Layout/NavMenu.razor: -------------------------------------------------------------------------------- 1 | @using System.Timers 2 | 3 | 常规设置 4 | 对战增强 5 | @if (Configuration.isSkinsLoad & Configuration.login) 6 | { 7 | 皮肤设置 8 | } 9 | else 10 | { 11 | 12 | 皮肤设置 13 | 14 | } 15 | 16 | 快捷按键 17 | 模拟开包 18 | 高级工具 19 | 20 | 21 | @code { 22 | private Timer timer = new Timer(1000); 23 | async protected override void OnInitialized() 24 | { 25 | timer.Elapsed += Timer_Elapsed; 26 | timer.Start(); 27 | } 28 | private void Timer_Elapsed(object sender, ElapsedEventArgs e) 29 | { 30 | InvokeAsync(() => StateHasChanged()); // 触发组件重新渲染 31 | } 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Splash/splash.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/AppIcon/appiconfg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Layout/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 640.98px) { 40 | .top-row { 41 | justify-content: space-between; 42 | } 43 | 44 | .top-row ::deep a, .top-row ::deep .btn-link { 45 | margin-left: 0; 46 | } 47 | } 48 | 49 | @media (min-width: 641px) { 50 | .page { 51 | flex-direction: row; 52 | } 53 | 54 | .sidebar { 55 | width: 250px; 56 | height: 100vh; 57 | position: sticky; 58 | top: 0; 59 | } 60 | 61 | .top-row { 62 | position: sticky; 63 | top: 0; 64 | z-index: 1; 65 | } 66 | 67 | .top-row.auth ::deep a:first-child { 68 | flex: 1; 69 | text-align: right; 70 | width: 0; 71 | } 72 | 73 | .top-row, article { 74 | padding-left: 2rem !important; 75 | padding-right: 1.5rem !important; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/MacCatalyst/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | UIDeviceFamily 15 | 16 | 2 17 | 18 | UIRequiredDeviceCapabilities 19 | 20 | arm64 21 | 22 | UISupportedInterfaceOrientations 23 | 24 | UIInterfaceOrientationPortrait 25 | UIInterfaceOrientationLandscapeLeft 26 | UIInterfaceOrientationLandscapeRight 27 | 28 | UISupportedInterfaceOrientations~ipad 29 | 30 | UIInterfaceOrientationPortrait 31 | UIInterfaceOrientationPortraitUpsideDown 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | XSAppIconAssets 36 | Assets.xcassets/appicon.appiconset 37 | 38 | 39 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/Windows/Package.appxmanifest: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | $placeholder$ 15 | User Name 16 | $placeholder$.png 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /HsmodConfiguration/Platforms/iOS/Resources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | NSPrivacyAccessedAPITypes 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryFileTimestamp 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | C617.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyAccessedAPIType 33 | NSPrivacyAccessedAPICategoryDiskSpace 34 | NSPrivacyAccessedAPITypeReasons 35 | 36 | E174.1 37 | 38 | 39 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Pages/Skin.razor: -------------------------------------------------------------------------------- 1 | @page "/skin" 2 | @inject Configuration conf 3 | 4 | 5 | 皮肤设置 6 | 7 | 8 | @if (Configuration.hsmodcfg != null & Configuration.skins != null) 9 | { 10 | foreach (string kind in _List) 11 | { 12 | var cfg = Configuration.hsmodcfg[kind]; 13 | 14 | 15 | 16 | 20 | @foreach (string item in Configuration.skins[kind].Values.ToList()) 21 | { 22 | @item 23 | } 24 | 25 | 26 | 27 | 28 | } 29 | } 30 | 31 | 32 | 33 | 34 | @code { 35 | private List _List = ["硬币", "卡背", "对战面板", "酒馆战斗面板", "酒馆击杀特效", "鲍勃", "宠物", "对手宠物"]; 36 | private Dictionary>>> _SearchFuncs = new Dictionary>>>(); 37 | // async protected override void OnInitialized() 38 | // { 39 | // if (Configuration.hsmodcfg.Count > 0) 40 | // { 41 | // foreach (string kind in _List) 42 | // { 43 | // _SearchFuncs.Add(kind, async Task> (string value, CancellationToken token) => 44 | // { 45 | // await Task.Delay(5, token); 46 | // var list = Configuration.skins[kind].Values.ToList(); 47 | // if text is null or empty, show complete list 48 | // if (string.IsNullOrEmpty(value)) 49 | // return list; 50 | 51 | // return list.Where(x => x.Contains(value, StringComparison.InvariantCultureIgnoreCase)); 52 | // }); 53 | // } 54 | // } 55 | 56 | 57 | // } 58 | 59 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Pages/Simulation.razor: -------------------------------------------------------------------------------- 1 | @page "/simulation" 2 | @inject Configuration conf 3 | 4 | 模拟开包 5 | 6 | 7 | 8 | @if (Configuration.hsmodcfg.Count > 0) 9 | { 10 | foreach (List card in _List) 11 | { 12 | 13 | @foreach (string item in card) 14 | { 15 | var cfg = Configuration.hsmodcfg[item]; 16 | if (cfg.type == typeof(int)) 17 | { 18 | if (cfg.acceptableRange != null & cfg.acceptableRange.Count == 2) 19 | { 20 | 21 | } 22 | else 23 | { 24 | 25 | } 26 | } 27 | else if (cfg.type == typeof(bool)) 28 | { 29 | 30 | @cfg.key 31 | 32 | } 33 | else if (cfg.type == typeof(string)) 34 | { 35 | if (cfg.acceptValue != null) 36 | { 37 | 41 | @foreach (var value in cfg.acceptValue) 42 | { 43 | @value 44 | } 45 | 46 | } 47 | } 48 | } 49 | 50 | } 51 | } 52 | 53 | 54 | 55 | 56 | @code { 57 | private List> _List = [["模拟开包状态", "数量", "类型"], ["随机结果", "随机稀有度", "随机品质", "随机其他特效", "稀有度类型", "品质类型"], ["卡牌1", "卡牌1品质"], ["卡牌2", "卡牌2品质"], ["卡牌3", "卡牌3品质"], ["卡牌4", "卡牌4品质"], ["卡牌5", "卡牌5品质"]]; 58 | } 59 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/FileIO.cs: -------------------------------------------------------------------------------- 1 | using System.IO.Compression; 2 | 3 | namespace HsmodConfiguration.Components 4 | { 5 | internal class FileIO 6 | { 7 | public static async Task CopyDirectory(string sourceDir, string destinationDir) 8 | { 9 | if (!Directory.Exists(destinationDir)) 10 | { 11 | Directory.CreateDirectory(destinationDir); 12 | } 13 | // 使用队列来处理目录 14 | Queue<(string Source, string Destination)> queue = new(); 15 | queue.Enqueue((sourceDir, destinationDir)); 16 | 17 | while (queue.Count > 0) 18 | { 19 | (string Source, string Destination) current = queue.Dequeue(); 20 | 21 | // 复制当前目录中的所有文件 22 | string[] files = Directory.GetFiles(current.Source, "*.*", SearchOption.TopDirectoryOnly); 23 | foreach (string file in files) 24 | { 25 | string destFile = Path.Combine(current.Destination, Path.GetFileName(file)); 26 | File.Copy(file, destFile, overwrite: true); // 覆盖目标文件 27 | } 28 | 29 | // 处理当前目录中的所有子目录(包括空文件夹) 30 | string[] subDirs = Directory.GetDirectories(current.Source, "*.*", SearchOption.TopDirectoryOnly); 31 | foreach (string subDir in subDirs) 32 | { 33 | string destSubDir = Path.Combine(current.Destination, Path.GetFileName(subDir)); 34 | Directory.CreateDirectory(destSubDir); // 创建目标子目录(即使它是空的) 35 | queue.Enqueue((subDir, destSubDir)); // 将子目录加入队列 36 | } 37 | } 38 | } 39 | public async static Task DeleteDirectory(string directoryPath) 40 | { 41 | if (Directory.Exists(directoryPath)) 42 | { 43 | Directory.Delete(directoryPath, recursive: true); // 递归删除目录及其所有内容 44 | Console.WriteLine($"目录已删除: {directoryPath}"); 45 | } 46 | else 47 | { 48 | Console.WriteLine($"目录不存在: {directoryPath}"); 49 | } 50 | } 51 | public async static Task CreateDirectory(string directoryPath) 52 | { 53 | if (!Directory.Exists(directoryPath)) 54 | { 55 | Directory.CreateDirectory(directoryPath); 56 | Console.WriteLine($"文件夹已创建: {directoryPath}"); 57 | } 58 | else 59 | { 60 | Console.WriteLine($"文件夹已存在: {directoryPath}"); 61 | } 62 | } 63 | public async static Task ExtractZipFile(string zipFilePath, string destinationDirectory) 64 | { 65 | if (!Directory.Exists(destinationDirectory)) 66 | { 67 | Directory.CreateDirectory(destinationDirectory); 68 | } 69 | 70 | ZipFile.ExtractToDirectory(zipFilePath, destinationDirectory); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Pages/Developer.razor: -------------------------------------------------------------------------------- 1 | @page "/developer" 2 | @inject Configuration conf 3 | 4 | 5 | 对战增强 6 | 7 | 8 | @if (Configuration.hsmodcfg.Count > 0) 9 | { 10 | foreach (List card in _List) 11 | { 12 | 13 | @foreach (string item in card) 14 | { 15 | var cfg = Configuration.hsmodcfg[item]; 16 | if (cfg.type == typeof(int)) 17 | { 18 | if (cfg.acceptableRange != null & cfg.acceptableRange.Count == 2) 19 | { 20 | 21 | } 22 | else 23 | { 24 | 25 | } 26 | } 27 | else if (cfg.type == typeof(bool)) 28 | { 29 | 30 | @cfg.key 31 | 32 | } 33 | else if (cfg.type == typeof(string)) 34 | { 35 | if (cfg.acceptValue != null) 36 | { 37 | 41 | @foreach (var value in cfg.acceptValue) 42 | { 43 | @value 44 | } 45 | 46 | } 47 | } 48 | } 49 | 50 | } 51 | } 52 | 53 | 54 | 55 | 56 | @code { 57 | private List> _List = [["冒险购买", "卡拉赞修复", "酒馆礼遇解锁"], ["设备模拟模板", "设备模拟系统", "设备屏幕大小", "设备设备型号"], ["定时退出", "网站端口", "Webshell", "内部模式"]]; 58 | } -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Pages/Battle.razor: -------------------------------------------------------------------------------- 1 | @page "/battle" 2 | @inject Configuration conf 3 | 4 | 5 | 对战增强 6 | 7 | 8 | @if (Configuration.hsmodcfg.Count > 0) 9 | { 10 | foreach (List card in _List) 11 | { 12 | 13 | @foreach (string item in card) 14 | { 15 | var cfg = Configuration.hsmodcfg[item]; 16 | if (cfg.type == typeof(int)) 17 | { 18 | if (cfg.acceptableRange != null & cfg.acceptableRange.Count == 2) 19 | { 20 | 21 | } 22 | else 23 | { 24 | 25 | } 26 | } 27 | else if (cfg.type == typeof(bool)) 28 | { 29 | 30 | @cfg.key 31 | 32 | } 33 | else if (cfg.type == typeof(string)) 34 | { 35 | if (cfg.acceptValue != null) 36 | { 37 | 41 | @foreach (var value in cfg.acceptValue) 42 | { 43 | @value 44 | } 45 | 46 | } 47 | } 48 | } 49 | 50 | } 51 | } 52 | 53 | 54 | 55 | 56 | @code { 57 | private List> _List = [["快速战斗", "卡牌追踪", "卡牌揭示", "观战展示卡牌", "跳过英雄介绍"], ["显示全名", "显示天梯等级", "自动举报"], ["表情无冷却", "思考表情", "表情数量", "沉默鲍勃"], ["对手卡牌特效", "异画特效", "金卡特效", "卡牌最高特效", "酒馆镀金"]]; 58 | } -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Pages/ShortCut.razor: -------------------------------------------------------------------------------- 1 | @page "/shortcut" 2 | @inject Configuration conf 3 | @using System.Text.RegularExpressions; 4 | @using System.Timers; 5 | 6 | 快捷按键 7 | 8 | 9 | 10 | @if (Configuration.hsmodcfg.Count > 0) 11 | { 12 | foreach (List card in _List) 13 | { 14 | 15 | @foreach (string item in card) 16 | { 17 | var cfg = Configuration.hsmodcfg[item]; 18 | if (cfg.type == typeof(string)) 19 | { 20 | 21 | 22 | @cfg.stringValue 23 | } 24 | } 25 | 26 | } 27 | } 28 | 29 | 30 | 31 | @keyCombination 32 | 确定 33 | 取消 34 | 35 | 36 | 37 | 38 | 39 | @code { 40 | private List> _List = [["齿轮倍率+1", "齿轮倍率-1", "齿轮倍率归零", "齿轮倍率最大", "模拟拔线"], ["复制对手战网标签", "复制所选对手战网标签", "投降", "结束回合", "沉默对手"], ["静音/恢复音量", "闭了,鲍勃", "一键全额分解", "朕,已阅!", "显示/隐藏帧率"], ["问候", "称赞", "感谢", "惊叹", "失误", "威胁"]]; 41 | 42 | private string keyCombination = ""; 43 | private string listeningItem = ""; 44 | private bool isListening = false; 45 | private bool visible; 46 | 47 | 48 | public void ToggleOverlay(bool value) 49 | { 50 | visible = value; 51 | } 52 | 53 | 54 | private void StartListening() 55 | { 56 | ToggleOverlay(true); 57 | isListening = true; 58 | } 59 | 60 | private void StopListening() 61 | { 62 | isListening = false; 63 | 64 | InvokeAsync(async () => 65 | { 66 | StateHasChanged(); 67 | }); 68 | } 69 | 70 | private void HandleKeyDown(KeyboardEventArgs e) 71 | { 72 | if (!isListening) return; // Only handle keys if we are listening 73 | 74 | // Record the last pressed key 75 | if (e.Key != "Control" & e.Key != "Shift" & e.Key != "Alt") 76 | { 77 | keyCombination = Regex.Replace(e.Key, @"\b[a-z]\b", match => match.Value.ToUpper()); 78 | switch (keyCombination) 79 | { 80 | case "ArrowUp": 81 | keyCombination = "UpArrow"; 82 | break; 83 | case "ArrowLeft": 84 | keyCombination = "LeftArrow"; 85 | break; 86 | case "ArrowRight": 87 | keyCombination = "RightArrow"; 88 | break; 89 | case "ArrowDown": 90 | keyCombination = "DownArrow"; 91 | break; 92 | } 93 | if (int.TryParse(keyCombination, out int number)) 94 | { 95 | keyCombination = "Alpha" + keyCombination; 96 | } 97 | } 98 | else 99 | { 100 | keyCombination = ""; 101 | } 102 | 103 | 104 | // Build the key combination string 105 | 106 | 107 | if (e.CtrlKey) keyCombination += " + LeftControl"; 108 | if (e.ShiftKey) keyCombination += " + Shift"; 109 | if (e.AltKey) keyCombination += " + Alt"; 110 | 111 | 112 | 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /HsmodConfiguration/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 3 | } 4 | 5 | a, .btn-link { 6 | color: #006bb7; 7 | } 8 | 9 | .btn-primary { 10 | color: #fff; 11 | background-color: #1b6ec2; 12 | border-color: #1861ac; 13 | } 14 | 15 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 16 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 17 | } 18 | 19 | .content { 20 | padding-top: 1.1rem; 21 | } 22 | 23 | h1:focus { 24 | outline: none; 25 | } 26 | 27 | .valid.modified:not([type=checkbox]) { 28 | outline: 1px solid #26b050; 29 | } 30 | 31 | .invalid { 32 | outline: 1px solid #e50000; 33 | } 34 | 35 | .validation-message { 36 | color: #e50000; 37 | } 38 | 39 | #blazor-error-ui { 40 | background: lightyellow; 41 | bottom: 0; 42 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 43 | display: none; 44 | left: 0; 45 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 46 | position: fixed; 47 | width: 100%; 48 | z-index: 1000; 49 | } 50 | 51 | #blazor-error-ui .dismiss { 52 | cursor: pointer; 53 | position: absolute; 54 | right: 0.75rem; 55 | top: 0.5rem; 56 | } 57 | 58 | .blazor-error-boundary { 59 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 60 | padding: 1rem 1rem 1rem 3.7rem; 61 | color: white; 62 | } 63 | 64 | .blazor-error-boundary::after { 65 | content: "An error has occurred." 66 | } 67 | 68 | .status-bar-safe-area { 69 | display: none; 70 | } 71 | 72 | @supports (-webkit-touch-callout: none) { 73 | .status-bar-safe-area { 74 | display: flex; 75 | position: sticky; 76 | top: 0; 77 | height: env(safe-area-inset-top); 78 | background-color: #f7f7f7; 79 | width: 100%; 80 | z-index: 1; 81 | } 82 | 83 | .flex-column, .navbar-brand { 84 | padding-left: env(safe-area-inset-left); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Layout/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | appearance: none; 3 | cursor: pointer; 4 | width: 3.5rem; 5 | height: 2.5rem; 6 | color: white; 7 | position: absolute; 8 | top: 0.5rem; 9 | right: 1rem; 10 | border: 1px solid rgba(255, 255, 255, 0.1); 11 | background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1); 12 | } 13 | 14 | .navbar-toggler:checked { 15 | background-color: rgba(255, 255, 255, 0.5); 16 | } 17 | 18 | .top-row { 19 | height: 3.5rem; 20 | background-color: rgba(0,0,0,0.4); 21 | } 22 | 23 | .navbar-brand { 24 | font-size: 1.1rem; 25 | } 26 | 27 | .bi { 28 | display: inline-block; 29 | position: relative; 30 | width: 1.25rem; 31 | height: 1.25rem; 32 | margin-right: 0.75rem; 33 | top: -1px; 34 | background-size: cover; 35 | } 36 | 37 | .bi-house-door-fill-nav-menu { 38 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E"); 39 | } 40 | 41 | .bi-plus-square-fill-nav-menu { 42 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E"); 43 | } 44 | 45 | .bi-list-nested-nav-menu { 46 | background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E"); 47 | } 48 | 49 | .nav-item { 50 | font-size: 0.9rem; 51 | padding-bottom: 0.5rem; 52 | } 53 | 54 | .nav-item:first-of-type { 55 | padding-top: 1rem; 56 | } 57 | 58 | .nav-item:last-of-type { 59 | padding-bottom: 1rem; 60 | } 61 | 62 | .nav-item ::deep a { 63 | color: #d7d7d7; 64 | border-radius: 4px; 65 | height: 3rem; 66 | display: flex; 67 | align-items: center; 68 | line-height: 3rem; 69 | } 70 | 71 | .nav-item ::deep a.active { 72 | background-color: rgba(255,255,255,0.37); 73 | color: white; 74 | } 75 | 76 | .nav-item ::deep a:hover { 77 | background-color: rgba(255,255,255,0.1); 78 | color: white; 79 | } 80 | 81 | .nav-scrollable { 82 | display: none; 83 | } 84 | 85 | .navbar-toggler:checked ~ .nav-scrollable { 86 | display: block; 87 | } 88 | 89 | @media (min-width: 641px) { 90 | .navbar-toggler { 91 | display: none; 92 | } 93 | 94 | .nav-scrollable { 95 | /* Never collapse the sidebar for wide screens */ 96 | display: block; 97 | /* Allow sidebar to scroll for tall menus */ 98 | height: calc(100vh - 3.5rem); 99 | overflow-y: auto; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and Publish 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | runs-on: windows-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | with: 13 | fetch-depth: 0 14 | 15 | - name: Generate release tag 16 | id: tag 17 | run: | 18 | $content = Get-Content ./HsmodConfiguration/HsmodConfiguration.csproj -Raw 19 | if ($content -match '(.*?)') { 20 | $version = $matches[1].Trim() 21 | Write-Output "Extracted version: $version" 22 | echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append 23 | } else { 24 | Write-Error "Failed to extract version from csproj file" 25 | exit 1 26 | } 27 | 28 | - name: .NET MAUI Build 29 | run: dotnet publish ./HsmodConfiguration/HsmodConfiguration.csproj --configuration Release --verbosity minimal --framework net8.0-windows10.0.19041.0 -p:ArchiveOnBuild=true --output ./HsMod_Configuration 30 | 31 | - name: Clean File 32 | run: | 33 | Set-Location ./HsMod_Configuration 34 | $languageFolders = @( 35 | "af-ZA", "am-ET", "ar", "ar-SA", "as-IN", "az-Latn-AZ", "bg-BG", "bn-IN", "bs-Latn-BA", 36 | "ca", "ca-ES", "ca-Es-VALENCIA", "cs", "cs-CZ", "cy-GB", "da", "da-DK", "de", "de-DE", 37 | "el", "el-GR", "en-GB", "en-us", "es", "es-ES", "es-MX", "et-EE", "eu-ES", "fa-IR", 38 | "fi", "fi-FI", "fil-PH", "fr", "fr-CA", "fr-FR", "ga-IE", "gd-gb", "gl-ES", "gu-IN", 39 | "he", "he-IL", "hi", "hi-IN", "hr", "hr-HR", "hu", "hu-HU", "hy-AM", "id", "id-ID", 40 | "is-IS", "it", "it-IT", "ja", "ja-JP", "ka-GE", "kk-KZ", "km-KH", "kn-IN", "ko", 41 | "ko-KR", "kok-IN", "lb-LU", "lo-LA", "lt-LT", "lv-LV", "mi-NZ", "mk-MK", "ml-IN", 42 | "mr-IN", "ms", "ms-MY", "mt-MT", "nb", "nb-NO", "ne-NP", "nl", "nl-NL", "nn-NO", 43 | "or-IN", "pa-IN", "pl", "pl-PL", "pt", "pt-BR", "pt-PT", "quz-PE", "ro", "ro-RO", 44 | "ru", "ru-RU", "sk", "sk-SK", "sl-SI", "sq-AL", "sr-Cyrl-BA", "sr-Cyrl-RS", 45 | "sr-Latn-RS", "sv", "sv-SE", "ta-IN", "te-IN", "th", "th-TH", "tr", "tr-TR", "tt-RU", 46 | "ug-CN", "uk", "uk-UA", "ur-PK", "uz-Latn-UZ", "vi", "vi-VN", "zh-CN", "zh-Hans", 47 | "zh-Hant", "zh-HK", "zh-TW") 48 | $specificFolders = @("Components", "HsmodConfiguration.exe.WebView2", "Microsoft.UI.Xaml", "Platforms") 49 | $foldersToDelete = $languageFolders + $specificFolders 50 | Write-Output "开始删除文件夹..." 51 | foreach ($folder in $foldersToDelete) { 52 | if (Test-Path $folder) { 53 | Remove-Item -Path $folder -Recurse -Force -ErrorAction SilentlyContinue 54 | } 55 | } 56 | Write-Output "开始删除文件..." 57 | $fileTypes = @("*.png", "*.txt", "*.ttf", "*.winmd", "*.ico") 58 | foreach ($type in $fileTypes) { 59 | if (Test-Path $type) { 60 | Remove-Item -Path $type -Force -ErrorAction SilentlyContinue 61 | } 62 | } 63 | Set-Location $env:GITHUB_WORKSPACE 64 | 65 | Write-Output "清理完成" 66 | - name: Create ZIP package (if needed) 67 | run: Compress-Archive -Path ./HsMod_Configuration -DestinationPath ./HsModConfiguration.zip 68 | 69 | - name: Create Release 70 | id: create_release 71 | uses: softprops/action-gh-release@v2 72 | env: 73 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 74 | with: 75 | tag_name: ${{ steps.tag.outputs.VERSION }} 76 | name: Release ${{ steps.tag.outputs.VERSION }} 77 | files: ./HsModConfiguration.zip 78 | prerelease: false 79 | make_latest: true 80 | generate_release_notes: true 81 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/GitHub.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | namespace HsmodConfiguration.Components 3 | { 4 | public class GitHub 5 | { 6 | public static int Downloadprogress = 0; 7 | public static async Task<(string url, string version)> GetLatestReleaseDownloadUrl(string repositoryOwner, string repositoryName) 8 | { 9 | using (HttpClient client = new HttpClient()) 10 | { 11 | string apiUrl = $"http://api.github.com/repos/{repositoryOwner}/{repositoryName}/releases/latest"; 12 | string myApiUrl = $"http://api.github.com/repos/cliencer/{repositoryName}/releases/latest"; 13 | client.DefaultRequestHeaders.Add("User-Agent", "Other"); 14 | HttpResponseMessage response = await client.GetAsync(apiUrl); 15 | if (!response.IsSuccessStatusCode) 16 | { 17 | response = await client.GetAsync(myApiUrl); 18 | if (!response.IsSuccessStatusCode) 19 | { 20 | throw new Exception("网络错误,无法获取Github资源,请手动下载HsMod.dll并复制插件到游戏安装目录下BepInEx\\plugins文件夹。"); 21 | } 22 | } 23 | 24 | string jsonResponse = await response.Content.ReadAsStringAsync(); 25 | JsonDocument document = JsonDocument.Parse(jsonResponse); 26 | 27 | // 获取最新版本的下载链接 28 | JsonElement root = document.RootElement; 29 | JsonElement assets = root.GetProperty("assets"); 30 | string version = root.GetProperty("name").GetString(); 31 | foreach (JsonElement asset in assets.EnumerateArray()) 32 | { 33 | string browserDownloadUrl = asset.GetProperty("browser_download_url").GetString(); 34 | if (browserDownloadUrl != null) 35 | { 36 | return (browserDownloadUrl, version); 37 | } 38 | } 39 | } 40 | return ("", ""); 41 | } 42 | public static async Task DownloadFileWithProgressAsync(string fileUrl, string savePath) 43 | { 44 | Downloadprogress = 0; 45 | using (HttpClient client = new HttpClient()) 46 | { 47 | HttpResponseMessage response = await client.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead); 48 | response.EnsureSuccessStatusCode(); 49 | 50 | long? totalBytes = response.Content.Headers.ContentLength; 51 | long downloadedBytes = 0; 52 | 53 | using (FileStream fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.None)) 54 | { 55 | using (Stream contentStream = await response.Content.ReadAsStreamAsync()) 56 | { 57 | byte[] buffer = new byte[8192]; 58 | int bytesRead; 59 | 60 | while ((bytesRead = await contentStream.ReadAsync(buffer)) > 0) 61 | { 62 | await fileStream.WriteAsync(buffer, 0, bytesRead); 63 | downloadedBytes += bytesRead; 64 | 65 | // 更新进度条 66 | UpdateProgress(downloadedBytes, totalBytes); 67 | } 68 | } 69 | } 70 | } 71 | } 72 | 73 | // 进度条更新方法 74 | public static void UpdateProgress(long downloadedBytes, long? totalBytes) 75 | { 76 | if (totalBytes.HasValue) 77 | { 78 | Downloadprogress = (int)((downloadedBytes * 100) / totalBytes.Value); 79 | } 80 | else 81 | { 82 | Console.Write($"\r已下载: {downloadedBytes} bytes"); 83 | } 84 | } 85 | public class GitHubRelease 86 | { 87 | public string Name { get; set; } 88 | public string DownloadUrl { get; set; } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.Harmony.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BepInEx.Harmony 5 | 6 | 7 | 8 | 9 | Specifies the indices of parameters that are ByRef. 10 | 11 | 12 | 13 | 14 | The indices of parameters that are ByRef. 15 | 16 | 17 | 18 | The indices of parameters that are ByRef. 19 | 20 | 21 | 22 | An extension class for Harmony based operations. 23 | 24 | 25 | 26 | 27 | Applies all patches specified in the type. 28 | 29 | The HarmonyInstance to use. 30 | The type to scan. 31 | 32 | 33 | 34 | A wrapper for Harmony based operations. 35 | 36 | 37 | 38 | 39 | Applies all patches specified in the type. 40 | 41 | The type to scan. 42 | The HarmonyInstance to use. 43 | 44 | 45 | 46 | Applies all patches specified in the type. 47 | 48 | The type to scan. 49 | The ID for the Harmony instance to create, which will be used. 50 | 51 | 52 | 53 | Applies all patches specified in the assembly. 54 | 55 | The assembly to scan. 56 | The HarmonyInstance to use. 57 | 58 | 59 | 60 | Applies all patches specified in the assembly. 61 | 62 | The assembly to scan. 63 | The ID for the Harmony instance to create, which will be used. 64 | 65 | 66 | 67 | Applies all patches specified in the calling assembly. 68 | 69 | The Harmony instance to use. 70 | 71 | 72 | 73 | Applies all patches specified in the calling assembly. 74 | 75 | The ID for the Harmony instance to create, which will be used. 76 | 77 | 78 | 79 | Returns an instruction to call the specified delegate. 80 | 81 | The delegate type to emit. 82 | The delegate to emit. 83 | The instruction to 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Layout/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject Configuration conf 3 | @inject ISnackbar Snackbar 4 | @using System.Timers 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | HsMod 插件管理器 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | @Body 28 | 29 | 30 | 31 | 32 | 33 |
34 | An unhandled error has occurred. 35 | Reload 36 | 🗙 37 |
38 | 39 | @code { 40 | 41 | private bool _drawerOpen = true; 42 | private bool _isDarkMode = false; 43 | private MudTheme? _theme = null; 44 | private Timer timer = new Timer(3000); 45 | protected override void OnInitialized() 46 | { 47 | base.OnInitialized(); 48 | 49 | _theme = new() 50 | { 51 | PaletteLight = _lightPalette, 52 | PaletteDark = _darkPalette, 53 | LayoutProperties = new LayoutProperties() 54 | }; 55 | timer.Elapsed += Timer_Elapsed; 56 | timer.Start(); 57 | } 58 | 59 | async public Task refresh() 60 | { 61 | await Configuration.getGamePath(); 62 | await Configuration.getAlive(); 63 | 64 | if (Configuration.login) 65 | { 66 | await Configuration.getHsmodCfg(); 67 | await Configuration.getSkinsData(); 68 | 69 | 70 | } 71 | StateHasChanged(); // 触发组件重新渲染 72 | } 73 | 74 | async private void Save() 75 | { 76 | await Configuration.save(); 77 | Snackbar.Clear(); 78 | Snackbar.Configuration.PositionClass = Defaults.Classes.Position.BottomCenter; 79 | var a = Snackbar.Add("保存成功", Severity.Success, config => 80 | { 81 | config.RequireInteraction = true; 82 | config.ShowCloseIcon = false; 83 | 84 | }); 85 | await Task.Delay(5000); 86 | a.ForceClose(); 87 | } 88 | private void DrawerToggle() 89 | { 90 | _drawerOpen = !_drawerOpen; 91 | } 92 | 93 | private void DarkModeToggle() 94 | { 95 | _isDarkMode = !_isDarkMode; 96 | } 97 | private async Task GoGithub(){ 98 | try 99 | { 100 | Uri uri = new Uri("https://github.com/Cliencer/HsMod-Configuration"); 101 | await Browser.Default.OpenAsync(uri, BrowserLaunchMode.SystemPreferred); 102 | } 103 | catch (Exception ex) 104 | { 105 | // An unexpected error occurred. No browser may be installed on the device. 106 | } 107 | } 108 | private readonly PaletteLight _lightPalette = new() 109 | { 110 | Black = "#110e2d", 111 | AppbarText = "#424242", 112 | AppbarBackground = "rgba(255,255,255,0.8)", 113 | DrawerBackground = "#ffffff", 114 | GrayLight = "#e8e8e8", 115 | GrayLighter = "#f9f9f9", 116 | }; 117 | 118 | private readonly PaletteDark _darkPalette = new() 119 | { 120 | Primary = "#7e6fff", 121 | Surface = "#1e1e2d", 122 | Background = "#1a1a27", 123 | BackgroundGray = "#151521", 124 | AppbarText = "#92929f", 125 | AppbarBackground = "rgba(26,26,39,0.8)", 126 | DrawerBackground = "#1a1a27", 127 | ActionDefault = "#74718e", 128 | ActionDisabled = "#9999994d", 129 | ActionDisabledBackground = "#605f6d4d", 130 | TextPrimary = "#b2b0bf", 131 | TextSecondary = "#92929f", 132 | TextDisabled = "#ffffff33", 133 | DrawerIcon = "#92929f", 134 | DrawerText = "#92929f", 135 | GrayLight = "#2a2833", 136 | GrayLighter = "#1e1e2d", 137 | Info = "#4a86ff", 138 | Success = "#3dcb6c", 139 | Warning = "#ffb545", 140 | Error = "#ff3f5f", 141 | LinesDefault = "#33323e", 142 | TableLines = "#33323e", 143 | Divider = "#292838", 144 | OverlayLight = "#1e1e2d80", 145 | }; 146 | 147 | public string DarkLightModeButtonIcon => _isDarkMode switch 148 | { 149 | true => Icons.Material.Outlined.LightMode, 150 | false => Icons.Material.Outlined.DarkMode, 151 | }; 152 | private void Timer_Elapsed(object sender, ElapsedEventArgs e) 153 | { 154 | if (Configuration.login) 155 | { 156 | InvokeAsync(async() =>{ 157 | 158 | await Configuration.getAlive(); 159 | StateHasChanged(); 160 | 161 | }); 162 | } 163 | } 164 | } 165 | 166 | 167 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /HsmodConfiguration/HsmodConfiguration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | .allowedextension 5 | 6 | $(TargetFrameworks);net8.0-windows10.0.19041.0 7 | 8 | 9 | 10 | 15 | 16 | 17 | Exe 18 | HsmodConfiguration 19 | true 20 | true 21 | enable 22 | false 23 | warnings 24 | 25 | HsmodConfiguration 26 | 27 | 28 | com.cliencer.hsmodconfiguration 29 | 30 | 31 | 1.0.6 32 | 7 33 | 34 | 14.2 35 | 14.0 36 | 24.0 37 | 10.0.17763.0 38 | 10.0.17763.0 39 | 10.0.17763.0 40 | 6.5 41 | None 42 | AnyCPU 43 | AnyCPU 44 | False 45 | False 46 | 47 | 48 | 49 | 50 | HsmodConfiguration 51 | com.cliencer.hsmodconfiguration 52 | 53 | 54 | 55 | HsmodConfiguration 56 | com.cliencer.hsmodconfiguration 57 | full 58 | False 59 | 60 | 61 | 62 | HsmodConfiguration 63 | com.cliencer.hsmodconfiguration 64 | 65 | 66 | 67 | HsmodConfiguration 68 | com.cliencer.hsmodconfiguration 69 | 70 | False 71 | none 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/BepInEx.Preloader.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BepInEx.Preloader 5 | 6 | 7 | 8 | 9 | Doorstop environment variables, passed into the BepInEx preloader. 10 | https://github.com/NeighTools/UnityDoorstop/wiki#environment-variables 11 | 12 | 13 | 14 | 15 | Path to the assembly that was invoked via Doorstop. Contains the same value as in "targetAssembly" configuration option in the config file. 16 | 17 | 18 | 19 | 20 | Full path to the game's "Managed" folder that contains all the game's managed assemblies 21 | 22 | 23 | 24 | 25 | Full path to the game executable currently running. 26 | 27 | 28 | 29 | 30 | Array of paths where Mono searches DLLs from before assembly resolvers are invoked. 31 | 32 | 33 | 34 | 35 | Log listener that listens to logs during preloading time and buffers messages for output in Unity logs later. 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Delegate used in patching assemblies. 52 | 53 | The assembly that is being patched. 54 | 55 | 56 | 57 | Worker class which is used for loading and patching entire folders of assemblies, or alternatively patching and 58 | loading assemblies one at a time. 59 | 60 | 61 | 62 | 63 | List of all patcher plugins to be applied 64 | 65 | 66 | 67 | 68 | Adds a single assembly patcher to the pool of applicable patches. 69 | 70 | Patcher to apply. 71 | 72 | 73 | 74 | Adds all patchers from all managed assemblies specified in a directory. 75 | 76 | Directory to search patcher DLLs from. 77 | 78 | 79 | 80 | Releases all patchers to let them be collected by GC. 81 | 82 | 83 | 84 | 85 | Applies patchers to all assemblies in the given directory and loads patched assemblies into memory. 86 | 87 | Directories to load CLR assemblies from in their search order. 88 | 89 | 90 | 91 | Loads an individual assembly definition into the CLR. 92 | 93 | The assembly to load. 94 | File name of the assembly being loaded. 95 | 96 | 97 | 98 | A single assembly patcher. 99 | 100 | 101 | 102 | 103 | Target assemblies to patch. 104 | 105 | 106 | 107 | 108 | Initializer method that is run before any patching occurs. 109 | 110 | 111 | 112 | 113 | Finalizer method that is run after all patching is done. 114 | 115 | 116 | 117 | 118 | The main patcher method that is called on every DLL defined in . 119 | 120 | 121 | 122 | 123 | Type name of the patcher. 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | Recreation of MonoMod's PlatformHelper.DeterminePlatform method, but with libc calls instead of creating processes. 135 | 136 | 137 | 138 | 139 | The main entrypoint of BepInEx, and initializes all patchers and the chainloader. 140 | 141 | 142 | 143 | 144 | The log writer that is specific to the preloader. 145 | 146 | 147 | 148 | 149 | Inserts BepInEx's own chainloader entrypoint into UnityEngine. 150 | 151 | The assembly that will be attempted to be patched. 152 | 153 | 154 | 155 | Allocates a console window for use by BepInEx safely. 156 | 157 | 158 | 159 | 160 | This exists because the Mono implementation of is/was broken, and would call Write directly instead of calling TraceEvent. 161 | 162 | 163 | 164 | 165 | The main entrypoint of BepInEx, called from Doorstop. 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Raw/Addins/BepInEx/core/MonoMod.RuntimeDetour.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | MonoMod.RuntimeDetour 5 | 6 | 7 | 8 | 9 | A fully managed detour. 10 | Multiple Detours for a method to detour from can exist at any given time. Detours can be layered. 11 | If you're writing your own detour manager or need to detour native functions, it's better to create instances of NativeDetour instead. 12 | 13 | 14 | 15 | 16 | Mark the detour as applied in the detour chain. This can be done automatically when creating an instance. 17 | 18 | 19 | 20 | 21 | Undo the detour without freeing it, allowing you to reapply it later. 22 | 23 | 24 | 25 | 26 | Free the detour, while also permanently undoing it. This makes any further operations on this detour invalid. 27 | 28 | 29 | 30 | 31 | Undo and free this temporary detour. 32 | 33 | 34 | 35 | 36 | Generate a new DynamicMethod with which you can invoke the previous state. 37 | 38 | 39 | 40 | 41 | Generate a new DynamicMethod with which you can invoke the previous state. 42 | 43 | 44 | 45 | 46 | Generate a new DynamicMethod with which you can invoke the previous state. 47 | 48 | 49 | 50 | 51 | A "raw" native detour, acting as a wrapper around NativeDetourData with a few helpers. 52 | Only one NativeDetour for a method to detour from can exist at any given time. NativeDetours cannot be layered. 53 | If you don't need the trampoline generator or any of the management helpers, use DetourManager.Native directly. 54 | Unless you're writing your own detour manager or need to detour native functions, it's better to create instances of Detour instead. 55 | 56 | 57 | 58 | 59 | Apply the native detour. This can be done automatically when creating an instance. 60 | 61 | 62 | 63 | 64 | Undo the native detour without freeing the detour native data, allowing you to reapply it later. 65 | 66 | 67 | 68 | 69 | Changes the source of this native detour to a new source address. This does not repair the old source location. 70 | This also assumes that is simply a new address for the same method as this was constructed with. 71 | 72 | The new source location. 73 | 74 | 75 | 76 | Changed the target of this native detour to a new target. 77 | 78 | The new target address. 79 | 80 | 81 | 82 | Free the detour's data without undoing it. This makes any further operations on this detour invalid. 83 | 84 | 85 | 86 | 87 | Undo and free this temporary detour. 88 | 89 | 90 | 91 | 92 | Generate a new DynamicMethod with which you can invoke the previous state. 93 | If the NativeDetour holds a reference to a managed method, a copy of the original method is returned. 94 | If the NativeDetour holds a reference to a native function, an "undo-call-redo" trampoline with a matching signature is returned. 95 | 96 | 97 | 98 | 99 | Generate a new delegate with which you can invoke the previous state. 100 | If the NativeDetour holds a reference to a managed method, a copy of the original method is returned. 101 | If the NativeDetour holds a reference to a native function, an "undo-call-redo" trampoline with a matching signature is returned. 102 | 103 | 104 | 105 | 106 | Write the given value at the address to + offs, afterwards advancing offs by sizeof(byte). 107 | 108 | 109 | 110 | 111 | Write the given value at the address to + offs, afterwards advancing offs by sizeof(ushort). 112 | 113 | 114 | 115 | 116 | Write the given value at the address to + offs, afterwards advancing offs by sizeof(ushort). 117 | 118 | 119 | 120 | 121 | Write the given value at the address to + offs, afterwards advancing offs by sizeof(ulong). 122 | 123 | 124 | 125 | 126 | Generate a DynamicMethod to easily call the given native function from another DynamicMethod. 127 | 128 | The pointer to the native function to call. 129 | A MethodBase with the target function's signature. 130 | The detoured DynamicMethod. 131 | 132 | 133 | 134 | Fill the DynamicMethodDefinition with a throw. 135 | 136 | 137 | 138 | 139 | Emit a call to DetourManager.Native.Copy using the given parameters. 140 | 141 | 142 | 143 | 144 | Emit a call to DetourManager.Native.Apply using a copy of the given data. 145 | 146 | 147 | 148 | 149 | The data forming a "raw" native detour, created and consumed by DetourManager.Native. 150 | 151 | 152 | 153 | 154 | The method to detour from. Set when the structure is created by the IDetourNativePlatform. 155 | 156 | 157 | 158 | 159 | The target method to be called instead. Set when the structure is created by the IDetourNativePlatform. 160 | 161 | 162 | 163 | 164 | The type of the detour. Determined when the structure is created by the IDetourNativePlatform. 165 | 166 | 167 | 168 | 169 | The size of the detour. Calculated when the structure is created by the IDetourNativePlatform. 170 | 171 | 172 | 173 | 174 | DetourManager.Native-specific data. 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Pages/Home.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | @inject Configuration conf 4 | @using System.Timers 5 | @inject IDialogService DialogService 6 | 常规设置 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | @if (_processing) 17 | { 18 | 19 | 20 | 正在连接服务器 21 | 22 | } 23 | else 24 | { 25 | if (Configuration.login) 26 | { 27 | 28 | 已连接插件 29 | 30 | PID: @Configuration.pid 31 | } 32 | else 33 | { 34 | 35 | 失败请重连 36 | 37 | } 38 | } 39 |
40 |
41 | 42 |
43 | 44 | 45 | 手动选择路径 46 | 47 | @if(_Downloading){ 48 | 49 | 50 | @_DownloadText 51 | 52 | 53 | }else{ 54 | if(Configuration.GamePath==""|| _processing || Configuration.login){ 55 | 56 | 57 | 58 | 安装HsMod插件 59 | 60 | 61 | }else{ 62 | if (Configuration.pluginVersion == null) 63 | { 64 | 65 | 66 | 安装HsMod插件 67 | 68 | 69 | }else { 70 | 71 | 72 | 73 | 重装HsMod插件 74 | 75 | 76 | } 77 | 78 | } 79 | } 80 | 81 |
82 |
83 | @if (Configuration.hsmodcfg.Count>0) 84 | { 85 | foreach (List card in _List) 86 | { 87 | 88 | @foreach (string item in card) 89 | { 90 | var cfg = Configuration.hsmodcfg[item]; 91 | if (cfg.type == typeof(int)) 92 | { 93 | if (cfg.acceptableRange != null & cfg.acceptableRange.Count == 2) 94 | { 95 | 96 | } 97 | else 98 | { 99 | 100 | } 101 | } 102 | else if (cfg.type == typeof(bool)) 103 | { 104 | 105 | @cfg.key 106 | 107 | } 108 | else if (cfg.type == typeof(string)) 109 | { 110 | if (cfg.acceptValue != null) 111 | { 112 | 117 | @foreach (var value in cfg.acceptValue) 118 | { 119 | @value 120 | } 121 | 122 | } 123 | } 124 | } 125 | 126 | } 127 | } 128 | 129 |
130 | 131 | 132 | 133 | 134 | @code { 135 | 136 | 137 | private bool _Downloading = false; 138 | private bool _processing = false; 139 | private int _DownloadValue = 0; 140 | private string _DownloadText = "下载中"; 141 | private List> _List = [["快捷键状态","变速齿轮状态", "显示FPS", "游戏帧率", "变速倍率", "开包加速", "快速战斗"], ["自动开包", "自动分解", "自动开盒", "自动举报", "自动领奖"], ["允许掉线", "游戏内消息", "结算展示", "弹出消息", "报错退出", "弹出响应"], ["收藏卡牌数量", "显示卡牌ID", "自动置换卡牌", "显示放弃"]]; 142 | private Timer timer = new Timer(1000); 143 | async protected override void OnInitialized() 144 | { 145 | if (Configuration.firstOpen){ 146 | 147 | await Configuration.getGamePath(); 148 | await Configuration.getPluginVersion(); 149 | await relink(); 150 | } 151 | timer.Elapsed += Timer_Elapsed; 152 | timer.Start(); 153 | } 154 | async Task Download(){ 155 | try{ 156 | GitHub.Downloadprogress = 0; 157 | _Downloading = true; 158 | _DownloadText = "清理安装目录"; 159 | string fromDir = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Addins"); 160 | string toDir = System.IO.Path.GetDirectoryName(Configuration.GamePath); 161 | await FileIO.DeleteDirectory($@"{toDir}\BepInEx"); 162 | _DownloadValue = 10; 163 | _DownloadText = "复制BepInEx"; 164 | await FileIO.CopyDirectory(fromDir, toDir); 165 | await FileIO.CreateDirectory($@"{toDir}\BepInEx\plugins"); 166 | _DownloadValue = 20; 167 | _DownloadText = "正在获取HsMod最新版本号"; 168 | var result = await GitHub.GetLatestReleaseDownloadUrl("Pik-4", "HsMod"); 169 | _DownloadValue = 30; 170 | _DownloadText = $"下载最新版本{result.version}HsMod"; 171 | await GitHub.DownloadFileWithProgressAsync(result.url, $@"{toDir}\BepInEx\plugins\HsMod.dll"); 172 | _DownloadText = "HsMod安装完成,请运行游戏后点击重连"; 173 | await Configuration.getPluginVersion(); 174 | await Task.Delay(5000); 175 | 176 | }catch(Exception e){ 177 | Console.WriteLine(e.Message); 178 | var parameters = new DialogParameters 179 | { 180 | { x => x.ContentText, e.Message }, 181 | { x => x.ButtonText, "好的" }, 182 | { x => x.Color, Color.Error } 183 | }; 184 | 185 | var options = new DialogOptions() { CloseButton = false, MaxWidth = MaxWidth.ExtraSmall }; 186 | 187 | await DialogService.ShowAsync("出错了", parameters, options); 188 | 189 | } 190 | _Downloading = false; 191 | _DownloadValue = 0; 192 | } 193 | async Task pickFile(){ 194 | await Configuration.PickFileAsync(); 195 | StateHasChanged(); 196 | } 197 | async Task relink() 198 | { 199 | _processing = true; 200 | 201 | await Task.Delay(1000); 202 | await Configuration.getAlive(); 203 | _processing = false; 204 | if (Configuration.login) 205 | { 206 | await Configuration.getHsmodCfg(); 207 | await Configuration.getSkinsData(); 208 | } 209 | 210 | Configuration.firstOpen = false; 211 | StateHasChanged(); 212 | } 213 | 214 | private void Timer_Elapsed(object sender, ElapsedEventArgs e) 215 | { 216 | InvokeAsync(() => StateHasChanged()); // 触发组件重新渲染 217 | } 218 | 219 | 220 | } -------------------------------------------------------------------------------- /HsmodConfiguration/Resources/Images/dotnet_bot.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /HsmodConfiguration/Components/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Text; 3 | using System.Text.Json; 4 | using System.Text.RegularExpressions; 5 | using Microsoft.Win32; 6 | namespace HsmodConfiguration.Components 7 | { 8 | public class Configuration 9 | { 10 | public static bool firstOpen = true; 11 | private static HttpClient Http = new HttpClient(); 12 | private static readonly Regex ConfigRegex = new Regex(@"^\s*(?[^=\s]+)\s*=\s*(?.*)\s*$", RegexOptions.Compiled | RegexOptions.Multiline); 13 | private static readonly Regex MetadataRegex = new Regex(@"^##?\s*(.*)$", RegexOptions.Compiled | RegexOptions.Multiline); 14 | public static string url = "localhost"; 15 | public static string port = "58744"; 16 | public static int pid; 17 | public static bool login; 18 | public static Dictionary? hsmodcfg = new Dictionary(); 19 | public static Dictionary>? skins = new Dictionary>(); 20 | public static bool isSkinsLoad = false; 21 | public static bool changed = false; 22 | public static string GamePath = ""; 23 | public static string? pluginVersion = null; 24 | public static bool isInstalled = true; 25 | public static async Task getAlive() 26 | { 27 | 28 | try 29 | { 30 | // 发送GET请求 31 | HttpResponseMessage response = await Http.GetAsync($"http://{url}:{port}/alive"); 32 | response.EnsureSuccessStatusCode(); 33 | 34 | string jsonResponse = await response.Content.ReadAsStringAsync(); 35 | 36 | // 解析JSON数据 37 | var jsonData = JsonSerializer.Deserialize(jsonResponse); 38 | 39 | if (jsonData?.pid != null) 40 | { 41 | pid = jsonData.pid; 42 | if (jsonData.login == "True") 43 | { 44 | login = true; 45 | } 46 | else 47 | { 48 | login = false; 49 | } 50 | } 51 | } 52 | catch (Exception e) 53 | { 54 | Console.WriteLine($"Request error: {e.Message}"); 55 | login = false; 56 | pid = 0; 57 | } 58 | } 59 | public static async Task PickFileAsync() 60 | { 61 | var customFileType = new FilePickerFileType( 62 | new Dictionary> 63 | { 64 | { DevicePlatform.WinUI, new[] { ".exe" } }, // Windows 平台限制为 .exe 文件 65 | { DevicePlatform.iOS, new[] { "public.executable" } }, // iOS 平台 66 | { DevicePlatform.Android, new[] { "application/x-ms-dos-executable" } }, // Android 平台 67 | { DevicePlatform.macOS, new[] { "public.executable" } }, // macOS 平台 68 | { DevicePlatform.Tizen, new[] { "*/*" } } // Tizen 平台(通用类型) 69 | }); 70 | var options = new PickOptions 71 | { 72 | PickerTitle = "请选择 Hearthstone.exe", 73 | FileTypes = customFileType 74 | }; 75 | 76 | try 77 | { 78 | var result = await FilePicker.Default.PickAsync(options); 79 | if (result != null) 80 | { 81 | if (result.FileName == "Hearthstone.exe") 82 | { 83 | GamePath = result.FullPath; 84 | } 85 | } 86 | } 87 | catch (Exception ex) 88 | { 89 | // 处理异常 90 | } 91 | } 92 | 93 | public static async Task getPluginVersion() 94 | { 95 | try 96 | { 97 | if (GamePath != "" & File.Exists(GamePath)) 98 | { 99 | string dllDir = $@"{System.IO.Path.GetDirectoryName(GamePath)}\BepInEx\plugins\HsMod.dll"; 100 | if (File.Exists(dllDir)) 101 | { 102 | pluginVersion = FileVersionInfo.GetVersionInfo(dllDir).FileVersion ?? "Unknown"; 103 | } 104 | else 105 | { 106 | pluginVersion = null; 107 | } 108 | 109 | } 110 | } 111 | catch (Exception ex) { } 112 | } 113 | public static async Task getGamePath() 114 | { 115 | try 116 | { 117 | using (RegistryKey baseKey = Registry.LocalMachine) 118 | { 119 | using (RegistryKey subKey = baseKey.OpenSubKey(@"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Hearthstone")) 120 | { 121 | if (subKey != null) 122 | { 123 | var saveSubkeyNames = subKey.GetSubKeyNames(); 124 | object path = subKey.GetValue("DisplayIcon"); // 获取默认值 125 | if (path is string && path.ToString().EndsWith("Hearthstone.exe")) 126 | { 127 | GamePath = path.ToString(); 128 | } 129 | } 130 | } 131 | } 132 | 133 | } 134 | catch (Exception ex) 135 | { 136 | Console.WriteLine($"扫描注册表失败: {ex.Message}"); 137 | } 138 | } 139 | public static async Task save() 140 | { 141 | try 142 | { 143 | if (hsmodcfg == null) { return; } 144 | foreach (CfgData val in hsmodcfg.Values) 145 | { 146 | if (val.changed) 147 | { 148 | 149 | var requestData = new RequestData 150 | { 151 | key = val.key, 152 | value = val.value 153 | }; 154 | string json = JsonSerializer.Serialize(requestData); 155 | var content = new StringContent(json, Encoding.UTF8, "application/json"); 156 | 157 | HttpResponseMessage response = await Http.PostAsync($"http://{url}:{port}/config", content); 158 | response.EnsureSuccessStatusCode(); 159 | string responseBody = await response.Content.ReadAsStringAsync(); 160 | Console.WriteLine(responseBody); 161 | 162 | 163 | } 164 | } 165 | } 166 | catch (Exception e) 167 | { 168 | Console.WriteLine($"Request error: {e.Message}"); 169 | } 170 | } 171 | public static async Task getSkinsData() 172 | { 173 | try 174 | { 175 | skins = new Dictionary>(); 176 | // 发送GET请求 177 | HttpResponseMessage response = await Http.GetAsync($"http://{url}:{port}/skins.log"); 178 | response.EnsureSuccessStatusCode(); 179 | string Response = await response.Content.ReadAsStringAsync(); 180 | string[] lines = Response.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries); 181 | if (lines.Length == 0) 182 | { 183 | Configuration.isSkinsLoad = false; 184 | } 185 | else 186 | { 187 | Configuration.isSkinsLoad = true; 188 | } 189 | List kindlist = ["硬币", "卡背", "对战面板", "酒馆战斗面板", "酒馆击杀特效", "鲍勃", "宠物", "对手宠物"]; 190 | foreach (string k in kindlist) 191 | { 192 | skins.Add(k, new Dictionary()); 193 | skins[k].Add("-1", "不做修改"); 194 | if (k == "宠物" || k == "对手宠物") 195 | { 196 | skins[k].Add("0", "隐藏"); 197 | } 198 | } 199 | string kind = ""; 200 | foreach (string line in lines) 201 | { 202 | if (line.StartsWith("#")) 203 | { 204 | switch (ExtractTextBetween(line, "获取到", "如下:")) 205 | { 206 | case "硬币皮肤": 207 | kind = "硬币"; 208 | break; 209 | case "卡背信息": 210 | kind = "卡背"; 211 | break; 212 | case "游戏面板信息": 213 | kind = "对战面板"; 214 | break; 215 | case "酒馆战斗面板": 216 | kind = "酒馆战斗面板"; 217 | break; 218 | case "酒馆终结特效": 219 | kind = "酒馆击杀特效"; 220 | break; 221 | case "英雄皮肤(包括酒馆)": 222 | kind = "皮肤"; 223 | break; 224 | case "宠物皮肤": 225 | kind = "宠物"; 226 | break; 227 | } 228 | continue; 229 | } 230 | if (kind == "皮肤") 231 | { 232 | var word = line.Split("\t"); 233 | var skinkind = ""; 234 | switch (word[2]) 235 | { 236 | case "BATTLEGROUNDS_HERO": 237 | skinkind = "酒馆英雄"; 238 | break; 239 | case "BATTLEGROUNDS_GUIDE": 240 | skinkind = "鲍勃"; 241 | break; 242 | default: 243 | skinkind = "对战英雄"; 244 | break; 245 | } 246 | if (!skins.ContainsKey(skinkind)) 247 | { 248 | skins.Add(skinkind, new Dictionary()); 249 | skins[skinkind].Add("-1", "不做修改"); 250 | } 251 | 252 | skins[skinkind].Add(word[0], word[1]); 253 | } 254 | else if (kind == "宠物") 255 | { 256 | var word = line.Split("\t"); 257 | string[] kinds = ["宠物", "对手宠物"]; 258 | foreach (string k in kinds) 259 | { 260 | skins[k].Add(word[0], word[1]); 261 | } 262 | 263 | } 264 | else 265 | { 266 | var word = line.Split("\t"); 267 | if (!skins.ContainsKey(kind)) 268 | { 269 | skins.Add(kind, new Dictionary()); 270 | skins[kind].Add("-1", "不做修改"); 271 | } 272 | 273 | skins[kind].Add(word[0], word[1]); 274 | } 275 | } 276 | } 277 | catch (Exception e) { Console.WriteLine(e); } 278 | } 279 | public static async Task getHsmodCfg() 280 | { 281 | 282 | try 283 | { 284 | // 发送GET请求 285 | HttpResponseMessage response = await Http.GetAsync($"http://{url}:{port}/hsmod.cfg"); 286 | response.EnsureSuccessStatusCode(); 287 | 288 | string cfgResponse = await response.Content.ReadAsStringAsync(); 289 | 290 | string[] blocks = cfgResponse.Split(new[] { "\r\n\r\n", "\n\n" }, StringSplitOptions.None); 291 | var data = new Dictionary(); 292 | foreach (string block in blocks) 293 | { 294 | var matches = ConfigRegex.Matches(block); 295 | foreach (Match match in matches) 296 | { 297 | if (match.Success) 298 | { 299 | string key = match.Groups["key"].Value.Trim(); 300 | string value = match.Groups["value"].Value.Trim(); 301 | var metadataMatches = MetadataRegex.Matches(block); 302 | string type = ""; 303 | string defaultValue = ""; 304 | string ps = ""; 305 | string acceptValue = ""; 306 | string acceptableRange = ""; 307 | foreach (Match metadataMatch in metadataMatches) 308 | { 309 | string comment = metadataMatch.Groups[1].Value.Trim(); 310 | 311 | if (comment.StartsWith("Setting type:")) 312 | { 313 | type = comment.Substring("Setting type:".Length).Trim(); 314 | } 315 | else if (comment.StartsWith("Default value:")) 316 | { 317 | defaultValue = comment.Substring("Default value:".Length).Trim(); 318 | } 319 | else if (comment.StartsWith("Acceptable values:")) 320 | { 321 | acceptValue = comment.Substring("Acceptable values:".Length).Trim(); 322 | } 323 | else if (comment.StartsWith("Acceptable value range:")) 324 | { 325 | acceptableRange = comment.Substring("Acceptable value range:".Length).Trim(); 326 | } 327 | else 328 | { 329 | ps = comment; 330 | } 331 | } 332 | data[key] = new CfgData(key, type, value, defaultValue, ps, acceptValue, acceptableRange); 333 | 334 | } 335 | } 336 | } 337 | hsmodcfg = data; 338 | changed = false; 339 | } 340 | 341 | catch (Exception e) 342 | { 343 | Console.WriteLine($"Request error: {e.Message}"); 344 | login = false; 345 | pid = 0; 346 | } 347 | } 348 | public static string ExtractTextBetween(string input, string startMarker, string endMarker) 349 | { 350 | // 构造正则表达式 351 | string pattern = $"{Regex.Escape(startMarker)}(.*?){Regex.Escape(endMarker)}"; 352 | 353 | // 匹配字符串 354 | Match match = Regex.Match(input, pattern); 355 | 356 | if (match.Success) 357 | { 358 | // 返回匹配到的内容 359 | return match.Groups[1].Value.Trim(); 360 | } 361 | else 362 | { 363 | // 如果没有匹配到,返回空字符串 364 | return string.Empty; 365 | } 366 | } 367 | 368 | private Dictionary ParseConfig(string cfg) 369 | { 370 | var config = new Dictionary(); 371 | var matches = ConfigRegex.Matches(cfg); 372 | foreach (Match match in matches) 373 | { 374 | if (match.Success) 375 | { 376 | string key = match.Groups["key"].Value.Trim(); 377 | string value = match.Groups["value"].Value.Trim(); 378 | config[key] = value; 379 | } 380 | } 381 | return config; 382 | } 383 | // 定义一个类来映射JSON结构 384 | public class AliveData 385 | { 386 | public int pid { get; set; } 387 | public required string login { get; set; } 388 | } 389 | public class RequestData 390 | { 391 | public string? key { get; set; } 392 | public string? value { get; set; } 393 | } 394 | } 395 | public class CfgData 396 | { 397 | public string key { get; set; } 398 | public Type type { get; set; } 399 | public string value; 400 | public string stringValue 401 | { 402 | get { return this.value; } 403 | set 404 | { 405 | this.value = value; 406 | Configuration.changed = true; 407 | this.changed = true; 408 | } 409 | } 410 | public int intValue 411 | { 412 | get 413 | { 414 | return int.Parse(this.value); 415 | } 416 | set 417 | { 418 | this.value = value.ToString(); 419 | Configuration.changed = true; 420 | this.changed = true; 421 | } 422 | } 423 | public bool boolValue 424 | { 425 | get 426 | { 427 | return Convert.ToBoolean(this.value); 428 | } 429 | set 430 | { 431 | this.value = value.ToString(); 432 | Configuration.changed = true; 433 | this.changed = true; 434 | } 435 | } 436 | public string tranValue 437 | { 438 | get 439 | { 440 | return Configuration.skins[this.key][this.value]; 441 | } 442 | set 443 | { 444 | this.value = Configuration.skins[this.key].FirstOrDefault(q => q.Value == value.ToString()).Key; 445 | Configuration.changed = true; 446 | this.changed = true; 447 | } 448 | 449 | } 450 | public bool changed = false; 451 | public string defaultValue { get; set; } 452 | public string ps { get; set; } 453 | public List? acceptValue { get; set; } 454 | public List? acceptableRange { get; set; } 455 | 456 | public CfgData(string key, string type, string value, string defaultValue, string ps, string acceptValue, string acceptableRange) 457 | { 458 | this.key = key; 459 | if (type == "Boolean") 460 | { 461 | this.type = typeof(bool); 462 | this.acceptValue = null; 463 | this.acceptableRange = null; 464 | } 465 | else if (type == "Int32") 466 | { 467 | this.type = typeof(int); 468 | this.acceptValue = null; 469 | this.acceptableRange = System.Text.RegularExpressions.Regex.Matches(acceptableRange, @"-?\d+") 470 | .Cast() 471 | .Select(match => int.Parse(match.Value)) 472 | .ToList(); 473 | } 474 | else 475 | { 476 | this.type = typeof(string); 477 | this.acceptValue = acceptValue.Split(',') 478 | .Select(word => word.Trim()) // 去除多余的空格 479 | .ToList(); 480 | this.acceptableRange = null; 481 | } 482 | this.value = value; 483 | this.defaultValue = defaultValue; 484 | this.ps = ps; 485 | this.stringValue = value; 486 | this.changed = false; 487 | } 488 | 489 | public T getValue() 490 | { 491 | Type t = typeof(T); 492 | if (t == typeof(int)) 493 | { 494 | return (T)(object)int.Parse(value); 495 | } 496 | else if (t == typeof(string)) 497 | { 498 | return (T)(object)value; 499 | } 500 | else if (t == typeof(bool)) 501 | { 502 | return (T)(object)Convert.ToBoolean(value); 503 | } 504 | return default(T); 505 | } 506 | } 507 | } 508 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------