private void Add(String[] Pakets, PackageSystem vfs, AssemblyControl assembly, bool loadExtras) { foreach (String pak in Pakets) { Add(pak, vfs, assembly, loadExtras); } }
public void LoadLanguage(PackageInfo game, PackageSystem vfs, string subPath) { // load languages foreach (PackageInfo info in PackageInfos) { if (info.GameName == game.GameName) { if (info.Type == PackageType.Language) { if (!vfs.ExistsMount(info.Package)) { PackageFactory factory = new PackageFactory(); IPackage package = factory.OpenPackage(basePath + info.Package, subPath); vfs.Mount(info.Package, package); ApplyPatches(info, vfs); } // add language codes to available language list foreach (string lang in info.Languages) { if (!languages.Contains(lang)) { languages.Add(lang); } } } } } }
static void Main(string[] args) { CourierSystem editor = new CourierSystem(); PackageSystem spelling = new PackageSystem(); PaymentSystem post = new PaymentSystem(); FacadePostClientSystem facade = new FacadePostClientSystem(editor, spelling, post); ClientPost.ClientCode(facade); Console.ReadLine(); }
static public PackageInfo TryCreate(string inFileName, PackageSystem inVFS) { string package = System.IO.Path.GetFileName(inFileName); File file; // open file from package if available if (inVFS.ExistsMount(package)) { file = inVFS.GetFile(package + ":info.txt", FileOpenMode.Read); } // open file without loading the package else { file = inVFS.GetFile(inFileName + ":info.txt", FileOpenMode.NoPackage); } if (file != null) { ConfigFile config = new ConfigFile(); config.Open(file); PackageInfo info = new PackageInfo(); info.package = package; info.dependencies = config[""].GetStrings("dependencies"); info.mainModule = config[""].GetString("start"); info.modules = config[""].GetStrings("modules"); info.languages = config[""].GetStrings("language"); info.version = config[""].GetVersion("version"); info.baseVersion = config[""].GetVersion("base"); switch (config[""].Get("type")) { case "patch": info.type = PackageType.Patch; break; case "game": info.type = PackageType.Game; break; case "language": info.type = PackageType.Language; break; default: info.type = PackageType.Data; break; } info.game = config[""].GetString("game"); info.hidden = config[""].GetBool("hidden"); return(info); } return(null); }
void ApplyPatches(PackageInfo package, PackageSystem vfs) { Version currentVersion = package.Version; Version nextVersion = currentVersion; List <PackageInfo> applyList = new List <PackageInfo>(); // search latest patch version PackageInfo best = null; do { best = null; foreach (PackageInfo info in PackageInfos) { if (info.GameName == package.Package) { if (info.Type == PackageType.Patch) { if (info.BaseVersion == currentVersion && info.Version > nextVersion) { best = info; nextVersion = info.Version; } } } } if (best != null) { currentVersion = nextVersion; applyList.Add(best); } } while (best != null); // apply patches foreach (PackageInfo info in applyList) { if (!vfs.ExistsMount(info.Package)) { PackageFactory factory = new PackageFactory(); IPackage p = factory.OpenPackage(basePath + info.Package); vfs.Mount(info.Package, p); } } }
/// <summary> /// Initializes a new instance of the <see cref="DefiningBenchmark"/> class. /// </summary> /// <param name="baseExperiment">The base experiment represents experiment based on which the benchmark is being defined.</param> public DefiningBenchmark(Experiment baseExperiment, ComponentsLibrary library, Workspace workspace, PackageSystem.PackageManager manager, IEnumerable<string> workspaceTypeDirectories, string webserviceAddress) { if (baseExperiment == null) throw new ArgumentNullException("baseExperiment"); if (library == null) throw new ArgumentNullException("library"); if (workspace == null) throw new ArgumentNullException("workspace"); if (workspaceTypeDirectories == null) throw new ArgumentNullException("workspaceTypeDirectories"); // these are needed to create experiment serializing in Define method m_packageManager = manager; m_library = library; WebserviceAddress = webserviceAddress; if (webserviceAddress != null) { m_webService = new WebserviceAccessor(webserviceAddress, true); } m_baseExperiment = baseExperiment; m_workspace = workspace; //wrap the workspace into experiment workspace wrapper, so that we can load units only from experiment namespace m_experimentWorkspaceWrapper = new ExperimentWorkspaceWrapper(workspace, m_baseExperiment.ExperimentInfo.Id); //prefil benchmark info PrefillBenchmarkInfo(); //get nodes that can be selected as template GetTemplatizableComponents(); //get the ExperimentResults variables that can be selected as publishable results //from the ExperimentResults all metric names, their descriptions and dataset names are going to be extracted //when contest is going to be published GetPublishableExperimentResults(); }
public GamePackage(PackageInfo info) { name = info.Package; string path = "game/" + info.Package; PackageManager pakman = new PackageManager("game/"); vfs = new PackageSystem(); // load package without language and extras pakman.LoadPackages(info.Package, vfs, null, false); // get package info packageInfo = new ConfigFile(); packageInfo.Open(vfs.GetFile("info.txt", FileOpenMode.Read)); // load language packages pakman.LoadLanguage(info, vfs, ""); if (name == Program.EnginePackage) { vfs.Mount("user", FileSystem.GetUserPackage("Burntime")); } else { vfs.Mount("user", FileSystem.GetUserPackage("Burntime/" + name)); } launcherInfo = new ConfigFile(); launcherInfo.Open(vfs.GetFile("launcher/info.txt", FileOpenMode.Read)); title = launcherInfo[""].Get("title"); version = packageInfo[""].GetVersion("version"); ReadSettings(); DownloadPageToTemporary(false); }
public bool LoadPackages(string game, PackageSystem vfs, AssemblyControl assembly, bool loadExtras) { return(Add(game, vfs, assembly, loadExtras)); }
public bool LoadPackages(string game, PackageSystem vfs, AssemblyControl assembly) { return(Add(game, vfs, assembly, true)); }
void LoadExtras(PackageInfo game, PackageSystem vfs) { }
private bool Add(string package, PackageSystem vfs, AssemblyControl assembly, bool loadExtras) { if (package.ToLower() == "burntime") { Burntime.Common.BurntimePath path = new Burntime.Common.BurntimePath(FileSystem.BasePath + "system/"); while (!path.IsValid) { if (!path.ShowSelector()) { Environment.Exit(0); } if (path.IsValid) { path.Save(); } } string burntimePackage = path.Path; if (burntimePackage.EndsWith(".pak")) { burntimePackage = burntimePackage.Substring(0, burntimePackage.Length - 4); } // make absolute path to avoid using basePath from FileSystem string absolutePath = burntimePackage; if (!System.IO.Path.IsPathRooted(absolutePath)) { absolutePath = System.IO.Path.GetFullPath(FileSystem.BasePath + "system/" + absolutePath); } IPackage burntime = FileSystem.OpenPackage(absolutePath, "BURN_GFX/"); if (burntime == null) { // something went wrong throw new Exception("BURN_GFX folder was not found. Please make sure to set the correct path in system/path.txt to where the BURN_GFX and BURN.EXE are!"); } vfs.Mount(package, burntime); return(true); } PackageInfo info = PackageInfo.TryCreate(basePath + package, vfs); if (info == null) { return(false); } if (info.Type == PackageType.Game) { Add(info.Dependencies, vfs, assembly, loadExtras); if (!vfs.ExistsMount(package)) { PackageFactory factory = new PackageFactory(); IPackage p = factory.OpenPackage(basePath + package); vfs.Mount(package, p); } // add language codes to available language list foreach (string lang in info.Languages) { if (!languages.Contains(lang)) { languages.Add(lang); } } ApplyPatches(info, vfs); if (loadExtras) { LoadLanguage(info, vfs, ""); LoadExtras(info, vfs); } if (assembly != null) { assembly.Load(info.Modules, package); } } return(true); }
public Updater(PackageSystem vfs, string basePath) { this.vfs = vfs; this.basePath = basePath; }
public PackageManagerForm(PackageSystem packages) { this.packages = packages; InitializeComponent(); }
static internal void Run() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // check dlls if (!CheckDlls()) { return; } if (System.IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath).Equals("update", StringComparison.InvariantCultureIgnoreCase)) { // updater mode Environment.CurrentDirectory = "../"; // initialize vfs vfs = new PackageSystem(); InitializeVFS(""); // find all packages CheckPackages(""); // get update info CheckUpdates(""); // release all packages vfs.UnmountAll(); // update updater.Update(versionControls.ToArray()); // start launcher ProcessStartInfo startInfo = new ProcessStartInfo("launcher.exe"); Process.Start(startInfo); } else { CreateTemporary(); Application.UseWaitCursor = true; // load vfs vfs = new PackageSystem(); if (!RefreshVFS(false)) { RemoveTemporary(); // code structure in this function is not nice return; } // find all packages CheckPackages(""); RefreshGamePackages(); // check for updates CheckUpdates(""); bool update = false; if (!noConnection && versionControls.Count > 0 && updater.AutoUpdate) { // show question before auto-update update = updater.ShowDownloadQuestion(versionControls.ToArray()); } if (update) { // enter update updater.InitiateUpdate(); } else { // fully updated, run after update if necessary Update.AfterUpdate.Check(); if (Update.AfterUpdate.IsAfterUpdate) { Update.AfterUpdate.RunAfterUpdate(); } // show dialog Application.Run(form = new LauncherForm()); } } RemoveTemporary(); }
public FacadePostClientSystem(CourierSystem courier, PackageSystem package, PaymentSystem payment) { courierSystem = courier; packageSystem = package; paymentSystem = payment; }