Exemplo n.º 1
0
        public void OnLeaveScene(GameClient client, SceneUIClasses sceneType, bool logout = false)
        {
            if (client.ClientSocket.IsKuaFuLogin)
            {
                switch (sceneType)
                {
                case SceneUIClasses.HuanYingSiYuan:
                    HuanYingSiYuanManager.getInstance().OnLogout(client);
                    break;

                case SceneUIClasses.TianTi:
                    TianTiManager.getInstance().OnLogout(client);
                    break;

                case SceneUIClasses.YongZheZhanChang:
                    YongZheZhanChangManager.getInstance().OnLogout(client);
                    break;

                case SceneUIClasses.KingOfBattle:
                    KingOfBattleManager.getInstance().OnLogout(client);
                    break;

                case SceneUIClasses.MoRiJudge:
                    MoRiJudgeManager.Instance().OnLogOut(client);
                    break;

                case SceneUIClasses.ElementWar:
                    ElementWarManager.getInstance().OnLogout(client);
                    break;

                case SceneUIClasses.LangHunLingYu:
                    LangHunLingYuManager.getInstance().OnLogout(client);
                    break;

                case SceneUIClasses.CopyWolf:
                    CopyWolfManager.getInstance().OnLogout(client);
                    break;

                case SceneUIClasses.KFZhengBa:
                    ZhengBaManager.Instance().OnLogout(client);
                    break;

                case SceneUIClasses.CoupleArena:
                    CoupleArenaManager.Instance().OnLeaveFuBen(client);
                    break;
                }

                if (!logout)
                {
                    GotoLastMap(client);
                }
            }
        }
Exemplo n.º 2
0
        public bool OnInitGame(GameClient client)
        {
            int gameType = Global.GetClientKuaFuServerLoginData(client).GameType;

            switch (gameType)
            {
            case (int)GameTypes.HuanYingSiYuan:
                return(HuanYingSiYuanManager.getInstance().OnInitGame(client));

            case (int)GameTypes.TianTi:
                return(TianTiManager.getInstance().OnInitGame(client));

            case (int)GameTypes.YongZheZhanChang:
                return(YongZheZhanChangManager.getInstance().OnInitGame(client));

            case (int)GameTypes.KingOfBattle:
                return(KingOfBattleManager.getInstance().OnInitGame(client));

            case (int)GameTypes.MoRiJudge:
                return(MoRiJudgeManager.Instance().OnInitGame(client));

            case (int)GameTypes.ElementWar:
                return(ElementWarManager.getInstance().OnInitGame(client));

            case (int)GameTypes.KuaFuBoss:
                return(KuaFuBossManager.getInstance().OnInitGame(client));

            case (int)GameTypes.KuaFuMap:
                return(KuaFuMapManager.getInstance().OnInitGame(client));

            case (int)GameTypes.KuaFuCopy:
                return(CopyTeamManager.Instance().HandleKuaFuInitGame(client));

            case (int)GameTypes.LangHunLingYu:
                return(LangHunLingYuManager.getInstance().OnInitGameKuaFu(client));

            case (int)GameTypes.ZhengBa:
                return(ZhengBaManager.Instance().KuaFuInitGame(client));

            case (int)GameTypes.CoupleArena:
                return(CoupleArenaManager.Instance().KuaFuInitGame(client));
            }

            return(false);
        }
Exemplo n.º 3
0
 public bool ProcessGuanZhanRoleMiniDataCmd(GameClient client, int nID, byte[] bytes, string[] cmdParams)
 {
     try
     {
         int roleID = Convert.ToInt32(cmdParams[0]);
         if (KuaFuManager.getInstance().ClientCmdCheckFaild(nID, client, ref roleID))
         {
             return(true);
         }
         if (client.ClientData.HideGM == 0)
         {
             return(true);
         }
         int posX = 0;
         int posY = 0;
         if (!this.GetGuanZhanPos(client.ClientData.MapCode, ref posX, ref posY))
         {
             return(true);
         }
         SceneUIClasses sceneType = Global.GetMapSceneType(client.ClientData.MapCode);
         GuanZhanData   gzData    = new GuanZhanData();
         if (SceneUIClasses.BangHuiMatch == sceneType)
         {
             BangHuiMatchManager.getInstance().FillGuanZhanData(client, gzData);
         }
         if (SceneUIClasses.LangHunLingYu == sceneType)
         {
             LangHunLingYuManager.getInstance().FillGuanZhanData(client, gzData);
         }
         if (SceneUIClasses.EscapeBattle == sceneType)
         {
             EscapeBattleManager.getInstance().FillGuanZhanData(client, gzData);
         }
         client.sendCmd <GuanZhanData>(nID, gzData, false);
         return(true);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false, false);
     }
     return(false);
 }
