Ejemplo n.º 1
0
        public static void EnsureExists()
        {
            string file = Path.Combine(AppContext.BaseDirectory, FileName);

            if (!File.Exists(file))
            {
                Console.WriteLine($"File Path: {FileName}\n Full Path: {file}");
                string path = Path.GetDirectoryName(file);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                var config = new LibConfiguration();

                Console.WriteLine("Please enter the path to the users.db: ");
                string conString = Console.ReadLine();
                config.ConnectionString = conString;

                Console.WriteLine("Please enter your fflogs api key: ");
                string FflogsKey = Console.ReadLine();
                config.FFLogsKey = FflogsKey;

                config.SaveJson();
            }
        }
Ejemplo n.º 2
0
        public async Task GetParse(NeroLib.User argUser)
        {
            NeroLib.User  user           = LoadUser(argUser);
            NeroLib.World requestedWorld = dba.ReturnWorld(user.WorldId);


            Console.WriteLine($"Username: {user.Username}\nDiscordID: {user.UserId}\nCharacter Name: {user.Name}\nCharacter World: {user.World}");

            var SavageUrl = new Uri($"https://www.fflogs.com/v1/parses/character/{user.Name}/{requestedWorld.WorldName}/{requestedWorld.Region}/?api_key={LibConfiguration.Load().FFLogsKey}");

            var TrialUrl = new Uri($"https://www.fflogs.com/v1/parses/character/{user.Name}/{requestedWorld.WorldName}/{requestedWorld.Region}/?api_key={LibConfiguration.Load().FFLogsKey}&zone=15");

            var UltimateUrl = new Uri($"https://www.fflogs.com/v1/parses/character/{user.Name}/{requestedWorld.WorldName}/{requestedWorld.Region}/?api_key={LibConfiguration.Load().FFLogsKey}&zone=19");

            Console.WriteLine($"FFLogs API URL: {SavageUrl}");
            await LogParse(user, SavageUrl);
            await LogParse(user, TrialUrl);
            await LogParse(user, UltimateUrl);
        }