Track player stats by nick if accounts are disabled
This commit is contained in:
parent
886434272f
commit
75c407c403
@ -2310,9 +2310,15 @@ def stop_game(cli, winner = "", abort = False):
|
|||||||
splr = plr # plr stripped of the (dced) bit at the front, since other dicts don't have that
|
splr = plr # plr stripped of the (dced) bit at the front, since other dicts don't have that
|
||||||
# TODO: figure out how player stats should work when var.DISABLE_ACCOUNTS is True; likely track by nick
|
# TODO: figure out how player stats should work when var.DISABLE_ACCOUNTS is True; likely track by nick
|
||||||
if plr.startswith("(dced)") and plr[6:] in var.DCED_PLAYERS.keys():
|
if plr.startswith("(dced)") and plr[6:] in var.DCED_PLAYERS.keys():
|
||||||
acc = var.DCED_PLAYERS[plr[6:]]["account"]
|
|
||||||
splr = plr[6:]
|
splr = plr[6:]
|
||||||
|
if var.DISABLE_ACCOUNTS:
|
||||||
|
acc = splr
|
||||||
|
else:
|
||||||
|
acc = var.DCED_PLAYERS[plr[6:]]["account"]
|
||||||
elif plr in var.PLAYERS.keys():
|
elif plr in var.PLAYERS.keys():
|
||||||
|
if var.DISABLE_ACCOUNTS:
|
||||||
|
acc = plr
|
||||||
|
else:
|
||||||
acc = var.PLAYERS[plr]["account"]
|
acc = var.PLAYERS[plr]["account"]
|
||||||
else:
|
else:
|
||||||
acc = "*" #probably fjoin'd fake
|
acc = "*" #probably fjoin'd fake
|
||||||
@ -8095,7 +8101,7 @@ def player_stats(cli, nick, chan, rest):
|
|||||||
# Find the player's account if possible
|
# Find the player's account if possible
|
||||||
luser = user.lower()
|
luser = user.lower()
|
||||||
lusers = {k.lower(): v for k, v in var.USERS.items()}
|
lusers = {k.lower(): v for k, v in var.USERS.items()}
|
||||||
if luser in lusers:
|
if luser in lusers and not var.DISABLE_ACCOUNTS:
|
||||||
acc = lusers[luser]["account"]
|
acc = lusers[luser]["account"]
|
||||||
if acc == "*":
|
if acc == "*":
|
||||||
if luser == nick.lower():
|
if luser == nick.lower():
|
||||||
|
Loading…
Reference in New Issue
Block a user