Exemplo n.º 4
0
        public static int ReloadXmlFile(string xmlFileName)
        {
            string lowerXmlFileName = xmlFileName.ToLower();
            int    result;

            if (Global.GetGiftExchangeFileName().ToLower() == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_activities();
            }
            else if ("config/gifts/biggift.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_biggift();
            }
            else if ("config/gifts/loginnumgift.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_loginnumgift();
            }
            else if ("config/gifts/huodongloginnumgift.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_huodongloginnumgift();
            }
            else if ("config/gifts/newrolegift.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_newrolegift();
            }
            else if ("config/gifts/comateffectivenessgift.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_combat_effectiveness_gift();
            }
            else if ("config/gifts/uplevelgift.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_uplevelgift();
            }
            else if ("config/gifts/onlietimegift.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_onlietimegift();
            }
            else if ("config/platconfig.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_platconfig();
            }
            else if ("config/mall.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_mall();
            }
            else if ("config/monstergoodslist.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_monstergoodslist();
            }
            else if ("config/broadcastinfos.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_broadcastinfos();
            }
            else if ("config/specialtimes.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_specialtimes();
            }
            else if ("config/battle.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_battle();
            }
            else if ("config/arenabattle.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_ArenaBattle();
            }
            else if ("config/popupwin.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_popupwin();
            }
            else if ("config/npcscripts.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_npcscripts();
            }
            else if ("config/systemoperations.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_systemoperations();
            }
            else if ("config/systemparams.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_systemparams();
            }
            else if ("config/goodsmergeitems.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_goodsmergeitems();
            }
            else if ("config/qizhengegoods.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_qizhengegoods();
            }
            else if ("config/npcsalelist.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_npcsalelist();
            }
            else if ("config/goods.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_goods();
            }
            else if ("config/goodspack.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_goodspack();
            }
            else if ("config/systemtasks.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_systemtasks();
            }
            else if ("config/taskzhangjie.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_taskzhangjie();
            }
            else if ("config/equipupgrade.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_equipupgrade();
            }
            else if ("config/dig.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_dig();
            }
            else if ("config/battleexp.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_battleexp();
            }
            else if ("config/rebirth.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_rebirth();
            }
            else if ("config/battleaward.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_Award();
            }
            else if ("config/equipborn.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_EquipBorn();
            }
            else if ("config/bornname.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_BornName();
            }
            else if ("config/gifts/fanli.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_FanLi();
            }
            else if ("config/gifts/chongzhisong.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_ChongZhiSong();
            }
            else if ("config/gifts/chongzhiking.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_ChongZhiKing();
            }
            else if ("config/gifts/levelking.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_LevelKing();
            }
            else if ("config/gifts/bossking.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_EquipKing();
            }
            else if ("config/gifts/wuxueking.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_HorseKing();
            }
            else if ("config/gifts/jingmaiking.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_JingMaiKing();
            }
            else if ("config/gifts/vipdailyawards.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_gifts_VipDailyAwards();
            }
            else if ("config/activity/activitytip.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_ActivityTip();
            }
            else if ("config/luckyaward.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_LuckyAward();
            }
            else if ("config/lucky.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_Lucky();
            }
            else if ("config/chengjiu.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_ChengJiu();
            }
            else if ("config/chengjiubuff.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_ChengJiuBuff();
            }
            else if (string.Format("Config\\JieRiGifts\\ JieRiDanBiChongZhi.xml", new object[0]).ToLower() == lowerXmlFileName)
            {
                result = HuodongCachingMgr.ResetDanBiChongZhiActivity();
            }
            else if ("config/jingmai.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_JingMai();
            }
            else if ("config/wuxue.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_WuXue();
            }
            else if ("config/zuanhuang.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_ZuanHuang();
            }
            else if ("config/vip.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_Vip();
            }
            else if ("config/qianggou.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_QiangGou();
            }
            else if ("config/hefugifts/hefuqianggou.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_HeFuQiangGou();
            }
            else if ("config/jierigifts/jirriqianggou.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_JieRiQiangGou();
            }
            else if ("config/systemopen.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_SystemOpen();
            }
            else if ("config/DailyActiveInfor.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_DailyActive();
            }
            else if ("DailyActiveAward.xml" == lowerXmlFileName)
            {
                result = ReloadXmlManager.ReloadXmlFile_config_DailyActiveAward();
            }
            else if ("config/ipwhitelist.xml" == lowerXmlFileName)
            {
                SingletonTemplate <CreateRoleLimitManager> .Instance().LoadConfig();

                result = 1;
            }
            else
            {
                if ("kuafu" == lowerXmlFileName)
                {
                    if (KuaFuManager.getInstance().InitConfig())
                    {
                        return(1);
                    }
                }
                else if ("langhunlingyu" == lowerXmlFileName)
                {
                    if (LangHunLingYuManager.getInstance().InitConfig())
                    {
                        return(1);
                    }
                }
                else if ("config/chongzhi_app.xml" == lowerXmlFileName || "config/chongzhi_andrid.xml" == lowerXmlFileName || "config/chongzhi_android.xml" == lowerXmlFileName || "config/chongzhi_yueyu.xml" == lowerXmlFileName)
                {
                    UserMoneyMgr.getInstance().InitConfig();
                }
                else
                {
                    if ("config/AssInfo.xml" == lowerXmlFileName || "config/AssList.xml" == lowerXmlFileName || "config/AssConfig.xml" == lowerXmlFileName)
                    {
                        return(RobotTaskValidator.getInstance().LoadRobotTaskData() ? 1 : 0);
                    }
                    if ("Config/Auction.xml" == lowerXmlFileName || "Config/AngelTempleAuctionAward.xml" == lowerXmlFileName)
                    {
                        return(GoldAuctionConfigModel.LoadConfig());
                    }
                    if ("Config/CaiShuZi.xml" == lowerXmlFileName || "Config/CaiDaXiao.xml" == lowerXmlFileName || "Config/DuiHuanShangCheng.xml" == lowerXmlFileName || "Config/DaiBiShiYong.xml" == lowerXmlFileName)
                    {
                        return(BoCaiConfigMgr.LoadConfig(true));
                    }
                    if (lowerXmlFileName.IndexOf("Config\\Horse") > -1)
                    {
                        ZuoQiManager.getInstance().ReLoadConfig(false);
                    }
                }
                result = -1000;
            }
            return(result);
        }
