/// <summary>
        /// 执行_needInSeq相关处理
        /// </summary>
        public void OnResultInternal()
        {
            ContextAsyncAction action = null;

            // 设置状态
            m_state = 3;

            // 设置对现场的ref
            if (m_onResultLocalMsgClient != null)
            {
                m_onResultLocalMsgClient.RemoveRef4AsyncAction();
            }

            if (m_needInSeq)
            {
                if (m_sequenceQueue.FirstInActionSeqQueue() == this)
                {
                    m_sequenceQueue.TryDequeueActionSeqQueue(out action);
                }

                // 执行业务逻辑
                if (m_onResultLocalMsgClient.IsAvaliable()) // 可能由于时序问题到这里的时候现场已经无效
                {
                    OnResult();
                }

                // 触发下一个排序action
                action = m_sequenceQueue.FirstInActionSeqQueue();
                if (action != null)
                {
                    action.m_state = 2;
                    //这里不用await
                    var noWarnning = action.ExecuteInternal(); // 这是个async函数
                }
            }
            else
            {
                OnResult();
            }
        }
        /// <summary>
        /// 消息都走这里,从网络来的消息 或者是内部产生的消息 都走这里
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public virtual async Task OnMessage(ILocalMessage msg)
        {
            //在这里将处理一系列消息

            switch (msg.MessageId)
            {
            //AsyncAction消息的回调
            case ServerBaseLocalMesssageIDDef.LocalMsgAsyncActionResult:
                ContextAsyncAction contextAsyncAction = msg as ContextAsyncAction;
                contextAsyncAction.OnResultInternal();    //执行回调

                break;

            case ServerBaseLocalMesssageIDDef.NetMessage:                    //如何是网络消息就通过分发器进行分发
                NetClientMessage message = msg as NetClientMessage;
                MessageDispather.Instance.Handle(this, message.MessageInfo); //在这里将消息进行分发  直接调用逻辑handler
                break;

            case ServerBaseLocalMesssageIDDef.RpcNetMessage:
                RpcNetClientMessage rpcmessage = msg as RpcNetClientMessage;



                var response = (IResponse)rpcmessage.MessageInfo.Message;
                if (response == null)
                {
                    throw new Exception($"flag is response, but message is not! {rpcmessage.MessageInfo.Opcode}");
                }
                Action <IResponse> action;
                if (!m_requestCallback.TryGetValue(response.RpcId, out action))
                {
                    return;
                }
                m_requestCallback.Remove(response.RpcId);

                action(response);    //这里处理逻辑 返回await


                break;

            case ServerBaseLocalMesssageIDDef.LocalMsgPlayCtxTimer:    //现场计时任务回调感知
            {
                PlayerTimerMessage timerMsg = msg as PlayerTimerMessage;
                await OnPlayerContextTimer(timerMsg);

                return;
            }

            case ServerBaseLocalMesssageIDDef.SystemSendNetMessage:

                var snm = (SystemSendNetMessage)msg;
                if (snm.Message == null)
                {
                    Log.Debug("要发送的网络消息为空");
                    return;
                }
                //Log.Info("系统向玩家发送消息 " + snm.PlayerId + "  " + snm.Message.GetType());
                //S2C_SyncLevelStateBattleMessage syncLevelStateBattleMessage = snm.Message as S2C_SyncLevelStateBattleMessage;
                //if (syncLevelStateBattleMessage != null)
                //{
                //    Log.Info("服务器转发延迟 = "+(DateTime.Now.Ticks - syncLevelStateBattleMessage.Time)/10000);
                //}
                Send(snm.Message);


                break;

            default: break;
            }


            //本地消息和网络消息分开

            //收到的如果是网络消息就通过分发器进行分发 分发器由ServerBase维护

            //收到的是本地消息就在本地进行处理


            return;
        }