Exemple #1
0
 void StartMod(string name, IMod mod, ModManager m)
 {
     if (loaded.ContainsKey(name))
     {
         return;
     }
     if (modRequirements.ContainsKey(name))
     {
         foreach (string required_name in modRequirements[name])
         {
             if (!mods.ContainsKey(required_name))
             {
                 try
                 {
                     System.Windows.Forms.MessageBox.Show(string.Format("Can't load mod {0} because its dependency {1} couldn't be loaded.", name, required_name));
                 }
                 catch
                 {
                     //This will be the case if the server is running on a headless linux server without X11 installed (previously crashed)
                     Console.WriteLine(string.Format("[Mod error] Can't load mod {0} because its dependency {1} couldn't be loaded.", name, required_name));
                 }
             }
             StartMod(required_name, mods[required_name], m);
         }
     }
     mod.Start(m);
     loaded[name] = true;
 }
Exemple #2
0
 void StartMod(string name, IMod mod, ModManager m)
 {
     if (loaded.ContainsKey(name))
     {
         return;
     }
     if (modRequirements.ContainsKey(name))
     {
         foreach (string required_name in modRequirements[name])
         {
             if (!mods.ContainsKey(required_name))
             {
                 try
                 {
                     System.Windows.Forms.MessageBox.Show(string.Format("Can't load mod {0} because its dependency {1} couldn't be loaded.", name, required_name));
                 }
                 catch
                 {
                     //This will be the case if the server is running on a headless linux server without X11 installed (previously crashed)
                     Console.WriteLine(string.Format("[Mod error] Can't load mod {0} because its dependency {1} couldn't be loaded.", name, required_name));
                 }
             }
             StartMod(required_name, mods[required_name], m);
         }
     }
     mod.Start(m);
     loaded[name] = true;
 }