diff --git a/MementoMori/Jobs/TimeZoneAwareJobRegister.cs b/MementoMori/Jobs/TimeZoneAwareJobRegister.cs index 13bd76d..5c8e046 100644 --- a/MementoMori/Jobs/TimeZoneAwareJobRegister.cs +++ b/MementoMori/Jobs/TimeZoneAwareJobRegister.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Text.RegularExpressions; using MementoMori.Common.Localization; using MementoMori.Option; using MementoMori.Ortega.Share; @@ -61,8 +61,8 @@ public async Task RegisterJobs(long userId) { AddJob(scheduler, _gameConfig.Value.AutoJob.DailyJobCron, ResourceStrings.DailyJob, userId, networkManager.TimeManager.DiffFromUtc); AddJob(scheduler, _gameConfig.Value.AutoJob.HourlyJobCron, ResourceStrings.RewardClaimJob, userId, networkManager.TimeManager.DiffFromUtc); - AddJob(scheduler, _gameConfig.Value.AutoJob.PvpJobCron, Masters.TextResourceTable.Get("[CommonHeaderLocalPvpLabel]"), userId, networkManager.TimeManager.DiffFromUtc); - AddJob(scheduler, _gameConfig.Value.AutoJob.LegendLeagueJobCron, Masters.TextResourceTable.Get("[CommonHeaderGlobalPvpLabel]"), userId, networkManager.TimeManager.DiffFromUtc); + AddJob(scheduler, NormalizeCron(_gameConfig.Value.AutoJob.PvpJobCron), Masters.TextResourceTable.Get("[CommonHeaderLocalPvpLabel]"), userId, networkManager.TimeManager.DiffFromUtc); + AddJob(scheduler, NormalizeCron(_gameConfig.Value.AutoJob.LegendLeagueJobCron), Masters.TextResourceTable.Get("[CommonHeaderGlobalPvpLabel]"), userId, networkManager.TimeManager.DiffFromUtc); AddJob(scheduler, _gameConfig.Value.AutoJob.GuildRaidBossReleaseCron, Masters.TextResourceTable.Get("[GuildRaidReleaseConfirmTitle]"), userId, networkManager.TimeManager.DiffFromUtc); AddJob(scheduler, _gameConfig.Value.AutoJob.AutoBuyShopItemJobCron, ResourceStrings.ShopAutoBuyItems, userId, networkManager.TimeManager.DiffFromUtc); @@ -77,6 +77,11 @@ public async Task RegisterJobs(long userId) } } + private string NormalizeCron(string cron) + { + return Regex.Replace(cron, @"^[\S]+", "0"); + } + private void RemoveJob(IScheduler scheduler, long userId) where T : IJob { var type = typeof(T);