Exemple #1
0
        public void StartIbet(string url)
        {
            Dictionary <string, string> ibetAccdics = new Dictionary <string, string>();
            var ibetScanAccs = System.IO.File.ReadAllLines(@"Config/IbetScanAccs.txt");

            foreach (var sboScanAcc in ibetScanAccs)
            {
                var a = sboScanAcc.Split(new[] { "<>" }, StringSplitOptions.None);
                ibetAccdics[a[0]] = a[1];
            }

            //ibetAccdics.AsParallel().ForAll(item =>
            //{

            //});

            foreach (var ibetAc in ibetAccdics)
            {
                IbetSubEngine ibet1 = new IbetSubEngine();
                while (ibet1.AccountStatus == eAccountStatus.Offline)
                {
                    ibet1.TryLogin(url, ibetAc.Key, ibetAc.Value);
                }

                ibet1.OnExceptionEvent += OnExceptionEvent;
                ibet1.StartScanLiveDriver();
                IbetScanEngines.Add(ibet1);

                Logger.Info("SCAN LOGIN IBET SUCCESS : " + ibetAc.Key);
            }

            int timeSleep = 6000;
            var sleppTime = timeSleep / ibetAccdics.Count;

            foreach (var ibetScanEngine in IbetScanEngines)
            {
                ibetScanEngine.StartUpdateLiveDriver(timeSleep);
                Thread.Sleep(sleppTime);
            }

            Logger.Info("START IBET SCAN THANH CONG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
        }
Exemple #2
0
        private void ReStartIbet(object obj)
        {
            try
            {
                IbetSubEngine i = obj as IbetSubEngine;
                Logger.Info("TAM DUNG IBET SCAN<<<<<<<<<<<<<<<<<<");
                i.OnExceptionEvent -= OnExceptionEvent;
                i.LogOff();
                i.ProxyLogin    = ScanData.ProxyLoginIbet;
                i.ProxyEndpoint = ScanData.ProxyLoginIbetEndpoint;

                if (i.ReLogin())
                {
                    i.OnExceptionEvent += OnExceptionEvent;
                    i.StartScanDriver(ScanType);
                    switch (ScanType)
                    {
                    case eScanType.Live:
                        i.StartUpdateLiveDriver();
                        break;

                    case eScanType.NonLive:
                        i.StartUpdateNonLiveDriver();
                        break;

                    case eScanType.All:
                        i.StartUpdateLiveDriver();
                        i.StartUpdateNonLiveDriver();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Fatal("BIG BUG", ex);
            }
        }
Exemple #3
0
        public void StartIbet()
        {
            int i = 0;

            int countIp = 0;

            if (_useRealIp)
            {
                countIp = ScanData.IpAddress.Count;
            }

            Parallel.ForEach(ScanData.ScanAccount.IbetAccounts, ibetAc =>
            {
                try
                {
                    IbetSubEngine ibet1 = new IbetSubEngine();
                    ibet1.ProxyLogin    = ScanData.ProxyLoginIbet;
                    ibet1.ProxyEndpoint = ScanData.ProxyLoginIbetEndpoint;

                    Random r = new Random();
                    if (_useRealIp)
                    {
                        var ip = ScanData.IpAddress[r.Next(countIp)];
                        ibet1.RealIpAddress = ip;
                    }

                    string url = DataContainer.IbetServers[r.Next(DataContainer.IbetServers.Count())];

                    var sourceIp = DataContainer.SourceIpFakes[r.Next(DataContainer.SourceIpFakes.Count)];
                    ibet1.IpFake = string.Concat(sourceIp, r.Next(2, 242));

                    if (_useRealIp)
                    {
                        ibet1.TryLogin(DataContainer.IbetServers.ToList(), url, ibetAc.Username, ibetAc.Password, ScanData.IpAddress);
                    }
                    else
                    {
                        ibet1.TryLogin(DataContainer.IbetServers.ToList(), url, ibetAc.Username, ibetAc.Password, null);
                    }

                    if (ibet1.AccountStatus == eAccountStatus.Online)
                    {
                        i++;

                        ibet1.OnExceptionEvent += OnExceptionEvent;
                        ibet1.StartScanDriver(ScanType);
                        IbetScanEngines.Add(ibet1);

                        Logger.InfoFormat("[COUNT = {0}] SCAN LOGIN IBET SUCCESS : " + ibetAc.Username, i);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error(ex);
                }
            });

            //foreach (var ibetAc in ScanData.ScanAccount.IbetAccounts)
            //{

            //}


            switch (ScanType)
            {
            case eScanType.Live:
                StartUpdateIbetLiveDriver();
                break;

            case eScanType.NonLive:
                StartUpdateIbetNonLiveDriver();
                break;

            case eScanType.All:
                StartUpdateIbetLiveDriver();
                StartUpdateIbetNonLiveDriver();
                break;
            }

            Logger.InfoFormat("[TOTAL SUCCESS = {0}] START IBET SCAN THANH CONG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", IbetScanEngines.Count);
        }