Use server-side randomness

This commit is contained in:
jvyden 2021-11-15 00:19:43 -05:00
commit 543996c1a6
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -141,8 +141,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
IEnumerable<Slot> slots = this.database.Slots.Where(s => s.GameVersion <= gameVersion)
.Include(s => s.Creator)
.Include(s => s.Location)
.AsEnumerable() // performance?
.OrderBy(x => new Random().Next())
.OrderBy(_ => EF.Functions.Random())
.Take(Math.Min(pageSize, 30));
string response = slots.Aggregate(string.Empty, (current, slot) => current + slot.Serialize());