Esempio n. 1
0
        public void CanLibraryCheckForDifferences()
        {
            HalvaPackage package = new HalvaPackage(destinationArchive);

            package.UpdateFromArchive(destinationFolder);
            package.Dispose();
        }
        public void UpdateDataFromArchive(string PackageName, string PackageVersionKey)
        {
            if (PackagePassword != "")
            {
                var package = new EncryptedHalvaPackage(Path.Combine(PackageLocation, PackageName), PackagePassword);
                package.UpdateFromArchive(Path.Combine(ExctractLocation, "GameData"));
                package.Dispose();
            }
            else
            {
                var package = new HalvaPackage(Path.Combine(PackageLocation, PackageName));
                package.UpdateFromArchive(Path.Combine(ExctractLocation, "GameData"));
                package.Dispose();
            }
            int packageVersion;

            if (CurrentPackageVersion.TryGetValue(PackageVersionKey, out _))
            {
                CurrentPackageVersion.Remove(PackageVersionKey);
                TargetPackageVersion.TryGetValue(PackageVersionKey, out packageVersion);
                CurrentPackageVersion.Add(PackageVersionKey, packageVersion);
            }
            else
            {
                TargetPackageVersion.TryGetValue(PackageVersionKey, out packageVersion);
                CurrentPackageVersion.Add(PackageVersionKey, packageVersion);
            }
        }