1
mirror of git://git.acid.vegas/IRCP.git synced 2024-11-26 09:56:42 +00:00

Code cleanup

This commit is contained in:
Dionysus 2023-05-28 01:21:47 -04:00
parent 483969d3ce
commit 2b7d36bbfc
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE

View File

@ -269,11 +269,11 @@ class probe:
try: try:
if self.reader.at_eof(): # TODO: can we use while self.reader.at_eof() outside of the try block? if self.reader.at_eof(): # TODO: can we use while self.reader.at_eof() outside of the try block?
break break
data = await asyncio.wait_for(self.reader.readuntil(b'\r\n'), throttle.ztimeout) data = await asyncio.wait_for(self.reader.readuntil(b'\r\n'), throttle.ztimeout)
line = data.decode('utf-8').strip() line = data.decode('utf-8').strip()
#debug(line) args = line.split()
args = line.split()
numeric = args[1] numeric = args[1]
#debug(line)
if line.startswith('ERROR :Closing Link'): if line.startswith('ERROR :Closing Link'):
raise Exception('DroneBL') if 'dronebl' in line.lower() else Exception('Banned') raise Exception('DroneBL') if 'dronebl' in line.lower() else Exception('Banned')
elif line.startswith('ERROR :Trying to reconnect too fast') or line.startswith('ERROR :Your host is trying to (re)connect too fast') or line.startswith('ERROR :Reconnecting too fast'): elif line.startswith('ERROR :Trying to reconnect too fast') or line.startswith('ERROR :Your host is trying to (re)connect too fast') or line.startswith('ERROR :Reconnecting too fast'):