Skip to content

Commit

Permalink
Try UA4 again
Browse files Browse the repository at this point in the history
  • Loading branch information
Pythonic-Rainbow committed Feb 6, 2024
1 parent cfe31ac commit b648d5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Build
run: dotnet publish -c Release -r linux-arm64 --no-self-contained
- name: Upload program
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Bot
path: |
Expand Down
4 changes: 2 additions & 2 deletions Bot/Clash/ClanUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ internal static ClanUtil FromInit(Clan clan)

internal static ClanUtil FromPoll(Clan clan)
{
ClanUtil c = new(clan, new(Coc.s_clan._members));
ClanUtil c = new(clan, new(Coc.Clan._members));

Check notice on line 47 in Bot/Clash/ClanUtil.cs

View workflow job for this annotation

GitHub Actions / inspect

"[ArrangeObjectCreationWhenTypeNotEvident] Missing type specification" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Clash/ClanUtil.cs(47,1474)
foreach (ClanMember member in clan.MemberList!)
{
c._members[member.Tag] = member;
if (Coc.s_clan.HasMember(member))
if (Coc.Clan.HasMember(member))
{
c._existingMembers[member.Tag] = member;
c._leavingMembers.Remove(member.Tag);
Expand Down
12 changes: 6 additions & 6 deletions Bot/Clash/Coc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal static class Coc
private const string ClanId = "#2QU2UCJJC"; // 2G8LP8PVV
private static readonly ClashOfClansClient s_client = new(Secrets.s_coc);
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
internal static ClanUtil s_clan;// { get; private set; }
internal static ClanUtil Clan { get; private set; }
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

private static void CheckMembersJoined(ClanUtil clan)
Expand Down Expand Up @@ -97,7 +97,7 @@ private static async Task PollAsync()
await Task.WhenAll([
CheckDonationsAsync(clanUtil),

Check notice on line 98 in Bot/Clash/Coc.cs

View workflow job for this annotation

GitHub Actions / inspect

"[ArrangeTrailingCommaInMultilineLists] Remove trailing comma to conform to code style" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Clash/Coc.cs(98,2873)
]);
s_clan = clanUtil;
Clan = clanUtil;
}

private static async Task CheckDonationsAsync(ClanUtil clan)
Expand All @@ -106,7 +106,7 @@ private static async Task CheckDonationsAsync(ClanUtil clan)
foreach (string tag in clan._existingMembers.Keys)
{
ClanMember current = clan._members[tag];
ClanMember previous = s_clan._members[tag];
ClanMember previous = Clan._members[tag];
if (current.Donations > previous.Donations || current.DonationsReceived > previous.DonationsReceived)
{
donDelta[current.Tag] = new(current.Donations - previous.Donations, current.DonationsReceived - previous.DonationsReceived);

Check notice on line 112 in Bot/Clash/Coc.cs

View workflow job for this annotation

GitHub Actions / inspect

"[ArrangeObjectCreationWhenTypeNotEvident] Missing type specification" on /home/runner/work/Hyperstellar/Hyperstellar/Bot/Clash/Coc.cs(112,3391)
Expand Down Expand Up @@ -170,13 +170,13 @@ private static async Task CheckDonationsAsync(ClanUtil clan)

internal static string? GetMemberId(string name)
{
ClanMember? result = s_clan._clan.MemberList!.FirstOrDefault(m => m.Name == name);
ClanMember? result = Clan._clan.MemberList!.FirstOrDefault(m => m.Name == name);
return result?.Tag;
}

internal static ClanMember GetMember(string id) => s_clan._members[id];
internal static ClanMember GetMember(string id) => Clan._members[id];

internal static async Task InitAsync() => s_clan = ClanUtil.FromInit(await GetClanAsync());
internal static async Task InitAsync() => Clan = ClanUtil.FromInit(await GetClanAsync());

internal static async Task BotReadyAsync()
{
Expand Down

0 comments on commit b648d5d

Please sign in to comment.