Skip to content

Commit c4e9f0e

Browse files
committed
CCPackageDownloadManager will allow to resume paused package downloads when enqueue is used.
A failed package download will start over when used with enqueue.
1 parent 2983112 commit c4e9f0e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cocos2d/CCPackageDownloadManager.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,23 @@ - (void)setDownloadPath:(NSString *)downloadPath
6060

6161
- (void)enqueuePackageForDownload:(CCPackage *)package
6262
{
63+
if (package.status == CCPackageStatusDownloadPaused)
64+
{
65+
[self resumeDownloadOfPackage:package];
66+
return;
67+
}
68+
6369
if ([self packageDownloadForPackage:package])
6470
{
6571
return;
6672
}
6773

74+
if (!(package.status == CCPackageStatusDownloadFailed
75+
|| package.status == CCPackageStatusInitial))
76+
{
77+
return;
78+
}
79+
6880
NSString *fileName = [[package standardIdentifier] stringByAppendingPathExtension:@"zip"];
6981

7082
CCPackageDownload *packageDownload = [[CCPackageDownload alloc] initWithPackage:package

0 commit comments

Comments
 (0)