Use regular lowercase for hosts + minor code cleanup
This commit is contained in:
parent
037065b40c
commit
01b7cea83c
@ -1171,14 +1171,14 @@ class MaelstromMode(GameMode):
|
||||
self.DEAD_ACCOUNTS.add(irc_lower(var.USERS[nick]["account"]))
|
||||
|
||||
if not var.ACCOUNTS_ONLY:
|
||||
self.DEAD_HOSTS.add(irc_lower(var.USERS[nick]["host"]))
|
||||
self.DEAD_HOSTS.add(var.USERS[nick]["host"].lower())
|
||||
|
||||
def on_join(self, evt, cli, var, nick, chan, rest, forced=False):
|
||||
if var.PHASE != "day" or (nick != chan and chan != botconfig.CHANNEL):
|
||||
return
|
||||
if (irc_lower(nick) in (irc_lower(x) for x in var.ALL_PLAYERS) or
|
||||
irc_lower(var.USERS[nick]["account"]) in self.DEAD_ACCOUNTS or
|
||||
irc_lower(var.USERS[nick]["host"]) in self.DEAD_HOSTS):
|
||||
var.USERS[nick]["host"].lower() in self.DEAD_HOSTS):
|
||||
cli.notice(nick, messages["maelstrom_dead"])
|
||||
return
|
||||
if not forced and evt.data["join_player"](cli, nick, botconfig.CHANNEL, sanity=False):
|
||||
|
@ -100,8 +100,9 @@ def mass_privmsg(cli, targets, msg, notice=False, privmsg=False):
|
||||
def reply(cli, nick, chan, msg, private=False, prefix_nick=False):
|
||||
if chan == nick:
|
||||
pm(cli, nick, msg)
|
||||
elif private or (nick not in list_players() and var.PHASE in var.GAME_PHASES and chan == botconfig.CHANNEL) \
|
||||
or (var.DEVOICE_DURING_NIGHT and var.PHASE == "night" and chan == botconfig.CHANNEL):
|
||||
elif private or (chan == botconfig.CHANNEL and
|
||||
((nick not in list_players() and var.PHASE in var.GAME_PHASES) or
|
||||
(var.DEVOICE_DURING_NIGHT and var.PHASE == "night"))):
|
||||
cli.notice(nick, msg)
|
||||
else:
|
||||
if prefix_nick:
|
||||
|
Loading…
Reference in New Issue
Block a user