Esempio n. 1
0
        public bool KFCallMsgFunc(KFCallMsg msg)
        {
            try
            {
                switch (msg.KuaFuEventType)
                {
                case 10039:
                {
                    KFStageData data = msg.Get <KFStageData>();
                    if (null != data)
                    {
                        if (data.BoCaiType == BoCaiTypeEnum.Bocai_CaiShuzi)
                        {
                            BoCaiCaiShuZi.GetInstance().SetStageData(data, true);
                        }
                        else if (data.BoCaiType == BoCaiTypeEnum.Bocai_Dice)
                        {
                            BoCaiCaiDaXiao.GetInstance().SetStageData(data, true);
                        }
                    }
                    else
                    {
                        BoCaiCaiDaXiao.GetInstance().SetStageData(data, true);
                        BoCaiCaiShuZi.GetInstance().SetStageData(data, true);
                    }
                    break;
                }

                case 10040:
                {
                    OpenLottery data2 = msg.Get <OpenLottery>();
                    if (null != data2)
                    {
                        if (data2.BocaiType == 2)
                        {
                            BoCaiCaiShuZi.GetInstance().SetOpenLotteryData(data2, false, false);
                        }
                        else if (data2.BocaiType == 1)
                        {
                            BoCaiCaiDaXiao.GetInstance().SetOpenLotteryData(data2, false, true);
                        }
                    }
                    else
                    {
                        BoCaiCaiDaXiao.GetInstance().SetOpenLotteryData(data2, false, true);
                        BoCaiCaiShuZi.GetInstance().SetOpenLotteryData(data2, false, false);
                    }
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_博彩]跨服消息{0}", ex.ToString()), null, true);
            }
            return(true);
        }
Esempio n. 2
0
 public bool KFCallMsgFunc(KFCallMsg msg)
 {
     try
     {
         int kuaFuEventType = msg.KuaFuEventType;
         if (kuaFuEventType == 10041)
         {
             if (!this.flag)
             {
                 this.receiveStopNum++;
                 TcpCall.TestS2KFCommunication.SendData(1, false);
                 if (this.receiveStopNum % 100 == 0)
                 {
                     Console.ForegroundColor = ConsoleColor.Red;
                     SysConOut.WriteLine(string.Format("结束服务器接收异步消息 {0}", this.receiveStopNum));
                     Console.ForegroundColor = ConsoleColor.White;
                 }
                 return(true);
             }
             string data = msg.Get <string>();
             if (null != data)
             {
                 this.receiveSuNum++;
             }
             else
             {
                 this.receiveErrNum++;
             }
             if (this.receiveErrNum + this.receiveSuNum == 50000)
             {
                 this.endTime = DateTime.Now;
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_博彩]跨服消息{0}", ex.ToString()), null, true);
     }
     return(true);
 }