private async void OnMailDelivery(object sender, EventArgs e) { try { await DeliverPostedMail(); } catch (Exception ex) { ModHelper.HandleError(_mod, ex, "delivering mail on schedule"); } }
private void MailDelivered(object sender, EventArgs e) { try { Task.Run(() => DeletePostedRemoteMail()); } catch (Exception ex) { ModHelper.HandleError(_mod, ex, "deleting mail from server"); } }
private async void MailDelivered(object sender, EventArgs e) { try { await DeleteDeliveredRemoteMail(); } catch (Exception ex) { ModHelper.HandleError(_mod, ex, "deleting mail from server"); } }
private void SaveEvents_AfterLoad(object sender, EventArgs e) { // render update warning if (_config.CheckForUpdates && !_hasSeenUpdateWarning && _newRelease != null) { try { _hasSeenUpdateWarning = true; ModHelper.ShowInfoMessage($"You can update {ModConstants.ModName} from {_currentVersion} to {_newRelease}."); } catch (Exception ex) { ModHelper.HandleError(_mod, ex, "showing the new version available"); } } }
private async void GameEvents_GameLoaded(object sender, EventArgs e) { // check for mod update if (_config.CheckForUpdates && !_config.Debug) { try { ISemanticVersion latest = await UpdateHelper.LogVersionCheck(_mod.Monitor, _mod.ModManifest.Version); if (latest.IsNewerThan(_currentVersion)) { _newRelease = latest; } } catch (Exception ex) { ModHelper.HandleError(_mod, ex, "checking for a new version"); } } }