Skip to content

Commit 94dcb52

Browse files
committed
Update assembly handling
1 parent bbb3b90 commit 94dcb52

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/Compilation.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ private void PreparseScript(CompilablePlugin plugin)
262262
if (match.Success)
263263
{
264264
string result = match.Groups[1].Value;
265-
if (!result.StartsWith("Oxide.") && !result.StartsWith("Newtonsoft.Json") && !result.StartsWith("protobuf-net") && !result.StartsWith("Rust."))
265+
if (!result.StartsWith("Oxide.") && !result.Contains("Harmony") && !result.Contains("Newtonsoft.Json")
266+
&& !result.Contains("protobuf-net") && !result.StartsWith("Rust."))
266267
{
267268
AddReference(plugin, result);
268269
Interface.Oxide.LogInfo("Added '// Reference: {0}' in plugin '{1}'", result, plugin.Name);

src/CompiledAssembly.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class CompiledAssembly
3535
private bool isLoaded;
3636

3737
private static IEnumerable<string> BlacklistedNamespaces => new[] {
38-
"Oxide.Core.ServerConsole", "System.IO", "System.Net", "System.Xml", "System.Reflection.Assembly", "System.Reflection.Emit", "System.Threading",
39-
"System.Runtime.InteropServices", "System.Diagnostics", "System.Security", "System.Timers", "Mono.CSharp", "Mono.Cecil", "ServerFileSystem"
38+
"Harmony", "Mono.CSharp", "Mono.Cecil", "Oxide.Core.ServerConsole", "ServerFileSystem", "System.IO", "System.Net", "System.Xml", "System.Reflection.Assembly",
39+
"System.Reflection.Emit", "System.Threading", "System.Runtime.InteropServices", "System.Diagnostics", "System.Security", "System.Timers"
4040
};
4141

4242
private static IEnumerable<string> WhitelistedNamespaces => new[] {

0 commit comments

Comments
 (0)