Пример #1
0
        public static async void Initialize()
        {
            Log("Initialize");
            if (!Directory.Exists(DataPath))
            {
                Directory.CreateDirectory(DataPath);
            }

            DataDragon.Locale = Locale;
            if (!DataDragon.IsCurrent)
            {
                DataDragon.Update();
            }

            RiotAPI.UrlFormat = "https://na.api.pvp.net{0}&api_key=25434b55-24de-40eb-8632-f88cc02fea25";

            Installed = await RiotVersion.GetInstalledVersion(Region, RiotGamesDir);

            Latest = await RiotVersion.GetLatestVersion(Region);

            var theme   = Latest.GetFiles("/files/theme.properties").Single();
            var content = await WebClient.DownloadStringTaskAsync(theme.Url);

            LoginTheme = content.Substring("themeConfig=", ",");

            if (!File.Exists(FFMpegPath))
            {
                using (var ffmpeg = new FileStream(FFMpegPath, FileMode.Create))
                    ffmpeg.Write(Properties.Resources.ffmpeg, 0, Properties.Resources.ffmpeg.Length);
            }

            Log(DataDragon.CurrentVersion);
            Log($"Air: {Installed.AirVersion} / {Latest.AirVersion}");
            Log($"Game: {Installed.GameVersion} / {Latest.GameVersion}");
            Log($"Solution: {Installed.SolutionVersion} / {Latest.SolutionVersion}");

            new Thread(CreateLoginTheme).Start();
        }