mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-22 17:12:26 +00:00
Make lucky dip actually random
This commit is contained in:
parent
ac40dd041a
commit
4b2db48550
1 changed files with 5 additions and 4 deletions
|
@ -117,13 +117,14 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
GameVersion gameVersion = token.GameVersion;
|
GameVersion gameVersion = token.GameVersion;
|
||||||
|
|
||||||
// TODO: Incorporate seed?
|
// TODO: Incorporate seed?
|
||||||
IQueryable<Slot> slots = this.database.Slots.Where(s => s.GameVersion <= gameVersion)
|
IOrderedEnumerable<Slot> slots = this.database.Slots.Where(s => s.GameVersion <= gameVersion)
|
||||||
.OrderBy(_ => Guid.NewGuid())
|
|
||||||
.Include(s => s.Creator)
|
.Include(s => s.Creator)
|
||||||
.Include(s => s.Location)
|
.Include(s => s.Location)
|
||||||
.Skip(pageStart - 1)
|
.Skip(pageStart - 1)
|
||||||
.Take(Math.Min(pageSize, 30));
|
.Take(Math.Min(pageSize, 30))
|
||||||
string response = Enumerable.Aggregate(slots, string.Empty, (current, slot) => current + slot.Serialize());
|
.AsEnumerable()
|
||||||
|
.OrderBy(_ => Guid.NewGuid());
|
||||||
|
string response = slots.Aggregate(string.Empty, (current, slot) => current + slot.Serialize());
|
||||||
|
|
||||||
return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "hint_start", pageStart + Math.Min(pageSize, 30)));
|
return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "hint_start", pageStart + Math.Min(pageSize, 30)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue