Пример #1
0
            public bool BeginBoot()
            {
                BaseSession         = new Session();
                Session.BaseSession = BaseSession;

                Shell                  = new Bin.Bash(NewPid());
                BaseSession.Shell      = Shell;
                BaseSession.MainSystem = this;
                Shell.StdOut.WriteLine("Booting...");

                MainDeviceManager = new Device.DeviceManager(this);

                RootDrive            = new FileSystem.FileSystem(this);
                RootDrive.RootFolder = Path.Combine(Directory.GetCurrentDirectory(), "root");
                Directory.CreateDirectory(RootDrive.RootFolder);
                ActivePrograms = new Dictionary <int, Bin.Program>();

                BinPrograms = new Dictionary <string, Type>();
                AddProgram("echo", typeof(Bin.Echo));
                AddProgram("pwd", typeof(Bin.Pwd));
                AddProgram("cd", typeof(Bin.Cd));
                AddProgram("cp", typeof(Bin.Cp));
                AddProgram("ls", typeof(Bin.Ls));
                AddProgram("clear", typeof(Bin.Clear));
                AddProgram("lua", typeof(Bin.RunLua));
                AddProgram("cat", typeof(Bin.Cat));
                AddProgram("mkdir", typeof(Bin.Mkdir));
                AddProgram("mv", typeof(Bin.Mv));
                AddProgram("rm", typeof(Bin.Rm));
                AddProgram("ln", typeof(Bin.Ln));
                AddProgram("mkdevice", typeof(Bin.MakeDevice));

                RootDrive.MakeDirectory(new NixPath("/dev"), true);
                Device.CharacterDevice device = new Device.NullDevice();
                MainDeviceManager.AddDevice(device);
                RootDrive.MakeCharacterDevice(new NixPath("/dev/null"), device.Id);

                device = new Device.ZeroDevice();
                MainDeviceManager.AddDevice(device);
                RootDrive.MakeCharacterDevice(new NixPath("/dev/zero"), device.Id);

                device = new Device.TestDevice();
                MainDeviceManager.AddDevice(device);
                RootDrive.MakeCharacterDevice(new NixPath("/dev/test"), device.Id);

                /*
                 * Terminal term = GetComponent<Terminal>();
                 * if (term != null)
                 * {
                 *  //term.Shell = Shell;
                 *  //term.CurrentSession = BaseSession;
                 * }
                 */

                Shell.StdOut.WriteLine("Booting Complete...");

                Shell.ExecuteAsync(this, BaseSession, new string[] { "" });

                return(true);
            }
Пример #2
0
        /// <summary>Loads all interfaces this plugin supports.</summary>
        public void Load(Hosts.HostInterface Host, FileSystem.FileSystem FileSystem, BaseOptions Options, object RendererReference = null)
        {
            if (this.Texture != null)
            {
                this.Texture.Load(Host);
            }

            if (this.Sound != null)
            {
                this.Sound.Load(Host);
            }

            if (this.Object != null)
            {
                this.Object.Load(Host, FileSystem);
                this.Object.SetObjectParser(Options.CurrentXParser);
                this.Object.SetObjectParser(Options.CurrentObjParser);
            }

            if (this.Route != null)
            {
                //FIXME: Remove renderer reference
                this.Route.Load(Host, FileSystem, Options, RendererReference);
            }
        }
Пример #3
0
        public void GoodAddFile()
        {
            FileSystem.FileSystem f = new FileSystem.FileSystem();
            bool added = f.AddFile("/foo/bar/diddles/file1.txt");

            Assert.AreEqual(true, added);
        }
Пример #4
0
        public void IgnoresAddDirectory()
        {
            FileSystem.FileSystem f = new FileSystem.FileSystem();
            f.AddDirectory("/foo/bar/diddles/");
            f.AddDirectory("/foo/bar/diddles/");

            Assert.AreEqual(true, f.DirectoryExists("/foo/bar/diddles/"));
        }
