예제 #1
0
        static void Main(string[] args)
        {
            ServiceClientTracing.IsEnabled = true;
            ServiceClientTracing.AddTracingInterceptor(new DebugTracer(ExtConsole));

            if (ConfigRepo.NotConfigure())
            {
                ExtConsole.WriteLine("You must complete the config.json file.");
                ExtConsole.WriteLine("Create an account on https://developer.clashroyale.com and genrate a key(token)");
                ExtConsole.ReadKey();
                return;
            }

            client = new ClientCR(ConfigRepo.Config, ExtConsole);

            if (client.Player != null)
            {
                ExtConsole.WriteLine($"Player : {client.Player}");
            }
            if (client.Clan != null)
            {
                ExtConsole.WriteLine($"Clan   : {client.Clan}");
            }

            ExtConsole
            .NewChoice(ConsoleKey.D1, "Rank of your clan", ExtConsole
                       .NewChoice(ConsoleKey.D1, "Local", RankLocalClan)
                       .NewChoice(ConsoleKey.D2, "General", RankGeneralClan))
            .NewChoice(ConsoleKey.D2, "Various functions", ExtConsole
                       .NewChoice(ConsoleKey.D1, "Upcomming chests", UpcommingChests)
                       .NewChoice(ConsoleKey.D2, "Open tournaments", OpenTournaments)
                       .NewChoice(ConsoleKey.D3, "Cards list", ListCards))
            .NewChoice(ConsoleKey.D3, "My cards", ExtConsole
                       .NewChoice(ConsoleKey.D1, "Completed cards", CompletedCards)
                       .NewChoice(ConsoleKey.D2, "Missing cards", MissingCards))
            .NewChoice(ConsoleKey.D4, "Stats players", ExtConsole
                       .NewChoice(ConsoleKey.D1, "Usage cards in local top 200", UsageCardsTop)
                       .NewChoice(ConsoleKey.D2, "Winrate card local top 200", WinrateCardTop)
                       .NewChoice(ConsoleKey.D3, "Winrate card by trophes (is long)", WinrateCardByClanTrophe, "Minimum clan trophy : "))
            .NewChoice(ConsoleKey.D9, "Change player and clan", ExtConsole
                       .NewChoice(ConsoleKey.D1, "Change player and clan", SettingPlayerClan)
                       .NewChoice(ConsoleKey.D2, "Change just clan", SettingClan))
            .WaitKey(ConsoleKey.X, client);
        }
예제 #2
0
        private static void SettingClan(params string[] args)
        {
            ExtConsole.Write($"Clan tag :");
            var tag = ExtConsole.ReadLine();

            if (!tag.StartsWith("#"))
            {
                tag = "#" + tag;
            }
            var clanlocal = client.GetClan(tag);

            if (clanlocal != null)
            {
                ExtConsole.WriteLine($"Clan : {clanlocal.Name}");
                client.SetClanTag(tag);
                ConfigRepo.SetClanTag(tag);
            }
            else
            {
                ExtConsole.Write($"Not exist");
            }
        }