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

            InitialiseSummonerCache();
        }
Esempio 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();
        }
Esempio n. 3
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();
        }
Esempio n. 4
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();
        }
Esempio n. 5
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();
        }
Esempio n. 6
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();
        }
Esempio n. 7
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();
        }
Esempio n. 8
0
        public MainWindow(Configuration configuration, Program program, StatisticsService statisticsService)
        {
            InitializeComponent();

            Configuration = configuration;
            Program = program;
            StatisticsService = statisticsService;

            IsFirstLine = true;

            DataContext = new MainWindowDataContext(configuration);

            Assembly entryAssembly = Assembly.GetEntryAssembly();

            Version version = entryAssembly.GetName().Version;

            Title = string.Format("Riot Control r{0} ({1})", version.Revision, Nil.Assembly.GetAssemblyBuildTime(entryAssembly));

            UpdateHelpLabel();
        }
Esempio n. 9
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;
        }
Esempio n. 10
0
 public StatisticsService(Configuration configuration, Database databaseProvider)
 {
     ServiceConfiguration = configuration;
     Provider = databaseProvider;
 }
Esempio n. 11
0
 public MainWindowDataContext(Configuration configuration)
 {
     List<RegionProperty> regions = (from x in configuration.RegionProfiles select new RegionProperty(x)).ToList();
     Regions = CollectionViewSource.GetDefaultView(regions);
 }