Пример #5
0
        public ModContentPromptLogic(Widget widget, Manifest mod, ModContent content, Action continueLoading)
        {
            var panel = widget.Get("CONTENT_PROMPT_PANEL");

            var headerTemplate = panel.Get<LabelWidget>("HEADER_TEMPLATE");
            var headerLines = !string.IsNullOrEmpty(content.InstallPromptMessage) ? content.InstallPromptMessage.Replace("\\n", "\n").Split('\n') : new string[0];
            var headerHeight = 0;
            foreach (var l in headerLines)
            {
                var line = (LabelWidget)headerTemplate.Clone();
                line.GetText = () => l;
                line.Bounds.Y += headerHeight;
                panel.AddChild(line);

                headerHeight += headerTemplate.Bounds.Height;
            }

            panel.Bounds.Height += headerHeight;
            panel.Bounds.Y -= headerHeight / 2;

            var advancedButton = panel.Get<ButtonWidget>("ADVANCED_BUTTON");
            advancedButton.Bounds.Y += headerHeight;
            advancedButton.OnClick = () =>
            {
                Ui.OpenWindow("CONTENT_PANEL", new WidgetArgs
                {
                    { "mod", mod },
                    { "content", content },
                    { "onCancel", Ui.CloseWindow }
                });
            };

            var quickButton = panel.Get<ButtonWidget>("QUICK_BUTTON");
            quickButton.IsVisible = () => !string.IsNullOrEmpty(content.QuickDownload);
            quickButton.Bounds.Y += headerHeight;
            quickButton.OnClick = () =>
            {
                var modFileSystem = new FileSystem.FileSystem(Game.Mods);
                modFileSystem.LoadFromManifest(mod);
                var downloadYaml = MiniYaml.Load(modFileSystem, content.Downloads, null);
                modFileSystem.UnmountAll();

                var download = downloadYaml.FirstOrDefault(n => n.Key == content.QuickDownload);
                if (download == null)
                    throw new InvalidOperationException("Mod QuickDownload `{0}` definition not found.".F(content.QuickDownload));

                Ui.OpenWindow("PACKAGE_DOWNLOAD_PANEL", new WidgetArgs
                {
                    { "download", new ModContent.ModDownload(download.Value) },
                    { "onSuccess", continueLoading }
                });
            };

            var backButton = panel.Get<ButtonWidget>("BACK_BUTTON");
            backButton.Bounds.Y += headerHeight;
            backButton.OnClick = Ui.CloseWindow;
            Game.RunAfterTick(Ui.ResetTooltips);
        }
Пример #6
0
        public ModContentLogic(Widget widget, Manifest mod, ModContent content, Action onCancel)
        {
            this.content = content;

            var panel = widget.Get("CONTENT_PANEL");

            var modFileSystem = new FileSystem.FileSystem(Game.Mods);
            modFileSystem.LoadFromManifest(mod);

            var sourceYaml = MiniYaml.Load(modFileSystem, content.Sources, null);
            foreach (var s in sourceYaml)
                sources.Add(s.Key, new ModContent.ModSource(s.Value));

            var downloadYaml = MiniYaml.Load(modFileSystem, content.Downloads, null);
            foreach (var d in downloadYaml)
                downloads.Add(d.Key, new ModContent.ModDownload(d.Value));

            modFileSystem.UnmountAll();

            scrollPanel = panel.Get<ScrollPanelWidget>("PACKAGES");
            template = scrollPanel.Get<ContainerWidget>("PACKAGE_TEMPLATE");

            var headerTemplate = panel.Get<LabelWidget>("HEADER_TEMPLATE");
            var headerLines = !string.IsNullOrEmpty(content.HeaderMessage) ? content.HeaderMessage.Replace("\\n", "\n").Split('\n') : new string[0];
            var headerHeight = 0;
            foreach (var l in headerLines)
            {
                var line = (LabelWidget)headerTemplate.Clone();
                line.GetText = () => l;
                line.Bounds.Y += headerHeight;
                panel.AddChild(line);

                headerHeight += headerTemplate.Bounds.Height;
            }

            panel.Bounds.Height += headerHeight;
            panel.Bounds.Y -= headerHeight / 2;
            scrollPanel.Bounds.Y += headerHeight;

            var discButton = panel.Get<ButtonWidget>("CHECK_DISC_BUTTON");
            discButton.Bounds.Y += headerHeight;
            discButton.IsVisible = () => discAvailable;

            discButton.OnClick = () => Ui.OpenWindow("DISC_INSTALL_PANEL", new WidgetArgs
            {
                { "afterInstall", () => { } },
                { "sources", sources },
                { "content", content }
            });

            var backButton = panel.Get<ButtonWidget>("BACK_BUTTON");
            backButton.Bounds.Y += headerHeight;
            backButton.OnClick = () => { Ui.CloseWindow(); onCancel(); };

            PopulateContentList();
            Game.RunAfterTick(Ui.ResetTooltips);
        }
