예제 #1
0
    private void SetStarActivityCountDown(int obj)
    {
        string timeStr       = "";
        var    curTimeStamp  = ClientTimer.Instance.GetCurrentTimeStamp();
        var    overTimeStamp = _missionModel.GetStarActivityOverTimeStamp();
        long   time          = overTimeStamp - curTimeStamp;

        if (time < 1000)
        {
            timeStr = "0";
        }
        else
        {
            long s = (time / 1000) % 60;
            long m = (time / (60 * 1000)) % 60;
            long h = time / (60 * 60 * 1000);
            timeStr = string.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);
        }

        _activityResidueTime.text = timeStr;
    }
예제 #2
0
    private void UpdateStarActivityRefresh(int obj)
    {
        var refreshTimeStamp = _missionModel.GetStarActivityRefreshTimePintList()[_missionModel.GetOpenDay()];
        var curTimeStamp     = ClientTimer.Instance.GetCurrentTimeStamp();
        var overTimeStamp    = _missionModel.GetStarActivityOverTimeStamp();

        if (curTimeStamp == overTimeStamp)
        {
            ModuleManager.Instance.GoBack();
            return;
        }
        if (refreshTimeStamp == curTimeStamp)
        {
            MissionRefreshReq req = new MissionRefreshReq();
            var data = NetWorkManager.GetByteData(req);
            NetWorkManager.Instance.Send <MissionRefreshRes>(CMD.MISSION_REFRESH, data, res =>
            {
                _missionModel.UpdateUserMissionInfo(res.UserMissionInfo);
                _missionModel.UpdateStarActivityMission(res.UserMissions);
                View.SetData(_missionModel, _missionModel.Day);
            });
        }
    }