示例#1
0
        public StatisticsService(Program program, Configuration configuration, Database databaseProvider)
        {
            Workers = new Dictionary<string, Worker>();
            Program = program;
            Configuration = configuration;
            Provider = databaseProvider;

            InitialiseSummonerCache();
        }
示例#2
0
        public Worker(EngineRegionProfile regionProfile, Configuration configuration, Database provider)
        {
            Profile = regionProfile;
            Provider = provider;

            WorkerProfiler = new Profiler();
            ActiveAccountIds = new HashSet<int>();

            Connection = Provider.GetConnection();
            ConnectionData = new ConnectionProfile(configuration.Authentication, regionProfile.Region, configuration.Proxy, Profile.Username, Profile.Password);
            Connect();
        }
示例#3
0
        public WebService(Configuration configuration, StatisticsService statisticsService, Database 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
        public WebService(Program program, Configuration configuration, StatisticsService statisticsService, Database databaseProvider)
        {
            Program = program;
            ProgramConfiguration = configuration;
            ServiceConfiguration = configuration.Web;
            StatisticsService = statisticsService;
            Server = new WebServer(ServiceConfiguration.Host, ServiceConfiguration.Port, Observe, ServiceConfiguration.EnableReverseProxyRealIPMode);

            DatabaseProvider = databaseProvider;

            WebServiceProfiler = new Profiler();

            Serialiser = new JavaScriptSerializer();

            Views = new HashSet<string>();
            PRNG = new Random();

            LoadIndex();
            InitialiseHandlers();
        }
示例#5
0
        public Worker(Program program, StatisticsService statisticsService, EngineRegionProfile regionProfile, Configuration configuration, Database provider)
        {
            Program = program;
            StatisticsService = statisticsService;
            Provider = provider;

            Configuration = configuration;
            Profile = regionProfile;

            Connected = false;

            Profiler = new Profiler();
            ActiveAccountIds = new HashSet<int>();

            Region = (RegionType)Profile.Identifier;

            AutomaticUpdateInterval = configuration.AutomaticUpdateInterval;

            InitialiseAuthenticationProfile();
        }
示例#6
0
        public bool Initialise()
        {
            try
            {
                Serialiser = new Nil.Serialiser<Configuration>(ConfigurationPath);
                Configuration = Serialiser.Load();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
                return false;
            }

            Database databaseProvider = new Database(Configuration.Database);
            StatisticsService = new StatisticsService(this, Configuration, databaseProvider);
            WebService = new WebService(this, Configuration, StatisticsService, databaseProvider);

            MainWindow = new MainWindow(Configuration, this, StatisticsService);

            return true;
        }
示例#7
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;
            }

            Database databaseProvider = new Database(configuration.Database);

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

            WebService webService = new WebService(configuration, statisticsService, databaseProvider);
            webService.Run();
        }
 public StatisticsService(Configuration configuration, Database databaseProvider)
 {
     ServiceConfiguration = configuration;
     Provider = databaseProvider;
 }