Пример #7
0
        bool IPackageLoader.TryParsePackage(Stream s, string filename, FileSystem.FileSystem context, out IReadOnlyPackage package)
        {
            if (!filename.EndsWith(".rs", StringComparison.InvariantCultureIgnoreCase))
            {
                package = null;
                return(false);
            }

            package = new D2kSoundResources(s, filename);
            return(true);
        }
Пример #8
0
        public void BadRemoveFile()
        {
            FileSystem.FileSystem f = new FileSystem.FileSystem();
            f.AddFile("/foo/bar/diddles/file1.txt");
            bool removed = f.RemoveFile("/foo/bar/diddles/file2.txt");

            FileSystem.Node node = f.AddDirectory("/foo/bar/diddles/");

            Assert.AreEqual(false, removed);
            Assert.AreEqual(1, node.Files().Count);
        }
Пример #9
0
        public void ProperAddDirectory()
        {
            FileSystem.FileSystem f = new FileSystem.FileSystem();
            f.AddDirectory("/foo/bar/diddles/");
            f.AddDirectory("/foo/bar/funtimes/");
            f.AddDirectory("/foo/bar/other/");
            f.AddDirectory("/foo/bar/funtimes/foo/1/2/3/4");

            bool exists = f.DirectoryExists("/foo/bar/funtimes/foo/1/2/3/4");

            Assert.AreEqual(true, exists);
        }
Пример #10
0
        public void BadRemoveDirectory()
        {
            FileSystem.FileSystem f = new FileSystem.FileSystem();
            f.AddDirectory("/foo/bar/diddles0");
            f.AddDirectory("/foo/bar/diddles1");
            f.AddDirectory("/foo/bar/diddles2");
            f.AddDirectory("/foo/bar/diddles3");

            bool removed = f.RemoveDirectory("/foo/bar/diddles7");

            Assert.AreEqual(false, removed);
            Assert.AreEqual(false, f.DirectoryExists("/foo/bar/diddles7"));
        }
Пример #11
0
        public void NumberFiles()
        {
            FileSystem.FileSystem f = new FileSystem.FileSystem();
            f.AddDirectory("/foo/bar");
            f.AddFile("/foo/bar/file1.txt");
            f.AddFile("/foo/bar/file2.txt");
            f.AddFile("/foo/bar/file3.txt");

            Assert.AreEqual(3, f.Count);

            f.RemoveFile("/foo/bar/randomFile.txt");
            f.RemoveFile("/foo/bar/file3.txt");

            Assert.AreEqual(2, f.Count);
        }
