Skip to content

Commit bbb3b90

Browse files
committed
Add System.Xml as default reference
Somehow Linq fails in 7 Days to Die without this
1 parent 1568fd2 commit bbb3b90

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/CSharpPluginLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Oxide.Plugins
99
{
1010
public class CSharpPluginLoader : PluginLoader
1111
{
12-
public static string[] DefaultReferences = { "mscorlib", "Oxide.Core", "Oxide.CSharp", "System", "System.Core", "System.Data" };
12+
public static string[] DefaultReferences = { "mscorlib", "Oxide.Core", "Oxide.CSharp", "System", "System.Core", "System.Data", "System.Xml" };
1313
public static HashSet<string> PluginReferences = new HashSet<string>(DefaultReferences);
1414
public static CSharpPluginLoader Instance;
1515

src/Compilation.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,18 @@ internal void Prepare(Action callback)
122122
{
123123
if (File.Exists(Path.Combine(Interface.Oxide.ExtensionDirectory, filename + ".dll")))
124124
{
125+
#if DEBUG
126+
Interface.Oxide.LogDebug($"Added default reference: {filename}");
127+
#endif
125128
references[filename + ".dll"] = new CompilerFile(Interface.Oxide.ExtensionDirectory, filename + ".dll");
126129
}
127130

128131
if (File.Exists(Path.Combine(Interface.Oxide.ExtensionDirectory, filename + ".exe")))
129132
{
130-
references[filename + ".exe"] = new CompilerFile(Interface.Oxide.ExtensionDirectory, filename + ".exe");
133+
#if DEBUG
134+
Interface.Oxide.LogDebug($"Added default reference: {filename}");
135+
#endif
136+
references[filename + ".exe"] = new CompilerFile(Interface.Oxide.RootDirectory, filename + ".exe");
131137
}
132138
}
133139

@@ -414,6 +420,9 @@ private void AddReference(CompilablePlugin plugin, AssemblyName reference)
414420
references[filename] = new CompilerFile(Interface.Oxide.ExtensionDirectory, filename);
415421
}
416422

423+
#if DEBUG
424+
Interface.Oxide.LogWarning($"{reference.Name} has been added as a reference");
425+
#endif
417426
plugin.References.Add(reference.Name);
418427
}
419428

src/PluginCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private static void DownloadCompiler(string remoteHash)
176176
}
177177
catch (Exception ex)
178178
{
179-
Interface.Oxide.LogError($"Could not download {FileName}! Please download manually from: https://assets.umod.org/compiler/{FileName}");
179+
Interface.Oxide.LogError($"Could not download {FileName}! Please download manually from: https://umod.cloud/compiler/{FileName}");
180180
Interface.Oxide.LogError(ex.Message);
181181
}
182182
}

0 commit comments

Comments
 (0)