From 543996c1a6e6950037f45da041b805bd83beeb21 Mon Sep 17 00:00:00 2001 From: jvyden Date: Mon, 15 Nov 2021 00:19:43 -0500 Subject: [PATCH] Use server-side randomness --- ProjectLighthouse/Controllers/SlotsController.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProjectLighthouse/Controllers/SlotsController.cs b/ProjectLighthouse/Controllers/SlotsController.cs index 50013cc7..5b536306 100644 --- a/ProjectLighthouse/Controllers/SlotsController.cs +++ b/ProjectLighthouse/Controllers/SlotsController.cs @@ -141,8 +141,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers IEnumerable 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());