Update userUtils.py

This commit is contained in:
depreciate 2019-02-27 20:26:47 +10:30
parent 9bb2c9f493
commit c59cc7ed8e

View File

@ -76,6 +76,7 @@ def getUserStats(userID, gameMode):
# Return stats + game rank # Return stats + game rank
return stats return stats
def getUserStatsRx(userID, gameMode): def getUserStatsRx(userID, gameMode):
""" """
Get all user stats relative to `gameMode` Get all user stats relative to `gameMode`
@ -145,6 +146,25 @@ def getUserStatsAp(userID, gameMode):
# Return stats + game rank # Return stats + game rank
return stats return stats
def getMaxCombo(userID, gameMode):
"""
Get all user stats relative to `gameMode`
:param userID:
:param gameMode: game mode number
:return: dictionary with result
"""
modeForDB = gameModes.getGameModeForDB(gameMode)
# Get stats
maxcombo = glob.db.fetch("""SELECT max_combo FROM scores WHERE userid = ? AND play_mode = {gm} ORDER BY max_combo DESC LIMIT 1""".format([userID], gm=modeForDB))
# Return stats + game rank
return maxcombo
def getIDSafe(_safeUsername): def getIDSafe(_safeUsername):
""" """
Get user ID from a safe username Get user ID from a safe username