示例#1
0
        public void Downgrade()
        {
            if (fileMLVersion < TConstants.NewTmodVersion)
            {
                return;
            }
            fileTable = null;
            foreach (var kvp in files)
            {
                kvp.Value.OriginalData     = GetTrueBytes(kvp.Value);
                kvp.Value.CompressedLength = kvp.Value.Length = kvp.Value.OriginalData.Length;
                kvp.Value.Offset           = -1;
            }

            fileMLVersion = TConstants.OldTmodVersion;
            var buildProp = BuildProperties.ReadFromModFile(this);

            if (new Version(buildProp.BuildVersion) >= TConstants.NewTmodVersion)
            {
                buildProp.BuildVersion = TConstants.OldTmodVersion.ToString();
                ReplaceFile(TConstants.InfoFileName, buildProp.ToBytes());
            }

            Close();
        }
示例#2
0
        public void Upgrade()
        {
            if (fileMLVersion >= TConstants.NewTmodVersion)
            {
                return;
            }
            fileTable = null;
            foreach (var fe in files)
            {
                CheckAndCompress(fe.Value);
            }

            fileMLVersion = TConstants.NewestTmodVersion;
            var buildProp = BuildProperties.ReadFromModFile(this);

            buildProp.BuildVersion = TConstants.NewestTmodVersion.ToString();
            ReplaceFile(TConstants.InfoFileName, buildProp.ToBytes());
            Close();
        }