예제 #1
0
        private void Init()
        {
            if (!this.IsHandleCreated)
            {
                this.CreateHandle();
            }

            ProcessorConfigs = new ProcessorConfigs();

            folderName = Path.Combine(Application.StartupPath, "AccountData");
            FileName   = Path.Combine(folderName, "PinaSboAccounts.xml");

            InitProcessConfig();

            Thread scanLogThread = new Thread(DoShowScanLog);

            scanLogThread.Start();

            Thread betLogThread = new Thread(DoShowBetLog);

            betLogThread.Start();

            _manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, 10);

            timerPing          = new System.Timers.Timer(60000);
            timerPing.Elapsed += PingManage;
            timerPing.Start();
        }
예제 #2
0
        private void Init()
        {
            if (!this.IsHandleCreated)
            {
                this.CreateHandle();
            }

            string proxyIbetEp = Convert.ToString(ConfigurationManager.AppSettings["PROXYIBET"]);

            if (string.IsNullOrEmpty(proxyIbetEp))
            {
                ClientData.ProxyIbet = false;
            }
            else
            {
                ClientData.ProxyIbet         = true;
                ClientData.ProxyIbetEndpoint = string.Concat("net.tcp://", proxyIbetEp, ":9998/bcwinsupservice");
            }

            ProcessorConfigs = new ProcessorConfigs();

            folderName = Path.Combine(Application.StartupPath, "AccountData");
            FileName   = Path.Combine(folderName, "IbetSboAccounts.xml");

            InitProcessConfig();

            Thread scanLogThread = new Thread(DoShowScanLog);

            scanLogThread.Start();

            Thread betLogThread = new Thread(DoShowBetLog);

            betLogThread.Start();

            _manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, 10);

            timerPing          = new System.Timers.Timer(60000 * 2);
            timerPing.Elapsed += PingManage;
            timerPing.Start();
        }
예제 #3
0
        public frmIbetSboBroker(string user, IBcManageService service, ScanInfoDTO betConfigSbo, ScanInfoDTO betConfigIbet)
        {
            //if (DateTime.Now > new DateTime(2015, 11, 20))
            //{
            //    MessageBox.Show("EX12301: Lỗi parse data!");
            //    return;
            //}

            InitializeComponent();
            CoreProcessor.InitConfig();
            SystemConfig.TIME_GET_UPDATE_LIVE_IBET   = 11000;
            SystemConfig.TIME_GET_UPDATE_LIVE_SBOBET = 10000;

            BrokerData.IbetScanServers = betConfigIbet.ScanServers;
            BrokerData.IbetAccounts    = betConfigIbet.Accounts;
            BrokerData.SboScanServers  = betConfigSbo.ScanServers;
            BrokerData.SboAccounts     = betConfigSbo.Accounts;

            Random r          = new Random();
            var    ibetAcc    = betConfigIbet.Accounts[r.Next(betConfigIbet.Accounts.Count)];
            var    ibetServer = betConfigIbet.ScanServers[r.Next(betConfigIbet.ScanServers.Count)];
            var    sboAcc     = betConfigSbo.Accounts[r.Next(betConfigSbo.Accounts.Count)];
            var    sboServer  = betConfigSbo.ScanServers[r.Next(betConfigSbo.ScanServers.Count)];

            BrokerData.ScanIbetUsername = ibetAcc.Username;
            BrokerData.ScanIbetPassword = ibetAcc.Password;
            BrokerData.ScanIbetDomain   = ibetServer;
            BrokerData.ScanSboUsername  = sboAcc.Username;
            BrokerData.ScanSboPassword  = sboAcc.Password;
            BrokerData.ScanSboDomain    = sboServer;

            this.Text = string.Concat("BcBroker - ", user, " © Copyright 2015");

            if (!this.IsHandleCreated)
            {
                this.CreateHandle();
            }

            BrokerControl ibetSbo = new BrokerControl();

            ibetSbo.Dock = DockStyle.Fill;
            this.Controls.Add(ibetSbo);

            _manageService = service;
            _manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, 10);

            timerPing          = new System.Timers.Timer(60000);
            timerPing.Elapsed += PingManage;
            timerPing.Start();
        }
