Пример #1
0
        /// <summary>
        /// データロードする
        /// </summary>
        public void DataLoad()
        {
            if (this.InfoLocation == null)
            {
                this.InfoLocation = new DatLocation();
            }
            if (this.InfoWether == null)
            {
                this.InfoWether = new DatWether();
            }
            if (this.NewTopic == null)
            {
                this.NewTopic = new DatNewTopic();
            }
            if (this.InfoAnniversary == null)
            {
                this.InfoAnniversary = new DatAnniversaryDays();
            }
            if (this.NewsList == null)
            {
                this.NewsList = new DatNewsList();
            }
            if (this.NewTopic.TalkTopicList == null)
            {
                this.NewTopic.TalkTopicList = new LpsQueue <MsgTopic>();
            }
            if (this.NewTopic.InterruptTopicList == null)
            {
                this.NewTopic.InterruptTopicList = new LpsQueue <MsgTopic>();
            }
            this.EnvironmentInfo = new DatEnvironmentInfomation();                 //環境情報初期化

            //天気情報は常に最新を取る
            this.InfoWether.LastUpdateTime = LpsDatetimeUtil.enc(DateTime.Now.AddMinutes(-70));

            //本日情報は常に最新を取る
            this.InfoAnniversary.LastUpdateTime = LpsDatetimeUtil.enc(DateTime.Now.AddMinutes(-70));

            //ニュースリストは常に最新を取る
            this.NewsList.LastUpdateTime = LpsDatetimeUtil.enc(DateTime.Now.AddMinutes(-70));

            //地域データは常に最新を取る
            this.InfoLocation.LastUpdateTime = LpsDatetimeUtil.enc(DateTime.Now.AddMinutes(-70));

            //最終解放日時
            this.LastRunReleaseProcessing = DateTime.Now;

            //保持件数が少ない場合は更新時刻を初期化する
            this.NewTopic.InitLastUpdateTime();

            //ペンディングフォルス設定
            this.EnvironmentInfo.SetPendingOff();
        }
Пример #2
0
    /// <summary>
    /// 最新のニュースリストを取得する
    /// </summary>
    /// <returns></returns>
    private IEnumerator SetLastNewsList()
    {
        //トークインスタンス取得
        DatNewsList newsList = LiplisStatus.Instance.NewsList;

        //指定時間経過していなければ抜ける
        if (LpsDatetimeUtil.dec(newsList.LastUpdateTime).AddMinutes(60) > DateTime.Now)
        {
            goto End;
        }

        //最新データをダウンロードする
        yield return(StartCoroutine(SetLastNews()));

        //終了ラベル
        End :;
    }
Пример #3
0
    //====================================================================
    //
    //                        天気情報収集
    //
    //====================================================================
    #region 天気情報収集

    /// <summary>
    /// 天気情報収集
    /// </summary>
    private IEnumerator DataCollectWether()
    {
        //トークインスタンス取得
        DatWether Wether = LiplisStatus.Instance.InfoWether;

        //指定時間経過していなければ抜ける
        if (LpsDatetimeUtil.dec(Wether.LastUpdateTime).AddMinutes(60) > DateTime.Now)
        {
            goto End;
        }

        //最新データをダウンロードする
        yield return(StartCoroutine(SetWether(Wether)));

        //終了ラベル
        End :;
    }
Пример #4
0
    //====================================================================
    //
    //                        位置情報収集
    //
    //====================================================================
    #region 位置情報収集

    /// <summary>
    /// 位置情報収集
    /// </summary>
    private IEnumerator DataCollectLocation()
    {
        //トークインスタンス取得
        DatLocation Location = LiplisStatus.Instance.InfoLocation;

        //指定時間経過していなければ抜ける
        if (LpsDatetimeUtil.dec(Location.LastUpdateTime).AddMinutes(10) > DateTime.Now)
        {
            goto End;
        }

        //最新データをダウンロードする
        yield return(StartCoroutine(SetLocation(Location)));

        //終了ラベル
        End :;
    }
Пример #5
0
    //====================================================================
    //
    //                        ニュースデータ収集関連
    //
    //====================================================================
    #region ニュースデータ収集関連
    /// <summary>
    /// データをセットする
    /// </summary>
    /// <param name="dataList"></param>
    public IEnumerator DataCollectNewTopic()
    {
        //指定時間経過していなければ抜ける
        if (LpsDatetimeUtil.dec(LiplisStatus.Instance.NewTopic.LastUpdateTime).AddMinutes(10) > DateTime.Now)
        {
            goto End;
        }

        //最終更新時刻設定
        yield return(LiplisStatus.Instance.NewTopic.LastUpdateTime = LpsDatetimeUtil.Now);

        //最新データをダウンロードする
        yield return(StartCoroutine(SetLastTopicMltData()));

        //古いデータを削除する
        StartCoroutine(DeleteOldData());

        //終了ラベル
        End :;
    }
