Exemplo n.º 1
0
 public void Chat(string msg)
 {
     if (!ModLoader.ModsStopped)
     {
         ServiceHandler.Chat(msg, this);
     }
 }
Exemplo n.º 2
0
        public static void LoadMods(object sender)
        {
            SysReq.Clear();
            if (Directory.Exists(@"mods") && Master == null)
            {
                Master     = sender;
                ModsLoaded = new List <IMod>();
                ICollection <IMod> ts = LoadMods(@"mods");
                if (ts != null)
                {
                    IModSystem l = new IModSystem();
                    Service    s = new Service(l);
                    foreach (var x in ts)
                    {
                        try
                        {
                            IMod i = (IMod)x;
                            ModsLoaded.Add(i);

                            if (i.RequestSystemPrivledges())
                            {
                                SysReq.Add(i);
                            }
                            else
                            {
                                if (!(i.ModName() == "SYSTEM" &&
                                      i.Author() == "SYSTEM" &&
                                      i.Version() == "SYSTEM"))
                                {
                                    if (i.ModName() == "User" || i.ModName() == "SYSTEM")
                                    {
                                        ServiceHandler.Chat("WARNING: Mod " + i.ModName() + " version " + i.Version() + ", by " + i.Author() + " will not be loaded because they're using an invalid ModName ( \"User\", \"SYSTEM\" )", s);
                                    }
                                    else
                                    {
                                        i.Init();
                                        ServiceHandler.Chat("Loaded: " + i.ModName() + " version " + i.Version() + ", by " + i.Author(), s);
                                    }
                                }
                            }
                        }
                        catch { }
                    }
                }
            }
        }