Skip to content

Commit 62c7be0

Browse files
authored
Merge pull request #145 from patchkit-net/RepairCost
Increasing repair cost
2 parents c0fc29b + 4a025c5 commit 62c7be0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Assets/PatchKit Patcher/Scripts/AppUpdater/AppRepairer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public class AppRepairer
3232

3333
private int _lowestVersionWithContentId;
3434

35+
private const double IncreaseRepairCost = 1.5d;
36+
3537

3638
public AppRepairer(AppUpdaterContext context, UpdaterStatus status)
3739
{
@@ -108,6 +110,9 @@ AppContentSummary latestVersionContentSummary
108110
: installedVersionContentSummary.Files.Sum(f => f.Size);
109111

110112
double repairCost = CalculateRepairCost(installedVersionContentSummary, filesNeedFixing);
113+
114+
// increasing repair costs that reinstallation will be done for 1/3 of the content size
115+
repairCost *= IncreaseRepairCost;
111116

112117

113118
if (_lowestVersionWithContentId > installedVersionId)

0 commit comments

Comments
 (0)