예제 #4
0
        public frmSboBet(string user, IBcManageService service, ScanInfoDTO betConfig, bool debug = false)
        {
            InitializeComponent();
            this.btnLoginBuyGroup.Image  = Properties.Resources.LoginGroup;
            this.btnLoginSellGroup.Image = Properties.Resources.LoginGroup;
            this.btnSaveExchange.Image   = BcBetRun.Properties.Resources.SaveBmp;
            this.btnSaveExchange2.Image  = BcBetRun.Properties.Resources.SaveBmp;

            cboMarket.SelectedIndex = 0;

            InitConfigSaved();

            this.Text = string.Concat("BetRunDown - ", user, " © Copyright 2015");

            CoreProcessor.InitConfig();

            sboScan.UpdateLiveDataChange    += sboScan_UpdateLiveDataChange;
            sboScan.UpdateNonLiveDataChange += sboScan_UpdateLiveDataChange;
            sboScan.OnExceptionEvent        += sboScan_OnExceptionEvent;

            if (!debug)
            {
                _manageService = service;

                DataContainer.SboScanServers = betConfig.ScanServers;

                _manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, 10);

                timerPing          = new System.Timers.Timer(60000);
                timerPing.Elapsed += PingManage;
                timerPing.Start();
            }
            else
            {
                DataContainer.SboScanServers = new List <string>()
                {
                    "http://www.currybread.com/",
                    "http://www.beer000.com/",
                    "http://www.beer777.com/",
                    "http://www.harybox.com/",
                    "http://www.pic5678.com/"
                };
            }
        }
예제 #5
0
        void PingManage(object sender, ElapsedEventArgs e)
        {
            try
            {
                if (_manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, keyPing) != 1)
                {
                    timerPing.Stop();
                    sboScan.LogOff();
                    foreach (var buyEngine in buyAccEngines)
                    {
                        if (buyEngine.AccountStatus == eAccountStatus.Online)
                        {
                            buyEngine.LogOff();
                        }
                    }

                    foreach (var sellEn in sellAccEngines)
                    {
                        if (sellEn.AccountStatus == eAccountStatus.Online)
                        {
                            sellEn.LogOff();
                        }
                    }

                    buyAccEngines.Clear();
                    sellAccEngines.Clear();

                    MessageBox.Show("Tài khoản này hiện đang login tại một nơi khác, vui lòng kiểm tra lại!", "Lỗi",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    this.Dispose();
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                //ConnectManage();
                //throw;
            }
        }
예제 #6
0
        void PingManage(object sender, ElapsedEventArgs e)
        {
            try
            {
                if (_manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, keyPing) != 1)
                {
                    timerPing.Stop();
                    foreach (var ibetSboManagement in IbetSboManagements)
                    {
                        if (ibetSboManagement.Processor.Status == eServiceStatus.Started)
                        {
                            ibetSboManagement.StopProcessor();
                        }

                        this.Invoke((MethodInvoker)(() =>
                        {
                            ibetSboManagement.Enabled = false;
                        }));
                    }

                    this.Invoke((MethodInvoker)(() =>
                    {
                        pbPlay.Enabled = false;
                        pbStop.Enabled = false;
                    }));

                    MessageBox.Show("Tài khoản này hiện đang login tại một nơi khác, vui lòng kiểm tra lại!", "Lỗi",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    this.Dispose();
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                //ConnectManage();
                //throw;
            }
        }
예제 #7
0
        void PingManage(object sender, ElapsedEventArgs e)
        {
            try
            {
                if (_manageService.PingBet(SelfInfo.Username, SelfInfo.MacAddress, keyPing) != 1)
                {
                    timerPing.Stop();

                    MessageBox.Show("Tài khoản này hiện đang login tại một nơi khác, vui lòng kiểm tra lại!", "Lỗi",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    this.Dispose();
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                //ConnectManage();
                //throw;
            }
        }