Skip to content

Commit 49d9361

Browse files
authored
Merge pull request #65 from Erol444/github_fix
Fixed check attack spamming in TTwars, fixed github error
2 parents 4f47ab6 + 5d6eba9 commit 49d9361

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

TbsCore/Helpers/GithubHelper.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ public static async Task<Version> CheckGitHubLatestVersion()
2020
var latest = await client.Repository.Release.GetLatest(username, repo);
2121
if (latest != null) return new Version(latest.TagName);
2222
}
23-
catch (Octokit.NotFoundException)
23+
catch
2424
{
2525
}
26-
2726
return null;
2827
}
2928

@@ -35,10 +34,9 @@ public static async Task<Version> CheckGitHublatestBuild()
3534
var releases = await client.Repository.Release.GetAll(username, repo);
3635
if (releases.Count > 0) return new Version(releases[0].TagName);
3736
}
38-
catch (Octokit.NotFoundException)
37+
catch
3938
{
4039
}
41-
4240
return null;
4341
}
4442
}

TbsCore/Tasks/LowLevel/CheckAttacks.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ private TaskRes CheckCompleted(Account acc, List<TroopsMovementRallyPoint> attac
123123

124124
Vill.TroopMovements.IncomingAttacks.AddRange(attacks);
125125
// Next check for new attacks should be in:
126-
// - 1x speed = 20 min
127-
// - 3x speed = 6:40 min
128-
// - 5x speed = 4 min
129-
this.NextExecute = DateTime.Now.AddMinutes(20 / acc.AccInfo.ServerSpeed);
126+
// - 1x speed = 30 min
127+
// - 3x speed = 10 min
128+
// - 5x speed = 6 min
129+
var nextCheckMin = 30 / acc.AccInfo.ServerSpeed;
130+
this.NextExecute = DateTime.Now.AddMinutes(Math.Max(nextCheckMin, 2)); // For TTWars
130131

131132
return TaskRes.Executed;
132133
}

0 commit comments

Comments
 (0)