コード例 #1
0
ファイル: RegionHandler.cs プロジェクト: andor44/RiotControl
        public RegionHandler(Configuration configuration, EngineRegionProfile regionProfile, DatabaseConnectionProvider databaseProvider)
        {
            ServiceConfiguration = configuration;
            Profile = regionProfile;
            DatabaseProvider = databaseProvider;

            LookupJobs = new Queue<LookupJob>();
            ManualUpdateJobs = new Queue<AccountIdJob>();
            AutomaticUpdateJobs = new Queue<AccountIdJob>();

            AccountLocks = new Dictionary<int, AccountLock>();

            Run();
        }
コード例 #2
0
ファイル: Worker.cs プロジェクト: andor44/RiotControl
        public Worker(EngineRegionProfile regionProfile, Login login, Configuration configuration, RegionHandler regionHandler, DatabaseConnectionProvider databaseProvider)
        {
            RegionProfile = regionProfile;
            WorkerLogin = login;

            WorkerProfiler = new Profiler();

            JobEvent = new AutoResetEvent(false);

            Master = regionHandler;

            DatabaseProvider = databaseProvider;

            Database = DatabaseProvider.GetConnection();
            ConnectionData = new ConnectionProfile(configuration.Authentication, regionProfile.Region, configuration.Proxy, login.Username, login.Password);
            Connect();
        }
コード例 #3
0
ファイル: WebService.cs プロジェクト: nolanlum/MyRiotControl
        public WebService(Configuration configuration, StatisticsService statisticsService, DatabaseConnectionProvider databaseProvider)
        {
            ProgramConfiguration = configuration;
            ServiceConfiguration = configuration.Web;
            Statistics = statisticsService;
            Server = new WebServer(ServiceConfiguration.Host, ServiceConfiguration.Port, Observe);

            DatabaseProvider = databaseProvider;

            WebServiceProfiler = new Profiler();

            Serialiser = new JavaScriptSerializer();

            LoadChampionNames();
            LoadItemInformation();

            InitialiseHandlers();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: nolanlum/MyRiotControl
        static void Main(string[] arguments)
        {
            Configuration configuration;
            try
            {
                Nil.Serialiser<Configuration> serialiser = new Nil.Serialiser<Configuration>(ConfigurationPath);
                configuration = serialiser.Load();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception.Message);
                return;
            }

            DatabaseConnectionProvider databaseProvider = new DatabaseConnectionProvider(configuration.Database);

            StatisticsService statisticsService = new StatisticsService(configuration, databaseProvider);
            statisticsService.Run();

            WebService webService = new WebService(configuration, statisticsService, databaseProvider);
            webService.Run();
        }
コード例 #5
0
 public StatisticsService(Configuration configuration, DatabaseConnectionProvider databaseProvider)
 {
     ServiceConfiguration = configuration;
     DatabaseProvider = databaseProvider;
 }