Add quieting code again, but disabled by default
This reverts commit 5e4bb1ed5d1beb91ea7b903096b06c6f8cc3b798 and puts the relevant quiet-related code in a conditional instead, depending on a newly-added var.QUIET_DEAD_PLAYERS setting.
This commit is contained in:
parent
5e4bb1ed5d
commit
b2e0a6b1a3
@ -111,6 +111,11 @@ def connect_callback(cli):
|
||||
to_be_devoiced = []
|
||||
cmodes = []
|
||||
|
||||
@hook("quietlist", hookid=294)
|
||||
def on_quietlist(cli, server, botnick, channel, q, quieted, by, something):
|
||||
if re.match(".+\!\*@\*", quieted): # only unquiet people quieted by bot
|
||||
cmodes.append(("-q", quieted))
|
||||
|
||||
@hook("whospcrpl", hookid=294)
|
||||
def on_whoreply(cli, server, nick, ident, cloak, user, status, acc):
|
||||
if user in var.USERS: return # Don't add someone who is already there
|
||||
@ -136,6 +141,12 @@ def connect_callback(cli):
|
||||
var.OPPED = True
|
||||
|
||||
if var.PHASE == "none":
|
||||
@hook("quietlistend", 294)
|
||||
def on_quietlist_end(cli, svr, nick, chan, *etc):
|
||||
if chan == botconfig.CHANNEL:
|
||||
mass_mode(cli, cmodes)
|
||||
|
||||
cli.mode(botconfig.CHANNEL, "q") # unquiet all
|
||||
cli.mode(botconfig.CHANNEL, "-m") # remove -m mode from channel
|
||||
elif modeaction == "-o" and target == botconfig.NICK:
|
||||
var.OPPED = False
|
||||
@ -182,6 +193,10 @@ def reset_modes_timers(cli):
|
||||
cmodes = []
|
||||
for plr in var.list_players():
|
||||
cmodes.append(("-v", plr))
|
||||
if var.QUIET_DEAD_PLAYERS:
|
||||
for deadguy in var.DEAD:
|
||||
if not is_fake_nick(deadguy):
|
||||
cmodes.append(("-q", deadguy+"!*@*"))
|
||||
mass_mode(cli, cmodes)
|
||||
|
||||
def reset(cli):
|
||||
@ -1602,6 +1617,9 @@ def del_player(cli, nick, forced_death = False, devoice = True, end_game = True,
|
||||
mass_mode(cli, cmode)
|
||||
return not chk_win(cli)
|
||||
if var.PHASE != "join":
|
||||
# Died during the game, so quiet!
|
||||
if var.QUIET_DEAD_PLAYERS and not is_fake_nick(nick):
|
||||
cmode.append(("+q", nick+"!*@*"))
|
||||
mass_mode(cli, cmode)
|
||||
if nick not in var.DEAD:
|
||||
var.DEAD.append(nick)
|
||||
|
@ -42,6 +42,7 @@ MAX_PRIVMSG_TARGETS = 4
|
||||
LEAVE_STASIS_PENALTY = 1
|
||||
IDLE_STASIS_PENALTY = 1
|
||||
PART_STASIS_PENALTY = 1
|
||||
QUIET_DEAD_PLAYERS = False
|
||||
|
||||
GOAT_HERDER = True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user