Browse Source

now warning/killing for idling can be individually disabled

master
jcao219 13 years ago
parent
commit
9fdb596c21
  1. 4
      wolfgame.py

4
wolfgame.py

@ -799,7 +799,7 @@ def reaper(cli, gameid): @@ -799,7 +799,7 @@ def reaper(cli, gameid):
# check to see if idlers need to be killed.
var.IDLE_WARNED = []
if not var.WARN_IDLE_TIME or not var.KILL_IDLE_TIME:
if not var.WARN_IDLE_TIME and not var.KILL_IDLE_TIME:
return
while gameid == var.GAME_ID:
@ -811,12 +811,14 @@ def reaper(cli, gameid): @@ -811,12 +811,14 @@ def reaper(cli, gameid):
tdiff = datetime.now() - lst
if (tdiff > timedelta(seconds=var.WARN_IDLE_TIME) and
nick not in var.IDLE_WARNED):
if var.WARN_IDLE_TIME:
to_warn.append(nick)
var.IDLE_WARNED.append(nick)
var.LAST_SAID_TIME[nick] = (datetime.now() -
timedelta(seconds=var.WARN_IDLE_TIME)) # Give him a chance
elif (tdiff > timedelta(seconds=var.KILL_IDLE_TIME) and
nick in var.IDLE_WARNED):
if var.KILL_IDLE_TIME:
to_kill.append(nick)
elif (tdiff < timedelta(seconds=var.WARN_IDLE_TIME) and
nick in var.IDLE_WARNED):

Loading…
Cancel
Save