fixed keep-alive spam

This commit is contained in:
MHProDev 2022-03-07 02:53:27 +03:30
parent 53c2d098c3
commit ee4e579c27
1 changed files with 1 additions and 4 deletions

View File

@ -380,11 +380,8 @@ class Layer4(Thread):
bytes_sent += (len(handshake + login)) bytes_sent += (len(handshake + login))
REQUESTS_SENT += 1 REQUESTS_SENT += 1
c = 1000 while s.recv(1):
while s.recv(1) and c:
c -= 1
s.send(Minecraft.keepalive(randint(1000, 1234567890))) s.send(Minecraft.keepalive(randint(1000, 1234567890)))
sleep(0.05)
except Exception: except Exception:
s.close() s.close()