少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-30 3878096a7b556df30e92428299334225b2b692e5
2199 加载地图过程中可能出现错误的记录
2个文件已修改
114 ■■■■ 已修改文件
Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA127_tagMCStartChangeMap.cs 113 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/StageManager.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA127_tagMCStartChangeMap.cs
@@ -23,10 +23,10 @@
        int _realMapDataID = PlayerDatas.Instance.baseData.MapID;
        var _mapConfig = Config.Instance.Get<MapConfig>(_realMapDataID);
        if (_mapConfig.MapFBType != 0)
        {
            DungeonModel _model = ModelCenter.Instance.GetModel<DungeonModel>();
            _realMapDataID = _model.GetDungeonDataIdByMapId(_realMapDataID);
        if (_mapConfig.MapFBType != 0)
        {
            DungeonModel _model = ModelCenter.Instance.GetModel<DungeonModel>();
            _realMapDataID = _model.GetDungeonDataIdByMapId(_realMapDataID);
        }
        var _key = _realMapDataID * 1000 + LineID;
@@ -44,16 +44,8 @@
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        DEBUG_A127 = true;
        if (DTC0403_tagPlayerLoginLoadOK.neverLoginOk)
        {
#if !UNITY_EDITOR
            // OperationLogCollect.Instance.BugReport("A127错误", "在首次登录未完成时客户端收到A127 ");
#endif
            Debug.LogError("在首次登录未完成时客户端收到A127!请通知蔡瀚");
        }
        DEBUG_A127 = true;
        var package = vNetPack as HA127_tagMCStartChangeMap;
        DEBUG_STEP = 0;
@@ -70,23 +62,23 @@
        if (_mapConfig.MapFBType != 0)
        {
            DungeonModel _model = ModelCenter.Instance.GetModel<DungeonModel>();
            DungeonModel _model = ModelCenter.Instance.GetModel<DungeonModel>();
            _realMapDataID = _model.GetDungeonDataIdByMapId(_realMapDataID);
            if (package.MapID != 52020 && package.MapID != 52010)
            {
            if (package.MapID != 52020 && package.MapID != 52010)
            {
                LineID = package.FuncLineID;
            }
        }
        var _mapResConfig = GetMapResourcesConfig(_realMapDataID, LineID);
        if (_mapResConfig == null)
        {
            LineID = 0;
            _mapResConfig = GetMapResourcesConfig(_realMapDataID, LineID);
        }
        }
        var _mapResConfig = GetMapResourcesConfig(_realMapDataID, LineID);
        if (_mapResConfig == null)
        {
            LineID = 0;
            _mapResConfig = GetMapResourcesConfig(_realMapDataID, LineID);
        }
        if (_mapResConfig != null)
        {
            GA_Hero.MapOffset.x = _mapResConfig.MapOffset.x;
@@ -96,8 +88,8 @@
        {
            GA_Hero.MapOffset.x = 0;
            GA_Hero.MapOffset.z = 0;
        }
        DEBUG_STEP = 1;
        }
        DEBUG_STEP = 1;
        BossShowModel.Instance.reqDungeonLineId = package.FuncLineID;
        GA_Hero _hero = PlayerDatas.Instance.hero;
@@ -106,14 +98,14 @@
        {
            _hero.ShowArrow(false);
            _hero.SwitchGrayName(false);
            if (StatusMgr.Instance.IsExist(PlayerDatas.Instance.PlayerId, StatusMgr.Instance.redNameBuffID))
            {
                _hero.SwitchRedName(true);
            if (StatusMgr.Instance.IsExist(PlayerDatas.Instance.PlayerId, StatusMgr.Instance.redNameBuffID))
            {
                _hero.SwitchRedName(true);
            }
        }
        GAMgr.Instance.UnInit();
        DTCA713_tagMCDynamicBarrierState.Clear();
        GAMgr.Instance.UnInit();
        DTCA713_tagMCDynamicBarrierState.Clear();
        DEBUG_STEP = 2;
        GameObjectPoolManager.Instance.UnLoadAll();
@@ -121,10 +113,10 @@
        if (PlayerDatas.Instance.baseData.MapID == package.MapID)
        {
            WindowCenter.Instance.Close<LoadingWin>();
        }
        LocalSave.SetInt(RECORDPREMAPID_KEY, PlayerDatas.Instance.baseData.MapID);
        }
        LocalSave.SetInt(RECORDPREMAPID_KEY, PlayerDatas.Instance.baseData.MapID);
        DEBUG_STEP = 3;
        PlayerDatas.Instance.baseData.MapID = (ushort)package.MapID;
@@ -134,21 +126,20 @@
        {
            PlayerDatas.Instance.hero.LockTarget = null;
            PlayerDatas.Instance.hero.SelectTarget = null;
        }
        }
        DungeonStage.CurrentMapType = (MapType)_mapConfig.MapFBType;
        if (StageManager.Instance.currentMapResId == _mapResConfig.ID)
        {
            // OperationLogCollect.Instance.BugReport("Warning", "A127 Load Same MapID:" + _mapResConfig.ID);
#if UNITY_EDITOR
            Debug.LogFormat("DTCA127_tagMCStartChangeMap出现加载相同地图行为:" + _mapResConfig.ID);
#endif
            return;
        }
        StageManager.Instance.isServerPreparing = true;
        DEBUG_STEP = 4;
        }
        StageManager.Instance.isServerPreparing = true;
        DEBUG_STEP = 4;
        switch (_mapConfig.MapFBType)
        {
            case 0:
@@ -156,8 +147,8 @@
            default:
                ModelCenter.Instance.GetModel<DungeonModel>().ResetDungeonBufData();
                break;
        }
        }
        DEBUG_STEP = 5;
        switch (package.MapID)
        {
@@ -173,22 +164,22 @@
            default:
                StageManager.Instance.Load<DungeonStage>(_mapConfig.MapID);
                break;
        }
        DEBUG_STEP = 6;
        }
        DEBUG_STEP = 6;
    }
    public static MapResourcesConfig GetMapResourcesConfig(int mapID, int lineID)
    {
    public static MapResourcesConfig GetMapResourcesConfig(int mapID, int lineID)
    {
        int _key = mapID * 1000 + lineID;
        int _mapResourceID = -1;
        MapResourcesConfig _mapResConfig = null;
        if (mapIdDict.TryGetValue(_key, out _mapResourceID))
        {
            _mapResConfig = Config.Instance.Get<MapResourcesConfig>(_mapResourceID);
        }
        else
        {
        }
        else
        {
            foreach (var _config in Config.Instance.GetAllValues<MapResourcesConfig>())
            {
                if (mapID == _config.DataID
@@ -199,10 +190,10 @@
                    mapIdDict[_key] = _mapResourceID;
                    break;
                }
            }
        }
        return _mapResConfig;
            }
        }
        return _mapResConfig;
    }
}
Fight/Stage/StageManager.cs
@@ -134,7 +134,6 @@
    {
        if (currentMapResId != 0 && currentMapResId == mapResConfigID)
        {
            //OperationLogCollect.Instance.BugReport("Warning", "StageManager Load Same MapID:" + mapResConfigID);
#if UNITY_EDITOR
            Debug.LogFormat("StageManager出现加载相同地图行为:" + mapResConfigID);
#endif