Exemple #1
0
        public static void startup()
        {
            //战盟事件管理器
            ZhanMengShiJianManager.getInstance().startup();

            //竞技场管理器
            JingJiChangManager.getInstance().startup();

            //离线摆摊
            LiXianBaiTanManager.getInstance().startup();

            //离线挂机
            LiXianGuaJiManager.getInstance().startup();

            //副本活动组队管理器
            CopyTeamManager.getInstance().startup();

            //指令注册管理器
            CmdRegisterTriggerManager.getInstance().startup();

            //发送指令管理
            SendCmdManager.getInstance().startup();

            //Boss AI管理器
            BossAIManager.getInstance().startup();

            //MU交易所
            SaleManager.getInstance().startup();

            //炼制系统
            LianZhiManager.GetInstance().startup();

            // 成就升级
            ChengJiuManager.GetInstance().startup();
        }
        public void processCmd(GameServerClient client, byte[] cmdParams, int count)
        {
            string cmd = new UTF8Encoding().GetString(cmdParams, 0, count);

            string[] param = cmd.Split(':');

            ZhanMengShiJianData data = new ZhanMengShiJianData();

            data.BHID        = Convert.ToInt32(param[0]);
            data.RoleName    = Convert.ToString(param[1]);
            data.ShiJianType = Convert.ToInt32(param[2]);
            data.SubValue1   = Convert.ToInt32(param[3]);
            data.SubValue2   = Convert.ToInt32(param[4]);
            data.SubValue3   = Convert.ToInt32(param[5]);
            data.CreateTime  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            //需要特殊处理的战盟事件类型: 职务改变
            if (data.ShiJianType == ZhanMengShiJianConstants.ChangeZhiWu)
            {
                string otherRoleName;
                string otherUserID;
                Global.GetRoleNameAndUserID(DBManager.getInstance(), data.SubValue3, out otherRoleName, out otherUserID);
                data.RoleName = otherRoleName;
            }

            ZhanMengShiJianManager.getInstance().onAddZhanMengShiJian(data);

            byte[] arrSendData = DataHelper.ObjectToBytes <string>(string.Format("{0}", 1));
            client.sendCmd((int)TCPGameServerCmds.CMD_DB_ADD_ZHANMENGSHIJIAN, arrSendData);
        }
        public void processCmd(GameServerClient client, int nID, byte[] cmdParams, int count)
        {
            int[] param     = DataHelper.BytesToObject <int[]>(cmdParams, 0, count);
            int   bhId      = param[0];
            int   pageIndex = param[1];

            client.sendCmd <List <ZhanMengShiJianData> >(10139, ZhanMengShiJianManager.getInstance().getDetailByPageIndex(bhId, pageIndex));
        }
        public static void startup()
        {
            ZhanMengShiJianManager.getInstance().startup();
            JingJiChangManager.getInstance().startup();
            LiXianBaiTanManager.getInstance().startup();
            LiXianGuaJiManager.getInstance().startup();
            CmdRegisterTriggerManager.getInstance().startup();
            SendCmdManager.getInstance().startup();
            BossAIManager.getInstance().startup();
            SaleManager.getInstance().startup();
            LianZhiManager.GetInstance().startup();
            ChengJiuManager.GetInstance().startup();
            UserReturnManager.getInstance().startup();
            OlympicsManager.getInstance().startup();
            TalentManager.getInstance().startup();
            TodayManager.getInstance().startup();
            FundManager.getInstance().startup();
            WarnManager.getInstance().startup();
            PrestigeMedalManager.getInstance().startup();
            UnionPalaceManager.getInstance().startup();
            UserActivateManager.getInstance().startup();
            PetSkillManager.getInstance().startup();
            BuildingManager.getInstance().startup();
            OnePieceManager.getInstance().startup();
            TenManager.getInstance().startup();
            SingletonTemplate <SevenDayActivityMgr> .Instance().startup();

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

            lock (GlobalServiceManager.Scene2ManagerDict)
            {
                foreach (List <IManager> list in GlobalServiceManager.Scene2ManagerDict.Values)
                {
                    foreach (IManager i in list)
                    {
                        try
                        {
                            bool success = i.startup();
                            if (GameManager.ServerStarting && !success)
                            {
                                LogManager.WriteLog(LogTypes.Fatal, string.Format("初始化{0}.startup()失败,按任意键忽略此错误并继续启动服务器!", i.GetType()), null, true);
                                Console.ReadKey();
                            }
                        }
                        catch (Exception ex)
                        {
                            LogManager.WriteException(ex.ToString());
                        }
                    }
                }
            }
            FaceBookManager.getInstance().startup();
        }
        public static void destroy()
        {
            ZhanMengShiJianManager.getInstance().destroy();
            JingJiChangManager.getInstance().destroy();
            LiXianBaiTanManager.getInstance().destroy();
            LiXianGuaJiManager.getInstance().destroy();
            CmdRegisterTriggerManager.getInstance().destroy();
            SendCmdManager.getInstance().destroy();
            BossAIManager.getInstance().destroy();
            SaleManager.getInstance().destroy();
            LianZhiManager.GetInstance().destroy();
            ChengJiuManager.GetInstance().destroy();
            PrestigeMedalManager.getInstance().destroy();
            UnionPalaceManager.getInstance().destroy();
            UserActivateManager.getInstance().destroy();
            PetSkillManager.getInstance().destroy();
            UserReturnManager.getInstance().destroy();
            OlympicsManager.getInstance().destroy();
            TalentManager.getInstance().destroy();
            TodayManager.getInstance().destroy();
            FundManager.getInstance().destroy();
            WarnManager.getInstance().destroy();
            MarryFuBenMgr.getInstance().destroy();
            BuildingManager.getInstance().destroy();
            OnePieceManager.getInstance().destroy();
            TenManager.getInstance().destroy();
            SingletonTemplate <SevenDayActivityMgr> .Instance().destroy();

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

            lock (GlobalServiceManager.Scene2ManagerDict)
            {
                foreach (List <IManager> list in GlobalServiceManager.Scene2ManagerDict.Values)
                {
                    foreach (IManager i in list)
                    {
                        try
                        {
                            i.destroy();
                        }
                        catch (Exception ex)
                        {
                            LogManager.WriteException(ex.ToString());
                        }
                    }
                }
            }
            FaceBookManager.getInstance().destroy();
        }
