Ejemplo n.º 1
0
    public static void Main(string[] args)
    {
#if !DEBUG
start:
        try
#endif
        {
            var config_file = (YamlMappingNode)YamlHelper.ParseFile(@"..\..\config.yaml");
            var config      = new AppConfig(Path.GetFullPath(@"..\.."), config_file);

            var downloader = new JavaVersionDownloader();
#if !DEBUG
            try
#endif
            {
                downloader.DownloadMissing(config.Java.InputFolders, config);
            }
#if !DEBUG
            catch (Exception ex)
            {
                Console.WriteLine("Java version downloader failed!");
                Console.WriteLine(ex.ToString());
            }
#endif

            var java = new JavaUpdater(config);
            java.Perform();

            var bedrock = new BedrockUpdater(config);
            bedrock.Perform();

            Console.WriteLine("All done!");
        }
#if !DEBUG
        catch (Exception ex)
        {
            Console.WriteLine(ex.ToString());
            Console.WriteLine();
            Console.WriteLine("Press enter to try again");
            Console.ReadLine();
            goto start;
        }
#endif
    }
Ejemplo n.º 2
0
    public RetroMCP(string folder, string matched_version)
    {
        Folder = folder;
        var mcp = ParseTsrgs(matched_version);

        MatchedMCP            = new(mcp.Client.Reversed(), mcp.Server.Reversed());
        MatchedMojang         = new();
        using var client_file = File.OpenText(Path.Combine(Folder, "matched_client.txt"));
        using var server_file = File.OpenText(Path.Combine(Folder, "matched_server.txt"));
        MappingsIO.ParseProguard(MatchedMojang.Client, client_file);
        MappingsIO.ParseProguard(MatchedMojang.Server, server_file);
        FoundRenames  = new((YamlMappingNode)YamlHelper.ParseFile(Path.Combine(folder, "mappings_found.yaml")));
        CustomRenames = new((YamlMappingNode)YamlHelper.ParseFile(Path.Combine(folder, "mappings_custom.yaml")));
        var found_equivs  = Equivalencies.Parse((YamlMappingNode)YamlHelper.ParseFile(Path.Combine(folder, "equivalencies_custom.yaml")));
        var custom_equivs = Equivalencies.Parse((YamlMappingNode)YamlHelper.ParseFile(Path.Combine(folder, "equivalencies_custom.yaml")));
        var client_equivs = new Equivalencies(found_equivs.Client, custom_equivs.Client);
        var server_equivs = new Equivalencies(found_equivs.Server, custom_equivs.Server);

        MergedEquivalencies = new(client_equivs, server_equivs);
    }