Skip to content

Implement Plugin System for Adding Support for Third-Party (Non-miHoYo) Titles #752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 58 commits into
base: main
Choose a base branch
from

Conversation

neon-nyan
Copy link
Member

@neon-nyan neon-nyan commented May 29, 2025

Main Goal

As per title says, this PR implements a Plugin System for Collapse Launcher, which will bring supports for any third-party (non-miHoYo) games.

This PR is still heavily in-development and in its state, is not yet ready to be implemented into Collapse Launcher's main repository. Though, the core library component is currently in the works.

First-Party Game Support Targets (by Collapse Project Team)

Implementation Progress Tracking

Core Library

  • COM Interop Calls and Interfaces
    • Exports
    • Library-to-App Exception Support
      • Asynchronous Tasks/Threads
      • Synchronous Blocking Threads
  • Preset Config
  • Launcher API Call Interfaces
    • News, Carousel and Social Media API
    • Game/Installation Resources API (managed by Game Versioning Management on Initialization)
  • Launcher Game Management Interfaces
    • Game Versioning Management
    • Game Installation/Update Management
  • Plugin Self-Update Management

Collapse Launcher

  • Pre-requisite: Refactor all COM-related submodules to support RuntimeMarshalling
  • COM Interop Wrappers for Calls and Interfaces
    • Preset Config
    • Launcher API Calls
      • News, Carousel and Social Media API
      • Game/Installation Resources API
    • Launcher Game Management
      • Game Versioning Management
      • Game Installation/Update Management
  • Plugin Loading and Self-Update Management

GitHub

  • Add template plugin repository for easy plugin generation
  • Update README, CONTRIBUTING and others to reflect future plugin support
  • Create CI flow for building and distributing precompiled DLLs from plugin repositories, including external forks

Websites (main & status)

  • Create documentation on feature set, compatibility, etc.
  • Create new status labels & category for plugin statuses

PR Status :

  • Overall Status : In Progress
  • Commits : In Progress
  • Synced to base (Collapse:main) : Yes

Templates

Changelog Prefixes
  **[New]**
  **[Imp]**
  **[Fix]**
  **[Loc]**
  **[Doc]**

@neon-nyan neon-nyan added this to the 1.83.x milestone May 29, 2025
@neon-nyan neon-nyan self-assigned this May 29, 2025
@neon-nyan neon-nyan added Enhancement New feature or request Area: Preset Config Issue labeled for Preset/Region Configuration Game: Others Issue labeled for Other Unregistered Games Area: Runtime Issue labeled for runtime, Hi3Helper.Core and other libraries used by Collapse Area: Launcher Issue labeled for Launcher update mechanism Area: Game Settings Issue labeled for Game Settings related issues Priority: Medium and removed Area: Game Settings Issue labeled for Game Settings related issues labels May 29, 2025
@bagusnl
Copy link
Member

bagusnl commented May 30, 2025

As of the CoreLib do we want to include Discord RPC as well, tho it might need quite a adjustment to detach the currently hardcoded Discord IDs to metadata or separate configs location for per-game RPCs.
The generic RPC also needs to be adjusted a little bit

@Cryotechnic
Copy link
Collaborator

Cryotechnic commented May 30, 2025

I believe that for Discord RPC, we can probably do something along the lines of just showing a generic "Playing a custom game" to avoid having to implement custom IDs on our end.

The alternative would be to have the plugin developer provide their own ID through the plugin configuration interface/code that we expose and display a generic message if that feature is not used.

@neon-nyan
Copy link
Member Author

I believe that for Discord RPC, we can probably do something along the lines of just showing a generic "Playing a custom game" to avoid having to implement custom IDs on our end.

The alternative would be to have the plugin developer provide their own ID through the plugin configuration interface/code that we expose and display a generic message if that feature is not used.

We can re-use the managed code part for Discord integration. The IDs for the Discord Presence will be provided by the plugin, stored in IPluginPresetConfig instance. If it's null, then tell the managed code to disable Discord Presence for that certain game.

Copy link

github-actions bot commented May 31, 2025

Qodana for .NET

10 new problems were found

Inspection name Severity Problems
Redundant using directive 🔶 Warning 8
Expression is always 'true' or 'false' according to nullable reference types' annotations 🔶 Warning 1
Possible 'System.NullReferenceException' 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Detected 72 dependencies

Third-party software list

This page lists the third-party software dependencies used in CollapseLauncher

