mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-01 09:48:37 +00:00
Fix score leaderboard at end of levels (#190)
This commit is contained in:
parent
58617df273
commit
535116c2e4
1 changed files with 4 additions and 4 deletions
|
@ -82,7 +82,7 @@ public class ScoreController : ControllerBase
|
|||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
||||
string myRanking = this.getScores(score.SlotId, score.Type, user);
|
||||
string myRanking = this.getScores(score.SlotId, score.Type, user, -1, 5, "scoreboardSegment");
|
||||
|
||||
return this.Ok(myRanking);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class ScoreController : ControllerBase
|
|||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "PossibleMultipleEnumeration")]
|
||||
private string getScores(int slotId, int type, User user, int pageStart = -1, int pageSize = 5)
|
||||
private string getScores(int slotId, int type, User user, int pageStart = -1, int pageSize = 5, string rootName = "scores")
|
||||
{
|
||||
// This is hella ugly but it technically assigns the proper rank to a score
|
||||
// var needed for Anonymous type returned from SELECT
|
||||
|
@ -138,11 +138,11 @@ public class ScoreController : ControllerBase
|
|||
);
|
||||
|
||||
string res;
|
||||
if (myScore == null) res = LbpSerializer.StringElement("scores", serializedScores);
|
||||
if (myScore == null) res = LbpSerializer.StringElement(rootName, serializedScores);
|
||||
else
|
||||
res = LbpSerializer.TaggedStringElement
|
||||
(
|
||||
"scores",
|
||||
rootName,
|
||||
serializedScores,
|
||||
new Dictionary<string, object>
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue