Ejemplo n.º 1
0
        public void OnEnterDungeonResult(GameEvent ge, EventParameter parameter)
        {
            MsgData_sEnterDungeonResult resp = parameter.msgParameter as MsgData_sEnterDungeonResult;

            if (resp.result == 0)
            {
                m_EnterTime = UiUtil.GetNowTimeStamp();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// S->C 返回进入灵兽墓地结果 msgId:8422;
        /// </summary>
        /// <param name="ge"></param>
        /// <param name="parameter"></param>
        public void OnChallLingShouMuDi(GameEvent ge, EventParameter parameter)
        {
            MsgData_sChallLingShouMuDi resp = parameter.msgParameter as MsgData_sChallLingShouMuDi;

            if (resp.result == 0)
            {
                FbType      = 2;
                m_EnterTime = UiUtil.GetNowTimeStamp();
            }
        }
Ejemplo n.º 3
0
        public long GetCurrRoleCreateTime()
        {
            long createTime = UiUtil.GetNowTimeStamp();

            if (roleInfoList.Count > mSelectIndex)
            {
                createTime = roleInfoList[mSelectIndex].CreateTime;
            }
            return(createTime);
        }
Ejemplo n.º 4
0
        public void onResEnterSimpleSecrectDupl(GameEvent ge, EventParameter param)
        {
            MsgData_sResEnterSimpleSecrectDupl data = param.msgParameter as MsgData_sResEnterSimpleSecrectDupl;

            EnterID    = data.id;
            EnterTime  = UiUtil.GetNowTimeStamp();
            num        = 0;
            value      = 0;
            id         = 0;
            EnterLayer = simpleMaxLayerCount;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 客户端请求 进入任务副本 msgId:4933;
        /// </summary>
        public void Send_CS_EnterDungeonQuest(int fbId)
        {
            // Debug.LogError("请求进入副本fbId  "+ fbId);
            curFbId = fbId;
            curTime = DateTime.Now;
            MsgData_cDungeonQuestEnter rsp = new MsgData_cDungeonQuestEnter();

            // CoreEntry.netMgr.send(3747, rsp);
            CoreEntry.netMgr.send((Int16)NetMsgDef.C_DungeonQuestEnter, rsp);
            //CoreEntry.netMgr.send(4933, rsp);
            questRsp    = null;
            m_EnterTime = UiUtil.GetNowTimeStamp();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 副本挑战。
        /// </summary>
        /// <param name="data">网络消息数据。</param>
        private void OnFight(MsgData data)
        {
            MsgData_sBackZhiYuanFbChallenge info = data as MsgData_sBackZhiYuanFbChallenge;

            mCurID      = info.ID;
            m_EnterTime = UiUtil.GetNowTimeStamp();

            //挑战通知
            EventParameter ep = EventParameter.Get();

            ep.intParameter  = info.Result;
            ep.intParameter1 = mCurID;
            CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_RESLEVEL_FIGHT, ep);
        }
Ejemplo n.º 7
0
        //剩余时间
        public int GetTimeLimit()
        {
            if (mTimeLimt <= 0)
            {
                mTimeLimt = 0;
                return(mTimeLimt);
            }
            int time = mTimeLimt - (int)(UiUtil.GetNowTimeStamp() - relativeTime);

            if (time < 0)
            {
                time = 0;
            }
            return(time);
        }
Ejemplo n.º 8
0
        public void OnDungeonQuestUpdate(GameEvent ge, EventParameter parameter)
        {
            questRsp = parameter.msgParameter as MsgData_sDungeonQuestStateUpdate;
            if (questRsp.state == 0)
            {
                resultDateTime = UiUtil.GetNowTimeStamp();
                CoreEntry.gAutoAIMgr.AutoFight = false;
                TaskMgr.RunTaskType            = 1;
            }
            else if (questRsp.state == 1)
            {
                resultDateTime = UiUtil.GetNowTimeStamp();
                CoreEntry.gAutoAIMgr.AutoFight = false;
                TaskMgr.RunTaskType            = 1;
            }

            CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_CC_DungeonQuestUpdate, EventParameter.Get(questRsp));
        }
Ejemplo n.º 9
0
        private void OnEnterFuben(GameEvent ge, EventParameter parameter)
        {
            MsgData_sEnterDungeonResult resp = parameter.msgParameter as MsgData_sEnterDungeonResult;

            if (resp.result == 0)
            {
                LuaTable mapConfig = ConfigManager.Instance.Map.GetMapConfig(resp.id);
                if (mapConfig == null)
                {
                    return;
                }
                int mapType = mapConfig.Get <int>("type");
                if (mapType == 43)
                {
                    mEnterTime = UiUtil.GetNowTimeStamp();
                }
            }
        }
Ejemplo n.º 10
0
        // Update is called once per frame
        void Update()
        {
            //Debug.LogError("===== NetMgr update !!! ");
            if (m_net != null)
            {
                m_net.update();

                if (MainThreadFun.Count > 0)
                {
                    for (int i = 0; i < MainThreadFun.Count; i++)
                    {
                        var child = MainThreadFun[i];
                        child();
                    }
                    MainThreadFun.Clear();
                }

                if (m_page == 2)
                {
                    if (m_HearBeatState == 0)
                    {
                        m_HearBeatGapCount -= Time.deltaTime;
                        if (m_HearBeatGapCount <= 0)
                        {
                            m_HearBeatState         = 1;
                            m_HearBeatSendTimeStamp = Time.realtimeSinceStartup;
                            m_HearBeatSendTimeTicks = DateTime.Now.Ticks;
                            m_HearBeatLastTime      = UiUtil.GetNowTimeStamp();

                            CacheSendHeartBeat.Time = m_HearBeatLastTime;
                            CoreEntry.netMgr.send((Int16)NetMsgDef.C_HEART_BEAT, CacheSendHeartBeat);
                        }
                    }
                    else if (m_HearBeatState == 1)
                    {
                        if (Time.realtimeSinceStartup - m_HearBeatSendTimeStamp > HEAR_BEAT_TIME_OUT)
                        {
                            m_HearBeatState    = 0;
                            m_HearBeatGapCount = 0;     //超时后直接重发
                            //AddHearBeatDelay((int)(HEAR_BEAT_TIME_OUT * 1000));
                            ++m_HearBeatTimeOutCount;
                            //LogMgr.LogError("心跳超时 n:{0}", m_HearBeatTimeOutCount);
                        }
                    }
                }

#if UNITY_EDITOR
                if (m_net.m_recordNet && Time.realtimeSinceStartup - m_StartRecordTime >= RECORD_GAP)
                {
                    int sent, recv;
                    lock (m_net)
                    {
                        sent             = m_net.m_byteSent;
                        recv             = m_net.m_byteRecv;
                        m_net.m_byteRecv = 0;
                        m_net.m_byteSent = 0;
                    }

                    m_StartRecordTime = Time.realtimeSinceStartup;
                    SaveNetFlow(sent, recv);
                }
#endif
            }
        }
Ejemplo n.º 11
0
 public void SetTimeLimit(int v)
 {
     mTimeLimt    = v;
     relativeTime = UiUtil.GetNowTimeStamp();
 }