Add on-the-fly rank calculation; change "subscribed" to "subscribed_to_scores"

This commit is contained in:
Morgan Bazalgette
2017-04-18 21:08:06 +02:00
parent b2c3ada7c0
commit 330b90b172
6 changed files with 46 additions and 25 deletions

6
vendor/vendor.json vendored
View File

@@ -201,10 +201,10 @@
"revisionTime": "2016-11-23T19:03:31Z"
},
{
"checksumSHA1": "ItsAqvnH+Qa+ewmWbnSxT6EzSBk=",
"checksumSHA1": "9wL5kcCkaY+bXT/mEp+67/M+6rU=",
"path": "zxq.co/x/getrank",
"revision": "e62f5bd6998d8d75fe3a2ff1becc9df06e88e3a6",
"revisionTime": "2016-05-28T18:25:35Z"
"revision": "97d2823cf77de9e0c95e89485df768518b6262a9",
"revisionTime": "2017-04-18T18:31:09Z"
}
],
"rootPath": "zxq.co/ripple/rippleapi"

View File

@@ -13,7 +13,7 @@ func GetRank(gameMode osuapi.Mode, mods osuapi.Mods, acc float64, c300, c100, c5
total := c300 + c100 + c50 + cmiss
switch gameMode {
case osuapi.ModeOsu:
case osuapi.ModeOsu, osuapi.ModeTaiko:
var (
c300f = float64(c300)
totalf = float64(total)
@@ -33,22 +33,6 @@ func GetRank(gameMode osuapi.Mode, mods osuapi.Mods, acc float64, c300, c100, c5
}
return "d"
case osuapi.ModeTaiko:
switch {
case acc == 100:
return s(true, mods)
case acc >= 95:
return s(false, mods)
case acc >= 90:
return "a"
case acc >= 80:
return "b"
// untested
case acc >= 70:
return "c"
}
return "d"
case osuapi.ModeCatchTheBeat:
if acc == 100 {
if mods&silver > 0 {