Exemplo n.º 5
0
        public void OnLeaveScene(GameClient client, SceneUIClasses sceneType, bool logout = false)
        {
            if (client.ClientSocket.IsKuaFuLogin)
            {
                switch (sceneType)
                {
                case SceneUIClasses.HuanYingSiYuan:
                    HuanYingSiYuanManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.TianTi:
                    TianTiManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.YongZheZhanChang:
                    YongZheZhanChangManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.ElementWar:
                    ElementWarManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.MoRiJudge:
                    SingletonTemplate <MoRiJudgeManager> .Instance().OnLogOut(client);

                    goto IL_1E7;

                case SceneUIClasses.CopyWolf:
                    CopyWolfManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.LangHunLingYu:
                    LangHunLingYuManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.KFZhengBa:
                    SingletonTemplate <ZhengBaManager> .Instance().OnLogout(client);

                    goto IL_1E7;

                case SceneUIClasses.CoupleArena:
                    SingletonTemplate <CoupleArenaManager> .Instance().OnLeaveFuBen(client);

                    goto IL_1E7;

                case SceneUIClasses.KingOfBattle:
                    KingOfBattleManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.KarenWest:
                    KarenBattleManager_MapWest.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.KarenEast:
                    KarenBattleManager_MapEast.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.LingDiCaiJi:
                    LingDiCaiJiManager.getInstance().OnLeaveFuBen(client);
                    goto IL_1E7;

                case SceneUIClasses.BangHuiMatch:
                    BangHuiMatchManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.KuaFuLueDuo:
                    KuaFuLueDuoManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.WanMoXiaGu:
                    WanMoXiaGuManager.getInstance().OnLogout(client);
                    goto IL_1E7;

                case SceneUIClasses.ZorkBattle:
                    ZorkBattleManager.getInstance().OnLogout(client);
                    goto IL_1E7;
                }
                if (SingletonTemplate <CopyTeamManager> .Instance().IsKuaFuCopy(client.ClientData.FuBenID))
                {
                    SingletonTemplate <CopyTeamManager> .Instance().OnLeaveFuBen(client, sceneType);
                }
IL_1E7:
                if (!logout)
                {
                    this.GotoLastMap(client);
                }
            }
        }
