少年修仙传客户端代码仓库
client_Hale
2018-12-27 efb9dc5bcfb6f5e312218ce9828ab6ae6e06c740
382 跨服tick逻辑修改
1个文件已修改
50 ■■■■ 已修改文件
Core/GameEngine/Model/Player/PlayerDatas.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Player/PlayerDatas.cs
@@ -34,7 +34,8 @@
    public PlayerRankData rank { get { return m_Rank; } }
    StoreModel m_StoreModel;
    StoreModel StoreModel {
    StoreModel StoreModel
    {
        get { return m_StoreModel ?? (m_StoreModel = ModelCenter.Instance.GetModel<StoreModel>()); }
    }
@@ -448,22 +449,45 @@
            case PlayerDataRefresh.BillboardLV:
                break;
            case PlayerDataRefresh.Tick:
#if UNITY_EDITOR
                DebugEx.LogFormat("---- 收到服务端Tick: {0}", value);
                if (extersion.Tick != 0)
                if (GameNetSystem.Instance.crossServerSocketConnected)
                {
                    uint _curWorldTick = GetWorldTick();
                    uint _diffValue = value > _curWorldTick ? value - _curWorldTick : _curWorldTick - value;
                    DebugEx.LogFormat(" |-------- 当前客户端Tick: {0}, 差异: {1}", _curWorldTick, _diffValue);
                    if (_diffValue > 5000)
                    if (!isMainServerData)
                    {
                        DebugEx.LogFormat(" |-------- <color=red>收到服务端WorldTick与当前的客户端Tick差异超过5秒</color>");
#if UNITY_EDITOR
                        DebugEx.LogFormat("---- 收到服务端Tick: {0}", value);
                        if (extersion.Tick != 0)
                        {
                            uint _curWorldTick = GetWorldTick();
                            uint _diffValue = value > _curWorldTick ? value - _curWorldTick : _curWorldTick - value;
                            DebugEx.LogFormat(" |-------- 当前客户端Tick: {0}, 差异: {1}", _curWorldTick, _diffValue);
                            if (_diffValue > 5000)
                            {
                                DebugEx.LogFormat(" |-------- <color=red>收到服务端WorldTick与当前的客户端Tick差异超过5秒</color>");
                            }
                        }
#endif
                        extersion.Tick = value;
                        m_Tick = Environment.TickCount;
                    }
                }
                else
                {
#if UNITY_EDITOR
                    DebugEx.LogFormat("---- 收到服务端Tick: {0}", value);
                    if (extersion.Tick != 0)
                    {
                        uint _curWorldTick = GetWorldTick();
                        uint _diffValue = value > _curWorldTick ? value - _curWorldTick : _curWorldTick - value;
                        DebugEx.LogFormat(" |-------- 当前客户端Tick: {0}, 差异: {1}", _curWorldTick, _diffValue);
                        if (_diffValue > 5000)
                        {
                            DebugEx.LogFormat(" |-------- <color=red>收到服务端WorldTick与当前的客户端Tick差异超过5秒</color>");
                        }
                    }
#endif
                extersion.Tick = value;
                m_Tick = Environment.TickCount;
                    extersion.Tick = value;
                    m_Tick = Environment.TickCount;
                }
                break;
            case PlayerDataRefresh.CurrentPlayerType:
                break;
@@ -514,7 +538,7 @@
                        GameNetSystem.Instance.crossServerConnected_Loigc = false;
                        LoadingWin.targetMapResId = 1;
                        WindowCenter.Instance.Open<LoadingWin>();
                        StageManager.Instance.Load<DungeonStage>(baseData.MapID,GameNetSystem.SocketType.Main, true);
                        StageManager.Instance.Load<DungeonStage>(baseData.MapID, GameNetSystem.SocketType.Main, true);
                        if (hero != null && !hero.ActorInfo.serverDie)
                        {
                            hero.RequestName();