From 07eede3f9a8e6900ffc4863732ac7996c446958e Mon Sep 17 00:00:00 2001 From: Sarah Faey Date: Thu, 8 Dec 2022 19:30:31 +0100 Subject: [PATCH] random raids now can have more players --- .gitignore | 2 ++ Lieb/Data/RaidService.cs | 4 ++-- Lieb/Data/TimerService.cs | 4 ++-- Lieb/Pages/Raids/RaidEdit/RaidEdit.razor | 21 ++++++++++++++++++- .../Raids/RaidEdit/RaidTemplateEdit.razor | 21 ++++++++++++++++++- 5 files changed, 46 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0972e0d..a4b1174 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ DiscordBot/token.txt DiscordBot/debugtoken.txt Lieb/discordAppSecret.txt publish.sh +getDatabase.sh +TODO.txt # Build results [Dd]ebug/ diff --git a/Lieb/Data/RaidService.cs b/Lieb/Data/RaidService.cs index f73187a..22c4e24 100644 --- a/Lieb/Data/RaidService.cs +++ b/Lieb/Data/RaidService.cs @@ -542,11 +542,11 @@ namespace Lieb.Data } } - public RaidRole CreateRandomSignUpRole(RaidType raidType) + public RaidRole CreateRandomSignUpRole(RaidType raidType, int spots = 10) { return new RaidRole() { - Spots = 10, + Spots = spots, Name = "Random", Description = raidType.ToString(), IsRandomSignUpRole = true diff --git a/Lieb/Data/TimerService.cs b/Lieb/Data/TimerService.cs index 36da057..f30d79b 100644 --- a/Lieb/Data/TimerService.cs +++ b/Lieb/Data/TimerService.cs @@ -37,8 +37,8 @@ namespace Lieb.Data foreach(RaidTemplate template in raidTemplateService.GetTemplates()) { TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(template.TimeZone); - DateTime UTCStartTime = TimeZoneInfo.ConvertTimeToUtc(template.StartTime, timeZone); - if(template.Interval > 0 && UTCStartTime.AddDays(-template.CreateDaysBefore).AddHours(1) < DateTime.UtcNow) + DateTime UTCEndTime = TimeZoneInfo.ConvertTimeToUtc(template.EndTime, timeZone); + if(template.Interval > 0 && UTCEndTime.AddDays(-template.CreateDaysBefore) < DateTime.UtcNow) { raidTemplateService.CreateRaidFromTemplate(template.RaidTemplateId).Wait(); } diff --git a/Lieb/Pages/Raids/RaidEdit/RaidEdit.razor b/Lieb/Pages/Raids/RaidEdit/RaidEdit.razor index 7245fc6..c7f3c2e 100644 --- a/Lieb/Pages/Raids/RaidEdit/RaidEdit.razor +++ b/Lieb/Pages/Raids/RaidEdit/RaidEdit.razor @@ -46,6 +46,15 @@

+ @if(_raid.RaidType != RaidType.Planned) + { +

+ +

+ }

+ @if(_template.RaidType != RaidType.Planned) + { +

+ +

+ }