Exemple #6
0
        public static void initialize()
        {
            //战盟事件管理器
            ZhanMengShiJianManager.getInstance().initialize();

            //竞技场管理器
            JingJiChangManager.getInstance().initialize();

            //离线摆摊
            LiXianBaiTanManager.getInstance().initialize();

            //离线挂机
            LiXianGuaJiManager.getInstance().initialize();

            //副本活动组队管理器
            CopyTeamManager.getInstance().initialize();

            //指令注册管理器
            CmdRegisterTriggerManager.getInstance().initialize();

            //发送指令管理
            SendCmdManager.getInstance().initialize();

            //Boss AI管理器
            BossAIManager.getInstance().initialize();

            //洗炼管理器
            WashPropsManager.initialize();

            //MU交易所
            SaleManager.getInstance().initialize();

            //炼制系统
            LianZhiManager.GetInstance().initialize();

            // 成就升级
            ChengJiuManager.GetInstance().initialize();

            //恶魔来袭
            EMoLaiXiCopySceneManager.LoadEMoLaiXiCopySceneInfo();
        }
        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();
        }
Exemple #8
0
        public static void initialize()
        {
#if BetaConfig
            int round = 9;
            Console.WriteLine("连接调试器或按任意键继续");
            do
            {
                Console.Write("\b\b" + round);
                if (Console.KeyAvailable)
                {
                    break;
                }
                Thread.Sleep(1000);
            } while (--round > 0);
            Console.Write("\b\b");
#endif
            //战盟事件管理器
            ZhanMengShiJianManager.getInstance().initialize();

            //竞技场管理器
            JingJiChangManager.getInstance().initialize();

            //离线摆摊
            LiXianBaiTanManager.getInstance().initialize();

            //离线挂机
            LiXianGuaJiManager.getInstance().initialize();

            //副本活动组队管理器
            CopyTeamManager.Instance().initialize();

            //指令注册管理器
            CmdRegisterTriggerManager.getInstance().initialize();

            //发送指令管理
            SendCmdManager.getInstance().initialize();

            //Boss AI管理器
            BossAIManager.getInstance().initialize();

            //洗炼管理器
            WashPropsManager.initialize();

            //MU交易所
            SaleManager.getInstance().initialize();

            //炼制系统
            LianZhiManager.GetInstance().initialize();

            // 成就升级
            ChengJiuManager.GetInstance().initialize();

            //声望勋章
            PrestigeMedalManager.getInstance().initialize();

            UnionPalaceManager.getInstance().initialize();
            UserActivateManager.getInstance().initialize();

            PetSkillManager.getInstance().initialize();

            //玩家召回
            UserReturnManager.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();

            //初始化跨服相关管理器
            RegisterManager4Scene((int)SceneUIClasses.Normal, KuaFuManager.getInstance());
            // RegisterManager4Scene((int)SceneUIClasses.LangHunLingYu, LangHunLingYuManager.getInstance());

            //注册罗兰城战管理器
            RegisterManager4Scene((int)SceneUIClasses.LuoLanChengZhan, LuoLanChengZhanManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.Normal, FashionManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.HuanYingSiYuan, HuanYingSiYuanManager.getInstance());
            RegisterManager4Scene((int)ManagerTypes.ClientGoodsList, JingLingQiYuanManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.TianTi, TianTiManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.YongZheZhanChang, YongZheZhanChangManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KingOfBattle, KingOfBattleManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.MoRiJudge, MoRiJudgeManager.Instance());
            RegisterManager4Scene((int)SceneUIClasses.ElementWar, ElementWarManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.CopyWolf, CopyWolfManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KuaFuBoss, KuaFuBossManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KuaFuMap, KuaFuMapManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.Spread, SpreadManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.KFZhengBa, ZhengBaManager.Instance());
            RegisterManager4Scene((int)SceneUIClasses.CoupleArena, CoupleArenaManager.Instance());
            RegisterManager4Scene((int)SceneUIClasses.Ally, AllyManager.getInstance());
            RegisterManager4Scene((int)SceneUIClasses.CoupleWish, CoupleWishManager.Instance());

            // 读取外挂列表和相关配置
            RobotTaskValidator.getInstance().Initialize(false, 0, 0, "");

            //初始化圣物系统相关配置
            HolyItemManager.getInstance().Initialize();

            //初始化塔罗牌相关配置
            TarotManager.getInstance().Initialize();

            // 七日活动
            SevenDayActivityMgr.Instance().initialize();

            // 魂石
            SoulStoneManager.Instance().initialize();

            TradeBlackManager.Instance().LoadConfig();
            //调用所有注册的管理模块的初始化函数
            lock (Scene2ManagerDict)
            {
                foreach (var list in Scene2ManagerDict.Values)
                {
                    foreach (var m in list)
                    {
                        bool      success = m.initialize();
                        IManager2 m2      = m as IManager2;
                        if (null != m2)
                        {
                            success = success && m2.initialize(GameCoreInterface.getinstance());
                        }

                        if (GameManager.ServerStarting && !success)
                        {
                            LogManager.WriteLog(LogTypes.Fatal, string.Format("执行{0}.initialize()失败,按任意键继续启动!", m.GetType()));
                            //Console.ReadKey(); HX_SERVER close the copy scenes;
                        }
                    }
                }
            }

            //应用宝
            TenManager.getInstance().initialize();
            TenRetutnManager.getInstance().initialize();

            //礼包码
            GiftCodeNewManager.getInstance().initialize();
        }
