Compare commits

...

3 Commits

@ -98,8 +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;
Console.WriteLine($"factor={factor}"); 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)
@ -113,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

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