public bool startup()
 {
     TCPCmdDispatcher.getInstance().registerProcessorEx(2070, 1, 1, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(2071, 1, 1, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(2072, 2, 2, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(2073, 1, 1, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(2074, 4, 4, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(2075, 1, 1, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(2076, 2, 2, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(2077, 2, 2, UserRegressActiveManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
     return(true);
 }
        public RegressActiveOpcode ProcessRegressAcitveDayBuy(GameClient client, int Role, int Level, out Dictionary <int, int> ZhiGouDict)
        {
            ZhiGouDict = null;
            RegressActiveOpen   iflAct = HuodongCachingMgr.GetRegressActiveOpen();
            RegressActiveOpcode result;
            string Regtime;

            if (iflAct == null || !iflAct.InActivityTime())
            {
                result = RegressActiveOpcode.RegressActiveOpenErr;
            }
            else if (!iflAct.CanGiveAward())
            {
                result = RegressActiveOpcode.RegressActiveNotIn;
            }
            else if (!UserRegressActiveManager.GetRegressMinRegtime(client, out Regtime) || Regtime == null || Regtime.Equals(""))
            {
                result = RegressActiveOpcode.RegressActiveGetRegTime;
            }
            else
            {
                int ConfID;
                int CaleLevel = iflAct.GetUserActiveFile(Regtime, out ConfID);
                if (0 == CaleLevel)
                {
                    result = RegressActiveOpcode.RegressActiveGetFile;
                }
                else if (CaleLevel != Level)
                {
                    result = RegressActiveOpcode.RegressActiveGetFile;
                }
                else
                {
                    Dictionary <int, int> ZhiGouInfoDict = new Dictionary <int, int>();
                    RegressActiveDayBuy   act            = HuodongCachingMgr.GetRegressActiveDayBuy();
                    if (null == act)
                    {
                        result = RegressActiveOpcode.RegressActiveBuyGetInfoErr;
                    }
                    else
                    {
                        ZhiGouInfoDict = act.BuildRegressZhiGouInfoForClient(client);
                        ZhiGouDict     = ZhiGouInfoDict;
                        result         = RegressActiveOpcode.RegressActiveSucc;
                    }
                }
            }
            return(result);
        }
Exemple #3
0
        public bool CheckValidChargeItem(GameClient client, int zhigouID)
        {
            bool result;

            if (!this.ActZhiGouIDSet.Contains(zhigouID))
            {
                result = true;
            }
            else
            {
                RegressActiveOpen iflAct = HuodongCachingMgr.GetRegressActiveOpen();
                if (null == iflAct)
                {
                    result = false;
                }
                else if (!iflAct.InActivityTime())
                {
                    result = true;
                }
                else if (!iflAct.CanGiveAward())
                {
                    result = false;
                }
                else
                {
                    DateTime now        = TimeUtil.NowDateTime();
                    string   newtime    = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second).ToString("yyyy-MM-dd HH:mm:ss");
                    int      CDate      = Global.GetOffsetDay(DateTime.Parse(newtime)) - Global.GetOffsetDay(DateTime.Parse(iflAct.FromDate));
                    string   ZeroTime   = "2011-11-11 00$00$00";
                    string   GetInfoStr = string.Format("{0}:{1}:{2}", client.ClientData.RoleID, ZeroTime, iflAct.FromDate.Replace(':', '$'));
                    string[] dbResult;
                    if (TCPProcessCmdResults.RESULT_FAILED == Global.RequestToDBServer(Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, 14136, GetInfoStr, out dbResult, 0))
                    {
                        result = false;
                    }
                    else if (dbResult == null || dbResult.Length != 2 || Convert.ToInt32(dbResult[0]) != client.ClientData.RoleID)
                    {
                        result = false;
                    }
                    else
                    {
                        int Money = Convert.ToInt32(dbResult[1]);
                        if (Money < 0)
                        {
                            Money = 0;
                        }
                        string Regtime;
                        if (!UserRegressActiveManager.GetRegressMinRegtime(client, out Regtime) || Regtime == null || Regtime.Equals(""))
                        {
                            result = false;
                        }
                        else
                        {
                            int ConfID;
                            int CaleLevel = iflAct.GetUserActiveFile(Regtime, out ConfID);
                            if (0 == CaleLevel)
                            {
                                result = false;
                            }
                            else
                            {
                                foreach (RegressActiveDayBuyXML item in this.regressActiveDayBuyXML.Values)
                                {
                                    if (item.ZhiGouID == zhigouID)
                                    {
                                        foreach (KeyValuePair <int, int> it in item.TotalYuanBao)
                                        {
                                            if (it.Value == -1 && Money < it.Key)
                                            {
                                                return(false);
                                            }
                                            if ((it.Value != -1 && Money > it.Value) || Money < it.Key)
                                            {
                                                return(false);
                                            }
                                        }
                                        if (CDate + 1 != item.Day)
                                        {
                                            return(false);
                                        }
                                        return(true);
                                    }
                                }
                                result = false;
                            }
                        }
                    }
                }
            }
            return(result);
        }
        public static void initialize()
        {
            ZhanMengShiJianManager.getInstance().initialize();
            JingJiChangManager.getInstance().initialize();
            LiXianBaiTanManager.getInstance().initialize();
            LiXianGuaJiManager.getInstance().initialize();
            CmdRegisterTriggerManager.getInstance().initialize();
            SendCmdManager.getInstance().initialize();
            BossAIManager.getInstance().initialize();
            WashPropsManager.initialize();
            SaleManager.getInstance().initialize();
            LianZhiManager.GetInstance().initialize();
            ChengJiuManager.GetInstance().initialize();
            PrestigeMedalManager.getInstance().initialize();
            UnionPalaceManager.getInstance().initialize();
            UserActivateManager.getInstance().initialize();
            PetSkillManager.getInstance().initialize();
            UserReturnManager.getInstance().initialize();
            OlympicsManager.getInstance().initialize();
            TalentManager.getInstance().initialize();
            TodayManager.getInstance().initialize();
            FundManager.getInstance().initialize();
            WarnManager.getInstance().initialize();
            EMoLaiXiCopySceneManager.LoadEMoLaiXiCopySceneInfo();
            LuoLanFaZhenCopySceneManager.initialize();
            MarryFuBenMgr.getInstance().initialize();
            MarryLogic.LoadMarryBaseConfig();
            MarryPartyLogic.getInstance().LoadMarryPartyConfig();
            BuildingManager.getInstance().initialize();
            OnePieceManager.getInstance().initialize();
            GlobalServiceManager.RegisterManager4Scene(0, SingletonTemplate <CopyTeamManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(0, KuaFuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(35, LangHunLingYuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, RebornManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, RebornBoss.getInstance());
            GlobalServiceManager.RegisterManager4Scene(24, LuoLanChengZhanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, FashionManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, OrnamentManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ShenJiFuWenManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, YaoSaiJianYuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, AlchemyManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, EraManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, VideoLogic.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, SpecPlatFuLiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(25, HuanYingSiYuanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10000, JingLingQiYuanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(26, TianTiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(27, YongZheZhanChangManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(39, KingOfBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(45, BangHuiMatchManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(48, CompManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(52, CompBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(53, CompMineManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(57, ZorkBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(47, KuaFuLueDuoManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, KarenBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(41, KarenBattleManager_MapWest.getInstance());
            GlobalServiceManager.RegisterManager4Scene(42, KarenBattleManager_MapEast.getInstance());
            GlobalServiceManager.RegisterManager4Scene(29, SingletonTemplate <MoRiJudgeManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(28, ElementWarManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(49, WanMoXiaGuManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(34, CopyWolfManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(31, KuaFuBossManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10003, KuaFuMapManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10002, SpreadManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(36, SingletonTemplate <ZhengBaManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(38, SingletonTemplate <CoupleArenaManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(10004, AllyManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(10005, SingletonTemplate <CoupleWishManager> .Instance());
            GlobalServiceManager.RegisterManager4Scene(40, ZhengDuoManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, AoYunDaTiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, RoleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ZhuanPanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ShenQiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, JunTuanManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, LingDiCaiJiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, HongBaoManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, YaoSaiBossManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, YaoSaiMissionManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, HuiJiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, DeControl.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, GVoiceManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ShenShiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, JueXingManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ZuoQiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ThemeBoss.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, ArmorManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, JingLingYuanSuJueXingManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, BianShenManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(55, TianTi5v5Manager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, UserRegressActiveManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, MountHolyStampManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, MazingerStoreManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, GlodAuctionProcessCmdEx.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, BoCaiManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, FunctionSendManager.GetInstance());
            GlobalServiceManager.RegisterManager4Scene(0, HuanLeDaiBiManager.GetInstance());
            GlobalServiceManager.RegisterManager4Scene(0, NewTimerProc.GetInstance());
            GlobalServiceManager.RegisterManager4Scene(56, ZhanDuiZhengBaManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(59, EscapeBattleManager.getInstance());
            GlobalServiceManager.RegisterManager4Scene(0, TestReceiveModel.getInstance());
            RobotTaskValidator.getInstance().Initialize(false, 0, 0, "");
            HolyItemManager.getInstance().Initialize();
            TarotManager.getInstance().Initialize();
            SingletonTemplate <SevenDayActivityMgr> .Instance().initialize();

            SingletonTemplate <SoulStoneManager> .Instance().initialize();

            SingletonTemplate <TradeBlackManager> .Instance().LoadConfig();

            lock (GlobalServiceManager.Scene2ManagerDict)
            {
                foreach (List <IManager> list in GlobalServiceManager.Scene2ManagerDict.Values)
                {
                    foreach (IManager i in list)
                    {
                        bool success = true;
                        try
                        {
                            success = (success && i.initialize());
                            IManager2 m2 = i as IManager2;
                            if (null != m2)
                            {
                                success = (success && m2.initialize(GameCoreInterface.getinstance()));
                            }
                        }
                        catch (Exception ex)
                        {
                            success = false;
                            LogManager.WriteException(ex.ToString());
                        }
                        if (GameManager.ServerStarting && !success)
                        {
                            LogManager.WriteLog(LogTypes.Fatal, string.Format("执行{0}.initialize()失败,按任意键继续启动!", i.GetType()), null, true);
                            Console.ReadKey();
                        }
                    }
                }
            }
            TenManager.getInstance().initialize();
            TenRetutnManager.getInstance().initialize();
            GiftCodeNewManager.getInstance().initialize();
            FaceBookManager.getInstance().initialize();
            AssemblyPatchManager.getInstance().initialize();
            IPStatisticsManager.getInstance().initialize();
            FuMoManager.getInstance().Initialize();
        }
        public RegressActiveOpcode ProcessRegressAcitveStore(GameClient client, int StoreConfID, int Level, int GoodsID, int Count)
        {
            RegressActiveOpen   iflAct = HuodongCachingMgr.GetRegressActiveOpen();
            RegressActiveOpcode result;
            string Regtime;

            if (iflAct == null || !iflAct.InActivityTime())
            {
                result = RegressActiveOpcode.RegressActiveOpenErr;
            }
            else if (!iflAct.CanGiveAward())
            {
                result = RegressActiveOpcode.RegressActiveNotIn;
            }
            else if (!UserRegressActiveManager.GetRegressMinRegtime(client, out Regtime) || Regtime == null || Regtime.Equals(""))
            {
                result = RegressActiveOpcode.RegressActiveGetRegTime;
            }
            else
            {
                int ConfID;
                int CaleLevel = iflAct.GetUserActiveFile(Regtime, out ConfID);
                if (0 == CaleLevel)
                {
                    result = RegressActiveOpcode.RegressActiveGetFile;
                }
                else if (CaleLevel != Level)
                {
                    result = RegressActiveOpcode.RegressActiveStoreCheckFail;
                }
                else
                {
                    DateTime nowDateTime = TimeUtil.NowDateTime();
                    string   CurrDate    = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, nowDateTime.Hour, nowDateTime.Minute, nowDateTime.Second).ToString("yyyy-MM-dd HH:mm:ss");
                    int      CDate       = Global.GetOffsetDay(DateTime.Parse(CurrDate)) - Global.GetOffsetDay(DateTime.Parse(iflAct.FromDate));
                    if (CDate < 0)
                    {
                        result = RegressActiveOpcode.RegressActiveStoreCheckDayFail;
                    }
                    else
                    {
                        RegressActiveStore StoreAct = HuodongCachingMgr.GetRegressActiveStore();
                        if (null == StoreAct)
                        {
                            result = RegressActiveOpcode.RegressActiveStoreConfErr;
                        }
                        else
                        {
                            string    stage = string.Format("{0}_{1}", Global.GetOffsetDay(DateTime.Parse(iflAct.FromDate)), Global.GetOffsetDay(DateTime.Parse(iflAct.ToDate)));
                            int       needYuanBao;
                            int       Sum;
                            GoodsData goodData;
                            if (!StoreAct.RegressStoreGoodsBuyCheck(client, StoreConfID, Level, CDate + 1, GoodsID, Count, stage, out needYuanBao, out Sum, out goodData))
                            {
                                result = RegressActiveOpcode.RegressActiveStoreBuyFail;
                            }
                            else if (goodData == null)
                            {
                                result = RegressActiveOpcode.RegressActiveStoreCheckGoodFail;
                            }
                            else if (Sum <= 0 || needYuanBao <= 0)
                            {
                                result = RegressActiveOpcode.RegressActiveStoreCheckParmErr;
                            }
                            else
                            {
                                int BagInt;
                                if (!RebornEquip.OneIsCanIntoRebornOrBaseBag(client, goodData, out BagInt))
                                {
                                    if (BagInt == 1)
                                    {
                                        return(RegressActiveOpcode.RegressActiveSignRebornBagFail);
                                    }
                                    if (BagInt == 2)
                                    {
                                        return(RegressActiveOpcode.RegressActiveSignBaseBagFail);
                                    }
                                }
                                if (!GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, needYuanBao, "三周年商城购买物品", true, true, false, DaiBiSySType.None))
                                {
                                    result = RegressActiveOpcode.RegressActiveStoreUserYuanBaoFail;
                                }
                                else
                                {
                                    string GetInfoStr = string.Format("{0}:{1}:{2}:{3}:{4}", new object[]
                                    {
                                        client.ClientData.RoleID,
                                        StoreConfID,
                                        CDate,
                                        Sum,
                                        stage
                                    });
                                    string[] dbResult;
                                    if (TCPProcessCmdResults.RESULT_FAILED == Global.RequestToDBServer(Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, 14135, GetInfoStr, out dbResult, 0))
                                    {
                                        result = RegressActiveOpcode.RegressActiveStoreInsertInfoErr;
                                    }
                                    else if (dbResult == null || dbResult.Length != 2 || Convert.ToInt32(dbResult[1]) != 0)
                                    {
                                        result = RegressActiveOpcode.RegressActiveStoreInsertInfoErr;
                                    }
                                    else
                                    {
                                        if (Global.GetGoodsRebornEquip(goodData.GoodsID) == 1)
                                        {
                                            Global.AddGoodsDBCommand_Hook(Global._TCPManager.TcpOutPacketPool, client, goodData.GoodsID, Count, goodData.Quality, goodData.Props, goodData.Forge_level, goodData.Binding, 15000, goodData.Jewellist, true, 1, "三周年商城购买", false, "1900-01-01 12:00:00", 0, 0, 0, 0, 0, 0, 0, false, null, null, "1900-01-01 12:00:00", 0, true);
                                        }
                                        else
                                        {
                                            Global.AddGoodsDBCommand_Hook(Global._TCPManager.TcpOutPacketPool, client, goodData.GoodsID, Count, goodData.Quality, goodData.Props, goodData.Forge_level, goodData.Binding, 0, goodData.Jewellist, true, 1, "三周年商城购买", false, "1900-01-01 12:00:00", 0, 0, 0, 0, 0, 0, 0, false, null, null, "1900-01-01 12:00:00", 0, true);
                                        }
                                        result = RegressActiveOpcode.RegressActiveSucc;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }
        public RegressActiveOpcode ProcessRegressAcitveRecharge(GameClient client, int Level, int RechargeConfID)
        {
            RegressActiveOpen   iflAct = HuodongCachingMgr.GetRegressActiveOpen();
            RegressActiveOpcode result;
            string Regtime;

            if (iflAct == null || !iflAct.InActivityTime())
            {
                result = RegressActiveOpcode.RegressActiveOpenErr;
            }
            else if (!iflAct.CanGiveAward())
            {
                result = RegressActiveOpcode.RegressActiveNotIn;
            }
            else if (!UserRegressActiveManager.GetRegressMinRegtime(client, out Regtime) || Regtime == null || Regtime.Equals(""))
            {
                result = RegressActiveOpcode.RegressActiveGetRegTime;
            }
            else
            {
                int ConfID;
                int CaleLevel = iflAct.GetUserActiveFile(Regtime, out ConfID);
                if (0 == CaleLevel)
                {
                    result = RegressActiveOpcode.RegressActiveGetFile;
                }
                else if (CaleLevel != Level)
                {
                    result = RegressActiveOpcode.RegressActiveGetFile;
                }
                else
                {
                    DateTime nowDateTime = TimeUtil.NowDateTime();
                    string   endtime     = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, nowDateTime.Hour, nowDateTime.Minute, nowDateTime.Second).ToString("yyyy-MM-dd HH:mm:ss");
                    string   GetInfoStr  = string.Format("{0}:{1}:{2}", client.ClientData.RoleID, iflAct.FromDate.Replace(':', '$'), endtime.Replace(':', '$'));
                    string[] dbResult;
                    if (TCPProcessCmdResults.RESULT_FAILED == Global.RequestToDBServer(Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, 14136, GetInfoStr, out dbResult, 0))
                    {
                        result = RegressActiveOpcode.RegressActiveInputGetInfoErr;
                    }
                    else if (dbResult == null || dbResult.Length != 2 || Convert.ToInt32(dbResult[0]) != client.ClientData.RoleID)
                    {
                        result = RegressActiveOpcode.RegressActiveInputGetInfoErr;
                    }
                    else
                    {
                        int Money = Convert.ToInt32(dbResult[1]);
                        if (Money < 0)
                        {
                            Money = 0;
                        }
                        string   stage           = string.Format("{0}_{1}", Global.GetOffsetDay(DateTime.Parse(iflAct.FromDate)), Global.GetOffsetDay(DateTime.Parse(iflAct.ToDate)));
                        string   GetAwardInfoStr = string.Format("{0}:{1}:{2}", client.ClientData.RoleID, 112, stage);
                        string   Repair          = "";
                        string[] dbResult2;
                        Global.RequestToDBServer(Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, 14137, GetAwardInfoStr, out dbResult2, 0);
                        if (dbResult2 == null || dbResult2.Length != 4 || Convert.ToInt32(dbResult2[0]) != client.ClientData.RoleID)
                        {
                            result = RegressActiveOpcode.RegressActiveInputGetInfoErr;
                        }
                        else
                        {
                            if (!dbResult2[3].Equals(""))
                            {
                                string[] idList = dbResult2[3].Split(new char[]
                                {
                                    '_'
                                });
                                foreach (string it in idList)
                                {
                                    if (!it.Equals("") && Convert.ToInt32(it) == RechargeConfID)
                                    {
                                        return(RegressActiveOpcode.RegressActiveInputHas);
                                    }
                                }
                                Repair = this.RepairRegressStoreData(idList);
                                if (!string.IsNullOrEmpty(Repair) && !Repair.Equals(dbResult2[3]))
                                {
                                    string SqlStr = string.Format("{0}:{1}:{2}:{3}", new object[]
                                    {
                                        client.ClientData.RoleID,
                                        112,
                                        Repair,
                                        stage
                                    });
                                    string[] SqlCmd = Global.ExecuteDBCmd(14138, SqlStr, 0);
                                    if (SqlCmd == null || SqlCmd.Length != 4)
                                    {
                                        return(RegressActiveOpcode.RegressActiveUpdateInputInfoErr);
                                    }
                                }
                            }
                            RegressActiveTotalRecharge SignAct = HuodongCachingMgr.GetRegressActiveTotalRecharge();
                            List <GoodsData>           goodsList;
                            if (SignAct == null || !SignAct.InActivityTime())
                            {
                                result = RegressActiveOpcode.RegressActiveInputConfErr;
                            }
                            else if (SignAct.GiveAwardCheck(client, Level, Money, RechargeConfID, out goodsList))
                            {
                                result = RegressActiveOpcode.RegressActiveInputCheckAwardErr;
                            }
                            else if (goodsList == null)
                            {
                                result = RegressActiveOpcode.RegressActiveInputCheckAwardErr;
                            }
                            else
                            {
                                int BagInt;
                                if (!RebornEquip.MoreIsCanIntoRebornOrBaseBag(client, goodsList, out BagInt))
                                {
                                    if (BagInt == 1)
                                    {
                                        return(RegressActiveOpcode.RegressActiveSignRebornBagFail);
                                    }
                                    if (BagInt == 2)
                                    {
                                        return(RegressActiveOpcode.RegressActiveSignBaseBagFail);
                                    }
                                }
                                DateTime FromActDate  = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, 0, 0, 0);
                                DateTime ToActDate    = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, 23, 59, 59);
                                string   beginStr     = FromActDate.ToString("yyyy-MM-dd HH:mm:ss").Replace(':', '$');
                                string   endStr       = ToActDate.ToString("yyyy-MM-dd HH:mm:ss").Replace(':', '$');
                                string   keyHasStr    = string.Format("{0}_{1}", beginStr, endStr);
                                string   ativedata    = Repair + "_" + RechargeConfID.ToString();
                                string   WriteInfoStr = string.Format("{0}:{1}:{2}:{3}", new object[]
                                {
                                    client.ClientData.RoleID,
                                    112,
                                    ativedata,
                                    stage
                                });
                                string[] resData = Global.ExecuteDBCmd(14138, WriteInfoStr, 0);
                                if (resData == null || resData.Length != 4)
                                {
                                    result = RegressActiveOpcode.RegressActiveUpdateInputInfoErr;
                                }
                                else if (!SignAct.GiveAward(client, goodsList))
                                {
                                    result = RegressActiveOpcode.RegressActiveInputGiveAwardErr;
                                }
                                else
                                {
                                    result = RegressActiveOpcode.RegressActiveSucc;
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }
        public RegressActiveOpcode ProcessRegressAcitveDaySignAward(GameClient client, int Level, int Day)
        {
            RegressActiveOpen   iflAct = HuodongCachingMgr.GetRegressActiveOpen();
            RegressActiveOpcode result;
            string Regtime;

            if (iflAct == null || !iflAct.InActivityTime())
            {
                result = RegressActiveOpcode.RegressActiveOpenErr;
            }
            else if (!iflAct.CanGiveAward())
            {
                result = RegressActiveOpcode.RegressActiveNotIn;
            }
            else if (!UserRegressActiveManager.GetRegressMinRegtime(client, out Regtime) || Regtime == null || Regtime.Equals(""))
            {
                result = RegressActiveOpcode.RegressActiveGetRegTime;
            }
            else
            {
                int ConfID;
                int CaleLevel = iflAct.GetUserActiveFile(Regtime, out ConfID);
                if (0 == CaleLevel)
                {
                    result = RegressActiveOpcode.RegressActiveGetFile;
                }
                else if (CaleLevel != Level)
                {
                    result = RegressActiveOpcode.RegressActiveSignCheckFail;
                }
                else
                {
                    string stage      = string.Format("{0}_{1}", Global.GetOffsetDay(DateTime.Parse(iflAct.FromDate)), Global.GetOffsetDay(DateTime.Parse(iflAct.ToDate)));
                    string GetInfoStr = string.Format("{0}:{1}:{2}", client.ClientData.RoleID, 111, stage);
                    Dictionary <string, string> SignInfoStr = Global.sendToDB <Dictionary <string, string>, string>(14132, GetInfoStr, 0);
                    if (SignInfoStr == null)
                    {
                        result = RegressActiveOpcode.RegressActiveSignSelectFail;
                    }
                    else
                    {
                        DateTime nowDateTime = TimeUtil.NowDateTime();
                        DateTime FromActDate = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, 0, 0, 0);
                        DateTime ToActDate   = new DateTime(nowDateTime.Year, nowDateTime.Month, nowDateTime.Day, 23, 59, 59);
                        string   SignInfo;
                        Dictionary <int, int> Info = this.ProcessSignInfo(SignInfoStr, Global.GetOffsetDay(nowDateTime), out SignInfo);
                        if (Info == null)
                        {
                            result = RegressActiveOpcode.RegressActiveGetSignInfoErr;
                        }
                        else
                        {
                            Dictionary <int, int> Dict = this.ChangeData(SignInfoStr, Info);
                            int state;
                            if (!Dict.TryGetValue(Day, out state))
                            {
                                result = RegressActiveOpcode.RegressActiveSignNotDay;
                            }
                            else if (state == 1)
                            {
                                result = RegressActiveOpcode.RegressActiveSignHas;
                            }
                            else
                            {
                                RegressActiveSignGift SignAct = HuodongCachingMgr.GetRegressActiveSignGift();
                                List <GoodsData>      OutGoodsList;
                                int DBDay;
                                if (SignAct == null || !SignAct.InActivityTime())
                                {
                                    result = RegressActiveOpcode.RegressActiveSignConfErr;
                                }
                                else if (!SignAct.GetAwardGoodsList(client, Level, Day, out OutGoodsList, out DBDay))
                                {
                                    result = RegressActiveOpcode.RegressActiveSignGetAwardFail;
                                }
                                else
                                {
                                    int BagInt;
                                    if (!RebornEquip.MoreIsCanIntoRebornOrBaseBag(client, OutGoodsList, out BagInt))
                                    {
                                        if (BagInt == 1)
                                        {
                                            return(RegressActiveOpcode.RegressActiveSignRebornBagFail);
                                        }
                                        if (BagInt == 2)
                                        {
                                            return(RegressActiveOpcode.RegressActiveSignBaseBagFail);
                                        }
                                    }
                                    string beginStr  = FromActDate.ToString("yyyy-MM-dd HH:mm:ss").Replace(':', '$');
                                    string endStr    = ToActDate.ToString("yyyy-MM-dd HH:mm:ss").Replace(':', '$');
                                    string keyHasStr = string.Format("{0}_{1}", beginStr, endStr);
                                    SignInfo = SignInfo + "|" + DBDay.ToString();
                                    string WriteInfoStr = string.Format("{0}:{1}:{2}:{3}", new object[]
                                    {
                                        client.ClientData.RoleID,
                                        111,
                                        SignInfo,
                                        stage
                                    });
                                    string[] resData = Global.ExecuteDBCmd(14138, WriteInfoStr, 0);
                                    if (resData == null || resData.Length != 4)
                                    {
                                        result = RegressActiveOpcode.RegressActiveSignRecordFail;
                                    }
                                    else if (!SignAct.GiveAward(client, OutGoodsList))
                                    {
                                        result = RegressActiveOpcode.RegressActiveSignGiveAwardFail;
                                    }
                                    else
                                    {
                                        result = RegressActiveOpcode.RegressActiveSucc;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }
        public RegressActiveOpcode ProcessGetRegressAcitveFile(GameClient client, out string ToClientRegtime, out int ToClientID, out int ToClientLevel, out int CurrDay, out int ActiveMoney)
        {
            ToClientRegtime = "";
            ToClientID      = 0;
            ToClientLevel   = 0;
            CurrDay         = 0;
            ActiveMoney     = 0;
            string UserID = client.strUserID;
            RegressActiveOpcode result;

            if (UserID == null || UserID.Equals("") || !UserID.Equals(client.strUserID))
            {
                result = RegressActiveOpcode.RegressActiveUserInfoErr;
            }
            else
            {
                RegressActiveOpen iflAct = HuodongCachingMgr.GetRegressActiveOpen();
                string            Regtime;
                if (iflAct == null || !iflAct.InActivityTime())
                {
                    result = RegressActiveOpcode.RegressActiveOpenErr;
                }
                else if (!iflAct.CanGiveAward())
                {
                    result = RegressActiveOpcode.RegressActiveNotIn;
                }
                else if (!UserRegressActiveManager.GetRegressMinRegtime(client, out Regtime) || Regtime == null || Regtime.Equals(""))
                {
                    result = RegressActiveOpcode.RegressActiveGetRegTime;
                }
                else
                {
                    int ConfID;
                    int Level = iflAct.GetUserActiveFile(Regtime, out ConfID);
                    if (0 == Level)
                    {
                        result = RegressActiveOpcode.RegressActiveGetFile;
                    }
                    else
                    {
                        ToClientRegtime = Regtime.Replace(":", "$");
                        ToClientID      = ConfID;
                        ToClientLevel   = Level;
                        DateTime nowDateTime = TimeUtil.NowDateTime();
                        int      Day         = Global.GetOffsetDay(nowDateTime) - Global.GetOffsetDay(DateTime.Parse(iflAct.FromDate));
                        CurrDay = Day + 1;
                        string   ZeroTime   = "2011-11-11 00$00$00";
                        string   GetInfoStr = string.Format("{0}:{1}:{2}", client.ClientData.RoleID, ZeroTime, iflAct.FromDate.Replace(':', '$'));
                        string[] dbResult;
                        if (TCPProcessCmdResults.RESULT_FAILED == Global.RequestToDBServer(Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, 14136, GetInfoStr, out dbResult, 0))
                        {
                            result = RegressActiveOpcode.RegressActiveGetFile;
                        }
                        else if (dbResult == null || dbResult.Length != 2 || Convert.ToInt32(dbResult[0]) != client.ClientData.RoleID)
                        {
                            result = RegressActiveOpcode.RegressActiveGetFile;
                        }
                        else
                        {
                            int Money = Convert.ToInt32(dbResult[1]);
                            if (Money < 0)
                            {
                                Money = 0;
                            }
                            ActiveMoney = Money;
                            result      = RegressActiveOpcode.RegressActiveSucc;
                        }
                    }
                }
            }
            return(result);
        }