|
|
@ -98,21 +98,26 @@ 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;
|
|
|
|
Console.WriteLine($"factor={factor}");
|
|
|
|
if (factor > 0 && JewelDbContext.Scores.Count() < 11)
|
|
|
|
|
|
|
|
|
|
|
|
var globalRanking = JewelDbContext.Scores
|
|
|
|
|
|
|
|
.Find(e => e.GameMode == mode)
|
|
|
|
|
|
|
|
.OrderByDescending(e => e.Points)
|
|
|
|
|
|
|
|
.Skip(factor*view)
|
|
|
|
|
|
|
|
.Take(10)
|
|
|
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (globalRanking.Any())
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
response = $"{factor}\n";
|
|
|
|
response = "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var globalRanking = JewelDbContext.Scores
|
|
|
|
|
|
|
|
.Find(e => e.GameMode == mode)
|
|
|
|
|
|
|
|
.OrderByDescending(e => e.Points)
|
|
|
|
|
|
|
|
.Skip(factor*view)
|
|
|
|
|
|
|
|
.Take(10)
|
|
|
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var score in globalRanking) response += score.ToString();
|
|
|
|
if (globalRanking.Any())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
response = $"{factor}\n";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var score in globalRanking) response += score.ToString();
|
|
|
|
|
|
|
|
}
|
|
|
|
} else // personal ranking
|
|
|
|
} else // personal ranking
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var personalRanking = JewelDbContext.Scores
|
|
|
|
var personalRanking = JewelDbContext.Scores
|
|
|
|