Esempio n. 1
0
        protected override async Task Init()
        {
            if (!File.Exists("Files/EveLogin.json"))
            {
                throw new FileNotFoundException("Eve login file not provided.");
            }

            await LogAsync(LogLevel.Message, "Starting server...");

            await Task.Factory.StartNew(
                SocketServer,
                CancellationToken.None,
                TaskCreationOptions.LongRunning,
                TaskScheduler.Default
                );

            await LogAsync(LogLevel.Message, "Done.");

            guild = Guild;

            EveLogin login = await EveLogin.FromFile("Files/EveLogin.json");

            ESI            = API.CreateEsi(EsiVersion.Latest, Datasource.Tranquility, login, config: ApiConfig);
            JobQueueModule = await GetModuleAsync <JobQueueModule>();
        }
Esempio n. 2
0
        async Task SetupAsync()
        {
            const string EnvironmentVariable = "TestDataDirectory";
            string       testDataDir         = Environment.GetEnvironmentVariable(EnvironmentVariable);

            login = await EveLogin.FromFile(testDataDir + "/Save.json");

            //await login.SaveToFile(testDataDir + "/Save.json");
            //esi = await ESI.CreateVersioned(EsiVersion.Latest, Datasource.Tranquility, login);
            esi = API.CreateEsi(EsiVersion.Latest, Datasource.Tranquility, login);

            esi.ChangeLogin(login);
        }