log stats for templates and "lover"

This commit is contained in:
jacob1 2014-11-26 18:55:28 -05:00
parent 059fe556ec
commit d31a75c43f
2 changed files with 6 additions and 1 deletions

View File

@ -1239,6 +1239,11 @@ def stop_game(cli, winner = ""):
if acc != "*": if acc != "*":
var.update_role_stats(acc, orol, won, iwon) var.update_role_stats(acc, orol, won, iwon)
for role in var.TEMPLATE_RESTRICTIONS.keys():
if plr in var.ORIGINAL_ROLES[role]:
var.update_role_stats(acc, role, won, iwon)
if splr in var.LOVERS:
var.update_role_stats(acc, "lover", won, iwon)
if won or iwon: if won or iwon:
winners.append(splr) winners.append(splr)

View File

@ -803,7 +803,7 @@ def update_game_stats(roleset, size, winner):
(roleset, size, vwins, wwins, mwins, fwins, total)) (roleset, size, vwins, wwins, mwins, fwins, total))
def get_player_stats(acc, role): def get_player_stats(acc, role):
if role.lower() not in [k.lower() for k in ROLE_GUIDE.keys()]: if role.lower() not in [k.lower() for k in ROLE_GUIDE.keys()] and role != "lover":
return "No such role: {0}".format(role) return "No such role: {0}".format(role)
with conn: with conn:
c.execute("SELECT player FROM rolestats WHERE player=? COLLATE NOCASE", (acc,)) c.execute("SELECT player FROM rolestats WHERE player=? COLLATE NOCASE", (acc,))