Exemple #9
0
        public static void destroy()
        {
            //战盟事件管理器
            ZhanMengShiJianManager.getInstance().destroy();

            //竞技场管理器
            JingJiChangManager.getInstance().destroy();

            //离线摆摊
            LiXianBaiTanManager.getInstance().destroy();

            //离线挂机
            LiXianGuaJiManager.getInstance().destroy();

            //副本活动组队管理器
            CopyTeamManager.Instance().destroy();

            //指令注册管理器
            CmdRegisterTriggerManager.getInstance().destroy();

            //发送指令管理
            SendCmdManager.getInstance().destroy();

            //Boss AI管理器
            BossAIManager.getInstance().destroy();

            //MU交易所
            SaleManager.getInstance().destroy();

            //炼制系统
            LianZhiManager.GetInstance().destroy();

            // 成就升级
            ChengJiuManager.GetInstance().destroy();

            //声望勋章
            PrestigeMedalManager.getInstance().destroy();

            UnionPalaceManager.getInstance().destroy();
            UserActivateManager.getInstance().destroy();

            PetSkillManager.getInstance().destroy();

            //玩家召回
            UserReturnManager.getInstance().destroy();

            //天赋
            TalentManager.getInstance().destroy();

            //每日专享
            TodayManager.getInstance().destroy();

            FundManager.getInstance().destroy();

            WarnManager.getInstance().destroy();

            //情侣副本管理器
            MarryFuBenMgr.getInstance().destroy();

            //领地
            BuildingManager.getInstance().destroy();

            //藏宝秘境
            OnePieceManager.getInstance().destroy();

            TenManager.getInstance().destroy();

            // 七日活动
            SevenDayActivityMgr.Instance().destroy();

            SoulStoneManager.Instance().destroy();

            //调用所有注册的管理模块的销毁函数
            lock (Scene2ManagerDict)
            {
                foreach (var list in Scene2ManagerDict.Values)
                {
                    foreach (var m in list)
                    {
                        m.destroy();
                    }
                }
            }
        }
Exemple #10
0
        public static void startup()
        {
            //战盟事件管理器
            ZhanMengShiJianManager.getInstance().startup();

            //竞技场管理器
            JingJiChangManager.getInstance().startup();

            //离线摆摊
            LiXianBaiTanManager.getInstance().startup();

            //离线挂机
            LiXianGuaJiManager.getInstance().startup();

            //副本活动组队管理器
            CopyTeamManager.Instance().startup();

            //指令注册管理器
            CmdRegisterTriggerManager.getInstance().startup();

            //发送指令管理
            SendCmdManager.getInstance().startup();

            //Boss AI管理器
            BossAIManager.getInstance().startup();

            //MU交易所
            SaleManager.getInstance().startup();

            //炼制系统
            LianZhiManager.GetInstance().startup();

            // 成就升级
            ChengJiuManager.GetInstance().startup();

            //玩家召回
            UserReturnManager.getInstance().startup();

            //天赋
            TalentManager.getInstance().startup();

            //每日专享
            TodayManager.getInstance().startup();

            FundManager.getInstance().startup();

            WarnManager.getInstance().startup();

            //声望勋章
            PrestigeMedalManager.getInstance().startup();

            UnionPalaceManager.getInstance().startup();
            UserActivateManager.getInstance().startup();

            PetSkillManager.getInstance().startup();

            //领地
            BuildingManager.getInstance().startup();

            //藏宝秘境
            OnePieceManager.getInstance().startup();

            TenManager.getInstance().startup();

            // 七日活动
            SevenDayActivityMgr.Instance().startup();

            SoulStoneManager.Instance().startup();

            //调用所有注册的管理模块的启动函数
            lock (Scene2ManagerDict)
            {
                foreach (var list in Scene2ManagerDict.Values)
                {
                    foreach (var m in list)
                    {
                        bool success = m.startup();
                        if (GameManager.ServerStarting && !success)
                        {
                            LogManager.WriteLog(LogTypes.Fatal, string.Format("初始化{0}.startup()失败,按任意键忽略此错误并继续启动服务器!", m.GetType()));
                            Console.ReadKey();
                        }
                    }
                }
            }
        }
Exemple #11
0
        public void processCmd(GameServerClient client, byte[] cmdParams, int count)
        {
            int[] param     = DataHelper.BytesToObject <int[]>(cmdParams, 0, count);
            int   bhId      = param[0];
            int   pageIndex = param[1];

            client.sendCmd <List <ZhanMengShiJianData> >((int)TCPGameServerCmds.CMD_DB_ZHANMENGSHIJIAN_DETAIL, ZhanMengShiJianManager.getInstance().getDetailByPageIndex(bhId, pageIndex));
        }
