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(); }
internal void Archive() { PlayerActivity top = LoadTop(); if (top == null || top.total < total) { this._id = "top"; this.Save(); } }
//Player Activity internal void LoadActivity() { if (activity != null) { return; } activity = PlayerActivity.LoadCurrent(); if (activity == null) { activity = new PlayerActivity(true); } RefreshActivityThread(); }