Simplify stasis logic for people who leave the channel.
Instead of setting make_stasis as soon as they leave, then setting it again with a negative number if they rejoin, we can just set it when they actually reach the timer and are killed. We were actually doing *both* up to now (which was probably what was causing the double stasis mentioned in issue #8), so I just removed the make_stasis calls when people leave and come back, and kept the one when they get killed.
This commit is contained in:
parent
cca373904d
commit
ecd62cf0ef
@ -1055,7 +1055,6 @@ def on_join(cli, raw_nick, chan, acc="*", rname=""):
|
|||||||
del var.DISCONNECTED[nick]
|
del var.DISCONNECTED[nick]
|
||||||
var.LAST_SAID_TIME[nick] = datetime.now()
|
var.LAST_SAID_TIME[nick] = datetime.now()
|
||||||
cli.msg(chan, "\02{0}\02 has returned to the village.".format(nick))
|
cli.msg(chan, "\02{0}\02 has returned to the village.".format(nick))
|
||||||
make_stasis(nick, -var.PART_STASIS_PENALTY)
|
|
||||||
for r,rlist in var.ORIGINAL_ROLES.items():
|
for r,rlist in var.ORIGINAL_ROLES.items():
|
||||||
if "(dced)"+nick in rlist:
|
if "(dced)"+nick in rlist:
|
||||||
rlist.remove("(dced)"+nick)
|
rlist.remove("(dced)"+nick)
|
||||||
@ -1188,7 +1187,6 @@ def on_nick(cli, prefix, nick):
|
|||||||
|
|
||||||
cli.msg(chan, ("\02{0}\02 has returned to "+
|
cli.msg(chan, ("\02{0}\02 has returned to "+
|
||||||
"the village.").format(nick))
|
"the village.").format(nick))
|
||||||
make_stasis(nick, -var.PART_STASIS_PENALTY)
|
|
||||||
|
|
||||||
def leave(cli, what, nick, why=""):
|
def leave(cli, what, nick, why=""):
|
||||||
nick, _, _, cloak = parse_nick(nick)
|
nick, _, _, cloak = parse_nick(nick)
|
||||||
@ -1226,9 +1224,6 @@ def leave(cli, what, nick, why=""):
|
|||||||
"\02{1}\02 is lost to the ravine forever.").format(nick, var.get_role(nick))
|
"\02{1}\02 is lost to the ravine forever.").format(nick, var.get_role(nick))
|
||||||
cli.msg(botconfig.CHANNEL, msg)
|
cli.msg(botconfig.CHANNEL, msg)
|
||||||
var.LOGGER.logMessage(msg.replace("\02", ""))
|
var.LOGGER.logMessage(msg.replace("\02", ""))
|
||||||
if var.PHASE != "join":
|
|
||||||
make_stasis(nick, var.PART_STASIS_PENALTY)
|
|
||||||
|
|
||||||
if killplayer:
|
if killplayer:
|
||||||
del_player(cli, nick)
|
del_player(cli, nick)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user