Пример #12
0
        /// <summary>
        /// The function that is load the plugin what can use
        /// </summary>
        /// <param name="fileSystem">The instance of FileSystem class</param>
        public static void LoadPlugins(FileSystem.FileSystem fileSystem)
        {
            if (fileSystem == null)
            {
                return;
            }
            FileSystem = fileSystem;
            string PluginsFolder = FileSystem.GetDataFolder("InputDevicePlugins");

            if (!System.IO.Directory.Exists(PluginsFolder))
            {
                return;
            }
            string[] PluginFiles = System.IO.Directory.GetFiles(PluginsFolder, "*.dll");
            foreach (var File in PluginFiles)
            {
                Assembly Plugin;
                try
                {
                    Plugin = Assembly.LoadFrom(File);
                }
                catch
                {
                    continue;
                }
                Type[] Types;
                try
                {
                    Types = Plugin.GetTypes();
                }
                catch
                {
                    continue;
                }
                foreach (var Type in Types)
                {
                    if (typeof(IInputDevice).IsAssignableFrom(Type))
                    {
                        if (Type.FullName == null)
                        {
                            continue;
                        }
                        AvailablePluginInfos.Add(new PluginInfo(Plugin));
                        AvailablePlugins.Add(Plugin.CreateInstance(Type.FullName) as IInputDevice);
                    }
                }
            }
        }
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            var filename = Path.GetFileName(args[1]);
            var path = Path.GetDirectoryName(args[1]);

            var fs = new FileSystem.FileSystem(utility.Mods);
            fs.Mount(path, "parent");
            var package = new InstallShieldPackage(fs, "parent|" + filename);

            foreach (var kv in package.Index)
            {
                Console.WriteLine("{0}:", kv.Key);
                Console.WriteLine("\tOffset: {0}", 255 + kv.Value.Offset);
                Console.WriteLine("\tLength: {0}", kv.Value.Length);
            }
        }
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            var filename = Path.GetFileName(args[1]);
            var path     = Path.GetDirectoryName(args[1]);

            var fs = new FileSystem.FileSystem(utility.Mods);

            fs.Mount(path, "parent");
            var package = new InstallShieldPackage(fs, "parent|" + filename);

            foreach (var kv in package.Index)
            {
                Console.WriteLine("{0}:", kv.Key);
                Console.WriteLine("\tOffset: {0}", 255 + kv.Value.Offset);
                Console.WriteLine("\tLength: {0}", kv.Value.Length);
            }
        }
Пример #15
0
        // TODO: The package should be mounted into its own context to avoid name collisions with installed files
        public static bool ExtractFromPackage(FileSystem.FileSystem fileSystem, string srcPath, string package, Dictionary <string, string[]> filesByDirectory,
                                              string destPath, bool overwrite, ContentInstaller.FilenameCase caseModifier, Action <string> onProgress, Action <string> onError)
        {
            Directory.CreateDirectory(destPath);

            Log.Write("debug", "Mounting {0}".F(srcPath));
            fileSystem.Mount(srcPath);
            Log.Write("debug", "Mounting {0}".F(package));
            fileSystem.Mount(package);

            foreach (var directory in filesByDirectory)
            {
                var targetDir = directory.Key;

                foreach (var file in directory.Value)
                {
                    var containingDir = Path.Combine(destPath, targetDir);
                    var dest          = Path.Combine(containingDir, GetFileName(file, caseModifier));
                    if (File.Exists(dest))
                    {
                        if (overwrite)
                        {
                            File.Delete(dest);
                        }
                        else
                        {
                            Log.Write("debug", "Skipping {0}".F(dest));
                            continue;
                        }
                    }

                    Directory.CreateDirectory(containingDir);

                    using (var sourceStream = fileSystem.Open(file))
                        using (var destStream = File.Create(dest))
                        {
                            Log.Write("debug", "Extracting {0} to {1}".F(file, dest));
                            onProgress("Extracting " + file);
                            destStream.Write(sourceStream.ReadAllBytes());
                        }
                }
            }

            return(true);
        }
Пример #16
0
        /// <summary>Loads all interfaces this plugin supports.</summary>
        public void Load(Hosts.HostInterface Host, FileSystem.FileSystem FileSystem, BaseOptions Options)
        {
            if (this.Texture != null)
            {
                this.Texture.Load(Host);
            }

            if (this.Sound != null)
            {
                this.Sound.Load(Host);
            }

            if (this.Object != null)
            {
                this.Object.Load(Host, FileSystem);
                this.Object.SetObjectParser(Options.CurrentXParser);
                this.Object.SetObjectParser(Options.CurrentObjParser);
            }
        }
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            var filename = Path.GetFileName(args[1]);
            var path     = Path.GetDirectoryName(args[1]);

            var fs = new FileSystem.FileSystem(utility.Mods);

            // Needed to access the global mix database
            fs.LoadFromManifest(utility.ModData.Manifest);

            fs.Mount(path, "parent");
            var package = new MixFile(fs, "parent|" + filename);

            foreach (var kv in package.Index.OrderBy(kv => kv.Value.Offset))
            {
                Console.WriteLine("{0}:", kv.Key);
                Console.WriteLine("\tOffset: {0}", kv.Value.Offset);
                Console.WriteLine("\tLength: {0}", kv.Value.Length);
            }
        }
