Ejemplo n.º 1
0
        public StatisticsService(Program program, Configuration configuration, Database databaseProvider)
        {
            Workers = new Dictionary<string, Worker>();
            Program = program;
            Configuration = configuration;
            Provider = databaseProvider;

            InitialiseSummonerCache();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 8
0
 public StatisticsService(Configuration configuration, Database databaseProvider)
 {
     ServiceConfiguration = configuration;
     Provider = databaseProvider;
 }