Beispiel #1
0
        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();
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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();
        }
Beispiel #4
0
        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();
        }
 public StatisticsService(Configuration configuration, DatabaseConnectionProvider databaseProvider)
 {
     ServiceConfiguration = configuration;
     DatabaseProvider = databaseProvider;
 }