Exemplo n.º 6
0
        public bool OnInitGame(GameClient client)
        {
            int  gameType = Global.GetClientKuaFuServerLoginData(client).GameType;
            bool result;

            if (KuaFuManager.KuaFuWorldKuaFuGameServer && !KuaFuManager.KuaFuWorldGameTypes.Contains(gameType))
            {
                result = true;
            }
            else
            {
                switch (gameType)
                {
                case 1:
                    return(HuanYingSiYuanManager.getInstance().OnInitGame(client));

                case 2:
                    return(TianTiManager.getInstance().OnInitGame(client));

                case 3:
                    return(SingletonTemplate <MoRiJudgeManager> .Instance().OnInitGame(client));

                case 4:
                    return(ElementWarManager.getInstance().OnInitGame(client));

                case 5:
                    return(YongZheZhanChangManager.getInstance().OnInitGame(client));

                case 6:
                    return(KuaFuBossManager.getInstance().OnInitGame(client));

                case 7:
                case 32:
                    return(KuaFuMapManager.getInstance().OnInitGame(client));

                case 8:
                    return(SingletonTemplate <CopyTeamManager> .Instance().HandleKuaFuInitGame(client));

                case 10:
                    return(LangHunLingYuManager.getInstance().OnInitGameKuaFu(client));

                case 12:
                    return(SingletonTemplate <ZhengBaManager> .Instance().KuaFuInitGame(client));

                case 13:
                    return(SingletonTemplate <CoupleArenaManager> .Instance().KuaFuInitGame(client));

                case 15:
                    return(KingOfBattleManager.getInstance().OnInitGame(client));

                case 17:
                    return(ZhengDuoManager.getInstance().OnInitGame(client));

                case 19:
                    return(KarenBattleManager_MapWest.getInstance().OnInitGame(client));

                case 20:
                    return(KarenBattleManager_MapEast.getInstance().OnInitGame(client));

                case 22:
                    return(LingDiCaiJiManager.getInstance().KuaFuInitGame(client));

                case 24:
                    return(BangHuiMatchManager.getInstance().OnInitGameKuaFu(client));

                case 25:
                    return(KuaFuLueDuoManager.getInstance().OnInitGameKuaFu(client));

                case 26:
                    return(WanMoXiaGuManager.getInstance().OnInitGame(client));

                case 27:
                case 28:
                case 29:
                    return(CompManager.getInstance().OnInitGameKuaFu(client));

                case 30:
                    return(CompBattleManager.getInstance().OnInitGameKuaFu(client));

                case 31:
                    return(CompMineManager.getInstance().OnInitGameKuaFu(client));

                case 34:
                    return(TianTi5v5Manager.getInstance().OnInitGame(client));

                case 36:
                    return(ZorkBattleManager.getInstance().OnInitGameKuaFu(client));
                }
                EventObjectEx_I1 eventObject = new EventObjectEx_I1(client, 62, gameType);
                result = (GlobalEventSource4Scene.getInstance().fireEvent(eventObject, 10007) && eventObject.Result);
            }
            return(result);
        }
