random raids now can have more players

This commit is contained in:
Sarah Faey 2022-12-08 19:30:31 +01:00
parent 929ca9c0a7
commit 07eede3f9a
5 changed files with 46 additions and 6 deletions

View file

@ -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

View file

@ -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();
}