Skip to content

Commit

Permalink
minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
laolarou726 committed Jan 7, 2022
1 parent e647588 commit 2ce4fed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ProjBobcat/ProjBobcat/Class/Helper/DownloadHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class DownloadHelper
/// <summary>
/// 下载线程
/// </summary>
public static int DownloadThread { get; set; }
public static int DownloadThread { get; set; } = 8;

static HttpClient DataClient => HttpClientHelper.GetNewClient(HttpClientHelper.DataClientName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class DefaultResourceCompleter : IResourceCompleter

bool disposedValue;

public int TotalDownloaded { get; set; }
public int NeedToDownload { get; set; }
public int TotalDownloaded { get; private set; }
public int NeedToDownload { get; private set; }

public int DownloadParts { get; set; } = 16;
public int TotalRetry { get; set; }
Expand Down Expand Up @@ -64,8 +64,7 @@ public event EventHandler<DownloadFileCompletedEventArgs> DownloadFileCompletedE
var totalLostFiles = new List<IGameResource>();
foreach (var resolver in ResourceInfoResolvers)
{
var handler = (EventHandler<GameResourceInfoResolveEventArgs>) _listEventDelegates[ResolveEventKey]!;
if (handler != null)
if (_listEventDelegates[ResolveEventKey] is EventHandler<GameResourceInfoResolveEventArgs> handler)
resolver.GameResourceInfoResolveEvent += handler;

var lostFiles = await resolver.ResolveResourceAsync();
Expand Down
4 changes: 2 additions & 2 deletions ProjBobcat/ProjBobcat/Interface/IResourceCompleter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public interface IResourceCompleter : IDisposable
/// </summary>
bool CheckFile { get; set; }

public int TotalDownloaded { get; set; }
public int NeedToDownload { get; set; }
public int TotalDownloaded { get; }
public int NeedToDownload { get; }

/// <summary>
/// 游戏资源解析器集合
Expand Down

0 comments on commit 2ce4fed

Please sign in to comment.