Esempio n. 1
0
        void ActivityThread(int sleepTime, int extraSleeptime)
        {
            new Task(async() =>
            {
                if (sleepTime > 0)
                {
                    await Task.Delay(sleepTime);
                    if (extraSleeptime > 0)
                    {
                        await Task.Delay(extraSleeptime);
                    }
                }

                try
                {
                    activity.Archive();
                    activity = new PlayerActivity(true);
                    RefreshActivityThread();
                }
                catch (Exception e)
                {
                    Log.LogS("Failed to complete Activity Thread");
                    Log.LogS(e);
                }
            }).Start();
        }
Esempio n. 2
0
        internal void Archive()
        {
            PlayerActivity top = LoadTop();

            if (top == null || top.total < total)
            {
                this._id = "top";
                this.Save();
            }
        }
Esempio n. 3
0
        //Player Activity
        internal void LoadActivity()
        {
            if (activity != null)
            {
                return;
            }

            activity = PlayerActivity.LoadCurrent();
            if (activity == null)
            {
                activity = new PlayerActivity(true);
            }
            RefreshActivityThread();
        }