Kevin now joins +kevin, not #kevin

This commit is contained in:
Neale Pickett 2009-10-05 16:51:45 -06:00
parent 6b2c413239
commit 4b176a363a
5 changed files with 11 additions and 10 deletions

View File

@ -11,8 +11,7 @@ PYC = __init__.pyc
PYC += config.pyc points.pyc teams.pyc
PYC += register.pyc scoreboard.pyc puzzler.pyc
PYC += flagd.pyc pointsd.pyc pointscli.pyc
PYC += histogram.pyc
#PYC += roshambo.pyc game.pyc
PYC += histogram.pyc irc.pyc
all: ctf.tce

View File

@ -7,6 +7,8 @@ import sys
import traceback
import time
channel_prefixes = '+#&'
class IRCHandler(asynchat.async_chat):
"""IRC Server connection.
@ -256,7 +258,7 @@ class User(Recipient):
return 'User(%s, %s, %s)' % (self.name(), self.user, self.host)
def recipient(interface, name):
if name[0] in ['&', '#', '+']:
if name[0] in channel_prefixes:
return Channel(interface, name)
else:
return User(interface, name, None, None)
@ -327,9 +329,8 @@ class SmartIRCHandler(IRCHandler):
# PRIVMSG ['neale!~user@127.0.0.1', 'PRIVMSG', '#hydra'] firebot, foo
# PRIVMSG ['neale!~user@127.0.0.1', 'PRIVMSG', 'firebot'] firebot, foo
try:
if args[2][0] in '#&':
forum = self.recipient(args[2])
else:
forum = self.recipient(args[2])
if not forum.is_channel():
forum = sender
addl = (text,)
except IndexError:

View File

@ -7,9 +7,8 @@ kevin.tce: target
$(FAKE) sh -c 'cd target && tar -czf - --exclude=placeholder --exclude=*~ .' > $@
target: kevin.py irc.pyc run log.run
$(INSTALL) -d target/usr/lib/ctf/kevin
$(INSTALL) kevin.py irc.py target/usr/lib/ctf/kevin
target: kevin.py run log.run
$(INSTALL) -D kevin.py target/usr/bin/kevin.py
$(INSTALL) --owner=100 -d target/var/lib/ctf/kevin/tokens

View File

@ -13,6 +13,8 @@ from ctf.flagd import Flagger
nobody = '\002[nobody]\002'
class Kevin(irc.Bot):
debug = True
def __init__(self, host, flagger, tokens, victims):
irc.Bot.__init__(self, host,
['kevin', 'kev', 'kevin_', 'kev_', 'kevinm', 'kevinm_'],

View File

@ -2,4 +2,4 @@
[ -f /var/lib/ctf/disabled/kevin ] && exit 0
exec envuidgid ctf /usr/lib/ctf/kevin/kevin.py --victims=/var/lib/ctf/kevin/victims.txt --tokens=/var/lib/ctf/kevin/tokens
exec envuidgid ctf /usr/bin/kevin.py --victims=/var/lib/ctf/kevin/victims.txt --tokens=/var/lib/ctf/kevin/tokens