mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
core: refresh various serverdata attributes on REHASH
This commit is contained in:
parent
f20e677577
commit
7e57798f4d
@ -21,6 +21,11 @@ class ProtocolError(Exception):
|
|||||||
|
|
||||||
class Irc():
|
class Irc():
|
||||||
def initVars(self):
|
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.connected.clear()
|
||||||
self.aborted.clear()
|
self.aborted.clear()
|
||||||
self.pseudoclient = None
|
self.pseudoclient = None
|
||||||
@ -88,10 +93,10 @@ class Irc():
|
|||||||
self.pingTimer = None
|
self.pingTimer = None
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
ip = self.serverdata["ip"]
|
|
||||||
port = self.serverdata["port"]
|
|
||||||
while True:
|
while True:
|
||||||
self.initVars()
|
self.initVars()
|
||||||
|
ip = self.serverdata["ip"]
|
||||||
|
port = self.serverdata["port"]
|
||||||
checks_ok = True
|
checks_ok = True
|
||||||
try:
|
try:
|
||||||
self.socket = socket.socket()
|
self.socket = socket.socket()
|
||||||
|
@ -341,6 +341,7 @@ def rehash(irc, source, args):
|
|||||||
del world.networkobjects[network]
|
del world.networkobjects[network]
|
||||||
else:
|
else:
|
||||||
ircobj.conf = new_conf
|
ircobj.conf = new_conf
|
||||||
|
ircobj.serverdata = new_conf['servers'][network]
|
||||||
for network, sdata in new_conf['servers'].items():
|
for network, sdata in new_conf['servers'].items():
|
||||||
# New server was added. Connect them if not already connected.
|
# New server was added. Connect them if not already connected.
|
||||||
if network not in world.networkobjects:
|
if network not in world.networkobjects:
|
||||||
|
Loading…
Reference in New Issue
Block a user