summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyLoader.cs10
-rw-r--r--src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs8
-rw-r--r--src/SMAPI/Framework/ModLoading/ModWarning.cs8
3 files changed, 24 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
index e750c659..fdbfdd8d 100644
--- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
+++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
@@ -350,6 +350,16 @@ namespace StardewModdingAPI.Framework.ModLoading
mod.SetWarning(ModWarning.UsesDynamic);
break;
+ case InstructionHandleResult.DetectedFilesystemAccess:
+ this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Detected filesystem access ({handler.NounPhrase}) in assembly {filename}.");
+ mod.SetWarning(ModWarning.AccessesFilesystem);
+ break;
+
+ case InstructionHandleResult.DetectedShellAccess:
+ this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Detected shell or process access ({handler.NounPhrase}) in assembly {filename}.");
+ mod.SetWarning(ModWarning.AccessesShell);
+ break;
+
case InstructionHandleResult.None:
break;
diff --git a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs
index cfa23d08..f3555c2d 100644
--- a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs
+++ b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs
@@ -24,6 +24,12 @@ namespace StardewModdingAPI.Framework.ModLoading
DetectedDynamic,
/// <summary>The instruction is compatible, but references <see cref="SpecialisedEvents.UnvalidatedUpdateTick"/> which may impact stability.</summary>
- DetectedUnvalidatedUpdateTick
+ DetectedUnvalidatedUpdateTick,
+
+ /// <summary>The instruction accesses the filesystem directly.</summary>
+ DetectedFilesystemAccess,
+
+ /// <summary>The instruction accesses the OS shell or processes directly.</summary>
+ DetectedShellAccess
}
}
diff --git a/src/SMAPI/Framework/ModLoading/ModWarning.cs b/src/SMAPI/Framework/ModLoading/ModWarning.cs
index 0e4b2570..c62199b2 100644
--- a/src/SMAPI/Framework/ModLoading/ModWarning.cs
+++ b/src/SMAPI/Framework/ModLoading/ModWarning.cs
@@ -26,6 +26,12 @@ namespace StardewModdingAPI.Framework.ModLoading
UsesUnvalidatedUpdateTick = 16,
/// <summary>The mod has no update keys set.</summary>
- NoUpdateKeys = 32
+ NoUpdateKeys = 32,
+
+ /// <summary>Uses .NET APIs for filesystem access.</summary>
+ AccessesFilesystem = 64,
+
+ /// <summary>Uses .NET APIs for shell or process access.</summary>
+ AccessesShell = 128
}
}