Update server.py

This commit is contained in:
Nova Cat 2024-12-11 22:48:29 -08:00
parent afa7a26bf2
commit c8d2b34339

View file

@ -77,8 +77,8 @@ def pinger(nick, connection):
property_list[nick]["ping_pending"] = True
time.sleep(0.5)
connection.sendall(bytes(f"PING {server}\r\n","UTF-8"))
elif property_list[nick]["ping_pending"] and ((time.time() - property_list[nick]["last_ping"]) > 120):
property_list[nick]["cause"] = "Ping timeout: 120 seconds"
elif property_list[nick]["ping_pending"] and ((time.time() - property_list[nick]["last_ping"]) > 255):
property_list[nick]["cause"] = "Ping timeout: 255 seconds"
connection.shutdown(socket.SHUT_WR)
connection.close()
break