Пример #18
0
        void IUtilityCommand.Run(Utility utility, string[] args)
        {
            var filename = Path.GetFileName(args[1]);
            var path = Path.GetDirectoryName(args[1]);

            var fs = new FileSystem.FileSystem(utility.Mods);

            // Needed to access the global mix database
            fs.LoadFromManifest(utility.ModData.Manifest);

            fs.Mount(path, "parent");
            var package = new MixFile(fs, "parent|" + filename);

            foreach (var kv in package.Index.OrderBy(kv => kv.Value.Offset))
            {
                Console.WriteLine("{0}:", kv.Key);
                Console.WriteLine("\tOffset: {0}", kv.Value.Offset);
                Console.WriteLine("\tLength: {0}", kv.Value.Length);
            }
        }
Пример #19
0
        private void Browser_Load(object sender, System.EventArgs e)
        {
            if (this.GameSource == null || this.GameSource is BiosOnlyGameSource)
            {
                this.Close();
                return;
            }

            _fileReader = new DiscFileReader(GameSource);
            _fileSystem = new FileSystem.FileSystem(_fileReader);

            _extractPath = System.IO.Directory.GetCurrentDirectory();

            DirectoryNotFoundLabel.Location = FileListView.Location;
            DirectoryNotFoundLabel.Size     = FileListView.Size;

            this.DirectoryTextBox.Text = @"/";
            this.UpdateCurrentDirectory();

            this.Localize();

            this.UpdateUI();
        }
Пример #20
0
 public IReadOnlyPackage OpenPackage(string filename, FileSystem.FileSystem context)
 {
     // Not implemented
     return(null);
 }
Пример #21
0
        public ModContentLogic(Widget widget, Manifest mod, ModContent content, Action onCancel)
        {
            this.content = content;

            var panel = widget.Get("CONTENT_PANEL");

            var modFileSystem = new FileSystem.FileSystem(Game.Mods);

            modFileSystem.LoadFromManifest(mod);

            var sourceYaml = MiniYaml.Load(modFileSystem, content.Sources, null);

            foreach (var s in sourceYaml)
            {
                sources.Add(s.Key, new ModContent.ModSource(s.Value));
            }

            var downloadYaml = MiniYaml.Load(modFileSystem, content.Downloads, null);

            foreach (var d in downloadYaml)
            {
                downloads.Add(d.Key, new ModContent.ModDownload(d.Value));
            }

            modFileSystem.UnmountAll();

            scrollPanel = panel.Get <ScrollPanelWidget>("PACKAGES");
            template    = scrollPanel.Get <ContainerWidget>("PACKAGE_TEMPLATE");

            var headerTemplate = panel.Get <LabelWidget>("HEADER_TEMPLATE");
            var headerLines    = !string.IsNullOrEmpty(content.HeaderMessage) ? content.HeaderMessage.Replace("\\n", "\n").Split('\n') : new string[0];
            var headerHeight   = 0;

            foreach (var l in headerLines)
            {
                var line = (LabelWidget)headerTemplate.Clone();
                line.GetText   = () => l;
                line.Bounds.Y += headerHeight;
                panel.AddChild(line);

                headerHeight += headerTemplate.Bounds.Height;
            }

            panel.Bounds.Height  += headerHeight;
            panel.Bounds.Y       -= headerHeight / 2;
            scrollPanel.Bounds.Y += headerHeight;

            var discButton = panel.Get <ButtonWidget>("CHECK_DISC_BUTTON");

            discButton.Bounds.Y += headerHeight;
            discButton.IsVisible = () => discAvailable;

            discButton.OnClick = () => Ui.OpenWindow("DISC_INSTALL_PANEL", new WidgetArgs
            {
                { "afterInstall", () => { } },
                { "sources", sources },
                { "content", content }
            });

            var backButton = panel.Get <ButtonWidget>("BACK_BUTTON");

            backButton.Bounds.Y += headerHeight;
            backButton.OnClick   = () => { Ui.CloseWindow(); onCancel(); };

            PopulateContentList();
            Game.RunAfterTick(Ui.ResetTooltips);
        }