Dependency Version Licenses
CommunityToolkit.Common 8.4.0 MIT
CommunityToolkit.Mvvm 8.4.0 MIT
CommunityToolkit.WinUI.Animations 8.2.250402 MIT
CommunityToolkit.WinUI.Behaviors 8.2.250402 MIT
CommunityToolkit.WinUI.Controls.Primitives 8.2.250402 MIT
CommunityToolkit.WinUI.Controls.Sizers 8.2.250402 MIT
CommunityToolkit.WinUI.Converters 8.2.250402 MIT
CommunityToolkit.WinUI.Extensions 8.2.250402 MIT
CommunityToolkit.WinUI.Helpers 8.2.250402 MIT
CommunityToolkit.WinUI.Media 8.2.250402 MIT
CommunityToolkit.WinUI.Triggers 8.2.250402 MIT
Costura.Fody 6.0.0 MIT
DependencyPropertyGenerator 1.5.0 MIT
DotNet.ReproducibleBuilds 1.2.25 MIT
EventGenerator.Generator 0.13.1 MIT
Fody 6.9.2 MIT
GitInfo 3.5.0 MIT
Google.Protobuf.Tools 3.31.1 PROTOBUF
Google.Protobuf 3.31.1 BSD-3-Clause
Hi3Helper.ZstdNet 1.6.4 BSD-3-Clause
HtmlAgilityPack 1.12.1 MIT
Markdig.Signed 0.41.2 BSD-2-Clause
Microsoft.CSharp 4.7.0 MIT
Microsoft.Extensions.DependencyInjection.Abstractions 9.0.3 MIT
Microsoft.Extensions.DependencyInjection.Abstractions 9.0.5 MIT
Microsoft.Extensions.DependencyInjection 9.0.5 MIT
Microsoft.Extensions.Logging.Abstractions 9.0.3 MIT
Microsoft.Extensions.Logging.Abstractions 9.0.5 MIT
Microsoft.Extensions.Logging 9.0.5 MIT
Microsoft.Extensions.Options 9.0.5 MIT
Microsoft.Extensions.Primitives 9.0.5 MIT
Microsoft.NET.ILLink.Tasks 9.0.6 MIT
Microsoft.NETCore.Targets 6.0.0-preview.4.21253.7 MIT
Microsoft.Web.WebView2 1.0.3344-prerelease BSD-3-Clause
BSD-MYLEX
Microsoft.Win32.SystemEvents 9.0.5 MIT
Microsoft.Windows.CsWin32 0.3.183 Apache-2.0
Microsoft.Windows.CsWinRT 2.2.0 MIT
Microsoft.Windows.SDK.BuildTools.MSIX 1.7.20250508.1 MIT
Microsoft.Windows.SDK.BuildTools 10.0.26100.4188 PROPRIETARY-LICENSE
Microsoft.Windows.SDK.Win32Docs 0.1.42-alpha PROPRIETARY-LICENSE
Microsoft.Windows.SDK.Win32Metadata 63.0.31-preview MIT
Microsoft.Windows.WDK.Win32Metadata 0.13.25-experimental MIT
Microsoft.WindowsAppSDK.AI 1.8.135-experimental MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK.Base 1.8.250509001-experimental MIT
MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK.DWrite 1.8.25050910-experimental.2 MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK.Foundation 1.8.250507001-experimental MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK.InteractiveExperiences 1.8.250509002-experimental MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK.Packages 1.8.250515001-experimental2 MIT
MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK.Widgets 1.8.250505003-experimental MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK.WinUI 1.8.250507002-experimental MIT
MS-DXSDK-D3DX-9.29.952.3
Microsoft.WindowsAppSDK 1.8.250515001-experimental2 MIT
MS-DXSDK-D3DX-9.29.952.3
Microsoft.Xaml.Behaviors.WinUI.Managed 3.0.0 MIT
NuGet.Versioning 6.14.0 Apache-2.0
PhotoSauce.MagicScaler 0.15.0 MIT
PhotoSauce.NativeCodecs.Libwebp 1.4.0-preview1 MIT
Roman-Numerals 2.0.1 MIT
Sentry 5.10.0 MIT
SharpCompress 0.40.0 MIT
SharpHDiffPatch.Core 2.3.3 MIT
System.Buffers 4.6.0 MIT
System.Drawing.Common 9.0.5 MIT
System.IO.Hashing 9.0.5 MIT
System.IO.Hashing 9.0.6 MIT
System.Security.AccessControl 6.0.1 MIT
System.Security.Cryptography.ProtectedData 9.0.5 MIT
System.Text.Encoding.CodePages 9.0.5 MIT
System.Text.Json 9.0.5 MIT
System.Threading.Tasks.Extensions 4.5.4 MIT
TaskScheduler 2.12.1 MIT
ThisAssembly.Constants 2.0.6 MIT
Velopack 0.0.1297 MIT
ZstdSharp.Port 0.8.5 MIT
Contact Qodana team

Contact us at qodana-support@jetbrains.com

using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Check warning

Code scanning / QDNET

Redundant using directive Warning

Using directive is not required by the code and can be safely removed
.GetAwaiter()
.GetResult();

if (resolvedIpAddresses == null || resolvedIpAddresses.Length == 0)

Check warning

Code scanning / QDNET

Expression is always 'true' or 'false' according to nullable reference types' annotations Warning

Expression is always false according to nullable reference types' annotations
@Cryotechnic Cryotechnic changed the title Implement Plugin System for Adding Support for Third-Party (Non-miHoYo) Games Implement Plugin System for Adding Support for Third-Party (Non-miHoYo) Titles Jun 12, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@@ -1,9 +1,12 @@
using CollapseLauncher.Helper.Metadata;
using Hi3Helper;
using Hi3Helper.Data;
using Hi3Helper.Plugin.Core.Management;

Check warning

Code scanning / QDNET

Redundant using directive Warning

Using directive is not required by the code and can be safely removed
using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.CompilerServices;

Check warning

Code scanning / QDNET

Redundant using directive Warning

Using directive is not required by the code and can be safely removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Launcher Issue labeled for Launcher update mechanism Area: Preset Config Issue labeled for Preset/Region Configuration Area: Runtime Issue labeled for runtime, Hi3Helper.Core and other libraries used by Collapse Enhancement New feature or request Game: Others Issue labeled for Other Unregistered Games Priority: Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants