Skip to content

Commit c3e685b

Browse files
committed
chore: Update documentation and version to v0.1.5, add per-file install progress feature
1 parent 930229c commit c3e685b

5 files changed

Lines changed: 49 additions & 5 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Make sure that your code is **as reflection-free** as possible, as the code is e
1111
# What's Included?
1212
This Core Library includes various APIs to make the plugin development faster, without needing to implement the entire functions from scratch. Here's a list of what's included currently:
1313

14-
### V1 (v0.1.4.0) Implementation Standard
14+
### V1 (v0.1.5.0) Implementation Standard
1515

16-
This repository follows the V1 implementation standard (current library version: ``v0.1.4.0``). The standard collects base API contracts, COM interop helpers, marshallers and small utility primitives that plugin authors and the launcher can rely on.
16+
This repository follows the V1 implementation standard (current library version: ``v0.1.5.0``). The standard collects base API contracts, COM interop helpers, marshallers and small utility primitives that plugin authors and the launcher can rely on.
1717

1818
> [!WARNING]
1919
> The API contracts and implementations are still under development, so expect some breaking changes in the future.
@@ -46,6 +46,7 @@ This repository follows the V1 implementation standard (current library version:
4646
* v0.1-update2 ([source](https://github.com/CollapseLauncher/Hi3Helper.Plugin.Core/blob/main/SharedStatic.V1Ext_Update2.cs)): ``GetCurrentDiscordPresenceInfo``
4747
* v0.1-update3 ([source](https://github.com/CollapseLauncher/Hi3Helper.Plugin.Core/blob/main/SharedStatic.V1Ext_Update3.cs)): ``StartResizableWindowHookAsync``
4848
* v0.1-update4 ([source](https://github.com/CollapseLauncher/Hi3Helper.Plugin.Core/blob/main/SharedStatic.V1Ext_Update4.cs)): ``RegisterSpeedThrottlerService``
49+
* v0.1-update5 ([source](https://github.com/CollapseLauncher/Hi3Helper.Plugin.Core/blob/main/SharedStatic.V1Ext_Update5.cs)): ``SetPerFileProgressCallback``
4950

5051
* COM-API Interfaces/Contracts
5152
* [``IFree``](https://github.com/CollapseLauncher/Hi3Helper.Plugin.Core/blob/main/IFree.cs)

SharedStatic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static unsafe SharedStatic()
103103
internal static string? ProxyPassword;
104104

105105
public static string PluginLocaleCode { get; internal set; } = "en-us";
106-
public static readonly GameVersion LibraryStandardVersion = new(0, 1, 4, 0);
106+
public static readonly GameVersion LibraryStandardVersion = new(0, 1, 5, 0);
107107
public static readonly ILogger InstanceLogger = new SharedLogger();
108108

109109
#if DEBUG

docs/advanced.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
2. [Proxy settings](#2-proxy-settings)
77
3. [Discord Rich Presence](#3-discord-rich-presence)
88
4. [Multi-region plugins](#4-multi-region-plugins)
9+
5. [Per-file install progress](#5-per-file-install-progress)
910

1011
---
1112

@@ -251,3 +252,37 @@ public partial class MySeaPresetConfig : PluginPresetConfigBase
251252
- **`ProfileName` vs `ZoneName`**`ZoneName` is the short display label in the launcher UI. `ProfileName` is used as an internal grouping key; it can be the same as `ZoneName`.
252253
- **Region ordering** — the launcher displays regions in the order the plugin returns them (index 0 first). Put the most common region first.
253254
- **Locale handling**`SharedStatic.PluginLocaleCode` is set by the launcher via the `SetPluginCurrentLocale` export. Both preset configs read the same `PluginLocaleCode`, so API calls for different regions will automatically use the user's selected language.
255+
256+
---
257+
258+
## 5. Per-file install progress
259+
260+
The launcher can receive per-file download progress from the plugin via the `v0.1-update5` extension export `SetPerFileProgressCallback`. This lets the launcher display fine-grained progress for each individual file being downloaded, rather than just the aggregate bytes.
261+
262+
**No extra setup is required.** The export is automatically registered by `SharedStaticV1Ext<T>`. If the launcher supports it, it will call `SetPerFileProgressCallback` with a function pointer after loading the plugin. If the launcher does not support it, the callback is never set and calls to `InvokePerFileProgress` are no-ops.
263+
264+
### Reporting progress from your installer
265+
266+
Call `SharedStaticV1Ext.InvokePerFileProgress` each time you have a new byte count for the current file:
267+
268+
```csharp
269+
using Hi3Helper.Plugin.Core;
270+
271+
// Inside your download loop, after each chunk written:
272+
InvokePerFileProgress(perFileDownloadedBytes, perFileTotalBytes);
273+
```
274+
275+
The helper is null-checked internally — it is always safe to call regardless of whether the launcher has registered a callback.
276+
277+
### `InstallPerFileProgress` struct layout
278+
279+
```
280+
Offset Field Type Description
281+
00–08 PerFileDownloadedBytes long Bytes downloaded so far for this file
282+
08–16 PerFileTotalBytes long Total size of this file in bytes
283+
```
284+
285+
### Launcher-side behaviour
286+
287+
- If the plugin exports `SetPerFileProgressCallback`, Collapse registers its handler on startup and shows per-file progress in the install UI.
288+
- If the plugin **does not** export the callback (i.e. older plugin versions), Collapse falls back to mirroring the aggregate `InstallProgressDelegate` as an approximation of per-file progress.

docs/introduction.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ Plugin.dll (NativeAOT)
3838

3939
## API standard versioning
4040

41-
The current API standard version is **v0.1.4**. All plugins must implement at minimum the **v0.1 core** exports. Optional feature sets are versioned as update packages (`v0.1-update1`, `v0.1-update2`, etc.) and are handled automatically by `SharedStaticV1Ext<T>`.
41+
The current API standard version is **v0.1.5**. All plugins must implement at minimum the **v0.1 core** exports. Optional feature sets are versioned as update packages (`v0.1-update1`, `v0.1-update2`, etc.) and are handled automatically by `SharedStaticV1Ext<T>`.
42+
43+
| Update | Export(s) added | Description |
44+
|--------|----------------|-------------|
45+
| v0.1-update1 | `LaunchGameFromGameManagerAsync`, `IsGameRunning`, `WaitRunningGameAsync`, `KillRunningGame`, `GetPluginUpdateCdnList`, `SetDnsResolverCallbackAsync` | Game launch/runtime management, async DNS resolver, CDN self-update |
46+
| v0.1-update2 | `GetCurrentDiscordPresenceInfo` | Discord Rich Presence |
47+
| v0.1-update3 | `StartResizableWindowHookAsync` | Resizable window hook |
48+
| v0.1-update4 | `RegisterSpeedThrottlerService` | Download speed throttling |
49+
| v0.1-update5 | `SetPerFileProgressCallback` | Per-file install/download progress reporting |
4250

4351
## Next steps
4452

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ _layout: landing
1111
- **Full NativeAOT support** — designed to be compiled with .NET NativeAOT; reflection-free when targeting `MANUALCOM`/`USELIGHTWEIGHTJSONPARSER` configurations
1212
- **COM interop via `System.Runtime.InteropServices.Marshalling`** — no custom COM registration; the launcher discovers everything through a single `GetApiExport` entry point
1313
- **Batteries-included utilities** — pre-configured `HttpClient` builder with automatic proxy and DNS resolver integration, retry-able download streams, speed limiting, and unmanaged memory helpers
14-
- **Versioned extension API** — optional feature sets (`v0.1-update1` through `v0.1-update4`) for game launch, Discord Rich Presence, resizable-window hook, and download throttling are all opt-in
14+
- **Versioned extension API** — optional feature sets (`v0.1-update1` through `v0.1-update5`) for game launch, Discord Rich Presence, resizable-window hook, download throttling, and per-file install progress are all opt-in
1515

1616
## Getting started
1717

0 commit comments

Comments
 (0)