diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index fda73e9..9e062df 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -2,9 +2,9 @@ name: .NET on: push: - branches: [ "master", "dev" ] + branches: [ "master", "dev", "dev2" ] pull_request: - branches: [ "master", "dev" ] + branches: [ "master", "dev", "dev2" ] env: DEPOT_DOWNLOADER_VERSION: 2.4.7 @@ -32,7 +32,7 @@ jobs: shell: pwsh run: | New-Item -ItemType Directory -Force -Path D:\a\NwPluginAPI\SCPSL_REFERENCES - Start-Process -NoNewWindow -Wait -FilePath "D:\a\NwPluginAPI\DepotDownloader\DepotDownloader.exe" -WorkingDirectory "D:\a\NwPluginAPI\DepotDownloader" -ArgumentList '-app 996560','-beta plugin-api','-betapassword ${{ secrets.BRANCHPASSWORD }}','-dir D:\a\NwPluginAPI\SCPSL_REFERENCES','-filelist "${{ github.workspace }}\download-files.txt"' + Start-Process -NoNewWindow -Wait -FilePath "D:\a\NwPluginAPI\DepotDownloader\DepotDownloader.exe" -WorkingDirectory "D:\a\NwPluginAPI\DepotDownloader" -ArgumentList '-app 996560','-beta nightly','-betapassword ${{ secrets.NIGHTLYPASSWORD }}','-dir D:\a\NwPluginAPI\SCPSL_REFERENCES','-filelist "${{ github.workspace }}\download-files.txt"' - name: Restore dependencies run: dotnet restore - name: Build diff --git a/NwPluginAPI/Core/Player.cs b/NwPluginAPI/Core/Player.cs index 81fb5bb..1457868 100644 --- a/NwPluginAPI/Core/Player.cs +++ b/NwPluginAPI/Core/Player.cs @@ -406,15 +406,6 @@ public string CustomInfo set => ReferenceHub.nicknameSync.CustomPlayerInfo = value; } - /// - /// Gets or sets player current unit. - /// - public string CurrentUnit - { - get => ReferenceHub.characterClassManager.CurUnitName; - set => ReferenceHub.characterClassManager.CurUnitName = value; - } - /// /// Gets or sets player current health; /// diff --git a/NwPluginAPI/Events/EventManager.cs b/NwPluginAPI/Events/EventManager.cs index 5468e5f..692c796 100644 --- a/NwPluginAPI/Events/EventManager.cs +++ b/NwPluginAPI/Events/EventManager.cs @@ -361,7 +361,12 @@ public static T ExecuteEvent(ServerEventType type, params object[] args) wher bool isBool = typeof(T) == typeof(bool); bool cancelled = false; - T cancellation = default; + + T cancellation; + + if (isBool) + cancellation = (T)(object)true; + else cancellation = default; foreach(var plugin in ev.Invokers.Values) { @@ -384,17 +389,20 @@ public static T ExecuteEvent(ServerEventType type, params object[] args) wher continue; } - if (result is null) + if (cancelled || result is null) continue; if (isBool) { if (result is bool b && b) - cancellation = (T)result; + continue; + + cancellation = (T)result; + cancelled = true; } else if (result is T r) { - if (cancelled || !(r is IEventCancellation ecd) || !ecd.IsCancelled) + if (!(r is IEventCancellation ecd) || !ecd.IsCancelled) continue; cancellation = r; diff --git a/NwPluginAPI/NwPluginAPI.csproj b/NwPluginAPI/NwPluginAPI.csproj index f87246e..c60640d 100644 --- a/NwPluginAPI/NwPluginAPI.csproj +++ b/NwPluginAPI/NwPluginAPI.csproj @@ -13,29 +13,38 @@ False - PluginAPI - 1.0.0 - Northwood Studio + Northwood.PluginAPI + Northwood Studios Northwood Studio PluginAPI - Plugin API for SCP: Secret Laboratory made by Northwood Studios. - github.com/northwood-studios/NwPluginAPI + Official server-side plugin system for SCP: Secret Laboratory game. + https://github.com/northwood-studios/NwPluginAPI Resources\nw_logo.jpg README.md - github.com/northwood-studios/NwPluginAPI + https://github.com/northwood-studios/NwPluginAPI git pluginapi,scpsl en - 1.0.0 - 1.0.0 LICENSE True + true + Northwood.PluginAPI + Copyright by Hubert Moszka Northwood, 2022 + 12.0.0-beta2 + + + + + false + false + false + diff --git a/NwPluginAPI/PluginApiVersion.cs b/NwPluginAPI/PluginApiVersion.cs new file mode 100644 index 0000000..0352f88 --- /dev/null +++ b/NwPluginAPI/PluginApiVersion.cs @@ -0,0 +1,10 @@ +namespace PluginAPI +{ + internal static class PluginApiVersion + { + internal const string Version = "12.0.0"; //major.minor.patch ONLY + internal const string VersionString = "12.0.0-beta2"; + + //PackageVersion needs to be set to the same value as VersionString MANUALLY IN .csproj + } +} \ No newline at end of file diff --git a/NwPluginAPI/Properties/VersionInfo.cs b/NwPluginAPI/Properties/VersionInfo.cs new file mode 100644 index 0000000..ac892c3 --- /dev/null +++ b/NwPluginAPI/Properties/VersionInfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; + +[assembly: AssemblyInformationalVersion(PluginAPI.PluginApiVersion.VersionString)] +[assembly: AssemblyFileVersion(PluginAPI.PluginApiVersion.VersionString)] +[assembly: AssemblyVersion(PluginAPI.PluginApiVersion.Version)]