Exemplo n.º 1
0
        internal override bool CompareSet(MarketEntityBase meb)
        {
            var mk = meb as MarketHtft;

            if (HHOdds == mk.HHOdds &&
                HAOdds == mk.HAOdds &&
                HDOdds == mk.HDOdds &&
                DHOdds == mk.DHOdds &&
                DAOdds == mk.DAOdds &&
                DDOdds == mk.DDOdds &&
                AHOdds == mk.AHOdds &&
                AAOdds == mk.AAOdds &&
                ADOdds == mk.ADOdds
                )
            {
                return(false);
            }
            HHOdds = mk.HHOdds;
            HAOdds = mk.HAOdds;
            HDOdds = mk.HDOdds;
            DHOdds = mk.DHOdds;
            DAOdds = mk.DAOdds;
            DDOdds = mk.DDOdds;
            AHOdds = mk.AHOdds;
            AAOdds = mk.AAOdds;
            ADOdds = mk.ADOdds;
            return(true);
        }
Exemplo n.º 2
0
        internal override bool CompareSet(MarketEntityBase meb)
        {
            var oneX2 = meb as Market1x2;

            if (HomeOdds == oneX2.HomeOdds && AwayOdds == oneX2.AwayOdds && DrawOdds == oneX2.DrawOdds)
            {
                return(false);
            }
            HomeOdds = oneX2.HomeOdds;
            AwayOdds = oneX2.AwayOdds;
            DrawOdds = oneX2.DrawOdds;
            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 对比是否一致,如果不一致更新
        /// </summary>
        /// <param name="hdp"></param>
        /// <param name="homeOdds"></param>
        /// <param name="awayOdds"></param>
        /// <returns></returns>
        internal override bool CompareSet(MarketEntityBase meb)
        {
            var two = meb as MarketTwo;

            if (Hdp == two.Hdp && HomeOdds == two.HomeOdds && AwayOdds == two.AwayOdds)
            {
                return(false);
            }

            HomeOdds = two.HomeOdds;
            AwayOdds = two.AwayOdds;
            Hdp      = two.Hdp;
            return(true);
        }
Exemplo n.º 4
0
        internal override bool CompareSet(MarketEntityBase meb)
        {
            var tg = meb as MarketTotalGoal;

            if (Odds01 == tg.Odds01 && Odds23 == tg.Odds23 && Odds46 == tg.Odds46 && Odds70 == tg.Odds70)
            {
                return(false);
            }
            Odds01 = tg.Odds01;
            Odds23 = tg.Odds23;
            Odds46 = tg.Odds46;
            Odds70 = tg.Odds70;
            return(true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 发送盘口统一方法
        /// </summary>
        /// <typeparam name="TOriginal">Take实体对象类型</typeparam>
        /// <typeparam name="TDestination">发送所需传输对象类型</typeparam>
        /// <param name="market">盘口实体</param>
        /// <param name="cmd">发送盘口命令</param>
        private void SendMarket <TOriginal, TDestination>(MarketEntityBase market, TakeServerCommand cmd)
            where TOriginal : MarketEntityBase
            where TDestination : MarketBase, new()
        {
            TOriginal original = market as TOriginal;

            if (original == null)
            {
                return;
            }
            TDestination destination = (TDestination)original.ToTakeMarketDto(MatchID, takeType);

            destination.RowIndex = 1;
            Communicator.Send(cmd, destination);
        }
Exemplo n.º 6
0
        //发送盘口更新信号
        private void SendCoupon(MarketEntityBase meb)
        {
            if (MatchID == 0)
            {
                return;
            }
            if (meb == null)
            {
                return;             //记日志
            }
            switch (meb.MarketID)
            {
            case (int)MarketTypeEnum.F_HDP:
            case (int)MarketTypeEnum.F_OU:
            case (int)MarketTypeEnum.H_HDP:
            case (int)MarketTypeEnum.H_OU:
            case (int)MarketTypeEnum.F_OE:
            case (int)MarketTypeEnum.H_OE:
            case (int)MarketTypeEnum.ML:
                SendMarket <MarketTwo, TakeTwoDto>(meb, TakeServerCommand.SrcTwo);
                break;

            case (int)MarketTypeEnum.F_1X2:
            case (int)MarketTypeEnum.H_1X2:
                SendMarket <Market1x2, Take1X2Dto>(meb, TakeServerCommand.Src1x2);
                break;

            case (int)MarketTypeEnum.F_TG:
                SendMarket <MarketTotalGoal, TakeTotalGoalDto>(meb, TakeServerCommand.SrcTG);
                break;

            case (int)MarketTypeEnum.F_FGLG:
                SendMarket <MarketFglg, TakeFglgDto>(meb, TakeServerCommand.SrcFglg);
                break;

            case (int)MarketTypeEnum.HTFT:
                SendMarket <MarketHtft, TakeHtFtDto>(meb, TakeServerCommand.SrcHtft);
                break;

            case (int)MarketTypeEnum.F_CS:
                SendMarket <MarketCS, TakeCsDto>(meb, TakeServerCommand.SrcFCS);
                break;
            }
        }
Exemplo n.º 7
0
        internal override bool CompareSet(MarketEntityBase meb)
        {
            var mk = meb as MarketFglg;

            if (HFOdds == mk.HFOdds &&
                HLOdds == mk.HLOdds &&
                AFOdds == mk.AFOdds &&
                ALOdds == mk.ALOdds &&
                NOOdds == mk.NOOdds
                )
            {
                return(false);
            }
            HFOdds = mk.HFOdds;
            HLOdds = mk.HLOdds;
            AFOdds = mk.AFOdds;
            ALOdds = mk.ALOdds;
            NOOdds = mk.NOOdds;
            return(true);
        }
Exemplo n.º 8
0
        //  不适用
        private void CompareSingleMarket(MarketEntityBase marketEntityBase, int stage)
        {
            if (stage > 0 && stage != Stage)
            {
                return;
            }

            MarketEntityBase cmeb;

            if (!MarketDic.TryGetValue(marketEntityBase.CouID, out cmeb))
            {
                return;
            }
            if (cmeb == null)
            {
                logger.Error("CompareSingleMarket get null mk = " + JsonConvert.SerializeObject(marketEntityBase));
                return;
            }
            if (!cmeb.CompareSet(marketEntityBase))
            {
                return;
            }
            SendCoupon(cmeb);
        }
Exemplo n.º 9
0
        internal override bool CompareSet(MarketEntityBase meb)
        {
            var mk = meb as MarketCS;

            if (Odds00 == mk.Odds00 &&
                Odds01 == mk.Odds01 &&
                Odds02 == mk.Odds02 &&
                Odds03 == mk.Odds03 &&
                Odds04 == mk.Odds04 &&
                Odds10 == mk.Odds10 &&
                Odds11 == mk.Odds11 &&
                Odds12 == mk.Odds12 &&
                Odds13 == mk.Odds13 &&
                Odds14 == mk.Odds14 &&
                Odds20 == mk.Odds20 &&
                Odds21 == mk.Odds21 &&
                Odds22 == mk.Odds22 &&
                Odds23 == mk.Odds23 &&
                Odds24 == mk.Odds24 &&
                Odds30 == mk.Odds30 &&
                Odds31 == mk.Odds31 &&
                Odds32 == mk.Odds32 &&
                Odds33 == mk.Odds33 &&
                Odds34 == mk.Odds34 &&
                Odds40 == mk.Odds40 &&
                Odds41 == mk.Odds41 &&
                Odds42 == mk.Odds42 &&
                Odds43 == mk.Odds43 &&
                Odds44 == mk.Odds44 &&
                Odds50 == mk.Odds50 &&
                Odds05 == mk.Odds05 &&
                AnyOdds == mk.AnyOdds
                )
            {
                return(false);
            }

            Odds00  = mk.Odds00;
            Odds01  = mk.Odds01;
            Odds02  = mk.Odds02;
            Odds03  = mk.Odds03;
            Odds04  = mk.Odds04;
            Odds10  = mk.Odds10;
            Odds11  = mk.Odds11;
            Odds12  = mk.Odds12;
            Odds13  = mk.Odds13;
            Odds14  = mk.Odds14;
            Odds20  = mk.Odds20;
            Odds21  = mk.Odds21;
            Odds22  = mk.Odds22;
            Odds23  = mk.Odds23;
            Odds24  = mk.Odds24;
            Odds30  = mk.Odds30;
            Odds31  = mk.Odds31;
            Odds32  = mk.Odds32;
            Odds33  = mk.Odds33;
            Odds34  = mk.Odds34;
            Odds40  = mk.Odds40;
            Odds41  = mk.Odds41;
            Odds42  = mk.Odds42;
            Odds43  = mk.Odds43;
            Odds44  = mk.Odds44;
            Odds50  = mk.Odds50;
            Odds05  = mk.Odds05;
            AnyOdds = mk.AnyOdds;
            return(true);
        }
Exemplo n.º 10
0
 /// <summary>
 /// 检查是否更新并设定新值
 /// </summary>
 /// <param name="meb"></param>
 /// <returns></returns>
 internal virtual bool CompareSet(MarketEntityBase meb)
 {
     return(false);
 }