Пример #6
0
    /// <summary>
    /// 開始時処理
    /// </summary>
    void Start()
    {
        //データロード
        Load();

        if (LiplisStatus.Instance.NewTopic.TalkTopicList == null)
        {
            LiplisStatus.Instance.NewTopic.TalkTopicList = new LpsQueue <MsgTopic>();
        }
        if (LiplisStatus.Instance.NewTopic.InterruptTopicList == null)
        {
            LiplisStatus.Instance.NewTopic.InterruptTopicList = new LpsQueue <MsgTopic>();
        }

        //背景ゲームオブジェクト取得
        this.BackGround     = GameObject.Find("CanvasBackGround");
        this.ctrlBackground = this.BackGround.GetComponent <CtrlBackGroundImage>();

        //天気情報は常に最新を取る
        LiplisStatus.Instance.InfoWether.LastUpdateTime = LpsDatetimeUtil.enc(DateTime.Now.AddMinutes(-70));

        //ニュースリストは常に最新を取る
        LiplisStatus.Instance.NewsList.LastUpdateTime = LpsDatetimeUtil.enc(DateTime.Now.AddMinutes(-70));

        //地域データは常に最新を取る
        LiplisStatus.Instance.InfoLocation.LastUpdateTime = LpsDatetimeUtil.enc(DateTime.Now.AddMinutes(-70));

        //最終解放日時
        LiplisStatus.Instance.LastRunReleaseProcessing = DateTime.Now;

        //保持件数が少ない場合は更新時刻を初期化する
        LiplisStatus.Instance.NewTopic.InitLastUpdateTime();

        //ペンディングフォルス設定
        LiplisStatus.Instance.EnvironmentInfo.SetPendingOff();

        //定周期ループスタート
        StartCoroutine(DacaCollectTimerTick());
    }
Пример #7
0
    //====================================================================
    //
    //                        本日情報データ取得
    //
    //====================================================================
    #region 本日情報データ取得

    /// <summary>
    /// 本日情報データ取得
    /// </summary>
    private IEnumerator DataCollectAnniversaryDays()
    {
        //トークインスタンス取得
        DatAnniversaryDays InfoAnniversary = LiplisStatus.Instance.InfoAnniversary;

        //指定時間経過していなければ抜ける
        if (LpsDatetimeUtil.dec(InfoAnniversary.LastUpdateTime).AddMinutes(10) > DateTime.Now)
        {
            goto End;
        }

        //本日データがすでに入っていれば抜ける
        if (InfoAnniversary.CheckTodayDataExists())
        {
            goto End;
        }

        //最新データをダウンロードする
        yield return(StartCoroutine(SetAnniversaryDays(InfoAnniversary)));

        //終了ラベル
        End :;
    }
        //====================================================================
        //
        //                        ニュースデータ収集関連
        //
        //====================================================================
        #region ニュースデータ収集関連
        /// <summary>
        /// データをセットする
        /// </summary>
        /// <param name="dataList"></param>
        public IEnumerator DataCollectNewTopic()
        {
            //指定時間経過していなければ抜ける
            if (LpsDatetimeUtil.dec(LiplisStatus.Instance.NewTopic.LastUpdateTime).AddMinutes(10) > DateTime.Now)
            {
                goto End;
            }

            //最終更新時刻設定
            yield return(LiplisStatus.Instance.NewTopic.LastUpdateTime = LpsDatetimeUtil.Now);

            //最新データをダウンロードする
            yield return(CoroutineHandler.StartStaticCoroutine(SetLastTopicMltData()));

            //要求データセット
            LiplisCache.Instance.ImagePath.SetRequestUrlQ();

            //古いデータを削除する
            CoroutineHandler.StartStaticCoroutine(DeleteOldData());

            //終了ラベル
            End :;
        }
Пример #9
0
        /// <summary>
        /// 保持データに本日データがあるかどうかチェックする
        /// </summary>
        /// <returns></returns>
        public bool CheckTodayDataExists()
        {
            //nullチェック
            if (DataList == null)
            {
                return(false);
            }
            if (DataList.AnniversaryDaysList == null)
            {
                return(false);
            }

            foreach (MsgTopic data in DataList.AnniversaryDaysList)
            {
                if (LpsDatetimeUtil.dec(data.CreateTime).Day == DateTime.Now.Day)
                {
                    return(true);
                }
            }

            //本日データが無かった。
            return(false);
        }
