Compare commits

..

No commits in common. '408989d83a65cbc0b8aa07af774994a9e95c7057' and '9da2cf962e6659027818d2831cc1c8c1193f757e' have entirely different histories.

@ -98,26 +98,21 @@ public class ServiceController : WebApiController
if (userId is not null && view == -1 || userId is null) // ?????? this game makes no sense dude
{
var factor = view == -1 ? 0 : view;
if (factor > 0 && JewelDbContext.Scores.Count() < 11)
{
response = "";
}
else
{
var globalRanking = JewelDbContext.Scores
.Find(e => e.GameMode == mode)
.OrderByDescending(e => e.Points)
.Skip(factor*view)
.Take(10)
.ToList();
Console.WriteLine($"factor={factor}");
if (globalRanking.Any())
{
response = $"{factor}\n";
}
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
{
var personalRanking = JewelDbContext.Scores

@ -16,8 +16,9 @@ public class Utils
// This game is wonderful and working on it is even more so
public static string GenerateCheapGuid()
{
var rng = new Random();
var bytes = new byte[8];
Random.Shared.NextBytes(bytes);
rng.NextBytes(bytes);
return Convert.ToHexStringLower(bytes);
}
}
Loading…
Cancel
Save