Exemplo n.º 7
0
        public bool OnUserLogin(TMSKSocket socket, int verSign, string userID, string userName, string lastTime, string userToken, string isadult, string signCode, int serverId = 0, string ip = null, int port = 0, int roleId = 0, int gameType = 0, long gameId = 0L)
        {
            KuaFuServerLoginData kuaFuServerLoginData = socket.ClientKuaFuServerLoginData;

            if (serverId > 0 && ip != null)
            {
                kuaFuServerLoginData.ServerId   = serverId;
                kuaFuServerLoginData.ServerIp   = ip;
                kuaFuServerLoginData.ServerPort = port;
                kuaFuServerLoginData.RoleId     = roleId;
                kuaFuServerLoginData.GameType   = gameType;
                kuaFuServerLoginData.GameId     = gameId;
            }
            if (kuaFuServerLoginData.WebLoginToken == null)
            {
                kuaFuServerLoginData.WebLoginToken = new WebLoginToken
                {
                    VerSign  = verSign,
                    UserID   = userID,
                    UserName = userName,
                    LastTime = lastTime,
                    Isadult  = isadult,
                    SignCode = signCode
                };
            }
            if (roleId > 0 && serverId > 0 && gameType > 0)
            {
                if (GameManager.ServerLineID != GameManager.ServerId)
                {
                    LogManager.WriteLog(LogTypes.Error, "GameManager.ServerLineID未配置,禁止跨服登录", null, true);
                    return(false);
                }
                if (string.IsNullOrEmpty(ip) || port <= 0 || gameType <= 0 || gameId <= 0L)
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("角色{0}未能在服务器列表中找本服务器,作为跨服服务器", kuaFuServerLoginData.RoleId), null, true);
                    return(false);
                }
                if (!KuaFuManager.getInstance().CanKuaFuLogin())
                {
                    return(false);
                }
                socket.ServerId = serverId;
                switch (gameType)
                {
                case 1:
                    socket.IsKuaFuLogin = HuanYingSiYuanClient.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 2:
                    socket.IsKuaFuLogin = TianTiClient.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 5:
                case 6:
                case 15:
                    socket.IsKuaFuLogin = YongZheZhanChangClient.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 7:
                    socket.IsKuaFuLogin = YongZheZhanChangClient.getInstance().CanEnterKuaFuMap(kuaFuServerLoginData);
                    goto IL_399;

                case 8:
                    socket.IsKuaFuLogin = SingletonTemplate <CopyTeamManager> .Instance().HandleKuaFuLogin(kuaFuServerLoginData);

                    goto IL_399;

                case 10:
                    socket.IsKuaFuLogin = LangHunLingYuManager.getInstance().CanEnterKuaFuMap(kuaFuServerLoginData);
                    goto IL_399;

                case 12:
                    socket.IsKuaFuLogin = SingletonTemplate <ZhengBaManager> .Instance().CanKuaFuLogin(kuaFuServerLoginData);

                    goto IL_399;

                case 13:
                    socket.IsKuaFuLogin = SingletonTemplate <CoupleArenaManager> .Instance().CanKuaFuLogin(kuaFuServerLoginData);

                    goto IL_399;

                case 17:
                    socket.IsKuaFuLogin = true;
                    goto IL_399;

                case 19:
                case 20:
                    socket.IsKuaFuLogin = KarenBattleManager.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 22:
                    socket.IsKuaFuLogin = true;
                    goto IL_399;

                case 24:
                    socket.IsKuaFuLogin = BangHuiMatchManager.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 25:
                    socket.IsKuaFuLogin = KuaFuLueDuoManager.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 27:
                case 28:
                case 29:
                    socket.IsKuaFuLogin = true;
                    goto IL_399;

                case 30:
                    socket.IsKuaFuLogin = CompBattleManager.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 31:
                    socket.IsKuaFuLogin = CompMineManager.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 32:
                    socket.IsKuaFuLogin = true;
                    goto IL_399;

                case 34:
                    socket.IsKuaFuLogin = TianTi5v5Manager.getInstance().CanKuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;

                case 36:
                    socket.IsKuaFuLogin = ZorkBattleManager.getInstance().KuaFuLogin(kuaFuServerLoginData);
                    goto IL_399;
                }
                EventObjectEx_I1 eventObject = new EventObjectEx_I1(kuaFuServerLoginData, 61, gameType);
                if (GlobalEventSource4Scene.getInstance().fireEvent(eventObject, 10007))
                {
                    socket.IsKuaFuLogin = eventObject.Result;
                }
