fix bug where people who did /nick to a bad nickname couldn't ever rejoin
probably only happened with ACCOUNTS_ONLY enabled
This commit is contained in:
parent
21391f9261
commit
29429cad66
@ -2454,7 +2454,7 @@ def reaper(cli, gameid):
|
|||||||
"or you will be declared dead.\u0002").format(chan), privmsg=True)
|
"or you will be declared dead.\u0002").format(chan), privmsg=True)
|
||||||
for dcedplayer in list(var.DISCONNECTED.keys()):
|
for dcedplayer in list(var.DISCONNECTED.keys()):
|
||||||
acc, cloak, timeofdc, what = var.DISCONNECTED[dcedplayer]
|
acc, cloak, timeofdc, what = var.DISCONNECTED[dcedplayer]
|
||||||
if what == "quit" and (datetime.now() - timeofdc) > timedelta(seconds=var.QUIT_GRACE_TIME):
|
if what in ("quit", "badnick") and (datetime.now() - timeofdc) > timedelta(seconds=var.QUIT_GRACE_TIME):
|
||||||
if var.get_role(dcedplayer) != "person" and var.ROLE_REVEAL:
|
if var.get_role(dcedplayer) != "person" and var.ROLE_REVEAL:
|
||||||
cli.msg(chan, ("\02{0}\02 was mauled by wild animals and has died. It seems that "+
|
cli.msg(chan, ("\02{0}\02 was mauled by wild animals and has died. It seems that "+
|
||||||
"\02{1}\02 meat is tasty.").format(dcedplayer, var.get_reveal_role(dcedplayer)))
|
"\02{1}\02 meat is tasty.").format(dcedplayer, var.get_reveal_role(dcedplayer)))
|
||||||
@ -2592,27 +2592,22 @@ def fgoat(cli, nick, chan, rest):
|
|||||||
@hook("nick")
|
@hook("nick")
|
||||||
def on_nick(cli, oldnick, nick):
|
def on_nick(cli, oldnick, nick):
|
||||||
prefix,u,m,cloak = parse_nick(oldnick)
|
prefix,u,m,cloak = parse_nick(oldnick)
|
||||||
|
chan = botconfig.CHANNEL
|
||||||
|
|
||||||
|
if (nick.startswith("Guest") or nick[0].isdigit() or (nick != "away" and "away" in nick.lower())) and nick not in var.DISCONNECTED.keys() and prefix in var.list_players():
|
||||||
|
if var.PHASE != "join":
|
||||||
|
cli.mode(chan, "-v", nick)
|
||||||
|
leave(cli, "badnick", oldnick)
|
||||||
|
return
|
||||||
|
|
||||||
if prefix in var.USERS:
|
if prefix in var.USERS:
|
||||||
var.USERS[nick] = var.USERS.pop(prefix)
|
var.USERS[nick] = var.USERS.pop(prefix)
|
||||||
if not var.USERS[nick]["inchan"]:
|
if not var.USERS[nick]["inchan"]:
|
||||||
return
|
return
|
||||||
chan = botconfig.CHANNEL
|
|
||||||
|
|
||||||
if prefix == var.ADMIN_TO_PING:
|
if prefix == var.ADMIN_TO_PING:
|
||||||
var.ADMIN_TO_PING = nick
|
var.ADMIN_TO_PING = nick
|
||||||
|
|
||||||
# for k,v in list(var.DEAD_USERS.items()):
|
|
||||||
# if prefix == k:
|
|
||||||
# var.DEAD_USERS[nick] = var.DEAD_USERS[k]
|
|
||||||
# del var.DEAD_USERS[k]
|
|
||||||
|
|
||||||
if (nick.startswith("Guest") or nick[0].isdigit() or (nick != "away" and "away" in nick.lower())) and nick not in var.DISCONNECTED.keys() and prefix in var.list_players():
|
|
||||||
if var.PHASE != "join":
|
|
||||||
cli.mode(chan, "-v", nick)
|
|
||||||
leave(cli, "quit", oldnick)
|
|
||||||
return
|
|
||||||
|
|
||||||
if prefix in var.list_players() and prefix not in var.DISCONNECTED.keys():
|
if prefix in var.list_players() and prefix not in var.DISCONNECTED.keys():
|
||||||
r = var.ROLES[var.get_role(prefix)]
|
r = var.ROLES[var.get_role(prefix)]
|
||||||
r.append(nick)
|
r.append(nick)
|
||||||
@ -2878,7 +2873,7 @@ def leave(cli, what, nick, why=""):
|
|||||||
"died.{2}").format(nick, var.get_reveal_role(nick), population)
|
"died.{2}").format(nick, var.get_reveal_role(nick), population)
|
||||||
else:
|
else:
|
||||||
msg = ("\02{0}\02 ate some poisonous berries and has died.{1}").format(nick, population)
|
msg = ("\02{0}\02 ate some poisonous berries and has died.{1}").format(nick, population)
|
||||||
elif what == "quit" and (not var.QUIT_GRACE_TIME or var.PHASE == "join"):
|
elif what in ("quit", "badnick") and (not var.QUIT_GRACE_TIME or var.PHASE == "join"):
|
||||||
if var.get_role(nick) != "person" and var.ROLE_REVEAL:
|
if var.get_role(nick) != "person" and var.ROLE_REVEAL:
|
||||||
msg = ("\02{0}\02 was mauled by wild animals and has died. It seems that "+
|
msg = ("\02{0}\02 was mauled by wild animals and has died. It seems that "+
|
||||||
"\02{1}\02 meat is tasty.{2}").format(nick, var.get_reveal_role(nick), population)
|
"\02{1}\02 meat is tasty.{2}").format(nick, var.get_reveal_role(nick), population)
|
||||||
@ -2901,7 +2896,7 @@ def leave(cli, what, nick, why=""):
|
|||||||
msg = ("\02{0}\02 died due to falling off a cliff.{1}").format(nick, population)
|
msg = ("\02{0}\02 died due to falling off a cliff.{1}").format(nick, population)
|
||||||
make_stasis(nick, var.LEAVE_STASIS_PENALTY)
|
make_stasis(nick, var.LEAVE_STASIS_PENALTY)
|
||||||
cli.msg(botconfig.CHANNEL, msg)
|
cli.msg(botconfig.CHANNEL, msg)
|
||||||
if nick in var.USERS:
|
if what not in ("badnick", "account") and nick in var.USERS:
|
||||||
var.USERS[nick]["modes"] = set()
|
var.USERS[nick]["modes"] = set()
|
||||||
var.USERS[nick]["moded"] = set()
|
var.USERS[nick]["moded"] = set()
|
||||||
if killplayer:
|
if killplayer:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user