summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Program.cs
diff options
context:
space:
mode:
authorZoryn Aaron <zoryn4163@gmail.com>2016-03-20 18:50:31 -0400
committerZoryn Aaron <zoryn4163@gmail.com>2016-03-20 18:50:31 -0400
commit17021ae35162cfa4a6dad2c0457d4981f38878bc (patch)
tree173d14dfc578d5f8b7f225b729742b977e910246 /StardewModdingAPI/Program.cs
parentb47f3a7e23d77a2fc8280f653caf51cc7951cee0 (diff)
downloadSMAPI-17021ae35162cfa4a6dad2c0457d4981f38878bc.tar.gz
SMAPI-17021ae35162cfa4a6dad2c0457d4981f38878bc.tar.bz2
SMAPI-17021ae35162cfa4a6dad2c0457d4981f38878bc.zip
commit things
Diffstat (limited to 'StardewModdingAPI/Program.cs')
-rw-r--r--StardewModdingAPI/Program.cs66
1 files changed, 33 insertions, 33 deletions
diff --git a/StardewModdingAPI/Program.cs b/StardewModdingAPI/Program.cs
index bb863ca4..cde2dfbc 100644
--- a/StardewModdingAPI/Program.cs
+++ b/StardewModdingAPI/Program.cs
@@ -342,41 +342,41 @@ namespace StardewModdingAPI
/// </summary>
public static void LoadMods_OldWay()
{
- StardewModdingAPI.Log.Verbose("LOADING MODS (OLD WAY - DEPRECATED. ANY MODS LOADED THIS WAY NEED TO UPDATE)");
- int loadedMods = 0;
- foreach (string ModPath in _modPaths)
- {
- foreach (String s in Directory.GetFiles(ModPath, "*.dll"))
- {
- if (s.Contains("StardewInjector"))
- continue;
- StardewModdingAPI.Log.Success("Found DLL: " + s);
- try
- {
- Assembly mod = Assembly.UnsafeLoadFrom(s); //to combat internet-downloaded DLLs
-
- if (mod.DefinedTypes.Count(x => x.BaseType == typeof(Mod)) > 0)
- {
- StardewModdingAPI.Log.Verbose("Loading Mod DLL...");
- TypeInfo tar = mod.DefinedTypes.First(x => x.BaseType == typeof(Mod));
+ StardewModdingAPI.Log.Verbose("LOADING MODS (OLD WAY - DEPRECATED. ANY MODS LOADED THIS WAY NEED TO UPDATE)");
+ int loadedMods = 0;
+ foreach (string ModPath in _modPaths)
+ {
+ foreach (String s in Directory.GetFiles(ModPath, "*.dll"))
+ {
+ if (s.Contains("StardewInjector"))
+ continue;
+ StardewModdingAPI.Log.Success("Found DLL: " + s);
+ try
+ {
+ Assembly mod = Assembly.UnsafeLoadFrom(s); //to combat internet-downloaded DLLs
+
+ if (mod.DefinedTypes.Count(x => x.BaseType == typeof(Mod)) > 0)
+ {
+ StardewModdingAPI.Log.Verbose("Loading Mod DLL...");
+ TypeInfo tar = mod.DefinedTypes.First(x => x.BaseType == typeof(Mod));
Mod m = (Mod)mod.CreateInstance(tar.ToString());
m.Manifest = null;
- m.PathOnDisk = Path.GetDirectoryName(s);
- Console.WriteLine("LOADED MOD: {0} by {1} - Version {2} | Description: {3}", m.Name, m.Authour, m.Version, m.Description);
- loadedMods += 1;
- m.Entry();
- }
- else
- {
- StardewModdingAPI.Log.Error("Invalid Mod DLL");
- }
- }
- catch (Exception ex)
- {
- StardewModdingAPI.Log.Error("Failed to load mod '{0}'. Exception details:\n" + ex, s);
- }
- }
- }
+ m.PathOnDisk = Path.GetDirectoryName(s);
+ Console.WriteLine("LOADED MOD: {0} by {1} - Version {2} | Description: {3}", m.Name, m.Authour, m.Version, m.Description);
+ loadedMods += 1;
+ m.Entry();
+ }
+ else
+ {
+ StardewModdingAPI.Log.Error("Invalid Mod DLL");
+ }
+ }
+ catch (Exception ex)
+ {
+ StardewModdingAPI.Log.Error("Failed to load mod '{0}'. Exception details:\n" + ex, s);
+ }
+ }
+ }
StardewModdingAPI.Log.Success("LOADED {0} MODS THAT NEED TO UPDATE", loadedMods);
}