Пример #22
0
        public ModContentPromptLogic(Widget widget, Manifest mod, ModContent content, Action continueLoading)
        {
            var panel = widget.Get("CONTENT_PROMPT_PANEL");

            var headerTemplate = panel.Get <LabelWidget>("HEADER_TEMPLATE");
            var headerLines    = !string.IsNullOrEmpty(content.InstallPromptMessage) ? content.InstallPromptMessage.Replace("\\n", "\n").Split('\n') : new string[0];
            var headerHeight   = 0;

            foreach (var l in headerLines)
            {
                var line = (LabelWidget)headerTemplate.Clone();
                line.GetText   = () => l;
                line.Bounds.Y += headerHeight;
                panel.AddChild(line);

                headerHeight += headerTemplate.Bounds.Height;
            }

            panel.Bounds.Height += headerHeight;
            panel.Bounds.Y      -= headerHeight / 2;

            var advancedButton = panel.Get <ButtonWidget>("ADVANCED_BUTTON");

            advancedButton.Bounds.Y += headerHeight;
            advancedButton.OnClick   = () =>
            {
                Ui.OpenWindow("CONTENT_PANEL", new WidgetArgs
                {
                    { "mod", mod },
                    { "content", content },
                    { "onCancel", Ui.CloseWindow }
                });
            };

            var quickButton = panel.Get <ButtonWidget>("QUICK_BUTTON");

            quickButton.IsVisible = () => !string.IsNullOrEmpty(content.QuickDownload);
            quickButton.Bounds.Y += headerHeight;
            quickButton.OnClick   = () =>
            {
                var modFileSystem = new FileSystem.FileSystem(Game.Mods);
                modFileSystem.LoadFromManifest(mod);
                var downloadYaml = MiniYaml.Load(modFileSystem, content.Downloads, null);
                modFileSystem.UnmountAll();

                var download = downloadYaml.FirstOrDefault(n => n.Key == content.QuickDownload);
                if (download == null)
                {
                    throw new InvalidOperationException("Mod QuickDownload `{0}` definition not found.".F(content.QuickDownload));
                }

                Ui.OpenWindow("PACKAGE_DOWNLOAD_PANEL", new WidgetArgs
                {
                    { "download", new ModContent.ModDownload(download.Value) },
                    { "onSuccess", continueLoading }
                });
            };

            var backButton = panel.Get <ButtonWidget>("BACK_BUTTON");

            backButton.Bounds.Y += headerHeight;
            backButton.OnClick   = Ui.CloseWindow;
            Game.RunAfterTick(Ui.ResetTooltips);
        }
Пример #23
0
 /// <summary>Called when the plugin is loaded.</summary>
 /// <param name="host">The host that loaded the plugin.</param>
 /// <param name="fileSystem">The program filesystem object</param>
 public virtual void Load(Hosts.HostInterface host, FileSystem.FileSystem fileSystem)
 {
 }
Пример #24
0
 /// <summary>Called when the plugin is loaded.</summary>
 /// <param name="host">The host that loaded the plugin.</param>
 /// <param name="fileSystem">The filesystem from the host application</param>
 /// <param name="Options">The options supplied by the host program</param>
 /// <param name="trainManagerReference">A reference to the TrainManager in the host application</param>
 public virtual void Load(Hosts.HostInterface host, FileSystem.FileSystem fileSystem, BaseOptions Options, object trainManagerReference)
 {
 }
