Skip to content

Comments

Fix & Refactor Download Speed Limiter System#859

Open
neon-nyan wants to merge 10 commits intomainfrom
speedlimiter-refactor
Open

Fix & Refactor Download Speed Limiter System#859
neon-nyan wants to merge 10 commits intomainfrom
speedlimiter-refactor

Conversation

@neon-nyan
Copy link
Member

@neon-nyan neon-nyan commented Feb 22, 2026

Main Goal

This PR brings up major changes on Download Speed Limiter System which brings a lot of advantages. We are switching from decentralized design of the feature into a newly unified, centralized service for Data Processing Throttling. We are utilizing our new lightweight, native library called Hi3Helper.Throttle.

There are few changes included within this Pull Request, including:

  • [New] Adding Download Speed Limit Support for Plugin System (for those plugins which have v1-update4 API Standard feature implemented. See more)
  • [Imp] Thread-Safe model await system for multi-threading download mechanism.
  • [Imp] Shared Speed Limit Throttling for each instances. Meaning if 2 download instances are running with 4 MB/s limit, both two instances will be getting 4 MB/s speed limit).
  • [New] Enabling Burst Download Mode to be used alongside Download Speed Limit.

PR Status :

  • Overall Status : Done
  • Commits : Done
  • Synced to base (Collapse:main) : Yes
  • Build status : OK
  • Crashing : No
  • Bug found caused by PR : N/A

Templates

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

+ As per now, due to behavioral changes from this refactor, the Burst Download Mode can now be enabled while Download Speed Limiter is enabled. Even though, this won't affect any performance as the speed download is now limited by the Speed Limiter.
@neon-nyan neon-nyan self-assigned this Feb 22, 2026
@neon-nyan neon-nyan added Enhancement New feature or request Area: Launcher Issue labeled for Launcher update mechanism Priority: Medium Size: Medium labels Feb 22, 2026
@neon-nyan neon-nyan requested a review from a team February 22, 2026 03:35
Copy link
Member

@Cryotechnic Cryotechnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CollapseLauncher/StaticLib/StaticLib.7z.0-23 have 0 bytes size?

Also, see comments, build must pass before merging:

[D:\a\Collapse\Collapse\CollapseLauncher\CollapseLauncher.csproj]
EXEC : fatal error C1900: Il mismatch between 'P1' version '20250730' and 'P2' version '20240319' [D:\a\Collapse\Collapse\CollapseLauncher\CollapseLauncher.csproj]
LINK : fatal error LNK1257: code generation failed [D:\a\Collapse\Collapse\CollapseLauncher\CollapseLauncher.csproj]
D:\a\Collapse\Collapse\.nuget\packages\microsoft.dotnet.ilcompiler\10.0.3\build\Microsoft.NETCore.Native.targets(396,5): error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe" @"obj\x64\Debug\net10.0-windows10.0.26100.0\win-x64\native\link.rsp"" exited with code 1257. [D:\a\Collapse\Collapse\CollapseLauncher\CollapseLauncher.csproj]

Comment on lines +14 to +17
/*
return LauncherConfig.DownloadSpeedLimit > 0 ?
Math.Min(LauncherConfig.DownloadSpeedLimit, speed) :
speed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if not needed

}

// Check if user has permission
bool isUserHasPermission = ConverterTool.IsUserHasPermission(gameFolder);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible null reference argument for parameter 'input' in 'bool ConverterTool.IsUserHasPermission(string input)'.

Comment on lines +170 to +178
protected nint SpeedLimiterServiceContext { get; } = SpeedLimiterService.CreateServiceContext();

public bool IsSophonInUpdateMode { get; protected set; }
protected bool IsAllowExtractCorruptZip { get; set; }

~ProgressBase()
{
SpeedLimiterService.FreeServiceContext(SpeedLimiterServiceContext);
}

This comment was marked as outdated.

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 Enhancement New feature or request Priority: Medium Size: Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants