diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-20 20:27:21 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-20 20:27:21 -0500 |
commit | 0a00c70397d85777499dcf7877cef08727a2dbae (patch) | |
tree | 1e27745dfeb3f555f4bfd997d3ae6772d79eb823 /src/SMAPI/Framework/ModLoading | |
parent | 4da65cf4c079ee32f0a5582fb73add2362b5a70c (diff) | |
download | SMAPI-0a00c70397d85777499dcf7877cef08727a2dbae.tar.gz SMAPI-0a00c70397d85777499dcf7877cef08727a2dbae.tar.bz2 SMAPI-0a00c70397d85777499dcf7877cef08727a2dbae.zip |
add console warning in paranoid mode
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 5 | ||||
-rw-r--r-- | src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index 7670eb3a..b5533335 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -356,6 +356,11 @@ namespace StardewModdingAPI.Framework.ModLoading mod.SetWarning(ModWarning.UsesDynamic); break; + case InstructionHandleResult.DetectedConsoleAccess: + this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Detected direct console access ({handler.NounPhrase}) in assembly {filename}."); + mod.SetWarning(ModWarning.AccessesConsole); + break; + case InstructionHandleResult.DetectedFilesystemAccess: this.Monitor.LogOnce(loggedMessages, $"{logPrefix}Detected filesystem access ({handler.NounPhrase}) in assembly {filename}."); mod.SetWarning(ModWarning.AccessesFilesystem); diff --git a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs index d93b603d..a948213b 100644 --- a/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs +++ b/src/SMAPI/Framework/ModLoading/InstructionHandleResult.cs @@ -26,6 +26,9 @@ namespace StardewModdingAPI.Framework.ModLoading /// <summary>The instruction is compatible, but references <see cref="ISpecializedEvents.UnvalidatedUpdateTicking"/> or <see cref="ISpecializedEvents.UnvalidatedUpdateTicked"/> which may impact stability.</summary> DetectedUnvalidatedUpdateTick, + /// <summary>The instruction accesses the SMAPI console directly.</summary> + DetectedConsoleAccess, + /// <summary>The instruction accesses the filesystem directly.</summary> DetectedFilesystemAccess, |