rejigger fdie too

This commit is contained in:
skizzerz 2016-07-27 23:01:28 -05:00
parent ebaca56c92
commit e6b6383b45

View File

@ -452,7 +452,10 @@ def forced_exit(cli, nick, chan, rest):
args = rest.split() args = rest.split()
if botconfig.DEBUG_MODE or (args and args[0] == "-force"): if args and args[0] == "-dirty":
# use as a last resort
os.abort()
elif botconfig.DEBUG_MODE or (args and args[0] == "-force"):
force = True force = True
rest = " ".join(args[1:]) rest = " ".join(args[1:])
else: else:
@ -460,24 +463,14 @@ def forced_exit(cli, nick, chan, rest):
if var.PHASE in var.GAME_PHASES: if var.PHASE in var.GAME_PHASES:
if var.PHASE == "join" or force or nick == "<console>": if var.PHASE == "join" or force or nick == "<console>":
try: stop_game(cli)
stop_game(cli)
except Exception:
traceback.print_exc()
else: else:
reply(cli, nick, chan, messages["stop_bot_ingame_safeguard"].format( reply(cli, nick, chan, messages["stop_bot_ingame_safeguard"].format(
what="stop", cmd="fdie", prefix=botconfig.CMD_CHAR), private=True) what="stop", cmd="fdie", prefix=botconfig.CMD_CHAR), private=True)
return return
try: reset_modes_timers(cli)
reset_modes_timers(cli) reset()
except Exception:
traceback.print_exc()
try:
reset()
except Exception:
traceback.print_exc()
msg = "{0} quit from {1}" msg = "{0} quit from {1}"
@ -489,6 +482,8 @@ def forced_exit(cli, nick, chan, rest):
nick, nick,
rest.strip())) rest.strip()))
except Exception: except Exception:
# bot may have quit by this point, so can't use regular handler
# the operator should see this on console anyway even though it isn't logged
traceback.print_exc() traceback.print_exc()
sys.exit() sys.exit()
finally: finally: