summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Program.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-05-16 01:15:02 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-05-16 01:15:02 -0400
commitf4a2d8100fa6553b79d3f91dfd7b2011ce453b79 (patch)
tree51fb43006cecca073e1d340e744d987bb937295c /src/StardewModdingAPI/Program.cs
parentbca78cd682c0d583913811f632815db142fbde8b (diff)
downloadSMAPI-f4a2d8100fa6553b79d3f91dfd7b2011ce453b79.tar.gz
SMAPI-f4a2d8100fa6553b79d3f91dfd7b2011ce453b79.tar.bz2
SMAPI-f4a2d8100fa6553b79d3f91dfd7b2011ce453b79.zip
add warning for mods that don't have a name or version
Diffstat (limited to 'src/StardewModdingAPI/Program.cs')
-rw-r--r--src/StardewModdingAPI/Program.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/StardewModdingAPI/Program.cs b/src/StardewModdingAPI/Program.cs
index 1678c5fa..65b4d6dd 100644
--- a/src/StardewModdingAPI/Program.cs
+++ b/src/StardewModdingAPI/Program.cs
@@ -514,8 +514,23 @@ namespace StardewModdingAPI
LogSkip(displayName, "its manifest doesn't set an entry DLL.");
continue;
}
- if (string.IsNullOrWhiteSpace(manifest.UniqueID))
- deprecationWarnings.Add(() => this.Monitor.Log($"{manifest.Name} doesn't have a {nameof(IManifest.UniqueID)} in its manifest. This will be required in an upcoming SMAPI release.", LogLevel.Warn));
+
+ // log warnings for missing fields that will be required in SMAPI 2.0
+ {
+ List<string> missingFields = new List<string>(3);
+
+ if (string.IsNullOrWhiteSpace(manifest.Name))
+ missingFields.Add(nameof(IManifest.Name));
+ if (manifest.Version.ToString() == "0.0")
+ missingFields.Add(nameof(IManifest.Version));
+ if (string.IsNullOrWhiteSpace(manifest.UniqueID))
+ missingFields.Add(nameof(IManifest.UniqueID));
+
+ if (missingFields.Any())
+ deprecationWarnings.Add(() => this.Monitor.Log($"{manifest.Name} is missing some manifest fields ({string.Join(", ", missingFields)}) which will be required in an upcoming SMAPI version.", LogLevel.Warn));
+ }
+
+
}
catch (Exception ex)
{