Skip to content

Commit edf88b4

Browse files
authored
Add Oxide plugin validation
Notify users if they attempt to install a uMod plugin with Oxide
1 parent c245186 commit edf88b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Compilation.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ private void PreparseScript(CompilablePlugin plugin)
197197
for (int i = 0; i < plugin.ScriptLines.Length; i++)
198198
{
199199
string line = plugin.ScriptLines[i].Trim();
200+
201+
if (line.IndexOf("namespace uMod.Plugins", StringComparison.InvariantCultureIgnoreCase) >= 0)
202+
{
203+
Interface.Oxide.LogError($"Plugin {plugin.ScriptName}.cs is a uMod plugin, not an Oxide plugin. Please downgrade to the Oxide version if available.");
204+
plugin.CompilerErrors = $"Plugin {plugin.ScriptName}.cs is a uMod plugin, not an Oxide plugin. Please downgrade to the Oxide version if available.";
205+
RemovePlugin(plugin);
206+
return;
207+
}
208+
200209
if (line.Length < 1)
201210
{
202211
continue;

0 commit comments

Comments
 (0)