my b
This commit is contained in:
parent
7336201a5f
commit
e454cb2661
|
@ -25,7 +25,7 @@ def getBeatmapTime(beatmapID):
|
|||
|
||||
return p
|
||||
|
||||
def incrementPlaytime(userID, gameMode=0, length=0):
|
||||
def incrementPlaytime(userID, gameMode=0, length=0, mode):
|
||||
modeForDB = gameModes.getGameModeForDB(gameMode)
|
||||
result = glob.db.fetch("SELECT playtime_{gm} as playtime FROM users_stats WHERE id = %s".format(gm=modeForDB), [userID])
|
||||
if result is not None:
|
||||
|
@ -33,6 +33,25 @@ def incrementPlaytime(userID, gameMode=0, length=0):
|
|||
else:
|
||||
print("something went wrong...")
|
||||
|
||||
|
||||
def incrementPlaytimeRX(userID, gameMode=0, length=0):
|
||||
modeForDB = gameModes.getGameModeForDB(gameMode)
|
||||
result = glob.db.fetch("SELECT playtime_{gm}_rx as playtime FROM users_stats WHERE id = %s".format(gm=modeForDB), [userID])
|
||||
if result is not None:
|
||||
glob.db.execute("UPDATE users_stats SET playtime_{gm}_rx = %s WHERE id = %s".format(gm=modeForDB), [(int(result['playtime'])+int(length)), userID])
|
||||
else:
|
||||
print("something went wrong...")
|
||||
|
||||
|
||||
def incrementPlaytimeAP(userID, gameMode=0, length=0):
|
||||
modeForDB = gameModes.getGameModeForDB(gameMode)
|
||||
result = glob.db.fetch("SELECT playtime_{gm}_ap as playtime FROM users_stats WHERE id = %s".format(gm=modeForDB), [userID])
|
||||
if result is not None:
|
||||
glob.db.execute("UPDATE users_stats SET playtime_{gm}_ap = %s WHERE id = %s".format(gm=modeForDB), [(int(result['playtime'])+int(length)), userID])
|
||||
else:
|
||||
print("something went wrong...")
|
||||
|
||||
|
||||
def getUserStats(userID, gameMode):
|
||||
"""
|
||||
Get all user stats relative to `gameMode`
|
||||
|
|
Loading…
Reference in New Issue
Block a user