diff --git a/classes.py b/classes.py index d37e06e..955a190 100644 --- a/classes.py +++ b/classes.py @@ -21,6 +21,11 @@ class ProtocolError(Exception): class Irc(): def initVars(self): + self.sid = self.serverdata["sid"] + self.botdata = self.conf['bot'] + self.pingfreq = self.serverdata.get('pingfreq') or 30 + self.pingtimeout = self.pingfreq * 2 + self.connected.clear() self.aborted.clear() self.pseudoclient = None @@ -88,10 +93,10 @@ class Irc(): self.pingTimer = None def connect(self): - ip = self.serverdata["ip"] - port = self.serverdata["port"] while True: self.initVars() + ip = self.serverdata["ip"] + port = self.serverdata["port"] checks_ok = True try: self.socket = socket.socket() diff --git a/plugins/commands.py b/plugins/commands.py index d828feb..9af2637 100644 --- a/plugins/commands.py +++ b/plugins/commands.py @@ -341,6 +341,7 @@ def rehash(irc, source, args): del world.networkobjects[network] else: ircobj.conf = new_conf + ircobj.serverdata = new_conf['servers'][network] for network, sdata in new_conf['servers'].items(): # New server was added. Connect them if not already connected. if network not in world.networkobjects: