Ejemplo n.º 1
0
        public static int getAwardRate(int FuBenID, int FuBenSeqID)
        {
            int result;

            if (FuBenID != LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID)
            {
                result = 1;
            }
            else
            {
                SingleLuoLanFaZhenFubenData fubenData = LuoLanFaZhenCopySceneManager.GetFubenData(FuBenSeqID);
                if (null == fubenData)
                {
                    result = 1;
                }
                else if (fubenData.SpecailBossLeftNum == 0)
                {
                    result = LuoLanFaZhenCopySceneManager.SpecialAwardRate;
                }
                else
                {
                    result = 1;
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static TCPProcessCmdResults ProcessFazhenBossCMD(TCPManager tcpMgr, TMSKSocket socket, TCPClientPool tcpClientPool, TCPOutPacketPool pool, int nID, byte[] data, int count, out TCPOutPacket tcpOutPacket)
        {
            tcpOutPacket = null;
            string cmdData = null;

            try
            {
                cmdData = new UTF8Encoding().GetString(data, 0, count);
            }
            catch (Exception)
            {
                LogManager.WriteLog(LogTypes.Error, string.Format("解析指令字符串错误, CMD={0}, Client={1}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false)), null, true);
                return(TCPProcessCmdResults.RESULT_FAILED);
            }
            try
            {
                string[] fields = cmdData.Split(new char[]
                {
                    ':'
                });
                if (fields.Length != 1)
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("指令参数个数错误, CMD={0}, Client={1}, Recv={2}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false), fields.Length), null, true);
                    return(TCPProcessCmdResults.RESULT_FAILED);
                }
                int        roleID = Convert.ToInt32(fields[0]);
                GameClient client = GameManager.ClientMgr.FindClient(socket);
                if (KuaFuManager.getInstance().ClientCmdCheckFaild(nID, client, ref roleID))
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("根据RoleID定位GameClient对象失败, CMD={0}, Client={1}, RoleID={2}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false), roleID), null, true);
                    return(TCPProcessCmdResults.RESULT_FAILED);
                }
                if (client.ClientData.FuBenID != LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID)
                {
                    return(TCPProcessCmdResults.RESULT_OK);
                }
                SingleLuoLanFaZhenFubenData fubenData = LuoLanFaZhenCopySceneManager.GetFubenData(client.ClientData.FuBenSeqID);
                if (null == fubenData)
                {
                    return(TCPProcessCmdResults.RESULT_OK);
                }
                string strcmd = string.Format("{0}:{1}:{2}:{3}:{4}", new object[]
                {
                    LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID,
                    LuoLanFaZhenCopySceneManager.FinalBossID,
                    fubenData.FinalBossLeftNum,
                    LuoLanFaZhenCopySceneManager.SpecialBossID,
                    fubenData.SpecailBossLeftNum
                });
                tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, strcmd, 760);
                return(TCPProcessCmdResults.RESULT_DATA);
            }
            catch (Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "ProcessFazhenBossCMD", false, false);
            }
            return(TCPProcessCmdResults.RESULT_FAILED);
        }
Ejemplo n.º 3
0
        protected static bool TryAddFubenData(int _FubenSeqID, int _FubenID, int _MapID, int _MapCode)
        {
            bool result;

            if (_FubenSeqID <= 0 || _FubenID <= 0 || _MapID <= 0 || _MapCode <= 0)
            {
                result = false;
            }
            else
            {
                FazhenMapData mapdata = null;
                SingleLuoLanFaZhenFubenData fubenData = null;
                lock (LuoLanFaZhenCopySceneManager.AllFazhenFubenData)
                {
                    if (!LuoLanFaZhenCopySceneManager.AllFazhenFubenData.TryGetValue(_FubenSeqID, out fubenData) || null == fubenData)
                    {
                        fubenData = new SingleLuoLanFaZhenFubenData
                        {
                            FubenID    = _FubenID,
                            FubenSeqID = _FubenSeqID
                        };
                        mapdata = new FazhenMapData
                        {
                            CopyMapID = _MapID,
                            MapCode   = _MapCode
                        };
                        LuoLanFaZhenCopySceneManager.CreateRandomGates(_MapCode, mapdata);
                        fubenData.MapDatas[_MapID] = mapdata;
                        LuoLanFaZhenCopySceneManager.AllFazhenFubenData[_FubenSeqID] = fubenData;
                    }
                    else
                    {
                        lock (fubenData.MapDatas)
                        {
                            if (!fubenData.MapDatas.TryGetValue(_MapID, out mapdata) || null == mapdata)
                            {
                                mapdata = new FazhenMapData
                                {
                                    CopyMapID = _MapID,
                                    MapCode   = _MapCode
                                };
                                LuoLanFaZhenCopySceneManager.CreateRandomGates(_MapCode, mapdata);
                                fubenData.MapDatas[_MapID] = mapdata;
                            }
                        }
                    }
                }
                result = true;
            }
            return(result);
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        public static TCPProcessCmdResults ProcessFazhenTeleportCMD(TCPManager tcpMgr, TMSKSocket socket, TCPClientPool tcpClientPool, TCPOutPacketPool pool, int nID, byte[] data, int count, out TCPOutPacket tcpOutPacket)
        {
            tcpOutPacket = null;
            string cmdData = null;

            try
            {
                cmdData = new UTF8Encoding().GetString(data, 0, count);
            }
            catch (Exception)
            {
                LogManager.WriteLog(LogTypes.Error, string.Format("解析指令字符串错误, CMD={0}, Client={1}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false)), null, true);
                return(TCPProcessCmdResults.RESULT_FAILED);
            }
            try
            {
                string[] fields = cmdData.Split(new char[]
                {
                    ':'
                });
                if (fields.Length != 2)
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("指令参数个数错误, CMD={0}, Client={1}, Recv={2}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false), fields.Length), null, true);
                    return(TCPProcessCmdResults.RESULT_FAILED);
                }
                int roleID  = Convert.ToInt32(fields[0]);
                int MapCode = 0;
                if (!int.TryParse(fields[1], out MapCode))
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("ProcessFazhenTeleportCMD, roleID={0}, MapCode={1}", roleID, fields[1]), null, true);
                    return(TCPProcessCmdResults.RESULT_OK);
                }
                GameClient client = GameManager.ClientMgr.FindClient(socket);
                if (KuaFuManager.getInstance().ClientCmdCheckFaild(nID, client, ref roleID))
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("根据RoleID定位GameClient对象失败, CMD={0}, Client={1}, RoleID={2}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false), roleID), null, true);
                    return(TCPProcessCmdResults.RESULT_FAILED);
                }
                if (client.ClientData.MapCode != MapCode)
                {
                    return(TCPProcessCmdResults.RESULT_OK);
                }
                if (client.ClientData.FuBenID != LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID)
                {
                    return(TCPProcessCmdResults.RESULT_OK);
                }
                SingleLuoLanFaZhenFubenData fubenData = LuoLanFaZhenCopySceneManager.GetFubenData(client.ClientData.FuBenSeqID);
                if (null == fubenData)
                {
                    return(TCPProcessCmdResults.RESULT_OK);
                }
                FazhenMapData mapData = null;
                lock (fubenData.MapDatas)
                {
                    fubenData.MapDatas.TryGetValue(client.ClientData.CopyMapID, out mapData);
                    if (null == mapData)
                    {
                        return(TCPProcessCmdResults.RESULT_OK);
                    }
                }
                FazhenMapProtoData senddata = new FazhenMapProtoData();
                senddata.listTelegate = new List <FazhenTelegateProtoData>();
                senddata.SrcMapCode   = mapData.MapCode;
                lock (mapData.Telegates)
                {
                    List <int> listGateID = mapData.Telegates.Keys.ToList <int>();
                    if (null != listGateID)
                    {
                        foreach (int gateid in listGateID)
                        {
                            SingleFazhenTelegateData gatedata = mapData.Telegates[gateid];
                            if (null != gatedata)
                            {
                                FazhenTelegateProtoData gatedata_s = new FazhenTelegateProtoData();
                                gatedata_s.gateId = gateid;
                                if (gatedata.usedAlready || LuoLanFaZhenCopySceneManager.GM_OpenState == 1)
                                {
                                    gatedata_s.DestMapCode = gatedata.destMapCode;
                                }
                                else
                                {
                                    gatedata_s.DestMapCode = 0;
                                }
                                senddata.listTelegate.Add(gatedata_s);
                            }
                        }
                    }
                }
                byte[] bytes = DataHelper.ObjectToBytes <FazhenMapProtoData>(senddata);
                tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, bytes, 0, bytes.Length, 685);
                return(TCPProcessCmdResults.RESULT_DATA);
            }
            catch (Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "ProcessFazhenTeleportCMD", false, false);
            }
            return(TCPProcessCmdResults.RESULT_FAILED);
        }
Ejemplo n.º 6
0
        public static bool OnKillMonster(GameClient client, Monster monster)
        {
            bool result;

            if (client.ClientData.FuBenID != LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID)
            {
                result = false;
            }
            else
            {
                SingleLuoLanFaZhenFubenData fubenData = LuoLanFaZhenCopySceneManager.GetFubenData(client.ClientData.FuBenSeqID);
                if (null == fubenData)
                {
                    result = false;
                }
                else
                {
                    List <int> listMapCodes = null;
                    bool       bKillBoss    = false;
                    if (monster.MonsterInfo.ExtensionID == LuoLanFaZhenCopySceneManager.FinalBossID)
                    {
                        fubenData.FinalBossLeftNum = 0;
                        bKillBoss = true;
                    }
                    else if (monster.MonsterInfo.ExtensionID == LuoLanFaZhenCopySceneManager.SpecialBossID)
                    {
                        FuBenInfoItem fuBenInfoItem = FuBenManager.FindFuBenInfoBySeqID(client.ClientData.FuBenSeqID);
                        if (null == fuBenInfoItem)
                        {
                            return(false);
                        }
                        fubenData.SpecailBossLeftNum = 0;
                        string msg = StringUtil.substitute(GLang.GetLang(98, new object[0]), new object[]
                        {
                            client.ClientData.RoleName
                        });
                        listMapCodes = SingletonTemplate <CopyTeamManager> .Instance().GetTeamCopyMapCodes(LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID);

                        if (null == listMapCodes)
                        {
                            return(false);
                        }
                        foreach (int mapCode in listMapCodes)
                        {
                            LuoLanFaZhenCopySceneManager.BroadMapMessage(msg, mapCode, client.ClientData.FuBenSeqID);
                        }
                        bKillBoss = true;
                    }
                    if (bKillBoss)
                    {
                        if (null == listMapCodes)
                        {
                            listMapCodes = SingletonTemplate <CopyTeamManager> .Instance().GetTeamCopyMapCodes(LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID);
                        }
                        if (null == listMapCodes)
                        {
                            return(false);
                        }
                        string cmdData = string.Format("{0}:{1}:{2}:{3}:{4}", new object[]
                        {
                            LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID,
                            LuoLanFaZhenCopySceneManager.FinalBossID,
                            fubenData.FinalBossLeftNum,
                            LuoLanFaZhenCopySceneManager.SpecialBossID,
                            fubenData.SpecailBossLeftNum
                        });
                        foreach (int mapCode in listMapCodes)
                        {
                            LuoLanFaZhenCopySceneManager.BroadMapData(760, cmdData, mapCode, client.ClientData.FuBenSeqID);
                        }
                    }
                    result = true;
                }
            }
            return(result);
        }
Ejemplo n.º 7
0
        public static TCPProcessCmdResults OnTeleport(GameClient client, int teleportID, TCPOutPacketPool pool, out TCPOutPacket tcpOutPacket)
        {
            tcpOutPacket = null;
            TCPProcessCmdResults result;

            if (client.ClientData.FuBenID != LuoLanFaZhenCopySceneManager.LuoLanFaZhenFubenID || client.ClientData.FuBenSeqID <= 0)
            {
                result = TCPProcessCmdResults.RESULT_FAILED;
            }
            else
            {
                SingleLuoLanFaZhenFubenData fubenData = LuoLanFaZhenCopySceneManager.GetFubenData(client.ClientData.FuBenSeqID);
                if (null == fubenData)
                {
                    result = TCPProcessCmdResults.RESULT_FAILED;
                }
                else
                {
                    FazhenMapData            mapdata  = null;
                    SingleFazhenTelegateData teledata = null;
                    lock (fubenData.MapDatas)
                    {
                        if (!fubenData.MapDatas.TryGetValue(client.ClientData.CopyMapID, out mapdata) || null == mapdata)
                        {
                            return(TCPProcessCmdResults.RESULT_FAILED);
                        }
                    }
                    if (mapdata.MapCode != client.ClientData.MapCode || mapdata.CopyMapID != client.ClientData.CopyMapID)
                    {
                        result = TCPProcessCmdResults.RESULT_FAILED;
                    }
                    else
                    {
                        lock (mapdata.Telegates)
                        {
                            if (!mapdata.Telegates.TryGetValue(teleportID, out teledata) || null == teledata)
                            {
                                return(TCPProcessCmdResults.RESULT_FAILED);
                            }
                        }
                        if (teledata.destMapCode <= 0)
                        {
                            result = TCPProcessCmdResults.RESULT_FAILED;
                        }
                        else
                        {
                            bool TeleToSpecial = false;
                            if (teledata.SpecialDestMapCode > 0)
                            {
                                if (0 != fubenData.SpecailBossLeftNum)
                                {
                                    int rand = Global.GetRandomNumber(0, 100);
                                    if (rand < LuoLanFaZhenCopySceneManager.SpecialTeleRate)
                                    {
                                        TeleToSpecial = true;
                                    }
                                }
                            }
                            if (TeleToSpecial)
                            {
                                GameManager.ClientMgr.ChangeMap(TCPManager.getInstance().MySocketListener, TCPOutPacketPool.getInstance(), client, teleportID, teledata.SpecialDestMapCode, teledata.SpecialDestX, teledata.SpecialDestY, client.ClientData.RoleDirection, 123);
                            }
                            else
                            {
                                bool NeedSend = false;
                                lock (teledata)
                                {
                                    if (!teledata.usedAlready)
                                    {
                                        teledata.usedAlready = true;
                                        NeedSend             = true;
                                    }
                                }
                                if (NeedSend)
                                {
                                    FazhenMapProtoData senddata = new FazhenMapProtoData();
                                    senddata.listTelegate = new List <FazhenTelegateProtoData>();
                                    senddata.SrcMapCode   = mapdata.MapCode;
                                    FazhenTelegateProtoData gatedata_s = new FazhenTelegateProtoData();
                                    gatedata_s.gateId      = teledata.gateId;
                                    gatedata_s.DestMapCode = teledata.destMapCode;
                                    senddata.listTelegate.Add(gatedata_s);
                                    LuoLanFaZhenCopySceneManager.BroadMapData <FazhenMapProtoData>(685, senddata, mapdata.MapCode, client.ClientData.FuBenSeqID);
                                }
                                GameManager.ClientMgr.ChangeMap(TCPManager.getInstance().MySocketListener, TCPOutPacketPool.getInstance(), client, teleportID, teledata.destMapCode, teledata.destX, teledata.destY, client.ClientData.RoleDirection, 123);
                            }
                            result = TCPProcessCmdResults.RESULT_OK;
                        }
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 8
0
 public static bool OnEnterFubenMap(GameClient client, int oldmapcode, bool isLogin)
 {
     return(LuoLanFaZhenCopySceneManager.TryAddFubenData(client.ClientData.FuBenSeqID, client.ClientData.FuBenID, client.ClientData.CopyMapID, client.ClientData.MapCode));
 }
Ejemplo n.º 9
0
 public static bool EnterFubenMapWhenLogin(GameClient client)
 {
     return(null != LuoLanFaZhenCopySceneManager.GetFubenData(client.ClientData.FuBenSeqID));
 }
Ejemplo n.º 10
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();
        }