Skip to content

Commit 26f6f9e

Browse files
committed
Add publicizer ignored references implementation
1 parent f44895b commit 26f6f9e

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

src/Patching/Publicizer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Oxide.CSharp.Patching
1616
[HasName("netstandard", InverseCheck = true)]
1717
[HasName("Oxide", InverseCheck = true)]
1818
[HasName("MySql.Data", InverseCheck = true)]
19+
[HasConfigNames(InverseCheck = true)]
1920
[HasEnvironmentalVariable("AllowPublicize")]
2021
public class Publicizer : TraversePatch
2122
{
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
extern alias References;
2+
3+
using System;
4+
using Oxide.Core;
5+
6+
namespace Oxide.CSharp.Patching.Validation
7+
{
8+
public class HasConfigNamesAttribute : HasNameAttribute
9+
{
10+
public HasConfigNamesAttribute() : base(string.Empty)
11+
{
12+
}
13+
14+
protected override bool IsValid(object item)
15+
{
16+
foreach (string reference in Interface.Oxide.Config.Compiler.IgnoredPublicizerReferences)
17+
{
18+
ValidationRule = reference;
19+
20+
if (base.IsValid(item))
21+
{
22+
return true;
23+
}
24+
}
25+
26+
return false;
27+
}
28+
}
29+
}

src/Patching/Validation/HasNameAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
extern alias References;
1+
extern alias References;
22

33
using References::Mono.Cecil;
44
using System;
@@ -8,7 +8,7 @@ namespace Oxide.CSharp.Patching.Validation
88
{
99
public class HasNameAttribute : PatchValidationAttribute
1010
{
11-
public string ValidationRule { get; }
11+
public string ValidationRule { get; internal set; }
1212

1313
public StringValidationType ValidationType { get; }
1414

0 commit comments

Comments
 (0)