Пример #1
0
        public void LoadGameSolutionTest()
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            var solutionLoader = new RiotSolutionLoader();

            Debug.WriteLine("Loaded Solution Loader in: " + stopwatch.ElapsedMilliseconds);

            var solution = solutionLoader.Load(kRadsDirectory, RiotProjectType.GameClient);

            Debug.WriteLine("Loaded Solution in: " + stopwatch.ElapsedMilliseconds);

            var project = solution.ProjectsByType[RiotProjectType.GameClient];

            Debug.WriteLine("Loaded Project in: " + stopwatch.ElapsedMilliseconds);

            var manifest = project.ReleaseManifest;

            Debug.WriteLine("Loaded Manifest in: " + stopwatch.ElapsedMilliseconds);

            var tree = manifest.Root;

            Debug.WriteLine("Loaded Tree in: " + stopwatch.ElapsedMilliseconds);
        }
Пример #2
0
        public void ReleaseManifestDummiesTest()
        {
            var archiveId    = 256 * 1 + 7;
            var firstArchive = @"V:\Riot Games\League of Legends\RADS\projects\lol_game_client\filearchives\0.0.1.25\Archive_2.raf";
            var archive      = new RiotArchive(firstArchive, firstArchive + ".dat");

            var solution          = new RiotSolutionLoader().Load(@"V:\Riot Games\League of Legends\RADS", RiotProjectType.GameClient);
            var gameClientProject = solution.ProjectsByType[RiotProjectType.GameClient];
            var manifest          = gameClientProject.ReleaseManifest;

            var exts = new HashSet <string>();

            foreach (var file in manifest.Files)
            {
                if (file.Name.Contains("."))
                {
                    var ext = file.Name.Substring(1 + file.Name.LastIndexOf('.'));
                    exts.Add(ext.ToLower());
                }
            }
            Debug.WriteLine(exts.Join(", "));

            var extsOfInterest = ImmutableSet.Of("dds", "skl", "tga", "gfx", "dll", "exe");

            foreach (var ext in extsOfInterest)
            {
                Debug.WriteLine(ext + ": ");
                var hasMatches    = new HashSet <ReleaseManifestFileEntry>();
                var hasNotMatches = new HashSet <ReleaseManifestFileEntry>();
                var maxCount      = 5;
                foreach (var file in manifest.Files)
                {
                    if (file.ArchiveId != archiveId)
                    {
                        continue;
                    }
                    if (file.Name.EndsWith(ext, StringComparison.OrdinalIgnoreCase))
                    {
                        var hasFile = archive.GetDirectoryFile().GetFileList().GetFileEntryOrNull(file.GetPath()) != null;
                        if (hasFile && hasMatches.Count < maxCount)
                        {
                            hasMatches.Add(file);
                        }
                        else if (!hasFile && hasNotMatches.Count < maxCount)
                        {
                            hasNotMatches.Add(file);
                        }
                    }
                    if (hasMatches.Count == hasNotMatches.Count && hasMatches.Count == maxCount)
                    {
                        break;
                    }
                }

                foreach (var group in new[] { new Tuple <bool, HashSet <ReleaseManifestFileEntry> >(true, hasMatches), new Tuple <bool, HashSet <ReleaseManifestFileEntry> >(false, hasNotMatches) })
                {
                    foreach (var file in group.Item2)
                    {
                        //Debug.WriteLine(file.UnknownConstant1 + " " + file.UnknownConstant2 + " " + file.GetPath());
                        //Debug.WriteLine(Convert.ToString(file.Checksum2, 2).PadLeft(32, '0') + " " + file.ChecksumLow + " " + file.ChecksumHigh + " " + file.GetPath());
                        Debug.WriteLine((group.Item1 ? 1 : 0) + " " + Convert.ToString(file.UnknownConstant1, 2).PadLeft(8, '0') + " " + Convert.ToString(file.UnknownConstant2, 2).PadLeft(8, '0') + " " + UInt64ToBinaryString(file.ChecksumLow) + " " + UInt64ToBinaryString(file.ChecksumHigh) + " " + Convert.ToString(file.Checksum2, 2).PadLeft(32, '0') + " " + Convert.ToString(file.EntityType, 2).PadLeft(32, '0') + " " + Convert.ToString(file.PatcherEntityType, 2).PadLeft(16, '0') + " " + file.Name);
                    }
                }
            }
        }