mania hot fix

This commit is contained in:
depreciate 2019-02-05 14:23:11 +10:30
parent dcb4d3db8d
commit fa11f5286a

View File

@ -85,15 +85,25 @@ def getUserStatsRx(userID, gameMode):
:return: dictionary with result :return: dictionary with result
""" """
modeForDB = gameModes.getGameModeForDB(gameMode) modeForDB = gameModes.getGameModeForDB(gameMode)
if gameMode == 3:
# Get stats stats = glob.db.fetch("""SELECT
stats = glob.db.fetch("""SELECT ranked_score_{gm} AS rankedScore,
ranked_score_{gm}_rx AS rankedScore, avg_accuracy_{gm} AS accuracy,
avg_accuracy_{gm}_rx AS accuracy, playcount_{gm} AS playcount,
playcount_{gm}_rx AS playcount, total_score_{gm} AS totalScore,
total_score_{gm}_rx AS totalScore, pp_{gm} AS pp
pp_{gm}_rx AS pp
FROM users_stats WHERE id = %s LIMIT 1""".format(gm=modeForDB), [userID]) FROM users_stats WHERE id = %s LIMIT 1""".format(gm=modeForDB), [userID])
else:
# Get stats
stats = glob.db.fetch("""SELECT
ranked_score_{gm}_rx AS rankedScore,
avg_accuracy_{gm}_rx AS accuracy,
playcount_{gm}_rx AS playcount,
total_score_{gm}_rx AS totalScore,
pp_{gm}_rx AS pp
FROM users_stats WHERE id = %s LIMIT 1""".format(gm=modeForDB), [userID])
# Get game rank # Get game rank
stats["gameRank"] = getGameRankRx(userID, gameMode) stats["gameRank"] = getGameRankRx(userID, gameMode)
@ -111,13 +121,23 @@ def getUserStatsAp(userID, gameMode):
""" """
modeForDB = gameModes.getGameModeForDB(gameMode) modeForDB = gameModes.getGameModeForDB(gameMode)
# Get stats # Get stats
stats = glob.db.fetch("""SELECT if gameMode == 3:
ranked_score_{gm}_ap AS rankedScore, stats = glob.db.fetch("""SELECT
avg_accuracy_{gm}_ap AS accuracy, ranked_score_{gm} AS rankedScore,
playcount_{gm}_ap AS playcount, avg_accuracy_{gm} AS accuracy,
total_score_{gm}_ap AS totalScore, playcount_{gm} AS playcount,
pp_{gm}_auto AS pp total_score_{gm} AS totalScore,
pp_{gm} AS pp
FROM users_stats WHERE id = %s LIMIT 1""".format(gm=modeForDB), [userID]) FROM users_stats WHERE id = %s LIMIT 1""".format(gm=modeForDB), [userID])
else:
stats = glob.db.fetch("""SELECT
ranked_score_{gm}_ap AS rankedScore,
avg_accuracy_{gm}_ap AS accuracy,
playcount_{gm}_ap AS playcount,
total_score_{gm}_ap AS totalScore,
pp_{gm}_auto AS pp
FROM users_stats WHERE id = %s LIMIT 1""".format(gm=modeForDB), [userID])
# Get game rank # Get game rank
stats["gameRank"] = getGameRankAp(userID, gameMode) stats["gameRank"] = getGameRankAp(userID, gameMode)