def getauth(nick): if c.getboolean("BOT", "auth-reader"): for data in _userdb.execute("select auth from auth where nick='%s'" % nick): return data[0] else: return "disabled"
def load(): bind("nick_in_use", "raw", "433") if c.getboolean("BOT", "auth-reader"): bind("on_quit", "quit") bind("whois_330", "raw", "330") bind("who_354", "raw", "354") bind("check_user", "raw", "352") bind("on_366", "raw", "366") bind("on_nickchange", "nick") bind("whois_307", "raw", "307")
def load(): bind("nick_in_use","raw","433") if c.getboolean("BOT", "auth-reader"): bind("on_quit","quit") bind("whois_330","raw","330") bind("who_354", "raw", "354") bind("check_user","raw","352") bind("on_366","raw","366") bind("on_nickchange","nick") bind("whois_307","raw","307")
def pirb(self): try: if c.getboolean("SERVER", "ipv6"): rc = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) else: rc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) rc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) if self.ip != "" and self.port != "": rc.bind((self.ip, int(self.port))) rc.listen(100) while 1: (client, address) = rc.accept() thread.start_new_thread(self.client,(client,address[0],rc)) rc.close() except Exception,e: printe(e)
def pirb(self): try: if c.getboolean("SERVER", "ipv6"): rc = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) else: rc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) rc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) if self.ip != "" and self.port != "": rc.bind((self.ip, int(self.port))) rc.listen(100) while 1: (client, address) = rc.accept() thread.start_new_thread(self.client, (client, address[0], rc)) rc.close() except Exception, e: printe(e)