fix paging in score ranking, i hope

main
Nightshade System 4 weeks ago
parent 9af10aff13
commit 7c71c7effb

@ -98,7 +98,12 @@ public class ServiceController : WebApiController
if (userId is not null && view == -1 || userId is null) // ?????? this game makes no sense dude if (userId is not null && view == -1 || userId is null) // ?????? this game makes no sense dude
{ {
var factor = view == -1 ? 0 : view; var factor = view == -1 ? 0 : view;
if (factor > 0 && JewelDbContext.Scores.Count() < 11)
{
response = "";
}
else
{
var globalRanking = JewelDbContext.Scores var globalRanking = JewelDbContext.Scores
.Find(e => e.GameMode == mode) .Find(e => e.GameMode == mode)
.OrderByDescending(e => e.Points) .OrderByDescending(e => e.Points)
@ -112,6 +117,7 @@ public class ServiceController : WebApiController
} }
foreach (var score in globalRanking) response += score.ToString(); foreach (var score in globalRanking) response += score.ToString();
}
} else // personal ranking } else // personal ranking
{ {
var personalRanking = JewelDbContext.Scores var personalRanking = JewelDbContext.Scores

Loading…
Cancel
Save