3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-23 18:54:05 +01:00

servprotect: only track kills and saves to PyLink clients

why wasn't this done before...
This commit is contained in:
James Lu 2017-05-20 15:02:04 -07:00
parent ead20f5be9
commit 76ecc60675

View File

@ -17,6 +17,8 @@ def handle_kill(irc, numeric, command, args):
Tracks kills against PyLink clients. If too many are received, Tracks kills against PyLink clients. If too many are received,
automatically disconnects from the network. automatically disconnects from the network.
""" """
if (args['userdata'] and irc.isInternalServer(args['userdata'].server)) or irc.isInternalClient(args['target']):
if killcache.setdefault(irc.name, 1) >= length: if killcache.setdefault(irc.name, 1) >= length:
log.error('(%s) servprotect: Too many kills received, aborting!', irc.name) log.error('(%s) servprotect: Too many kills received, aborting!', irc.name)
irc.disconnect() irc.disconnect()
@ -31,6 +33,7 @@ def handle_save(irc, numeric, command, args):
Tracks SAVEs (nick collision) against PyLink clients. If too many are received, Tracks SAVEs (nick collision) against PyLink clients. If too many are received,
automatically disconnects from the network. automatically disconnects from the network.
""" """
if irc.isInternalClient(args['target']):
if savecache.setdefault(irc.name, 0) >= length: if savecache.setdefault(irc.name, 0) >= length:
log.error('(%s) servprotect: Too many nick collisions, aborting!', irc.name) log.error('(%s) servprotect: Too many nick collisions, aborting!', irc.name)
irc.disconnect() irc.disconnect()