From 2c05bb0e33f149dd9fe0c952507c4c29137911f3 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 27 Apr 2024 12:42:29 +1000 Subject: [PATCH] Add action build for .NET framework 2.0 --- .github/workflows/build.yml | 25 ++++++++++++++++++- .../Modules/Relay/Discord/DiscordWebsocket.cs | 3 ++- MCGalaxy/Player/Pronouns.cs | 1 - 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb830c1fa..d6d44b21b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,30 @@ concurrency: cancel-in-progress: true jobs: - build-mono: + build-mono2: + if: github.ref_name == github.event.repository.default_branch + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Compile MCGalaxy using mono + shell: bash + id: compile + run: | + msbuild MCGalaxy.sln /p:Configuration=Release /p:TargetFrameworkVersion=v2.0 /p:DefineConstants="NET_20" + + - uses: ./.github/actions/notify_failure + if: ${{ always() && steps.compile.outcome == 'failure' }} + with: + NOTIFY_MESSAGE: 'Failed to compile MCGalaxy .NET 2.0 build' + WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}' + + - uses: ./.github/actions/upload_build + if: ${{ always() && steps.compile.outcome == 'success' }} + with: + SOURCE_FILE: 'bin/Release' + DEST_NAME: 'MCGalaxy_net2.0' + + build-mono4: if: github.ref_name == github.event.repository.default_branch runs-on: ubuntu-latest steps: diff --git a/MCGalaxy/Modules/Relay/Discord/DiscordWebsocket.cs b/MCGalaxy/Modules/Relay/Discord/DiscordWebsocket.cs index 461cdacf9..85e6e7b4d 100644 --- a/MCGalaxy/Modules/Relay/Discord/DiscordWebsocket.cs +++ b/MCGalaxy/Modules/Relay/Discord/DiscordWebsocket.cs @@ -34,6 +34,7 @@ namespace MCGalaxy.Modules.Relay.Discord public int Intents; } public delegate string DiscordGetStatus(); + public delegate void GatewayEventCallback(string eventName, JsonObject data); /// Implements a basic websocket for communicating with Discord's gateway /// https://discord.com/developers/docs/topics/gateway @@ -65,7 +66,7 @@ namespace MCGalaxy.Modules.Relay.Discord /// Callback invoked when a channel created event has been received public Action OnChannelCreate; /// Callback invoked when a gateway event has been received - public Action OnGatewayEvent; + public GatewayEventCallback OnGatewayEvent; readonly object sendLock = new object(); SchedulerTask heartbeat; diff --git a/MCGalaxy/Player/Pronouns.cs b/MCGalaxy/Player/Pronouns.cs index e73c5ebe3..fc91c67fb 100644 --- a/MCGalaxy/Player/Pronouns.cs +++ b/MCGalaxy/Player/Pronouns.cs @@ -19,7 +19,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; using MCGalaxy.Tasks;