예제 #1
0
    public override bool checkRequestBind(int mid)
    {
        int[] responses = _messageBind.get(mid);

        if (responses == null)
        {
            return(true);
        }

        //当前有了
        if (_currentRequestMid > 0)
        {
            if (!_isShowDelayUI)
            {
                _isShowDelayUI = true;
                GameC.ui.showNetDelay(true);
            }

            return(false);
        }
        else
        {
            _currentRequestMid = mid;
            _currentResponses  = responses;
            _requestRecordTime = DateControl.getTimeMillis();
            _isShowDelayUI     = false;
            return(true);
        }
    }
예제 #2
0
    public override void onSecond(int delay)
    {
        base.onSecond(delay);

        if (!_itemTimeSet.isEmpty())
        {
            long now = DateControl.getTimeMillis();

            bool has = false;

            ItemData data;

            foreach (int k in _itemTimeSet)
            {
                data = getItem(k);

                //超时
                if (now >= data.disableTime)
                {
                    doRemoveItemByIndexC(k, data);
                    has = true;
                }
            }

            if (has)
            {
                flushRemove(CallWayType.ItemTimeOut);
            }
        }
    }
예제 #3
0
    /** 创建ActionLog信息 */
    protected LogInfo createActionLogInfo(String type)
    {
        LogInfo info = new LogInfo("action");

        //当前区ID
        info.put("areaID", GameC.main.areaID);
        //unix时间戳
        info.put("time", DateControl.getTimeMillis());
        //类型
        info.put("action", "type");

        return(info);
    }
예제 #4
0
    /** 每秒间隔 */
    public virtual void onSecond(int delay)
    {
        if (!_d.applyDic.isEmpty())
        {
            long tt = DateControl.getTimeMillis() - _config.applyEnableTime * 1000;

            foreach (PlayerApplyRoleGroupData v in _d.applyDic)
            {
                if (tt > v.time)
                {
                    _d.applyDic.remove(v.data.showData.playerID);
                }
            }
        }
    }
예제 #5
0
    /** 添加离线事务 */
    public void addOfflineWork(ClientOfflineWorkData data)
    {
        data.workIndex = ++_currentIndex;
        data.workTime  = DateControl.getTimeMillis();

        ThreadControl.addAssistFunc(() =>
        {
            _offlineWorkListData.index = data.workIndex;
            _offlineWorkListData.list.add(data);
        });

        //当前在线
        if (GameC.player.system.isOnline())
        {
            SendClientOfflineWorkRequest.create(data).send();
        }
    }
예제 #6
0
    protected override void onFrame(int delay)
    {
        base.onFrame(delay);

        if (_currentRequestMid > 0)
        {
            long time = DateControl.getTimeMillis() - _requestRecordTime;

            if (!_isShowDelayUI)
            {
                if (time >= Global.showNetDelayMinTime)
                {
                    _isShowDelayUI = true;
                    GameC.ui.showNetDelay(true);
                }
            }

            if (time >= Global.showNetDelayMaxTime)
            {
                toCancelRequestBind();
            }
        }
    }
예제 #7
0
    //--快捷方式--//

    public long getTimeMillis()
    {
        return(DateControl.getTimeMillis());
    }