Browse Source

improved the logger (added a bare log without extra talk)

master
jcao219 13 years ago
parent
commit
cabd9d7cfd
  1. 1
      var.py
  2. 10
      wolfgame.py

1
var.py

@ -11,6 +11,7 @@ START_WITH_DAY = False
KILL_IDLE_TIME = 300 KILL_IDLE_TIME = 300
WARN_IDLE_TIME = 180 WARN_IDLE_TIME = 180
LOG_FILENAME = "gamelog.txt" LOG_FILENAME = "gamelog.txt"
BARE_LOG_FILENAME = "barelog.txt"
# HIT MISS SUICIDE # HIT MISS SUICIDE
GUN_CHANCES = ( 5/7 , 1/7 , 1/7 ) GUN_CHANCES = ( 5/7 , 1/7 , 1/7 )

10
wolfgame.py

@ -92,7 +92,7 @@ def connect_callback(cli):
var.GRAVEYARD_LOCK = threading.RLock() var.GRAVEYARD_LOCK = threading.RLock()
var.GAME_ID = 0 var.GAME_ID = 0
var.LOGGER = WolfgameLogger(var.LOG_FILENAME) var.LOGGER = WolfgameLogger(var.LOG_FILENAME, var.BARE_LOG_FILENAME)
if botconfig.DEBUG_MODE: if botconfig.DEBUG_MODE:
var.NIGHT_TIME_LIMIT = 0 # 90 var.NIGHT_TIME_LIMIT = 0 # 90
@ -418,7 +418,7 @@ def stats(cli, nick, chan, rest):
message[-1], message[-1],
vb) vb)
cli.msg(chan, stats_mssg) cli.msg(chan, stats_mssg)
var.LOGGER.logMessage(stats_mssg) var.LOGGER.logMessage(stats_mssg.replace("\02", ""))
@ -664,9 +664,9 @@ def chk_win(cli):
cli.msg(chan, ('\u0002The villagers, during their celebrations, are '+ cli.msg(chan, ('\u0002The villagers, during their celebrations, are '+
'frightened as they hear a loud howl. The wolves are '+ 'frightened as they hear a loud howl. The wolves are '+
'not gone!\u0002')) 'not gone!\u0002'))
var.LOGGER.logMessage(('\u0002The villagers, during their celebrations, are '+ var.LOGGER.logMessage(('The villagers, during their celebrations, are '+
'frightened as they hear a loud howl. The wolves are '+ 'frightened as they hear a loud howl. The wolves are '+
'not gone!\u0002')) 'not gone!'))
return False return False
else: else:
return False return False
@ -790,7 +790,7 @@ def update_last_said(cli, nick, chan, rest):
var.LAST_SAID_TIME[nick] = datetime.now() var.LAST_SAID_TIME[nick] = datetime.now()
if var.PHASE not in ("none", "join"): if var.PHASE not in ("none", "join"):
var.LOGGER.log("<{0}> {1}".format(nick, rest)) var.LOGGER.logChannelMessage(nick, rest)

Loading…
Cancel
Save