diff --git a/.github/workflows/Resonance.yml b/.github/workflows/Resonance.yml deleted file mode 100644 index f918e5e675..0000000000 --- a/.github/workflows/Resonance.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Exiled Resonance CI - -on: - push: - branches: - - apis-rework - pull_request: - branches: - - apis-rework - workflow_dispatch: - -env: - EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Dev.zip - EXILED_REFERENCES_PATH: ${{ github.workspace }}/References - EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Team/EXILED-DLL-Archiver/releases/download/v1.5/EXILED-DLL-Archiver.exe - -jobs: - - build: - - runs-on: windows-latest - # Prevent double running for push & pull_request events from the main repo - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'Exiled-Team/Exiled' - - steps: - - - name: Setup .NET Core SDK - uses: actions/setup-dotnet@v1.7.2 - - - name: Setup Nuget - uses: iRebbok/setup-nuget@master - - - uses: actions/checkout@v2.3.4 - - - name: Get references - shell: pwsh - run: | - Invoke-WebRequest -Uri ${{ env.EXILED_REFERENCES_URL }} -OutFile ${{ github.workspace }}/References.zip - Expand-Archive -Path References.zip -DestinationPath ${{ env.EXILED_REFERENCES_PATH }} - - - name: Build - env: - EXILED_REFERENCES: ${{ env.EXILED_REFERENCES_PATH }} - shell: pwsh - run: | - ./build.ps1 -BuildNuGet - $File = (Get-ChildItem -Path . -Include 'EXILED.*.nupkg' -Recurse).Name - Out-File -FilePath ${{ github.env }} -InputObject "PackageFile=$File" -Encoding utf-8 -Append - - - name: Upload nuget package - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PackageFile }} - path: ${{ env.PackageFile }} - - - name: Get references - shell: pwsh - run: | - Invoke-WebRequest -Uri ${{ env.EXILED_DLL_ARCHIVER_URL }} -OutFile ${{ github.workspace }}/EXILED-DLL-Archiver.exe - - - name: Packaging results as tar.gz - shell: pwsh - run: ./packaging.ps1 - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: Build Result - path: bin/Release/Exiled.tar.gz diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 971e3448bb..fa18bbf143 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Dev.zip + EXILED_REFERENCES_URL: https://cdn.exiled.to/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/References EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e9a2f13935..1fa5a36c6c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,7 +9,7 @@ on: - master env: - EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Master.zip + EXILED_REFERENCES_URL: https://cdn.exiled.to/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/References jobs: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 098d1368d1..d2cfbe44a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ on: - master env: - EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Master.zip + EXILED_REFERENCES_URL: https://cdn.exiled.to/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/References jobs: diff --git a/.github/workflows/push_nuget.yml b/.github/workflows/push_nuget.yml index 4ce9682b17..73a1453b98 100644 --- a/.github/workflows/push_nuget.yml +++ b/.github/workflows/push_nuget.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: env: - EXILED_REFERENCES_URL: https://misaka-zerotwo.github.io/SL-References/Master.zip + EXILED_REFERENCES_URL: https://cdn.exiled.to/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/References jobs: diff --git a/Exiled.CreditTags/Commands/ShowCreditTag.cs b/Exiled.CreditTags/Commands/ShowCreditTag.cs index 9f291492c4..1104d1a88f 100644 --- a/Exiled.CreditTags/Commands/ShowCreditTag.cs +++ b/Exiled.CreditTags/Commands/ShowCreditTag.cs @@ -28,7 +28,7 @@ public class ShowCreditTag : ICommand /// public string Description { get; } = "Shows your EXILED Credits tag, if available."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Config/Merge.cs b/Exiled.Events/Commands/Config/Merge.cs index afa0718f17..0a29f27600 100644 --- a/Exiled.Events/Commands/Config/Merge.cs +++ b/Exiled.Events/Commands/Config/Merge.cs @@ -36,7 +36,7 @@ public class Merge : ICommand /// public string Description { get; } = "Merges your configs into the default config distribution."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Config/Split.cs b/Exiled.Events/Commands/Config/Split.cs index 3eea472fa2..cb855e394e 100644 --- a/Exiled.Events/Commands/Config/Split.cs +++ b/Exiled.Events/Commands/Config/Split.cs @@ -36,7 +36,7 @@ public class Split : ICommand /// public string Description { get; } = "Splits your configs into the separated config distribution."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/ConfigValue/Get.cs b/Exiled.Events/Commands/ConfigValue/Get.cs index 639f044e6b..d010fa7751 100644 --- a/Exiled.Events/Commands/ConfigValue/Get.cs +++ b/Exiled.Events/Commands/ConfigValue/Get.cs @@ -36,7 +36,7 @@ public class Get : ICommand /// public string Description { get; } = "Gets a config value"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/ConfigValue/Set.cs b/Exiled.Events/Commands/ConfigValue/Set.cs index e0bc489de9..fe7b7896fd 100644 --- a/Exiled.Events/Commands/ConfigValue/Set.cs +++ b/Exiled.Events/Commands/ConfigValue/Set.cs @@ -39,7 +39,7 @@ public class Set : ICommand /// public string Description { get; } = "Sets a config value"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/PluginManager/Disable.cs b/Exiled.Events/Commands/PluginManager/Disable.cs index d8f8c04609..8a67c11059 100644 --- a/Exiled.Events/Commands/PluginManager/Disable.cs +++ b/Exiled.Events/Commands/PluginManager/Disable.cs @@ -33,7 +33,7 @@ public sealed class Disable : ICommand, IPermissioned /// public string Description { get; } = "Disable a plugin."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/PluginManager/DisplaySubscribed.cs b/Exiled.Events/Commands/PluginManager/DisplaySubscribed.cs index f9fdfc465f..465018a05d 100644 --- a/Exiled.Events/Commands/PluginManager/DisplaySubscribed.cs +++ b/Exiled.Events/Commands/PluginManager/DisplaySubscribed.cs @@ -35,7 +35,7 @@ public class DisplaySubscribed : IPermissioned, ICommand /// public string Description { get; } = "Displays plugins that are subscribed to the event."; - /// + /// public bool SanitizeResponse { get; } = true; /// diff --git a/Exiled.Events/Commands/PluginManager/Enable.cs b/Exiled.Events/Commands/PluginManager/Enable.cs index 2e935d8955..2b2f9a8567 100644 --- a/Exiled.Events/Commands/PluginManager/Enable.cs +++ b/Exiled.Events/Commands/PluginManager/Enable.cs @@ -37,7 +37,7 @@ public sealed class Enable : ICommand, IPermissioned /// public string Description { get; } = "Enable a plugin"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/PluginManager/Install.cs b/Exiled.Events/Commands/PluginManager/Install.cs index 641be491b7..a2b0951b32 100644 --- a/Exiled.Events/Commands/PluginManager/Install.cs +++ b/Exiled.Events/Commands/PluginManager/Install.cs @@ -42,7 +42,7 @@ public class Install : ICommand /// public string Description { get; } = "Installs a plugin"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/PluginManager/Patches.cs b/Exiled.Events/Commands/PluginManager/Patches.cs index c4c09ce66e..74f0415c69 100644 --- a/Exiled.Events/Commands/PluginManager/Patches.cs +++ b/Exiled.Events/Commands/PluginManager/Patches.cs @@ -40,7 +40,7 @@ public sealed class Patches : ICommand, IPermissioned /// public string Description { get; } = "Returns information about all patches (whether they are patched or not)"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/PluginManager/Plugins.cs b/Exiled.Events/Commands/PluginManager/Plugins.cs index 049c00ed0c..197a9b52dc 100644 --- a/Exiled.Events/Commands/PluginManager/Plugins.cs +++ b/Exiled.Events/Commands/PluginManager/Plugins.cs @@ -37,7 +37,7 @@ public class Plugins : IPermissioned, ICommand /// public string Description { get; } = "Gets a list of all verified plugins."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/PluginManager/Show.cs b/Exiled.Events/Commands/PluginManager/Show.cs index 34d250c886..20bb13eb6e 100644 --- a/Exiled.Events/Commands/PluginManager/Show.cs +++ b/Exiled.Events/Commands/PluginManager/Show.cs @@ -36,7 +36,7 @@ public sealed class Show : ICommand, IPermissioned /// public string Description { get; } = "Get all plugins, names, authors and versions"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Reload/All.cs b/Exiled.Events/Commands/Reload/All.cs index 766766edc7..a53181c7bb 100644 --- a/Exiled.Events/Commands/Reload/All.cs +++ b/Exiled.Events/Commands/Reload/All.cs @@ -30,7 +30,7 @@ public class All : ICommand /// public string Description { get; } = "Reload all configs and plugins."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Reload/Configs.cs b/Exiled.Events/Commands/Reload/Configs.cs index 0300d4524d..51c9a21994 100644 --- a/Exiled.Events/Commands/Reload/Configs.cs +++ b/Exiled.Events/Commands/Reload/Configs.cs @@ -36,7 +36,7 @@ public class Configs : ICommand, IPermissioned /// public string Description { get; } = "Reload plugin configs."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Reload/GamePlay.cs b/Exiled.Events/Commands/Reload/GamePlay.cs index efe10873d7..bb3f64b1ae 100644 --- a/Exiled.Events/Commands/Reload/GamePlay.cs +++ b/Exiled.Events/Commands/Reload/GamePlay.cs @@ -34,7 +34,7 @@ public class GamePlay : ICommand, IPermissioned /// public string Description { get; } = "Reloads gameplay configs."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Reload/Permissions.cs b/Exiled.Events/Commands/Reload/Permissions.cs index 5826d7f9f5..664292ea2b 100644 --- a/Exiled.Events/Commands/Reload/Permissions.cs +++ b/Exiled.Events/Commands/Reload/Permissions.cs @@ -33,7 +33,7 @@ public class Permissions : ICommand, IPermissioned /// public string Description { get; } = "Reload permissions."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Reload/Plugins.cs b/Exiled.Events/Commands/Reload/Plugins.cs index 2c72e98a79..61b31b7f6a 100644 --- a/Exiled.Events/Commands/Reload/Plugins.cs +++ b/Exiled.Events/Commands/Reload/Plugins.cs @@ -34,7 +34,7 @@ public class Plugins : ICommand, IPermissioned /// public string Description { get; } = "Reloads all plugins."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Reload/RemoteAdmin.cs b/Exiled.Events/Commands/Reload/RemoteAdmin.cs index bb60f448b9..ca28e32918 100644 --- a/Exiled.Events/Commands/Reload/RemoteAdmin.cs +++ b/Exiled.Events/Commands/Reload/RemoteAdmin.cs @@ -33,7 +33,7 @@ public class RemoteAdmin : ICommand, IPermissioned /// public string Description { get; } = "Reloads remote admin configs."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/Reload/Translations.cs b/Exiled.Events/Commands/Reload/Translations.cs index 52d6617f50..844c741c08 100644 --- a/Exiled.Events/Commands/Reload/Translations.cs +++ b/Exiled.Events/Commands/Reload/Translations.cs @@ -36,7 +36,7 @@ public class Translations : ICommand, IPermissioned /// public string Description { get; } = "Reload plugin translations."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Events/Commands/TpsCommand.cs b/Exiled.Events/Commands/TpsCommand.cs index 08bf0ac3e0..4465bd96b0 100644 --- a/Exiled.Events/Commands/TpsCommand.cs +++ b/Exiled.Events/Commands/TpsCommand.cs @@ -28,7 +28,7 @@ public class TpsCommand : ICommand /// public string Description { get; } = "Shows the current TPS."; - /// + /// public bool SanitizeResponse { get; } = false; /// diff --git a/Exiled.Events/EventArgs/Warhead/SurfaceButtonInteractEventArgs.cs b/Exiled.Events/EventArgs/Warhead/SurfaceButtonInteractEventArgs.cs deleted file mode 100644 index 7f47e621b1..0000000000 --- a/Exiled.Events/EventArgs/Warhead/SurfaceButtonInteractEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.EventArgs.Warhead -{ - using API.Features; - using Interfaces; - - /// - /// Contains all information before a player interacts with the Warhead button in surface. - /// - public class SurfaceButtonInteractEventArgs : IPlayerEvent, IDeniableEvent - { - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// - /// - public SurfaceButtonInteractEventArgs(Player player, bool isAllowed = true) - { - Player = player; - IsAllowed = isAllowed; - } - - /// - public bool IsAllowed { get; set; } - - /// - /// Gets the player who's interacting with the Warhead button in surface. - /// - public Player Player { get; } - } -} diff --git a/Exiled.Events/Handlers/Warhead.cs b/Exiled.Events/Handlers/Warhead.cs index 9416a5c607..a0d2423440 100644 --- a/Exiled.Events/Handlers/Warhead.cs +++ b/Exiled.Events/Handlers/Warhead.cs @@ -42,11 +42,6 @@ public class Warhead /// public static Event Detonating { get; set; } = new(); - /// - /// Invoked before player interacting with the warhead button in surface. - /// - public static Event SurfaceButtonInteract { get; set; } = new(); - /// /// Called before stopping the warhead. /// @@ -75,11 +70,5 @@ public class Warhead /// /// The instance. public static void OnDetonating(DetonatingEventArgs ev) => Detonating.InvokeSafely(ev); - - /// - /// Called before interacting the warhead button in surface. - /// - /// The instance. - public static void OnSurfaceButtonInteract(SurfaceButtonInteractEventArgs ev) => SurfaceButtonInteract.InvokeSafely(ev); } -} \ No newline at end of file +} diff --git a/Exiled.Events/Patches/Events/Warhead/SurfaceButtonInteract.cs b/Exiled.Events/Patches/Events/Warhead/SurfaceButtonInteract.cs deleted file mode 100644 index 4ee89d2d5c..0000000000 --- a/Exiled.Events/Patches/Events/Warhead/SurfaceButtonInteract.cs +++ /dev/null @@ -1,79 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Events.Warhead -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using API.Features; - using API.Features.Core.Generic.Pools; - using Exiled.Events.Attributes; - using Exiled.Events.EventArgs.Warhead; - - using HarmonyLib; - - using static HarmonyLib.AccessTools; - - using Warhead = Handlers.Warhead; - - /// - /// Patches . - /// Adds the event. - /// - [EventPatch(typeof(Warhead), nameof(Warhead.SurfaceButtonInteract))] - [HarmonyPatch(typeof(PlayerInteract), nameof(PlayerInteract.UserCode_CmdSwitchAWButton))] - internal static class SurfaceButtonInteract - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - int index = newInstructions.FindIndex(instruction => instruction.LoadsField(Field(typeof(AlphaWarheadOutsitePanel), nameof(AlphaWarheadOutsitePanel.keycardEntered)))) + 3; - - Label thisFunctionLabel = generator.DefineLabel(); - - // SurfaceButtonInteractEventArgs ev = new SurfaceButtonInteractEventArgs(Player.Get(PlayerInteract._hub), bool) - // Warhead.OnSurfaceButtonInteract(ev) - // if (!ev.IsAllowed) - // return; - newInstructions.InsertRange( - index, - new[] - { - new CodeInstruction(OpCodes.Ldarg_0).MoveLabelsFrom(newInstructions[index]), - - // PlayerInteract._hub - new CodeInstruction(OpCodes.Ldfld, Field(typeof(PlayerInteract), nameof(PlayerInteract._hub))), - - // Player.Get(PlayerInteract._hub) - new CodeInstruction(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - - new CodeInstruction(OpCodes.Ldc_I4_1), - - // new ButtonInteractEventArgs(Player.Get(PlayerInteract._hub), bool) - new CodeInstruction(OpCodes.Newobj, GetDeclaredConstructors(typeof(SurfaceButtonInteractEventArgs))[0]), - new CodeInstruction(OpCodes.Dup), - - // Warhead.OnSurfaceButtonInteract(ev) - new CodeInstruction(OpCodes.Call, Method(typeof(Warhead), nameof(Warhead.OnSurfaceButtonInteract))), - new CodeInstruction(OpCodes.Callvirt, PropertyGetter(typeof(SurfaceButtonInteractEventArgs), nameof(SurfaceButtonInteractEventArgs.IsAllowed))), - - // if (!ev.IsAllowed) - // return; - new(OpCodes.Brfalse_S, thisFunctionLabel), - }); - - newInstructions[newInstructions.Count - 1].labels.Add(thisFunctionLabel); - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} diff --git a/Exiled.Example/Commands/ParentCommandExample.cs b/Exiled.Example/Commands/ParentCommandExample.cs index 983ea4f5a7..a33c8df347 100644 --- a/Exiled.Example/Commands/ParentCommandExample.cs +++ b/Exiled.Example/Commands/ParentCommandExample.cs @@ -76,7 +76,7 @@ public class ParentTest : ICommand /// public string Description { get; } = "YOUR DESC"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Example/Commands/Test.cs b/Exiled.Example/Commands/Test.cs index f4cf7eeb45..c8be0a3af2 100644 --- a/Exiled.Example/Commands/Test.cs +++ b/Exiled.Example/Commands/Test.cs @@ -29,7 +29,7 @@ public class Test : ICommand /// public string Description { get; } = "A simple test command."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Permissions/Commands/Permissions/Add.cs b/Exiled.Permissions/Commands/Permissions/Add.cs index 3a8b0848b1..afb95fefc2 100644 --- a/Exiled.Permissions/Commands/Permissions/Add.cs +++ b/Exiled.Permissions/Commands/Permissions/Add.cs @@ -27,7 +27,7 @@ public class Add : ICommand /// public string Description { get; } = "Adds a permission to a group"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Permissions/Commands/Permissions/Group/Add.cs b/Exiled.Permissions/Commands/Permissions/Group/Add.cs index bbb1f13576..a3aac95b95 100644 --- a/Exiled.Permissions/Commands/Permissions/Group/Add.cs +++ b/Exiled.Permissions/Commands/Permissions/Group/Add.cs @@ -27,7 +27,7 @@ public class Add : ICommand /// public string Description { get; } = "Adds a group to a permission."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Permissions/Commands/Permissions/Group/Remove.cs b/Exiled.Permissions/Commands/Permissions/Group/Remove.cs index aedf04a1eb..3ea1077e60 100644 --- a/Exiled.Permissions/Commands/Permissions/Group/Remove.cs +++ b/Exiled.Permissions/Commands/Permissions/Group/Remove.cs @@ -27,7 +27,7 @@ public class Remove : ICommand /// public string Description { get; } = "Removes a group from permission."; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Permissions/Commands/Permissions/Reload.cs b/Exiled.Permissions/Commands/Permissions/Reload.cs index be571984cf..4f203f8468 100644 --- a/Exiled.Permissions/Commands/Permissions/Reload.cs +++ b/Exiled.Permissions/Commands/Permissions/Reload.cs @@ -27,7 +27,7 @@ public class Reload : ICommand /// public string Description { get; } = "Reloads all permissions"; - /// + /// public bool SanitizeResponse { get; } /// diff --git a/Exiled.Permissions/Commands/Permissions/Remove.cs b/Exiled.Permissions/Commands/Permissions/Remove.cs index 14bc4f6887..d249f4b8f3 100644 --- a/Exiled.Permissions/Commands/Permissions/Remove.cs +++ b/Exiled.Permissions/Commands/Permissions/Remove.cs @@ -27,7 +27,7 @@ public class Remove : ICommand /// public string Description { get; } = "Adds a permission to a group"; - /// + /// public bool SanitizeResponse { get; } ///