BuIlDaLiBlE / BetterHI3Launcher

A much better Honkai Impact 3rd launcher.
The Unlicense
105 stars 19 forks source link

Implementation of LogAdapter and Update on PartialHttpClient #48

Closed neon-nyan closed 2 years ago

neon-nyan commented 2 years ago

Pull Request Overview

This Pull Request introduces LogAdapter class for writing log on class outside of MainWindow, so displaying it in to both Console (Debug only) and LogBox on MainWindow is possible.

This also adding a latest changes on PartialHttpClient to add retry-able download per thread to avoid thread-lock if network problem is happening. The default retry count is 5 times and retry delay is 1 second. To adjust it, define the class with this format:

/*
* max_retrycount : Maximum count of retries for downloading (default: 5).
* retry_delaysec : Delay for each retry in second (default: 1).
*/
DownloadParallelAdapter parallelDownload = new DownloadParallelAdapter(false, max_retrycount, retry_delaysec);

Major Changes

Minor Changes

Changes In Action

image

The left log window and right log console have the same output while at the same time, PartialHttpClient is retrying a failed download at one of the thread while network problem has occured