Exemple #12
0
        public TCPProcessCmdResults ProcChangeBangHuiName(DBManager dbMgr, TCPOutPacketPool pool, int nID, byte[] data, int count, out TCPOutPacket tcpOutPacket)
        {
            tcpOutPacket = null;
            string cmdData   = null;
            string bhOldName = "";

            try
            {
                cmdData = new UTF8Encoding().GetString(data, 0, count);
            }
            catch (Exception)
            {
                LogManager.WriteLog(LogTypes.Error, string.Format("解析指令字符串错误, CMD={0}", (TCPGameServerCmds)nID), null, true);
                tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, "0", 30767);
                return(TCPProcessCmdResults.RESULT_DATA);
            }
            try
            {
                string[] fields = cmdData.Split(new char[]
                {
                    ':'
                });
                if (fields.Length != 3)
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("指令参数个数错误, CMD={0}, Recv={1}, CmdData={2}", (TCPGameServerCmds)nID, fields.Length, cmdData), null, true);
                    tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, "0", 30767);
                    return(TCPProcessCmdResults.RESULT_DATA);
                }
                int    roleId                  = Convert.ToInt32(fields[0]);
                int    factionId               = Convert.ToInt32(fields[1]);
                string newName                 = fields[2];
                EChangeGuildNameError ne       = EChangeGuildNameError.DBFailed;
                DBRoleInfo            roleInfo = dbMgr.GetDBRoleInfo(ref roleId);
                if (null == roleInfo)
                {
                    ne = EChangeGuildNameError.DBFailed;
                }
                else
                {
                    lock (roleInfo)
                    {
                        if (roleInfo.Faction != factionId || roleInfo.BHZhiWu != 1)
                        {
                            ne = EChangeGuildNameError.OperatorDenied;
                            goto IL_381;
                        }
                    }
                    if (!this.IsNameCanUseInDb(dbMgr, newName))
                    {
                        ne = EChangeGuildNameError.InvalidName;
                    }
                    else
                    {
                        BangHuiDetailData detail = DBQuery.QueryBangHuiInfoByID(dbMgr, factionId);
                        if (detail == null || detail.CanModNameTimes <= 0 || detail.BZRoleID != roleId)
                        {
                            ne = EChangeGuildNameError.OperatorDenied;
                        }
                        else
                        {
                            bhOldName = detail.BHName;
                            SingletonTemplate <NameUsedMgr> .Instance().AddCannotUse_BangHui_Ex(detail.BHName);

                            if (!SingletonTemplate <NameUsedMgr> .Instance().AddCannotUse_BangHui_Ex(newName) || dbMgr.IsBangHuiNameExist(newName))
                            {
                                ne = EChangeGuildNameError.NameAlreadyUsed;
                            }
                            else
                            {
                                string sql = string.Format("UPDATE t_banghui SET bhname='{0}', can_mod_name_times={1} WHERE bhid={2}", newName, detail.CanModNameTimes - 1, factionId);
                                if (!this._Util_ExecNonQuery(dbMgr, sql))
                                {
                                    ne = EChangeGuildNameError.DBFailed;
                                }
                                else
                                {
                                    lock (roleInfo)
                                    {
                                        roleInfo.BHName = newName;
                                    }
                                    if (!DBWriter.UpdateAllRoleBangHuiName(dbMgr, factionId, newName))
                                    {
                                        LogManager.WriteLog(LogTypes.Error, string.Format("更新帮会id={0}的名字 {1} => {2},更新t_roles未(全部)成功", factionId, detail.BHName, newName), null, true);
                                    }
                                    List <DBRoleInfo> dbRoleInfoList = dbMgr.DBRoleMgr.GetCachingDBRoleInfoListByFaction(factionId);
                                    if (null != dbRoleInfoList)
                                    {
                                        for (int i = 0; i < dbRoleInfoList.Count; i++)
                                        {
                                            dbRoleInfoList[i].BHName = newName;
                                        }
                                    }
                                    ZhanMengShiJianData eventData = new ZhanMengShiJianData();
                                    eventData.BHID        = factionId;
                                    eventData.ShiJianType = ZhanMengShiJianConstants.ChangeName;
                                    eventData.RoleName    = roleInfo.RoleName;
                                    eventData.SubSzValue1 = newName;
                                    eventData.CreateTime  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                                    ZhanMengShiJianManager.getInstance().onAddZhanMengShiJian(eventData);
                                    string recordSql = string.Format("INSERT INTO t_change_name_banghui(bhid,by_role,old_name,new_name,time) VALUES({0},{1},'{2}','{3}','{4}')", new object[]
                                    {
                                        factionId,
                                        roleId,
                                        bhOldName,
                                        newName,
                                        DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                                    });
                                    this._Util_ExecNonQuery(dbMgr, recordSql);
                                    ne = EChangeGuildNameError.Success;
                                }
                            }
                        }
                    }
                }
IL_381:
                if (ne == EChangeGuildNameError.Success)
                {
                    GameDBManager.BangHuiLingDiMgr.OnChangeBangHuiName(factionId, bhOldName, newName);
                    string gmCmdData = string.Format("-synclingdi", new object[0]);
                    ChatMsgManager.AddGMCmdChatMsg(-1, gmCmdData);
                }
                tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, string.Format("{0}", (int)ne), nID);
                return(TCPProcessCmdResults.RESULT_DATA);
            }
            catch (Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "", false, false);
            }
            tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, "0", 30767);
            return(TCPProcessCmdResults.RESULT_DATA);
        }