mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-12 05:02:33 +01:00
relay: use the "official" method of removing bad networks
This commit is contained in:
parent
31bf984996
commit
5c7524bcf3
@ -7,6 +7,7 @@ from collections import defaultdict
|
|||||||
|
|
||||||
from pylinkirc import utils, world, conf
|
from pylinkirc import utils, world, conf
|
||||||
from pylinkirc.log import log
|
from pylinkirc.log import log
|
||||||
|
from pylinkirc.coremods import control
|
||||||
|
|
||||||
### GLOBAL (statekeeping) VARIABLES
|
### GLOBAL (statekeeping) VARIABLES
|
||||||
relayusers = defaultdict(dict)
|
relayusers = defaultdict(dict)
|
||||||
@ -248,9 +249,8 @@ def spawnRelayServer(irc, remoteirc):
|
|||||||
log.exception('(%s) Failed to spawn server for %r:',
|
log.exception('(%s) Failed to spawn server for %r:',
|
||||||
irc.name, remoteirc.name)
|
irc.name, remoteirc.name)
|
||||||
# We will just bail here. Disconnect the bad network.
|
# We will just bail here. Disconnect the bad network.
|
||||||
handle_disconnect(irc, None, 'PYLINK_DISCONNECT_RELAY_FORCED', {})
|
control.remove_network(irc)
|
||||||
irc.disconnect()
|
return
|
||||||
raise
|
|
||||||
|
|
||||||
# Mark the server as a relay server
|
# Mark the server as a relay server
|
||||||
irc.servers[sid].remote = remoteirc.name
|
irc.servers[sid].remote = remoteirc.name
|
||||||
|
Loading…
Reference in New Issue
Block a user