IL_399:
                string dbIp = "";
                int    dbPort    = 0;
                string logDbIp   = "";
                int    logDbPort = 0;
                if (kuaFuServerLoginData.ips != null && kuaFuServerLoginData.ports != null)
                {
                    dbIp      = kuaFuServerLoginData.ips[0];
                    logDbIp   = kuaFuServerLoginData.ips[1];
                    dbPort    = kuaFuServerLoginData.ports[0];
                    logDbPort = kuaFuServerLoginData.ports[1];
                }
                else if (!KuaFuManager.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("GameType{0}未能找到角色{1}的原服务器的服务器IP和端口", gameType, kuaFuServerLoginData.RoleId), null, true);
                    return(false);
                }
                if (socket.IsKuaFuLogin && serverId != 0)
                {
                    if (serverId != 0)
                    {
                        if (!this.InitGameDbConnection(serverId, dbIp, dbPort, logDbIp, logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("连接角色{0}的原服务器的GameDBServer和LogDBServer失败", kuaFuServerLoginData.RoleId), null, true);
                            return(false);
                        }
                    }
                    return(socket.IsKuaFuLogin);
                }
            }
            else
            {
                if (GameManager.IsKuaFuServer)
                {
                    LogManager.WriteLog(LogTypes.Error, "跨服服务器禁止非跨服登录,请检查是否将LineID配置,原服应当为1", null, true);
                    return(false);
                }
                if (KuaFuManager.getInstance().LocalLogin(userID))
                {
                    kuaFuServerLoginData.RoleId   = 0;
                    kuaFuServerLoginData.GameId   = 0L;
                    kuaFuServerLoginData.GameType = 0;
                    kuaFuServerLoginData.ServerId = 0;
                    socket.ServerId     = 0;
                    socket.IsKuaFuLogin = false;
                    return(true);
                }
            }
            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的跨服活动或副本信息", kuaFuServerLoginData.RoleId), null, true);
            return(false);
        }
        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();
        }
Exemplo n.º 9
0
        /// <summary>
        /// 重新加载程序配置参数文件
        /// </summary>
        /// <param name="xmlFileName"></param>
        /// <returns></returns>
        public static int ReloadXmlFile(string xmlFileName)
        {
            string lowerXmlFileName = xmlFileName.ToLower();

            if (Global.GetGiftExchangeFileName().ToLower() == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_activities());
            }
            else if ("config/gifts/biggift.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_biggift());
            }
            else if ("config/gifts/loginnumgift.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_loginnumgift());
            }
            else if ("config/gifts/huodongloginnumgift.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_huodongloginnumgift());
            }
            else if ("config/gifts/newrolegift.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_newrolegift());
            }
            else if ("config/gifts/uplevelgift.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_uplevelgift());
            }
            else if ("config/gifts/onlietimegift.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_onlietimegift());
            }
            else if ("config/platconfig.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_platconfig());
            }
            else if ("config/mall.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_mall());
            }
            else if ("config/monstergoodslist.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_monstergoodslist());
            }
            else if ("config/broadcastinfos.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_broadcastinfos());
            }
            else if ("config/specialtimes.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_specialtimes());
            }
            else if ("config/battle.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_battle());
            }
            else if ("config/arenabattle.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_ArenaBattle());
            }
            else if ("config/popupwin.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_popupwin());
            }
            else if ("config/npcscripts.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_npcscripts());
            }
            else if ("config/systemoperations.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_systemoperations());
            }
            else if ("config/systemparams.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_systemparams());
            }
            else if ("config/goodsmergeitems.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_goodsmergeitems());
            }
            else if ("config/qizhengegoods.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_qizhengegoods());
            }
            else if ("config/npcsalelist.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_npcsalelist());
            }
            else if ("config/goods.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_goods());
            }
            else if ("config/goodspack.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_goodspack());
            }
            else if ("config/systemtasks.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_systemtasks());
            }
            else if ("config/taskzhangjie.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_taskzhangjie());
            }
            else if ("config/equipupgrade.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_equipupgrade());
            }
            else if ("config/dig.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_dig());
            }
            else if ("config/battleexp.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_battleexp());
            }
            else if ("config/rebirth.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_rebirth());
            }
            else if ("config/battleaward.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_Award());
            }
            else if ("config/equipborn.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_EquipBorn());
            }
            else if ("config/bornname.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_BornName());
            }
            //***************新活动部分*************************
            else if ("config/gifts/fanli.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_FanLi());
            }
            else if ("config/gifts/chongzhisong.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_ChongZhiSong());
            }
            else if ("config/gifts/chongzhiking.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_ChongZhiKing());
            }
            else if ("config/gifts/levelking.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_LevelKing());
            }
            else if ("config/gifts/bossking.xml" == lowerXmlFileName)//原来的装备王 ==》修改成boss王
            {
                return(ReloadXmlFile_config_gifts_EquipKing());
            }
            else if ("config/gifts/wuxueking.xml" == lowerXmlFileName)//原来的经脉王 ==》修改成武学王
            {
                return(ReloadXmlFile_config_gifts_HorseKing());
            }
            else if ("config/gifts/jingmaiking.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_JingMaiKing());
            }
            else if ("config/gifts/vipdailyawards.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_gifts_VipDailyAwards());
            }
            else if ("config/activity/activitytip.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_ActivityTip());
            }
            else if ("config/luckyaward.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_LuckyAward());
            }
            else if ("config/lucky.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_Lucky());
            }
            else if ("config/chengjiu.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_ChengJiu());
            }
            else if ("config/chengjiubuff.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_ChengJiuBuff());
            }
            else if ("config/jingmai.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_JingMai());
            }
            else if ("config/wuxue.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_WuXue());
            }
            else if ("config/zuanhuang.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_ZuanHuang());
            }
            else if ("config/vip.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_Vip());
            }
            else if ("config/qianggou.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_QiangGou());
            }
            else if ("config/hefugifts/hefuqianggou.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_HeFuQiangGou());
            }
            else if ("config/jierigifts/jirriqianggou.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_JieRiQiangGou());
            }
            else if ("config/systemopen.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_SystemOpen());
            }
            else if ("config/DailyActiveInfor.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_DailyActive());
            }
            else if ("DailyActiveAward.xml" == lowerXmlFileName)
            {
                return(ReloadXmlFile_config_DailyActiveAward());
            }
            else if ("config/ipwhitelist.xml" == lowerXmlFileName)
            {
                CreateRoleLimitManager.Instance().LoadConfig();
                return(1);
            }
            else if ("kuafu" == lowerXmlFileName)
            {
                if (KuaFuManager.getInstance().InitConfig())
                {
                    return(1);
                }
            }
            else if ("langhunlingyu" == lowerXmlFileName)
            {
                if (LangHunLingYuManager.getInstance().InitConfig())
                {
                    return(1);
                }
            }
            else if ("config/chongzhi_app.xml" == lowerXmlFileName ||
                     "config/chongzhi_andrid.xml" == lowerXmlFileName || "config/chongzhi_android.xml" == lowerXmlFileName ||
                     "config/chongzhi_yueyu.xml" == lowerXmlFileName)
            {
                // 任何一项条件满足时,都会重新加载,但是重新加载时,会根据本平台,决定加载哪一项
                Global.InitFirstChargeConfigData();
            }
            else if ("config/AssInfo.xml" == lowerXmlFileName || "config/AssList.xml" == lowerXmlFileName || "config/AssConfig.xml" == lowerXmlFileName)
            {
                return(RobotTaskValidator.getInstance().LoadRobotTaskData()? 1 : 0);
            }
            return(-1000);
        }