Пример #10
0
        public void DeleteOldData()
        {
            //下処理に変更
            //指定条件に合致するデータを削除する
            //LiplisStatus.Instance.NewTopic.TalkTopicList.RemoveAll(TermOldTopicDelete);
            //LiplisStatus.Instance.NewTopic.ChattedKeyList.RemoveAll(TermOldTopicDelete);

            while (TalkTopicList.Count > MINIMUM_NUMBER)
            {
                if (LpsDatetimeUtil.dec(TalkTopicList[0].CreateTime) <= DateTime.Now.AddHours(-24))
                {
                    MsgTopic topic = TalkTopicList.Dequeue();
                    topic.TalkSentenceList.Clear();
                    topic.TalkSentenceList = null;
                    topic = null;
                }
                else
                {
                    break;
                }
            }
            while (ChattedKeyList.Count > MINIMUM_NUMBER)
            {
                if (LpsDatetimeUtil.dec(ChattedKeyList[0].CreateTime) <= DateTime.Now.AddHours(-24))
                {
                    MsgTopic topic = ChattedKeyList.Dequeue();
                    topic.TalkSentenceList.Clear();
                    topic.TalkSentenceList = null;
                    topic = null;
                }
                else
                {
                    break;
                }
            }
        }
Пример #11
0
        /// <summary>
        /// 保持データに本日データがあるかどうかチェックする
        /// </summary>
        /// <returns></returns>
        public bool CheckTodayDataExists()
        {
            //nullチェック
            if (AnniversaryDaysList == null)
            {
                AnniversaryDaysList = new List <MsgTopic>();
                return(false);
            }

            //本日データ検索
            foreach (MsgTopic daysData in AnniversaryDaysList)
            {
                if (LpsDatetimeUtil.dec(daysData.CreateTime).Day == DateTime.Now.Day)
                {
                    return(true);
                }
            }

            //クリアする
            AnniversaryDaysList.Clear();

            //本日データが無かった。
            return(false);
        }
Пример #12
0
 /// <summary>
 /// 古データ 削除条件
 /// </summary>
 /// <param name="topic"></param>
 /// <returns></returns>
 private bool TermOldTopicDelete(MsgTopic topic)
 {
     return(LpsDatetimeUtil.dec(topic.CreateTime) <= DateTime.Now.AddHours(-24));
 }
Пример #13
0
        //====================================================================
        //
        //                           更新処理
        //
        //====================================================================
        #region 更新処理

        /// <summary>
        /// アイテム更新
        /// </summary>
        /// <returns></returns>
        private IEnumerator updateItem()
        {
            if (this.dataIndex == -1)
            {
                yield break;
            }

            //ニュースデータNULLチェック
            if (ScrollViewControllerLog.sc.NewsDataList == null)
            {
                yield break;
            }

            //ニュースデータカウントチェック
            if (ScrollViewControllerLog.sc.NewsDataList.Count - 1 < this.dataIndex)
            {
                yield break;
            }

            //ニュースデータ取得
            MsgBaseNewsData data = ScrollViewControllerLog.sc.NewsDataList[this.dataIndex];

            //コンペアチェック
            if (CompareData(data))
            {
                yield break;
            }

            //一個前のURL設定
            prvData = data;

            //タイトル表示
            this.txtNews.text = data.TITLE;

            //サムネイルURL取得
            string thumbUrl = ThumbnailUrl.CreateListThumbnailUrl(data.THUMBNAIL_URL);

            //時刻表示
            this.txtTime.text = LpsDatetimeUtil.dec(data.CREATE_TIME).ToString("yyyy/MM/dd HH:mm:ss");

            //タイプ表示
            this.txtType.text = ContentCategolyText.GetContentText(data.DATA_TYPE);

            //ファイルからサムネイル取得を試みる
            Texture2D texture = LiplisCache.Instance.ImagePath.GetWebTexutreFromFile(thumbUrl);

            //NULLならノーイメージ適用
            if (texture == null)
            {
                texture = LiplisCache.Instance.ImagePath.GetNoImageTex();
            }

            //NULLならWebからダウンロードする
            if (texture == null)
            {
                //からテクスチャ取得
                texture = LiplisCache.Instance.ImagePath.GetNoImageTex();

                //設定
                icon.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);

                //最新ニュースデータ取得
                var Async = LiplisCache.Instance.ImagePath.GetWebTexutre(thumbUrl);

                //非同期実行
                yield return(CoroutineHandler.StartStaticCoroutine(Async));

                //再度データを取り直す
                data = ScrollViewControllerLog.sc.NewsDataList[this.dataIndex];

                //データ取得
                texture = (Texture2D)Async.Current;
            }


            //ボタンのテキスト変更
            if (texture != null)
            {
                try
                {
                    icon.sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
                }
                catch
                {
                }
            }
            else
            {
            }
        }