Пример #25
0
        /// <summary>Loads all non-runtime plugins.</summary>
        /// <returns>Whether loading all plugins was successful.</returns>
        public bool LoadPlugins(FileSystem.FileSystem fileSystem, BaseOptions currentOptions, out string errorMessage, object TrainManagerReference = null, object RendererReference = null)
        {
            UnloadPlugins(out errorMessage);
            string folder = fileSystem.GetDataFolder("Plugins");

            string[] files = {};
            try
            {
                files = Directory.GetFiles(folder);
            }
            catch
            {
                // ignored
            }

            List <ContentLoadingPlugin> list = new List <ContentLoadingPlugin>();
            StringBuilder builder            = new StringBuilder();

            foreach (string file in files)
            {
                if (file.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
                {
                    try
                    {
                        ContentLoadingPlugin plugin = new ContentLoadingPlugin(file);
                        Assembly             assembly;
                        Type[] types;
                        try
                        {
                            assembly = Assembly.LoadFile(file);
                            types    = assembly.GetTypes();
                        }
                        catch (Exception ex)
                        {
                            if ((ex is ReflectionTypeLoadException))
                            {
                                /*
                                 * This is actually a .Net assembly, it just failed to load a reference
                                 * Probably built against a newer API version.
                                 */

                                builder.Append("Plugin ").Append(System.IO.Path.GetFileName(file)).AppendLine(" failed to load. \n \n Please check that you are using the most recent version of OpenBVE.");
                            }
                            else
                            {
                                builder.Append("Plugin ").Append(System.IO.Path.GetFileName(file)).AppendLine(" is not a .Net assembly.");
                            }

                            continue;
                        }
                        bool iruntime = false;
                        foreach (Type type in types)
                        {
                            if (type.FullName == null)
                            {
                                continue;
                            }
                            if (type.IsSubclassOf(typeof(Textures.TextureInterface)))
                            {
                                plugin.Texture = (Textures.TextureInterface)assembly.CreateInstance(type.FullName);
                            }
                            if (type.IsSubclassOf(typeof(Sounds.SoundInterface)))
                            {
                                plugin.Sound = (Sounds.SoundInterface)assembly.CreateInstance(type.FullName);
                            }

                            if (type.IsSubclassOf(typeof(Objects.ObjectInterface)))
                            {
                                plugin.Object = (Objects.ObjectInterface)assembly.CreateInstance(type.FullName);
                            }

                            if (type.IsSubclassOf(typeof(Routes.RouteInterface)))
                            {
                                plugin.Route = (Routes.RouteInterface)assembly.CreateInstance(type.FullName);
                            }

                            if (type.IsSubclassOf(typeof(Trains.TrainInterface)))
                            {
                                plugin.Train = (Trains.TrainInterface)assembly.CreateInstance(type.FullName);
                            }

                            if (typeof(Runtime.IRuntime).IsAssignableFrom(type))
                            {
                                iruntime = true;
                            }
                        }

                        if (plugin.Texture != null | plugin.Sound != null | plugin.Object != null | plugin.Route != null | plugin.Train != null)
                        {
                            plugin.Load(this, fileSystem, currentOptions, TrainManagerReference, RendererReference);
                            list.Add(plugin);
                        }
                        else if (!iruntime)
                        {
                            builder.Append("Plugin ").Append(System.IO.Path.GetFileName(file)).AppendLine(" does not implement compatible interfaces.");
                            builder.AppendLine();
                        }
                    }
                    catch (Exception ex)
                    {
                        builder.Append("Could not load plugin ").Append(System.IO.Path.GetFileName(file)).AppendLine(":").AppendLine(ex.Message);
                        builder.AppendLine();
                    }
                }
            }
            Plugins = list.ToArray();
            if (Plugins.Length == 0)
            {
                errorMessage = "No available content loading plugins were found." + Environment.NewLine + " Please re-download openBVE.";
                return(false);
            }
            errorMessage = builder.ToString().Trim(new char[] { });
            if (errorMessage.Length != 0)
            {
                return(false);
            }
            return(true);
        }