mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-01 09:48:37 +00:00
Use server-side randomness
This commit is contained in:
parent
d5ff088552
commit
543996c1a6
1 changed files with 1 additions and 2 deletions
|
@ -141,8 +141,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
IEnumerable<Slot> slots = this.database.Slots.Where(s => s.GameVersion <= gameVersion)
|
IEnumerable<Slot> slots = this.database.Slots.Where(s => s.GameVersion <= gameVersion)
|
||||||
.Include(s => s.Creator)
|
.Include(s => s.Creator)
|
||||||
.Include(s => s.Location)
|
.Include(s => s.Location)
|
||||||
.AsEnumerable() // performance?
|
.OrderBy(_ => EF.Functions.Random())
|
||||||
.OrderBy(x => new Random().Next())
|
|
||||||
.Take(Math.Min(pageSize, 30));
|
.Take(Math.Min(pageSize, 30));
|
||||||
|
|
||||||
string response = slots.Aggregate(string.Empty, (current, slot) => current + slot.Serialize());
|
string response = slots.Aggregate(string.Empty, (current, slot) => current + slot.Serialize());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue