Skip to content

Commit

Permalink
Convert old rank strings
Browse files Browse the repository at this point in the history
  • Loading branch information
matte-ek committed Oct 16, 2023
1 parent 3b7ad4d commit 9358962
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BanchoMultiplayerBot/GlobalCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private async void OnPrivateMessageReceived(IPrivateIrcMessage msg)
response.Append($" + {((ModsModel)int.Parse(recentScore.EnabledMods!)).ToAbbreviatedForm()}");
}

response.Append($" | [{recentScore.Rank}]");
response.Append($" | [{recentScore.GetRankString()}]");

response.Append($" | {ppInformation.PerformancePoints} pp ");

Expand Down
12 changes: 12 additions & 0 deletions BanchoMultiplayerBot/OsuApi/ScoreModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ public class ScoreModel
[JsonPropertyName("score_id")]
public string? ScoreId { get; set; }

public string GetRankString()
{
return Rank switch
{
"X" => "SS",
"XS" => "SS",
"SH" => "SS",
"XH" => "SS",
_ => Rank ?? "N/A"
};
}

public float CalculateAccuracy()
{
var n300 = int.Parse(Count300!);
Expand Down

0 comments on commit 9358962

Please sign in to comment.