CmlLib
한국어 (v3)
한국어 (v3)
  • 🧊CmlLib Projects
  • [AD] 커스텀 런처 주문제작
  • 🚀CmlLib.Core
    • 홈
    • 시작하기
      • CMLauncher
      • 게임 경로 설정
      • 실행 옵션 설정
      • 이벤트 처리
    • 로그인과 세션
      • 마이크로소프트 엑스박스 계정
      • 예전 모장 계정
      • 오프라인 계정
    • 고급 기능
      • VersionLoader
      • Version
      • FileChecker
      • Downloader
    • 모드 로더 인스톨러
      • Forge Installer
      • Fabric Installer
      • LiteLoader Installer
    • 유틸리티
      • Minecraft Changelogs
    • 자료
      • 자주 묻는 질문
      • 알려진 문제
      • 예시 런처
      • 라이센스
  • 🔓Auth.Microsoft
    • 홈
    • CmlLib.Core.Auth.Microsoft
      • JELoginHandler
      • JELoginHandlerBuilder
      • JEAuthenticator
    • XboxAuthNet.Game
      • OAuth
      • XboxAuth
      • XboxAuthException
      • AccountManager
      • Accounts
    • XboxAuthNet.Game.Msal
      • ClientID
      • MsalClientHelper
      • OAuth
    • CmlLib.Core.Bedrock.Auth
    • 자료
  • 🌐MojangAPI
    • 홈
    • Mojang API
    • SecurityQuestion
  • ⚒️Installer.Forge
    • 홈
    • 지원되는 버전
    • 시작하기
    • MForge
    • ForgeVersionLoader
Powered by GitBook
On this page
  • IDownloader
  • SequenceDownloader
  • AsyncParallelDownloader
  • Constructors
  • Example
  • Make custom downloader
  • DownloadFile class
  • Properties
  • Methods
Edit on GitHub
  1. CmlLib.Core
  2. 고급 기능

Downloader

Download game files

Downloaders should inherit IDownloader class. Currently, there are only two downloader, SequenceDownloader and AsyncParallelDownloader. AsyncParallelDownloader is default downloader.

IDownloader

public event DownloadFileChangedHandler ChangeFile;

When the file being downloaded changes. See 이벤트 처리.

public event ProgressChangedEventHandler ChangeProgress;

When the progress of the file currently being downloaded changes. See 이벤트 처리.

public Task DownloadFiles(DownloadFile[] files);

Download all files.

SequenceDownloader

Download files sequentially.

AsyncParallelDownloader

Download files in parallel. In this class, The progress of ChangeProgress means (received bytes) / (the sum of the byte sizes of All files to download) * 100

Constructors

public AsyncParallelDownloader()

Same as new AsyncParallelDownloader(10)

public AsyncParallelDownloader(int parallelism)

Limit the max number of parallelism.

Example

var launcher = new CMLauncher(new MinecraftPath());

// Use SequenceDownloader
launcher.Downloader = new SequenceDownloader();

// Use AsyncParallelDownloader with limiting max parallelism number to 5
launcher.Downloader = new AsyncParallelDownloader(5);

Make custom downloader

Make implementation of IDownloader.

DownloadFile class

Represent file that requires to be downloaded.

Properties

Type

Type: MFile 이벤트 처리

Name

Type: string

Path

Type: string

Url

Type: string

Size

Type: long

AfterDownload

Type: Func<Task>[]

The list of work to do after download was completed.

Methods

Equals(object obj)

Return true if Path property is same.

PreviousFileCheckerNext모드 로더 인스톨러

Last updated 1 year ago

🚀