Skip to content
This repository was archived by the owner on Jun 21, 2025. It is now read-only.

Commit 2749a86

Browse files
Killers0992ced777ricSrLicht-1
authored
13.1.x (#226)
* Update * Roles * Progress on 13.0.0 changes * Update * Update 17.04 * Update * Fix * Docs update * Update * Update Changes * Update template, fixes. * Fixes * Fix * Add ReserverdSlots.cs Whitelist.cs * Seperate events into folders. * Remove not used usings * Final changes * Debug logs... * Master changes * Update template plugin to properly reflect eventargs * Update ItemPickup to reflect 13.1 changes Increment version * Resolving issue 203 (#204) resolves #203 * Revert "Resolving issue 203 (#204)" This reverts commit 32e4e07. * IsOffline (#207) * Update package version * bump version remove heavily modded field due to removal from basegame * bump packageversion for nuget * Update dotnet.yml * Update dotnet.yml * Update download-files.txt * 13.3.0 compatability * update packageversion to reflect pluginapi version --------- Co-authored-by: ced777ric <ced777ric@cedmod.nl> Co-authored-by: SrLicht <francoquiroz_13@live.com> Co-authored-by: ced777ric <44529860+ced777ric@users.noreply.github.com>
1 parent f30a546 commit 2749a86

460 files changed

Lines changed: 119065 additions & 3620 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dotnet.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ "master", "dev", "dev2" ]
88

99
env:
10-
DEPOT_DOWNLOADER_VERSION: 2.4.7
10+
DEPOT_DOWNLOADER_VERSION: 2.5.0
1111
SL_REFERENCES: D:\a\NwPluginAPI\SCPSL_REFERENCES\SCPSL_Data\Managed
1212
UNITY_REFERENCES: D:\a\NwPluginAPI\SCPSL_REFERENCES\SCPSL_Data\Managed
1313

@@ -32,7 +32,7 @@ jobs:
3232
shell: pwsh
3333
run: |
3434
New-Item -ItemType Directory -Force -Path D:\a\NwPluginAPI\SCPSL_REFERENCES
35-
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"'
35+
Start-Process -NoNewWindow -Wait -FilePath "D:\a\NwPluginAPI\DepotDownloader\DepotDownloader.exe" -WorkingDirectory "D:\a\NwPluginAPI\DepotDownloader" -ArgumentList '-app 996560','-dir D:\a\NwPluginAPI\SCPSL_REFERENCES','-filelist "${{ github.workspace }}\download-files.txt"'
3636
- name: Restore dependencies
3737
run: dotnet restore
3838
- name: Build
@@ -41,4 +41,4 @@ jobs:
4141
uses: actions/upload-artifact@v3
4242
with:
4343
name: PluginAPI
44-
path: ${{ github.workspace }}/NwPluginAPI/bin/Release/net48/PluginAPI.dll
44+
path: ${{ github.workspace }}/NwPluginAPI/bin/Release/net48/PluginAPI.dll

Analyzers/NWPluginAPI.Analyzers/NWPluginAPIAnalyzersAnalyzer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Microsoft.CodeAnalysis;
22
using Microsoft.CodeAnalysis.Diagnostics;
33
using NWPluginAPI.Analyzers.Enums;
4-
using System;
54
using System.Collections.Generic;
65
using System.Collections.Immutable;
76
using System.Linq;

Analyzers/NWPluginAPI.Analyzers/NWPluginAPIAnalyzersCodeFixProvider.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
using Microsoft.CodeAnalysis.CodeFixes;
44
using Microsoft.CodeAnalysis.CSharp;
55
using Microsoft.CodeAnalysis.CSharp.Syntax;
6-
using Microsoft.CodeAnalysis.Editing;
76
using Microsoft.CodeAnalysis.Simplification;
87
using System.Collections.Generic;
98
using System.Collections.Immutable;
109
using System.Composition;
1110
using System.Linq;
12-
using System.Reflection;
1311
using System.Threading;
1412
using System.Threading.Tasks;
1513

Analyzers/NwPluginAPI.Analyzers.Generator/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using PluginAPI.Events;
1+
using PluginAPI.Events;
22
using System.Text;
33

44
StringBuilder builder = new StringBuilder();
@@ -35,19 +35,19 @@
3535

3636
foreach (var ev in EventManager.Events)
3737
{
38-
if (ev.Value.Parameters.Length == 0)
38+
if (ev.Value.Parameters.Count == 0)
3939
builder.AppendLine(" { " + (int)ev.Key + ", new Event() },");
4040
else
4141
{
4242
builder.AppendLine(" { " + (int)ev.Key + ", new Event(");
43-
for (int x = 0; x < ev.Value.Parameters.Length; x++)
43+
for (int x = 0; x < ev.Value.Parameters.Count; x++)
4444
{
4545
var param = ev.Value.Parameters[x];
4646

4747
if (param.BaseType.IsArray)
48-
builder.AppendLine(" new EventParameter(\"" + param.BaseType.GetElementType()?.FullName + "\", true, \"" + param.DefaultIdentifierName + "\")" + (x == (ev.Value.Parameters.Length - 1) ? ") }," : ","));
48+
builder.AppendLine(" new EventParameter(\"" + param.BaseType.GetElementType()?.FullName + "\", true, \"" + param.DefaultIdentifierName + "\")" + (x == (ev.Value.Parameters.Count - 1) ? ") }," : ","));
4949
else
50-
builder.AppendLine(" new EventParameter(\"" + param.BaseType.FullName + "\", false, \"" + param.DefaultIdentifierName + "\")" + (x == (ev.Value.Parameters.Length - 1) ? ") }," : ","));
50+
builder.AppendLine(" new EventParameter(\"" + param.BaseType.FullName + "\", false, \"" + param.DefaultIdentifierName + "\")" + (x == (ev.Value.Parameters.Count - 1) ? ") }," : ","));
5151
}
5252
}
5353
}

NwPluginAPI.Docs/log.txt

Lines changed: 206 additions & 0 deletions
Large diffs are not rendered by default.

NwPluginAPI.sln

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NwPluginAPI.Analyzers", "An
1818
EndProject
1919
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NwPluginAPI.Analyzers.Generator", "Analyzers\NwPluginAPI.Analyzers.Generator\NwPluginAPI.Analyzers.Generator.csproj", "{9638A1ED-142B-4487-8DAA-A24E1F42E04C}"
2020
EndProject
21-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NwPluginAPI.Docs", "NwPluginAPI.Docs\NwPluginAPI.Docs.csproj", "{3D50BC79-9168-47F3-9805-E0D7502916DF}"
21+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NwPluginAPI.Docs", "NwPluginAPI.Docs\NwPluginAPI.Docs.csproj", "{3D50BC79-9168-47F3-9805-E0D7502916DF}"
2222
EndProject
2323
Global
2424
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2525
Debug|Any CPU = Debug|Any CPU
2626
Release|Any CPU = Release|Any CPU
2727
EndGlobalSection
2828
GlobalSection(ProjectConfigurationPlatforms) = postSolution
29-
{5079D346-050F-45DF-AF41-067C992CAAFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{5079D346-050F-45DF-AF41-067C992CAAFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
29+
{5079D346-050F-45DF-AF41-067C992CAAFC}.Debug|Any CPU.ActiveCfg = Release|Any CPU
30+
{5079D346-050F-45DF-AF41-067C992CAAFC}.Debug|Any CPU.Build.0 = Release|Any CPU
3131
{5079D346-050F-45DF-AF41-067C992CAAFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
3232
{5079D346-050F-45DF-AF41-067C992CAAFC}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{E0F1B55A-971A-418D-B45A-CB2C702B6364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{E0F1B55A-971A-418D-B45A-CB2C702B6364}.Debug|Any CPU.Build.0 = Debug|Any CPU
33+
{E0F1B55A-971A-418D-B45A-CB2C702B6364}.Debug|Any CPU.ActiveCfg = Release|Any CPU
34+
{E0F1B55A-971A-418D-B45A-CB2C702B6364}.Debug|Any CPU.Build.0 = Release|Any CPU
3535
{E0F1B55A-971A-418D-B45A-CB2C702B6364}.Release|Any CPU.ActiveCfg = Release|Any CPU
3636
{E0F1B55A-971A-418D-B45A-CB2C702B6364}.Release|Any CPU.Build.0 = Release|Any CPU
37-
{4BE5D776-39A9-4532-9390-C59FB45E9571}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38-
{4BE5D776-39A9-4532-9390-C59FB45E9571}.Debug|Any CPU.Build.0 = Debug|Any CPU
37+
{4BE5D776-39A9-4532-9390-C59FB45E9571}.Debug|Any CPU.ActiveCfg = Release|Any CPU
38+
{4BE5D776-39A9-4532-9390-C59FB45E9571}.Debug|Any CPU.Build.0 = Release|Any CPU
3939
{4BE5D776-39A9-4532-9390-C59FB45E9571}.Release|Any CPU.ActiveCfg = Release|Any CPU
4040
{4BE5D776-39A9-4532-9390-C59FB45E9571}.Release|Any CPU.Build.0 = Release|Any CPU
4141
{9638A1ED-142B-4487-8DAA-A24E1F42E04C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4242
{9638A1ED-142B-4487-8DAA-A24E1F42E04C}.Debug|Any CPU.Build.0 = Debug|Any CPU
4343
{9638A1ED-142B-4487-8DAA-A24E1F42E04C}.Release|Any CPU.ActiveCfg = Release|Any CPU
4444
{9638A1ED-142B-4487-8DAA-A24E1F42E04C}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{3D50BC79-9168-47F3-9805-E0D7502916DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46-
{3D50BC79-9168-47F3-9805-E0D7502916DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
45+
{3D50BC79-9168-47F3-9805-E0D7502916DF}.Debug|Any CPU.ActiveCfg = Release|Any CPU
46+
{3D50BC79-9168-47F3-9805-E0D7502916DF}.Debug|Any CPU.Build.0 = Release|Any CPU
4747
{3D50BC79-9168-47F3-9805-E0D7502916DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
4848
{3D50BC79-9168-47F3-9805-E0D7502916DF}.Release|Any CPU.Build.0 = Release|Any CPU
4949
EndGlobalSection

NwPluginAPI/Commands/ReloadCommand.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
using System.Linq;
2-
using System.Reflection;
3-
using PluginAPI.Core;
4-
using PluginAPI.Core.Attributes;
5-
61
namespace PluginAPI.Commands
72
{
83
using CommandSystem;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using System;
2+
3+
namespace PluginAPI.Core.Attributes
4+
{
5+
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
6+
public class EventArgument : Attribute { }
7+
}

NwPluginAPI/Core/Attributes/PluginEvent.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace PluginAPI.Core.Attributes
99
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
1010
public class PluginEvent : Attribute
1111
{
12-
public ServerEventType EventType { get; }
12+
public ServerEventType EventType { get; } = ServerEventType.None;
1313

1414
/// <summary>
1515
/// Initializes a new instance of the <see cref="PluginEvent"/> class.
@@ -19,5 +19,7 @@ public PluginEvent(ServerEventType eventType)
1919
{
2020
EventType = eventType;
2121
}
22+
23+
public PluginEvent() { }
2224
}
2325
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using PluginAPI.Enums;
2+
using System;
3+
4+
namespace PluginAPI.Core.Attributes
5+
{
6+
/// <summary>
7+
/// Marks the plugin role.
8+
/// </summary>
9+
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
10+
public class PluginRole : Attribute
11+
{
12+
public RoleRegisterType RegisterType;
13+
public int RoleId;
14+
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="PluginRole"/> class.
17+
/// </summary>
18+
/// <param name="registerType">The type of registered role.</param>
19+
public PluginRole(RoleRegisterType registerType)
20+
{
21+
RegisterType = registerType;
22+
}
23+
24+
/// <summary>
25+
/// Initializes a new instance of the <see cref="PluginRole"/> class.
26+
/// </summary>
27+
/// <param name="registerType">The type of registered role.</param>
28+
public PluginRole(RoleRegisterType registerType, int roleId)
29+
{
30+
RegisterType = registerType;
31+
RoleId = roleId;
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)