Exemplo n.º 10
0
        public bool OnUserLogin(TMSKSocket socket, int verSign, string userID, string userName, string lastTime, string userToken, string isadult, string signCode, int serverId, string ip, int port, int roleId, int gameType, long gameId)
        {
            KuaFuServerLoginData kuaFuServerLoginData = socket.ClientKuaFuServerLoginData;

            kuaFuServerLoginData.ServerId   = serverId;
            kuaFuServerLoginData.ServerIp   = ip;
            kuaFuServerLoginData.ServerPort = port;
            kuaFuServerLoginData.RoleId     = roleId;
            kuaFuServerLoginData.GameType   = gameType;
            kuaFuServerLoginData.GameId     = gameId;

            if (kuaFuServerLoginData.WebLoginToken == null)
            {
                kuaFuServerLoginData.WebLoginToken = new WebLoginToken()
                {
                    VerSign  = verSign,
                    UserID   = userID,
                    UserName = userName,
                    LastTime = lastTime,
                    Isadult  = isadult,
                    SignCode = signCode,
                };
            }

            if (roleId > 0)
            {
                // 跨服服务器的两个ID相等,如果不想等,则配置错误;
                // 如果想要去掉这个限制,允许区游戏服务器兼作跨服活动服务器(混合使用),必须先修改GameManager.ServerLineID相关的逻辑,使其可以兼容
                // 完成修改前,这个限制不可取消.
                if (GameManager.ServerLineID != GameManager.ServerId)
                {
                    LogManager.WriteLog(LogTypes.Error, "GameManager.ServerLineID未配置,禁止跨服登录");
                    return(false);
                }

                //跨服登录,限制rid
                if (!string.IsNullOrEmpty(ip) && port > 0 && gameType > 0 && gameId > 0 /* && HuanYingSiYuanClient.getInstance().CanKuaFuLogin()*/)
                {
                    string dbIp      = "";
                    int    dbPort    = 0;
                    string logDbIp   = "";
                    int    logDbPort = 0;
                    socket.ServerId = serverId;
                    switch (gameType)
                    {
                    case (int)GameTypes.HuanYingSiYuan:
                    {
                        if (!HuanYingSiYuanClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = HuanYingSiYuanClient.getInstance().KuaFuLogin(kuaFuServerLoginData);
                        if (!HuanYingSiYuanClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;

                    case (int)GameTypes.TianTi:
                    {
                        if (!TianTiClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = TianTiClient.getInstance().KuaFuLogin(kuaFuServerLoginData);
                        if (!TianTiClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;

                    case (int)GameTypes.KingOfBattle:
                    case (int)GameTypes.YongZheZhanChang:
                    case (int)GameTypes.KuaFuBoss:
                    {
                        if (!YongZheZhanChangClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = YongZheZhanChangClient.getInstance().KuaFuLogin(kuaFuServerLoginData);
                        if (!YongZheZhanChangClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;

                    case (int)GameTypes.KuaFuMap:
                    {
                        if (!YongZheZhanChangClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = YongZheZhanChangClient.getInstance().CanEnterKuaFuMap(kuaFuServerLoginData);
                        if (!YongZheZhanChangClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;

                    case (int)GameTypes.LangHunLingYu:
                    {
                        if (!YongZheZhanChangClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = LangHunLingYuManager.getInstance().CanEnterKuaFuMap(kuaFuServerLoginData);
                        if (!YongZheZhanChangClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;

                    case (int)GameTypes.KuaFuCopy:
                    {
                        if (!KFCopyRpcClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = CopyTeamManager.Instance().HandleKuaFuLogin(kuaFuServerLoginData);
                        if (!KFCopyRpcClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;

                    case (int)GameTypes.ZhengBa:
                    {
                        if (!TianTiClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = ZhengBaManager.Instance().CanKuaFuLogin(kuaFuServerLoginData);
                        if (!TianTiClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;

                    case (int)GameTypes.CoupleArena:
                    {
                        if (!TianTiClient.getInstance().CanKuaFuLogin())
                        {
                            return(false);
                        }

                        socket.IsKuaFuLogin = CoupleArenaManager.Instance().CanKuaFuLogin(kuaFuServerLoginData);
                        if (!TianTiClient.getInstance().GetKuaFuDbServerInfo(serverId, out dbIp, out dbPort, out logDbIp, out logDbPort))
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的原服务器的服务器IP和端口", kuaFuServerLoginData.RoleId));
                            return(false);
                        }
                    }
                    break;
                    }

                    if (socket.IsKuaFuLogin && serverId != 0)
                    {
                        if (serverId != 0)
                        {
                            if (!InitGameDbConnection(serverId, dbIp, dbPort, logDbIp, logDbPort))
                            {
                                LogManager.WriteLog(LogTypes.Error, string.Format("连接角色{0}的原服务器的GameDBServer和LogDBServer失败", kuaFuServerLoginData.RoleId));
                                return(false);
                            }
                        }

                        return(socket.IsKuaFuLogin);
                    }
                }
                else
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("角色{0}未能在服务器列表中找本服务器,作为跨服服务器", kuaFuServerLoginData.RoleId));
                    return(false);
                }
            }
            else
            {
                //非跨服登录
                if (HuanYingSiYuanClient.getInstance().LocalLogin(userID))
                {
                    kuaFuServerLoginData.RoleId   = 0;
                    kuaFuServerLoginData.GameId   = 0;
                    kuaFuServerLoginData.GameType = 0;
                    kuaFuServerLoginData.ServerId = 0;
                    socket.ServerId     = 0;
                    socket.IsKuaFuLogin = false;
                    return(true);
                }
            }

            LogManager.WriteLog(LogTypes.Error, string.Format("未能找到角色{0}的跨服活动或副本信息", kuaFuServerLoginData.RoleId));
            return(false);
        }